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
a289b8e0
Commit
a289b8e0
authored
Dec 06, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 06, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added bytecode version of member expression.
parent
822fdde4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
0 deletions
+60
-0
compile.c
dlls/jscript/compile.c
+14
-0
engine.c
dlls/jscript/engine.c
+45
-0
engine.h
dlls/jscript/engine.h
+1
-0
No files found.
dlls/jscript/compile.c
View file @
a289b8e0
...
@@ -210,6 +210,18 @@ static HRESULT compile_unary_expression(compiler_ctx_t *ctx, unary_expression_t
...
@@ -210,6 +210,18 @@ static HRESULT compile_unary_expression(compiler_ctx_t *ctx, unary_expression_t
return
push_instr
(
ctx
,
op
)
==
-
1
?
E_OUTOFMEMORY
:
S_OK
;
return
push_instr
(
ctx
,
op
)
==
-
1
?
E_OUTOFMEMORY
:
S_OK
;
}
}
/* ECMA-262 3rd Edition 11.2.1 */
static
HRESULT
compile_member_expression
(
compiler_ctx_t
*
ctx
,
member_expression_t
*
expr
)
{
HRESULT
hres
;
hres
=
compile_expression
(
ctx
,
expr
->
expression
);
if
(
FAILED
(
hres
))
return
hres
;
return
push_instr_bstr
(
ctx
,
OP_member
,
expr
->
identifier
);
}
/* ECMA-262 3rd Edition 11.14 */
/* ECMA-262 3rd Edition 11.14 */
static
HRESULT
compile_comma_expression
(
compiler_ctx_t
*
ctx
,
binary_expression_t
*
expr
)
static
HRESULT
compile_comma_expression
(
compiler_ctx_t
*
ctx
,
binary_expression_t
*
expr
)
{
{
...
@@ -519,6 +531,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr)
...
@@ -519,6 +531,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr)
return
compile_literal
(
ctx
,
((
literal_expression_t
*
)
expr
)
->
literal
);
return
compile_literal
(
ctx
,
((
literal_expression_t
*
)
expr
)
->
literal
);
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_MEMBER
:
return
compile_member_expression
(
ctx
,
(
member_expression_t
*
)
expr
);
case
EXPR_MINUS
:
case
EXPR_MINUS
:
return
compile_unary_expression
(
ctx
,
(
unary_expression_t
*
)
expr
,
OP_minus
);
return
compile_unary_expression
(
ctx
,
(
unary_expression_t
*
)
expr
,
OP_minus
);
case
EXPR_MOD
:
case
EXPR_MOD
:
...
...
dlls/jscript/engine.c
View file @
a289b8e0
...
@@ -153,6 +153,22 @@ static HRESULT stack_pop_number(exec_ctx_t *ctx, VARIANT *r)
...
@@ -153,6 +153,22 @@ static HRESULT stack_pop_number(exec_ctx_t *ctx, VARIANT *r)
return
hres
;
return
hres
;
}
}
static
HRESULT
stack_pop_object
(
exec_ctx_t
*
ctx
,
IDispatch
**
r
)
{
VARIANT
*
v
;
HRESULT
hres
;
v
=
stack_pop
(
ctx
);
if
(
V_VT
(
v
)
==
VT_DISPATCH
)
{
*
r
=
V_DISPATCH
(
v
);
return
S_OK
;
}
hres
=
to_object
(
ctx
->
parser
->
script
,
v
,
r
);
VariantClear
(
v
);
return
hres
;
}
static
inline
HRESULT
stack_pop_int
(
exec_ctx_t
*
ctx
,
INT
*
r
)
static
inline
HRESULT
stack_pop_int
(
exec_ctx_t
*
ctx
,
INT
*
r
)
{
{
return
to_int32
(
ctx
->
parser
->
script
,
stack_pop
(
ctx
),
&
ctx
->
ei
,
r
);
return
to_int32
(
ctx
->
parser
->
script
,
stack_pop
(
ctx
),
&
ctx
->
ei
,
r
);
...
@@ -1591,6 +1607,35 @@ HRESULT member_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD fla
...
@@ -1591,6 +1607,35 @@ HRESULT member_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD fla
}
}
/* ECMA-262 3rd Edition 11.2.1 */
/* ECMA-262 3rd Edition 11.2.1 */
static
HRESULT
interp_member
(
exec_ctx_t
*
ctx
)
{
const
BSTR
arg
=
ctx
->
parser
->
code
->
instrs
[
ctx
->
ip
].
arg1
.
bstr
;
IDispatch
*
obj
;
VARIANT
v
;
DISPID
id
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
hres
=
stack_pop_object
(
ctx
,
&
obj
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
disp_get_id
(
ctx
->
parser
->
script
,
obj
,
arg
,
0
,
&
id
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
disp_propget
(
ctx
->
parser
->
script
,
obj
,
id
,
&
v
,
&
ctx
->
ei
,
NULL
/*FIXME*/
);
}
else
if
(
hres
==
DISP_E_UNKNOWNNAME
)
{
V_VT
(
&
v
)
=
VT_EMPTY
;
hres
=
S_OK
;
}
IDispatch_Release
(
obj
);
if
(
FAILED
(
hres
))
return
hres
;
return
stack_push
(
ctx
,
&
v
);
}
/* ECMA-262 3rd Edition 11.2.1 */
static
HRESULT
interp_memberid
(
exec_ctx_t
*
ctx
)
static
HRESULT
interp_memberid
(
exec_ctx_t
*
ctx
)
{
{
VARIANT
*
objv
,
*
namev
;
VARIANT
*
objv
,
*
namev
;
...
...
dlls/jscript/engine.h
View file @
a289b8e0
...
@@ -62,6 +62,7 @@ typedef struct _func_stack {
...
@@ -62,6 +62,7 @@ typedef struct _func_stack {
X(jmp_z, 0, ARG_ADDR, 0) \
X(jmp_z, 0, ARG_ADDR, 0) \
X(lt, 1, 0,0) \
X(lt, 1, 0,0) \
X(lteq, 1, 0,0) \
X(lteq, 1, 0,0) \
X(member, 1, ARG_BSTR, 0) \
X(memberid, 1, 0,0) \
X(memberid, 1, 0,0) \
X(minus, 1, 0,0) \
X(minus, 1, 0,0) \
X(mod, 1, 0,0) \
X(mod, 1, 0,0) \
...
...
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