Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
47314a92
Commit
47314a92
authored
Nov 25, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Use bytecode for comma expression implementation.
parent
172fa4fa
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
22 deletions
+27
-22
compile.c
dlls/jscript/compile.c
+17
-0
engine.c
dlls/jscript/engine.c
+8
-20
engine.h
dlls/jscript/engine.h
+1
-1
parser.y
dlls/jscript/parser.y
+1
-1
No files found.
dlls/jscript/compile.c
View file @
47314a92
...
...
@@ -156,6 +156,21 @@ static HRESULT compile_unary_expression(compiler_ctx_t *ctx, unary_expression_t
return
push_instr
(
ctx
,
op
)
==
-
1
?
E_OUTOFMEMORY
:
S_OK
;
}
/* ECMA-262 3rd Edition 11.14 */
static
HRESULT
compile_comma_expression
(
compiler_ctx_t
*
ctx
,
binary_expression_t
*
expr
)
{
HRESULT
hres
;
hres
=
compile_expression
(
ctx
,
expr
->
expression1
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
push_instr
(
ctx
,
OP_pop
)
==
-
1
)
return
E_OUTOFMEMORY
;
return
compile_expression
(
ctx
,
expr
->
expression2
);
}
static
HRESULT
compile_interp_fallback
(
compiler_ctx_t
*
ctx
,
expression_t
*
expr
)
{
unsigned
instr
;
...
...
@@ -211,6 +226,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr)
return
compile_binary_expression
(
ctx
,
(
binary_expression_t
*
)
expr
,
OP_add
);
case
EXPR_BITNEG
:
return
compile_unary_expression
(
ctx
,
(
unary_expression_t
*
)
expr
,
OP_bneg
);
case
EXPR_COMMA
:
return
compile_comma_expression
(
ctx
,
(
binary_expression_t
*
)
expr
);
case
EXPR_EQEQ
:
return
compile_binary_expression
(
ctx
,
(
binary_expression_t
*
)
expr
,
OP_eq2
);
case
EXPR_IN
:
...
...
dlls/jscript/engine.c
View file @
47314a92
...
...
@@ -1910,26 +1910,6 @@ HRESULT property_value_expression_eval(script_ctx_t *ctx, expression_t *_expr, D
return
S_OK
;
}
/* ECMA-262 3rd Edition 11.14 */
HRESULT
comma_expression_eval
(
script_ctx_t
*
ctx
,
expression_t
*
_expr
,
DWORD
flags
,
jsexcept_t
*
ei
,
exprval_t
*
ret
)
{
binary_expression_t
*
expr
=
(
binary_expression_t
*
)
_expr
;
VARIANT
lval
,
rval
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
hres
=
get_binary_expr_values
(
ctx
,
expr
,
ei
,
&
lval
,
&
rval
);
if
(
FAILED
(
hres
))
return
hres
;
VariantClear
(
&
lval
);
ret
->
type
=
EXPRVAL_VARIANT
;
ret
->
u
.
var
=
rval
;
return
S_OK
;
}
/* ECMA-262 3rd Edition 11.11 */
HRESULT
logical_or_expression_eval
(
script_ctx_t
*
ctx
,
expression_t
*
_expr
,
DWORD
flags
,
jsexcept_t
*
ei
,
exprval_t
*
ret
)
{
...
...
@@ -3342,6 +3322,14 @@ HRESULT assign_xor_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD
return
assign_oper_eval
(
ctx
,
expr
->
expression1
,
expr
->
expression2
,
xor_eval
,
ei
,
ret
);
}
static
HRESULT
interp_pop
(
exec_ctx_t
*
ctx
)
{
TRACE
(
"
\n
"
);
stack_popn
(
ctx
,
1
);
return
S_OK
;
}
static
HRESULT
interp_ret
(
exec_ctx_t
*
ctx
)
{
TRACE
(
"
\n
"
);
...
...
dlls/jscript/engine.h
View file @
47314a92
...
...
@@ -52,6 +52,7 @@ typedef struct _func_stack {
X(neg, 1, 0,0) \
X(neq2, 1, 0,0) \
X(null, 1, 0,0) \
X(pop, 1, 0,0) \
X(regexp, 1, ARG_STR, ARG_INT) \
X(str, 1, ARG_STR, 0) \
X(this, 1, 0,0) \
...
...
@@ -534,7 +535,6 @@ HRESULT identifier_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*
HRESULT
array_literal_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
property_value_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
comma_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
logical_or_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
logical_and_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
binary_or_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/jscript/parser.y
View file @
47314a92
...
...
@@ -1305,7 +1305,7 @@ static expression_t *new_function_expression(parser_ctx_t *ctx, const WCHAR *ide
}
static const expression_eval_t expression_eval_table[] = {
com
ma
_expression_eval,
com
piled
_expression_eval,
logical_or_expression_eval,
logical_and_expression_eval,
binary_or_expression_eval,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment