Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
1c824ea6
Commit
1c824ea6
authored
13 years ago
by
Jacek Caban
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
jscript: Use bytecode for 'in' expression implementation.
parent
517d9333
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
dlls/jscript/compile.c
+2
-0
2 additions, 0 deletions
dlls/jscript/compile.c
dlls/jscript/engine.c
+24
-23
24 additions, 23 deletions
dlls/jscript/engine.c
dlls/jscript/engine.h
+1
-1
1 addition, 1 deletion
dlls/jscript/engine.h
dlls/jscript/parser.y
+1
-1
1 addition, 1 deletion
dlls/jscript/parser.y
with
28 additions
and
25 deletions
dlls/jscript/compile.c
+
2
−
0
View file @
1c824ea6
...
...
@@ -113,6 +113,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_EQEQ
:
return
compile_binary_expression
(
ctx
,
(
binary_expression_t
*
)
expr
,
OP_eq2
);
case
EXPR_IN
:
return
compile_binary_expression
(
ctx
,
(
binary_expression_t
*
)
expr
,
OP_in
);
case
EXPR_LOGNEG
:
return
compile_unary_expression
(
ctx
,
(
unary_expression_t
*
)
expr
,
OP_neg
);
case
EXPR_NOTEQEQ
:
...
...
This diff is collapsed.
Click to expand it.
dlls/jscript/engine.c
+
24
−
23
View file @
1c824ea6
...
...
@@ -2111,42 +2111,43 @@ HRESULT instanceof_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD
}
/* ECMA-262 3rd Edition 11.8.7 */
static
HRESULT
in
_eval
(
script_ctx_t
*
ctx
,
VARIANT
*
lval
,
VARIANT
*
obj
,
jsexcept_t
*
ei
,
VARIANT
*
retv
)
HRESULT
in
terp_in
(
exec_ctx_t
*
ctx
)
{
VARIANT_BOOL
ret
;
DISPID
id
;
VARIANT
*
obj
,
*
v
;
DISPID
id
=
0
;
BOOL
ret
;
BSTR
str
;
HRESULT
hres
;
if
(
V_VT
(
obj
)
!=
VT_DISPATCH
||
!
V_DISPATCH
(
obj
))
return
throw_type_error
(
ctx
,
ei
,
JS_E_OBJECT_EXPECTED
,
NULL
);
TRACE
(
"
\n
"
);
hres
=
to_string
(
ctx
,
lval
,
ei
,
&
str
);
if
(
FAILED
(
hres
))
obj
=
stack_pop
(
ctx
);
v
=
stack_pop
(
ctx
);
if
(
V_VT
(
obj
)
!=
VT_DISPATCH
||
!
V_DISPATCH
(
obj
))
{
VariantClear
(
obj
);
VariantClear
(
v
);
return
throw_type_error
(
ctx
->
parser
->
script
,
&
ctx
->
ei
,
JS_E_OBJECT_EXPECTED
,
NULL
);
}
hres
=
to_string
(
ctx
->
parser
->
script
,
v
,
&
ctx
->
ei
,
&
str
);
VariantClear
(
v
);
if
(
FAILED
(
hres
))
{
IDispatch_Release
(
V_DISPATCH
(
obj
));
return
hres
;
}
hres
=
disp_get_id
(
ctx
,
V_DISPATCH
(
obj
),
str
,
0
,
&
id
);
hres
=
disp_get_id
(
ctx
->
parser
->
script
,
V_DISPATCH
(
obj
),
str
,
0
,
&
id
);
IDispatch_Release
(
V_DISPATCH
(
obj
));
SysFreeString
(
str
);
if
(
SUCCEEDED
(
hres
))
ret
=
VARIANT_
TRUE
;
ret
=
TRUE
;
else
if
(
hres
==
DISP_E_UNKNOWNNAME
)
ret
=
VARIANT_
FALSE
;
ret
=
FALSE
;
else
return
hres
;
V_VT
(
retv
)
=
VT_BOOL
;
V_BOOL
(
retv
)
=
ret
;
return
S_OK
;
}
/* ECMA-262 3rd Edition 11.8.7 */
HRESULT
in_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
binary_expr_eval
(
ctx
,
expr
,
in_eval
,
ei
,
ret
);
return
stack_push_bool
(
ctx
,
ret
);
}
/* ECMA-262 3rd Edition 11.6.1 */
...
...
This diff is collapsed.
Click to expand it.
dlls/jscript/engine.h
+
1
−
1
View file @
1c824ea6
...
...
@@ -45,6 +45,7 @@ typedef struct _func_stack {
X(add, 1, 0) \
X(bneg, 1, 0) \
X(eq2, 1, 0) \
X(in, 1, 0) \
X(neg, 1, 0) \
X(neq2, 1, 0) \
X(tonum, 1, 0) \
...
...
@@ -529,7 +530,6 @@ HRESULT binary_or_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,
HRESULT
binary_xor_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
binary_and_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
instanceof_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
in_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
sub_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
mul_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
div_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
...
...
This diff is collapsed.
Click to expand it.
dlls/jscript/parser.y
+
1
−
1
View file @
1c824ea6
...
...
@@ -1312,7 +1312,7 @@ static const expression_eval_t expression_eval_table[] = {
binary_xor_expression_eval,
binary_and_expression_eval,
instanceof_expression_eval,
in
_expression_eval,
compiled
_expression_eval,
compiled_expression_eval,
sub_expression_eval,
mul_expression_eval,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment