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
a120ecbe
Commit
a120ecbe
authored
Mar 25, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 25, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Store instruction pointer in call_frame_t.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fa5d9b3d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
18 deletions
+20
-18
engine.c
dlls/jscript/engine.c
+19
-16
engine.h
dlls/jscript/engine.h
+1
-2
No files found.
dlls/jscript/engine.c
View file @
a120ecbe
...
@@ -568,33 +568,38 @@ static HRESULT identifier_eval(script_ctx_t *ctx, BSTR identifier, exprval_t *re
...
@@ -568,33 +568,38 @@ static HRESULT identifier_eval(script_ctx_t *ctx, BSTR identifier, exprval_t *re
}
}
static
inline
BSTR
get_op_bstr
(
exec_ctx_t
*
ctx
,
int
i
){
static
inline
BSTR
get_op_bstr
(
exec_ctx_t
*
ctx
,
int
i
){
return
ctx
->
script
->
call_ctx
->
bytecode
->
instrs
[
ctx
->
ip
].
u
.
arg
[
i
].
bstr
;
call_frame_t
*
frame
=
ctx
->
script
->
call_ctx
;
return
frame
->
bytecode
->
instrs
[
frame
->
ip
].
u
.
arg
[
i
].
bstr
;
}
}
static
inline
unsigned
get_op_uint
(
exec_ctx_t
*
ctx
,
int
i
){
static
inline
unsigned
get_op_uint
(
exec_ctx_t
*
ctx
,
int
i
){
return
ctx
->
script
->
call_ctx
->
bytecode
->
instrs
[
ctx
->
ip
].
u
.
arg
[
i
].
uint
;
call_frame_t
*
frame
=
ctx
->
script
->
call_ctx
;
return
frame
->
bytecode
->
instrs
[
frame
->
ip
].
u
.
arg
[
i
].
uint
;
}
}
static
inline
unsigned
get_op_int
(
exec_ctx_t
*
ctx
,
int
i
){
static
inline
unsigned
get_op_int
(
exec_ctx_t
*
ctx
,
int
i
){
return
ctx
->
script
->
call_ctx
->
bytecode
->
instrs
[
ctx
->
ip
].
u
.
arg
[
i
].
lng
;
call_frame_t
*
frame
=
ctx
->
script
->
call_ctx
;
return
frame
->
bytecode
->
instrs
[
frame
->
ip
].
u
.
arg
[
i
].
lng
;
}
}
static
inline
jsstr_t
*
get_op_str
(
exec_ctx_t
*
ctx
,
int
i
){
static
inline
jsstr_t
*
get_op_str
(
exec_ctx_t
*
ctx
,
int
i
){
return
ctx
->
script
->
call_ctx
->
bytecode
->
instrs
[
ctx
->
ip
].
u
.
arg
[
i
].
str
;
call_frame_t
*
frame
=
ctx
->
script
->
call_ctx
;
return
frame
->
bytecode
->
instrs
[
frame
->
ip
].
u
.
arg
[
i
].
str
;
}
}
static
inline
double
get_op_double
(
exec_ctx_t
*
ctx
){
static
inline
double
get_op_double
(
exec_ctx_t
*
ctx
){
return
ctx
->
script
->
call_ctx
->
bytecode
->
instrs
[
ctx
->
ip
].
u
.
dbl
;
call_frame_t
*
frame
=
ctx
->
script
->
call_ctx
;
return
frame
->
bytecode
->
instrs
[
frame
->
ip
].
u
.
dbl
;
}
}
static
inline
void
jmp_next
(
exec_ctx_t
*
ctx
)
static
inline
void
jmp_next
(
exec_ctx_t
*
ctx
)
{
{
ctx
->
ip
++
;
ctx
->
script
->
call_ctx
->
ip
++
;
}
}
static
inline
void
jmp_abs
(
exec_ctx_t
*
ctx
,
unsigned
dst
)
static
inline
void
jmp_abs
(
exec_ctx_t
*
ctx
,
unsigned
dst
)
{
{
ctx
->
ip
=
dst
;
ctx
->
script
->
call_ctx
->
ip
=
dst
;
}
}
/* ECMA-262 3rd Edition 12.2 */
/* ECMA-262 3rd Edition 12.2 */
...
@@ -2428,7 +2433,7 @@ static HRESULT unwind_exception(exec_ctx_t *ctx)
...
@@ -2428,7 +2433,7 @@ static HRESULT unwind_exception(exec_ctx_t *ctx)
while
(
except_frame
->
scope
!=
ctx
->
scope_chain
)
while
(
except_frame
->
scope
!=
ctx
->
scope_chain
)
scope_pop
(
&
ctx
->
scope_chain
);
scope_pop
(
&
ctx
->
scope_chain
);
ctx
->
ip
=
except_frame
->
catch_off
;
frame
->
ip
=
except_frame
->
catch_off
;
except_val
=
ctx
->
script
->
ei
.
val
;
except_val
=
ctx
->
script
->
ei
.
val
;
ctx
->
script
->
ei
.
val
=
jsval_undefined
();
ctx
->
script
->
ei
.
val
=
jsval_undefined
();
...
@@ -2466,7 +2471,7 @@ static HRESULT unwind_exception(exec_ctx_t *ctx)
...
@@ -2466,7 +2471,7 @@ static HRESULT unwind_exception(exec_ctx_t *ctx)
static
HRESULT
enter_bytecode
(
script_ctx_t
*
ctx
,
function_code_t
*
func
,
jsval_t
*
ret
)
static
HRESULT
enter_bytecode
(
script_ctx_t
*
ctx
,
function_code_t
*
func
,
jsval_t
*
ret
)
{
{
exec_ctx_t
*
exec_ctx
=
ctx
->
call_ctx
->
exec_ctx
;
exec_ctx_t
*
exec_ctx
=
ctx
->
call_ctx
->
exec_ctx
;
unsigned
prev_
ip
,
prev_
top
;
unsigned
prev_top
;
scope_chain_t
*
prev_scope
;
scope_chain_t
*
prev_scope
;
call_frame_t
*
frame
;
call_frame_t
*
frame
;
jsop_t
op
;
jsop_t
op
;
...
@@ -2477,11 +2482,9 @@ static HRESULT enter_bytecode(script_ctx_t *ctx, function_code_t *func, jsval_t
...
@@ -2477,11 +2482,9 @@ static HRESULT enter_bytecode(script_ctx_t *ctx, function_code_t *func, jsval_t
frame
=
ctx
->
call_ctx
;
frame
=
ctx
->
call_ctx
;
prev_top
=
exec_ctx
->
top
;
prev_top
=
exec_ctx
->
top
;
prev_scope
=
exec_ctx
->
scope_chain
;
prev_scope
=
exec_ctx
->
scope_chain
;
prev_ip
=
exec_ctx
->
ip
;
exec_ctx
->
ip
=
func
->
instr_off
;
while
(
exec_ctx
->
ip
!=
-
1
)
{
while
(
frame
->
ip
!=
-
1
)
{
op
=
frame
->
bytecode
->
instrs
[
exec_ctx
->
ip
].
op
;
op
=
frame
->
bytecode
->
instrs
[
frame
->
ip
].
op
;
hres
=
op_funcs
[
op
](
exec_ctx
);
hres
=
op_funcs
[
op
](
exec_ctx
);
if
(
FAILED
(
hres
))
{
if
(
FAILED
(
hres
))
{
TRACE
(
"EXCEPTION %08x
\n
"
,
hres
);
TRACE
(
"EXCEPTION %08x
\n
"
,
hres
);
...
@@ -2493,12 +2496,10 @@ static HRESULT enter_bytecode(script_ctx_t *ctx, function_code_t *func, jsval_t
...
@@ -2493,12 +2496,10 @@ static HRESULT enter_bytecode(script_ctx_t *ctx, function_code_t *func, jsval_t
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
break
;
break
;
}
else
{
}
else
{
exec_ctx
->
ip
+=
op_move
[
op
];
frame
->
ip
+=
op_move
[
op
];
}
}
}
}
exec_ctx
->
ip
=
prev_ip
;
assert
(
ctx
->
call_ctx
==
frame
);
assert
(
ctx
->
call_ctx
==
frame
);
ctx
->
call_ctx
=
frame
->
prev_frame
;
ctx
->
call_ctx
=
frame
->
prev_frame
;
release_call_frame
(
frame
);
release_call_frame
(
frame
);
...
@@ -2566,6 +2567,8 @@ static HRESULT setup_call_frame(exec_ctx_t *ctx, bytecode_t *bytecode, function_
...
@@ -2566,6 +2567,8 @@ static HRESULT setup_call_frame(exec_ctx_t *ctx, bytecode_t *bytecode, function_
frame
->
bytecode
=
bytecode
;
frame
->
bytecode
=
bytecode
;
frame
->
function
=
function
;
frame
->
function
=
function
;
frame
->
ip
=
function
->
instr_off
;
frame
->
exec_ctx
=
ctx
;
frame
->
exec_ctx
=
ctx
;
frame
->
prev_frame
=
ctx
->
script
->
call_ctx
;
frame
->
prev_frame
=
ctx
->
script
->
call_ctx
;
...
...
dlls/jscript/engine.h
View file @
a120ecbe
...
@@ -191,6 +191,7 @@ typedef struct _except_frame_t except_frame_t;
...
@@ -191,6 +191,7 @@ typedef struct _except_frame_t except_frame_t;
struct
_parser_ctx_t
;
struct
_parser_ctx_t
;
typedef
struct
_call_frame_t
{
typedef
struct
_call_frame_t
{
unsigned
ip
;
except_frame_t
*
except_frame
;
except_frame_t
*
except_frame
;
bytecode_t
*
bytecode
;
bytecode_t
*
bytecode
;
...
@@ -213,8 +214,6 @@ struct _exec_ctx_t {
...
@@ -213,8 +214,6 @@ struct _exec_ctx_t {
unsigned
stack_size
;
unsigned
stack_size
;
unsigned
top
;
unsigned
top
;
jsval_t
ret
;
jsval_t
ret
;
unsigned
ip
;
};
};
static
inline
void
exec_addref
(
exec_ctx_t
*
ctx
)
static
inline
void
exec_addref
(
exec_ctx_t
*
ctx
)
...
...
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