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
1c824ea6
Commit
1c824ea6
authored
Nov 23, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Use bytecode for 'in' expression implementation.
parent
517d9333
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
25 deletions
+28
-25
compile.c
dlls/jscript/compile.c
+2
-0
engine.c
dlls/jscript/engine.c
+24
-23
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 @
1c824ea6
...
@@ -113,6 +113,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr)
...
@@ -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
);
return
compile_unary_expression
(
ctx
,
(
unary_expression_t
*
)
expr
,
OP_bneg
);
case
EXPR_EQEQ
:
case
EXPR_EQEQ
:
return
compile_binary_expression
(
ctx
,
(
binary_expression_t
*
)
expr
,
OP_eq2
);
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
:
case
EXPR_LOGNEG
:
return
compile_unary_expression
(
ctx
,
(
unary_expression_t
*
)
expr
,
OP_neg
);
return
compile_unary_expression
(
ctx
,
(
unary_expression_t
*
)
expr
,
OP_neg
);
case
EXPR_NOTEQEQ
:
case
EXPR_NOTEQEQ
:
...
...
dlls/jscript/engine.c
View file @
1c824ea6
...
@@ -2111,42 +2111,43 @@ HRESULT instanceof_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD
...
@@ -2111,42 +2111,43 @@ HRESULT instanceof_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD
}
}
/* ECMA-262 3rd Edition 11.8.7 */
/* 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
interp_in
(
exec_ctx_t
*
ctx
)
{
{
VARIANT_BOOL
ret
;
VARIANT
*
obj
,
*
v
;
DISPID
id
;
DISPID
id
=
0
;
BOOL
ret
;
BSTR
str
;
BSTR
str
;
HRESULT
hres
;
HRESULT
hres
;
if
(
V_VT
(
obj
)
!=
VT_DISPATCH
||
!
V_DISPATCH
(
obj
))
TRACE
(
"
\n
"
);
return
throw_type_error
(
ctx
,
ei
,
JS_E_OBJECT_EXPECTED
,
NULL
);
hres
=
to_string
(
ctx
,
lval
,
ei
,
&
str
);
obj
=
stack_pop
(
ctx
);
if
(
FAILED
(
hres
))
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
;
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
);
SysFreeString
(
str
);
if
(
SUCCEEDED
(
hres
))
if
(
SUCCEEDED
(
hres
))
ret
=
VARIANT_
TRUE
;
ret
=
TRUE
;
else
if
(
hres
==
DISP_E_UNKNOWNNAME
)
else
if
(
hres
==
DISP_E_UNKNOWNNAME
)
ret
=
VARIANT_
FALSE
;
ret
=
FALSE
;
else
else
return
hres
;
return
hres
;
V_VT
(
retv
)
=
VT_BOOL
;
return
stack_push_bool
(
ctx
,
ret
);
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
);
}
}
/* ECMA-262 3rd Edition 11.6.1 */
/* ECMA-262 3rd Edition 11.6.1 */
...
...
dlls/jscript/engine.h
View file @
1c824ea6
...
@@ -45,6 +45,7 @@ typedef struct _func_stack {
...
@@ -45,6 +45,7 @@ typedef struct _func_stack {
X(add, 1, 0) \
X(add, 1, 0) \
X(bneg, 1, 0) \
X(bneg, 1, 0) \
X(eq2, 1, 0) \
X(eq2, 1, 0) \
X(in, 1, 0) \
X(neg, 1, 0) \
X(neg, 1, 0) \
X(neq2, 1, 0) \
X(neq2, 1, 0) \
X(tonum, 1, 0) \
X(tonum, 1, 0) \
...
@@ -529,7 +530,6 @@ HRESULT binary_or_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,
...
@@ -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_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
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
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
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
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
;
HRESULT
div_expression_eval
(
script_ctx_t
*
,
expression_t
*
,
DWORD
,
jsexcept_t
*
,
exprval_t
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/jscript/parser.y
View file @
1c824ea6
...
@@ -1312,7 +1312,7 @@ static const expression_eval_t expression_eval_table[] = {
...
@@ -1312,7 +1312,7 @@ static const expression_eval_t expression_eval_table[] = {
binary_xor_expression_eval,
binary_xor_expression_eval,
binary_and_expression_eval,
binary_and_expression_eval,
instanceof_expression_eval,
instanceof_expression_eval,
in
_expression_eval,
compiled
_expression_eval,
compiled_expression_eval,
compiled_expression_eval,
sub_expression_eval,
sub_expression_eval,
mul_expression_eval,
mul_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