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
3fd2979f
Commit
3fd2979f
authored
Dec 15, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Use byte code for deleting identifier expressions.
parent
fda8c217
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
42 deletions
+40
-42
compile.c
dlls/jscript/compile.c
+2
-0
engine.c
dlls/jscript/engine.c
+37
-42
engine.h
dlls/jscript/engine.h
+1
-0
No files found.
dlls/jscript/compile.c
View file @
3fd2979f
...
...
@@ -487,6 +487,8 @@ static HRESULT compile_delete_expression(compiler_ctx_t *ctx, unary_expression_t
return
E_OUTOFMEMORY
;
break
;
}
case
EXPR_IDENT
:
return
push_instr_bstr
(
ctx
,
OP_delete_ident
,
((
identifier_expression_t
*
)
expr
->
expression
)
->
identifier
);
default:
expr
->
expr
.
eval
=
delete_expression_eval
;
return
compile_interp_fallback
(
ctx
,
&
expr
->
expr
);
...
...
dlls/jscript/engine.c
View file @
3fd2979f
...
...
@@ -1399,15 +1399,6 @@ HRESULT try_statement_eval(script_ctx_t *ctx, statement_t *_stat, return_type_t
return
S_OK
;
}
static
HRESULT
return_bool
(
exprval_t
*
ret
,
DWORD
b
)
{
ret
->
type
=
EXPRVAL_VARIANT
;
V_VT
(
&
ret
->
u
.
var
)
=
VT_BOOL
;
V_BOOL
(
&
ret
->
u
.
var
)
=
b
?
VARIANT_TRUE
:
VARIANT_FALSE
;
return
S_OK
;
}
/* ECMA-262 3rd Edition 13 */
HRESULT
function_expression_eval
(
script_ctx_t
*
ctx
,
expression_t
*
_expr
,
DWORD
flags
,
jsexcept_t
*
ei
,
exprval_t
*
ret
)
{
...
...
@@ -2377,39 +2368,8 @@ static HRESULT interp_mod(exec_ctx_t *ctx)
/* ECMA-262 3rd Edition 11.4.2 */
HRESULT
delete_expression_eval
(
script_ctx_t
*
ctx
,
expression_t
*
_expr
,
DWORD
flags
,
jsexcept_t
*
ei
,
exprval_t
*
ret
)
{
unary_expression_t
*
expr
=
(
unary_expression_t
*
)
_expr
;
VARIANT_BOOL
b
=
VARIANT_FALSE
;
exprval_t
exprval
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
hres
=
expr_eval
(
ctx
,
expr
->
expression
,
0
,
ei
,
&
exprval
);
if
(
FAILED
(
hres
))
return
hres
;
switch
(
exprval
.
type
)
{
case
EXPRVAL_IDREF
:
{
IDispatchEx
*
dispex
;
hres
=
IDispatch_QueryInterface
(
exprval
.
u
.
idref
.
disp
,
&
IID_IDispatchEx
,
(
void
**
)
&
dispex
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
IDispatchEx_DeleteMemberByDispID
(
dispex
,
exprval
.
u
.
idref
.
id
);
b
=
VARIANT_TRUE
;
IDispatchEx_Release
(
dispex
);
}
break
;
}
default:
FIXME
(
"unsupported type %d
\n
"
,
exprval
.
type
);
hres
=
E_NOTIMPL
;
}
exprval_release
(
&
exprval
);
if
(
FAILED
(
hres
))
return
hres
;
return
return_bool
(
ret
,
b
);
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
}
/* ECMA-262 3rd Edition 11.4.2 */
...
...
@@ -2460,6 +2420,41 @@ static HRESULT interp_delete(exec_ctx_t *ctx)
}
/* ECMA-262 3rd Edition 11.4.2 */
static
HRESULT
interp_delete_ident
(
exec_ctx_t
*
ctx
)
{
const
BSTR
arg
=
ctx
->
parser
->
code
->
instrs
[
ctx
->
ip
].
arg1
.
bstr
;
IDispatchEx
*
dispex
;
exprval_t
exprval
;
BOOL
ret
=
FALSE
;
HRESULT
hres
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
arg
));
hres
=
identifier_eval
(
ctx
->
parser
->
script
,
arg
,
0
,
&
ctx
->
ei
,
&
exprval
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
exprval
.
type
!=
EXPRVAL_IDREF
)
{
FIXME
(
"Unsupported exprval
\n
"
);
exprval_release
(
&
exprval
);
return
E_NOTIMPL
;
}
hres
=
IDispatch_QueryInterface
(
exprval
.
u
.
idref
.
disp
,
&
IID_IDispatchEx
,
(
void
**
)
&
dispex
);
IDispatch_Release
(
exprval
.
u
.
idref
.
disp
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
IDispatchEx_DeleteMemberByDispID
(
dispex
,
exprval
.
u
.
idref
.
id
);
IDispatchEx_Release
(
dispex
);
if
(
FAILED
(
hres
))
return
hres
;
ret
=
TRUE
;
}
return
stack_push_bool
(
ctx
,
ret
);
}
/* ECMA-262 3rd Edition 11.4.2 */
static
HRESULT
interp_void
(
exec_ctx_t
*
ctx
)
{
VARIANT
v
;
...
...
dlls/jscript/engine.h
View file @
3fd2979f
...
...
@@ -52,6 +52,7 @@ typedef struct _func_stack {
X(call_member,1, ARG_UINT, ARG_UINT) \
X(carray, 1, ARG_UINT, 0) \
X(delete, 1, 0,0) \
X(delete_ident,1,ARG_BSTR, 0) \
X(div, 1, 0,0) \
X(double, 1, ARG_SBL, 0) \
X(eq, 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