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
087afe8b
Commit
087afe8b
authored
Dec 05, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Use bytecode for '+=' expression implementation.
parent
8511797c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
14 deletions
+43
-14
compile.c
dlls/jscript/compile.c
+12
-2
engine.c
dlls/jscript/engine.c
+29
-10
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 @
087afe8b
...
...
@@ -357,7 +357,7 @@ static HRESULT compile_delete_expression(compiler_ctx_t *ctx, unary_expression_t
return
S_OK
;
}
static
HRESULT
compile_assign_expression
(
compiler_ctx_t
*
ctx
,
binary_expression_t
*
expr
)
static
HRESULT
compile_assign_expression
(
compiler_ctx_t
*
ctx
,
binary_expression_t
*
expr
,
jsop_t
op
)
{
HRESULT
hres
;
...
...
@@ -410,14 +410,22 @@ static HRESULT compile_assign_expression(compiler_ctx_t *ctx, binary_expression_
if
(
FAILED
(
hres
))
return
hres
;
if
(
op
!=
OP_LAST
&&
push_instr
(
ctx
,
op
)
==
-
1
)
return
E_OUTOFMEMORY
;
return
push_instr_uint
(
ctx
,
OP_throw
,
JS_E_ILLEGAL_ASSIGN
);
}
if
(
op
!=
OP_LAST
&&
push_instr
(
ctx
,
OP_refval
)
==
-
1
)
return
E_OUTOFMEMORY
;
hres
=
compile_expression
(
ctx
,
expr
->
expression2
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
op
!=
OP_LAST
&&
push_instr
(
ctx
,
op
)
==
-
1
)
return
E_OUTOFMEMORY
;
if
(
push_instr
(
ctx
,
OP_assign
)
==
-
1
)
return
E_OUTOFMEMORY
;
...
...
@@ -468,7 +476,9 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr)
case
EXPR_AND
:
return
compile_logical_expression
(
ctx
,
(
binary_expression_t
*
)
expr
,
OP_jmp_z
);
case
EXPR_ASSIGN
:
return
compile_assign_expression
(
ctx
,
(
binary_expression_t
*
)
expr
);
return
compile_assign_expression
(
ctx
,
(
binary_expression_t
*
)
expr
,
OP_LAST
);
case
EXPR_ASSIGNADD
:
return
compile_assign_expression
(
ctx
,
(
binary_expression_t
*
)
expr
,
OP_add
);
case
EXPR_BITNEG
:
return
compile_unary_expression
(
ctx
,
(
unary_expression_t
*
)
expr
,
OP_bneg
);
case
EXPR_BOR
:
...
...
dlls/jscript/engine.c
View file @
087afe8b
...
...
@@ -166,6 +166,14 @@ static inline IDispatch *stack_pop_objid(exec_ctx_t *ctx, DISPID *id)
return
V_DISPATCH
(
stack_pop
(
ctx
));
}
static
inline
IDispatch
*
stack_top_objid
(
exec_ctx_t
*
ctx
,
DISPID
*
id
)
{
assert
(
V_VT
(
stack_top
(
ctx
))
==
VT_INT
&&
V_VT
(
stack_topn
(
ctx
,
1
))
==
VT_DISPATCH
);
*
id
=
V_INT
(
stack_top
(
ctx
));
return
V_DISPATCH
(
stack_topn
(
ctx
,
1
));
}
static
void
exprval_release
(
exprval_t
*
val
)
{
switch
(
val
->
type
)
{
...
...
@@ -1617,6 +1625,27 @@ static HRESULT interp_memberid(exec_ctx_t *ctx)
return
stack_push_objid
(
ctx
,
obj
,
id
);
}
/* ECMA-262 3rd Edition 11.2.1 */
static
HRESULT
interp_refval
(
exec_ctx_t
*
ctx
)
{
IDispatch
*
disp
;
VARIANT
v
;
DISPID
id
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
disp
=
stack_top_objid
(
ctx
,
&
id
);
if
(
!
disp
)
return
throw_reference_error
(
ctx
->
parser
->
script
,
&
ctx
->
ei
,
JS_E_ILLEGAL_ASSIGN
,
NULL
);
hres
=
disp_propget
(
ctx
->
parser
->
script
,
disp
,
id
,
&
v
,
&
ctx
->
ei
,
NULL
/*FIXME*/
);
if
(
FAILED
(
hres
))
return
hres
;
return
stack_push
(
ctx
,
&
v
);
}
static
void
free_dp
(
DISPPARAMS
*
dp
)
{
DWORD
i
;
...
...
@@ -3373,16 +3402,6 @@ HRESULT assign_rrshift_expression_eval(script_ctx_t *ctx, expression_t *_expr, D
}
/* ECMA-262 3rd Edition 11.13.2 */
HRESULT
assign_add_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
;
TRACE
(
"
\n
"
);
return
assign_oper_eval
(
ctx
,
expr
->
expression1
,
expr
->
expression2
,
add_eval
,
ei
,
ret
);
}
/* ECMA-262 3rd Edition 11.13.2 */
HRESULT
assign_sub_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
;
...
...
dlls/jscript/engine.h
View file @
087afe8b
...
...
@@ -79,6 +79,7 @@ typedef struct _func_stack {
X(throw, 0, ARG_UINT, 0) \
X(tonum, 1, 0,0) \
X(tree, 1, ARG_EXPR, 0) \
X(refval, 1, 0,0) \
X(ret, 0, 0,0) \
X(sub, 1, 0,0) \
X(void, 1, 0,0) \
...
...
@@ -574,7 +575,6 @@ HRESULT right2_shift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_
HRESULT
assign_lshift_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
assign_rshift_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
assign_rrshift_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
assign_add_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
assign_sub_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
assign_mul_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
assign_div_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/jscript/parser.y
View file @
087afe8b
...
...
@@ -1344,7 +1344,7 @@ static const expression_eval_t expression_eval_table[] = {
assign_lshift_expression_eval,
assign_rshift_expression_eval,
assign_rrshift_expression_eval,
assign_ad
d_expression_eval,
compile
d_expression_eval,
assign_sub_expression_eval,
assign_mul_expression_eval,
assign_div_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