Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
58952a07
Commit
58952a07
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 '==' and '!=' expression.
parent
413fe9a4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
32 deletions
+32
-32
compile.c
dlls/jscript/compile.c
+4
-0
engine.c
dlls/jscript/engine.c
+24
-28
engine.h
dlls/jscript/engine.h
+2
-2
parser.y
dlls/jscript/parser.y
+2
-2
No files found.
dlls/jscript/compile.c
View file @
58952a07
...
...
@@ -228,6 +228,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr)
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_EQ
:
return
compile_binary_expression
(
ctx
,
(
binary_expression_t
*
)
expr
,
OP_eq
);
case
EXPR_EQEQ
:
return
compile_binary_expression
(
ctx
,
(
binary_expression_t
*
)
expr
,
OP_eq2
);
case
EXPR_IN
:
...
...
@@ -238,6 +240,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr)
return
compile_unary_expression
(
ctx
,
(
unary_expression_t
*
)
expr
,
OP_neg
);
case
EXPR_MINUS
:
return
compile_unary_expression
(
ctx
,
(
unary_expression_t
*
)
expr
,
OP_minus
);
case
EXPR_NOTEQ
:
return
compile_binary_expression
(
ctx
,
(
binary_expression_t
*
)
expr
,
OP_neq
);
case
EXPR_NOTEQEQ
:
return
compile_binary_expression
(
ctx
,
(
binary_expression_t
*
)
expr
,
OP_neq2
);
case
EXPR_PLUS
:
...
...
dlls/jscript/engine.c
View file @
58952a07
...
...
@@ -2842,70 +2842,66 @@ static HRESULT equal_values(script_ctx_t *ctx, VARIANT *lval, VARIANT *rval, jse
}
/* ECMA-262 3rd Edition 11.9.1 */
HRESULT
equal_expression_eval
(
script_ctx_t
*
ctx
,
expression_t
*
_expr
,
DWORD
flags
,
jsexcept_t
*
ei
,
exprval_t
*
ret
)
HRESULT
interp_eq
(
exec_ctx_t
*
ctx
)
{
binary_expression_t
*
expr
=
(
binary_expression_t
*
)
_expr
;
VARIANT
rval
,
lval
;
VARIANT
*
l
,
*
r
;
BOOL
b
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
r
=
stack_pop
(
ctx
);
l
=
stack_pop
(
ctx
);
hres
=
get_binary_expr_values
(
ctx
,
expr
,
ei
,
&
rval
,
&
lval
);
if
(
FAILED
(
hres
))
return
hres
;
TRACE
(
"%s == %s
\n
"
,
debugstr_variant
(
l
),
debugstr_variant
(
r
));
hres
=
equal_values
(
ctx
,
&
rval
,
&
lval
,
ei
,
&
b
);
VariantClear
(
&
lva
l
);
VariantClear
(
&
rval
);
hres
=
equal_values
(
ctx
->
parser
->
script
,
l
,
r
,
&
ctx
->
ei
,
&
b
);
VariantClear
(
l
);
VariantClear
(
r
);
if
(
FAILED
(
hres
))
return
hres
;
return
return_bool
(
ret
,
b
);
return
stack_push_bool
(
ctx
,
b
);
}
/* ECMA-262 3rd Edition 11.9.
4
*/
static
HRESULT
interp_eq2
(
exec_ctx_t
*
ctx
)
/* ECMA-262 3rd Edition 11.9.
2
*/
HRESULT
interp_neq
(
exec_ctx_t
*
ctx
)
{
VARIANT
*
l
,
*
r
;
BOOL
b
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
r
=
stack_pop
(
ctx
);
l
=
stack_pop
(
ctx
);
hres
=
equal2_values
(
r
,
l
,
&
b
);
TRACE
(
"%s != %s
\n
"
,
debugstr_variant
(
l
),
debugstr_variant
(
r
));
hres
=
equal_values
(
ctx
->
parser
->
script
,
l
,
r
,
&
ctx
->
ei
,
&
b
);
VariantClear
(
l
);
VariantClear
(
r
);
if
(
FAILED
(
hres
))
return
hres
;
return
stack_push_bool
(
ctx
,
b
);
return
stack_push_bool
(
ctx
,
!
b
);
}
/* ECMA-262 3rd Edition 11.9.
2
*/
HRESULT
not_equal_expression_eval
(
script_ctx_t
*
ctx
,
expression_t
*
_expr
,
DWORD
flags
,
jsexcept_t
*
ei
,
exprval_t
*
ret
)
/* ECMA-262 3rd Edition 11.9.
4
*/
static
HRESULT
interp_eq2
(
exec_ctx_t
*
ctx
)
{
binary_expression_t
*
expr
=
(
binary_expression_t
*
)
_expr
;
VARIANT
rval
,
lval
;
VARIANT
*
l
,
*
r
;
BOOL
b
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
hres
=
get_binary_expr_values
(
ctx
,
expr
,
ei
,
&
lval
,
&
rval
);
if
(
FAILED
(
hres
))
return
hres
;
r
=
stack_pop
(
ctx
);
l
=
stack_pop
(
ctx
);
hres
=
equal
_values
(
ctx
,
&
lval
,
&
rval
,
ei
,
&
b
);
VariantClear
(
&
lva
l
);
VariantClear
(
&
rval
);
hres
=
equal
2_values
(
r
,
l
,
&
b
);
VariantClear
(
l
);
VariantClear
(
r
);
if
(
FAILED
(
hres
))
return
hres
;
return
return_bool
(
ret
,
!
b
);
return
stack_push_bool
(
ctx
,
b
);
}
/* ECMA-262 3rd Edition 11.9.5 */
...
...
dlls/jscript/engine.h
View file @
58952a07
...
...
@@ -46,11 +46,13 @@ typedef struct _func_stack {
X(bool, 1, ARG_INT, 0) \
X(bneg, 1, 0,0) \
X(double, 1, ARG_SBL, 0) \
X(eq, 1, 0,0) \
X(eq2, 1, 0,0) \
X(in, 1, 0,0) \
X(int, 1, ARG_INT, 0) \
X(minus, 1, 0,0) \
X(neg, 1, 0,0) \
X(neq, 1, 0,0) \
X(neq2, 1, 0,0) \
X(null, 1, 0,0) \
X(pop, 1, 0,0) \
...
...
@@ -553,8 +555,6 @@ HRESULT post_increment_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcep
HRESULT
post_decrement_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
pre_increment_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
pre_decrement_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
equal_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
not_equal_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
less_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
lesseq_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
greater_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/jscript/parser.y
View file @
58952a07
...
...
@@ -1327,9 +1327,9 @@ static const expression_eval_t expression_eval_table[] = {
post_decrement_expression_eval,
pre_increment_expression_eval,
pre_decrement_expression_eval,
equal_expression_eval,
compiled_expression_eval,
not_equal_expression_eval,
compiled_expression_eval,
compiled_expression_eval,
compiled_expression_eval,
less_expression_eval,
lesseq_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