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
0f0f76ce
Commit
0f0f76ce
authored
Dec 14, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Allow poping multiple stack values at the time.
parent
10c2a2bb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
15 deletions
+17
-15
compile.c
dlls/jscript/compile.c
+12
-12
engine.c
dlls/jscript/engine.c
+4
-2
engine.h
dlls/jscript/engine.h
+1
-1
No files found.
dlls/jscript/compile.c
View file @
0f0f76ce
...
...
@@ -530,8 +530,9 @@ static HRESULT compile_conditional_expression(compiler_ctx_t *ctx, conditional_e
return
E_OUTOFMEMORY
;
set_arg_uint
(
ctx
,
jmp_false
,
ctx
->
code_off
);
if
(
!
push_instr
(
ctx
,
OP_pop
))
return
E_OUTOFMEMORY
;
hres
=
push_instr_uint
(
ctx
,
OP_pop
,
1
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
compile_expression
(
ctx
,
expr
->
false_expression
,
TRUE
);
if
(
FAILED
(
hres
))
...
...
@@ -1053,7 +1054,7 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr, BOOL
if
(
FAILED
(
hres
))
return
hres
;
return
emit_ret
||
push_instr
(
ctx
,
OP_pop
)
?
S_OK
:
E_OUTOFMEMORY
;
return
emit_ret
?
S_OK
:
push_instr_uint
(
ctx
,
OP_pop
,
1
)
;
}
static
inline
BOOL
is_loop_statement
(
statement_type_t
type
)
...
...
@@ -1353,12 +1354,12 @@ static HRESULT pop_to_stat(compiler_ctx_t *ctx, BOOL var_stack, BOOL scope_stack
stack_pop
+=
iter
->
stack_use
;
}
if
(
var_stack
)
{
/* FIXME: optimize */
while
(
stack_pop
--
)
{
if
(
!
push_instr
(
ctx
,
OP_pop
))
return
E_OUTOFMEMORY
;
}
if
(
var_stack
&&
stack_pop
)
{
HRESULT
hres
;
hres
=
push_instr_uint
(
ctx
,
OP_pop
,
stack_pop
);
if
(
FAILED
(
hres
))
return
hres
;
}
return
S_OK
;
...
...
@@ -1579,12 +1580,11 @@ static HRESULT compile_switch_statement(compiler_ctx_t *ctx, switch_statement_t
}
if
(
SUCCEEDED
(
hres
))
{
if
(
push_instr
(
ctx
,
OP_pop
))
{
hres
=
push_instr_uint
(
ctx
,
OP_pop
,
1
);
if
(
SUCCEEDED
(
hres
))
{
default_jmp
=
push_instr
(
ctx
,
OP_jmp
);
if
(
!
default_jmp
)
hres
=
E_OUTOFMEMORY
;
}
else
{
hres
=
E_OUTOFMEMORY
;
}
}
...
...
dlls/jscript/engine.c
View file @
0f0f76ce
...
...
@@ -2339,9 +2339,11 @@ static HRESULT interp_jmp_z(exec_ctx_t *ctx)
static
HRESULT
interp_pop
(
exec_ctx_t
*
ctx
)
{
TRACE
(
"
\n
"
);
const
unsigned
arg
=
get_op_uint
(
ctx
,
0
);
stack_popn
(
ctx
,
1
);
TRACE
(
"%u
\n
"
,
arg
);
stack_popn
(
ctx
,
arg
);
return
S_OK
;
}
...
...
dlls/jscript/engine.h
View file @
0f0f76ce
...
...
@@ -84,7 +84,7 @@ typedef struct {
X(null, 1, 0,0) \
X(obj_prop, 1, ARG_BSTR, 0) \
X(or, 1, 0,0) \
X(pop, 1,
0,0)
\
X(pop, 1,
ARG_UINT, 0)
\
X(pop_except, 1, 0,0) \
X(pop_scope, 1, 0,0) \
X(postinc, 1, ARG_INT, 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