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
00ce4419
Commit
00ce4419
authored
Mar 25, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 26, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Store is_global flag in call_frame_t.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
932ffa0d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
16 deletions
+16
-16
engine.c
dlls/jscript/engine.c
+6
-6
engine.h
dlls/jscript/engine.h
+3
-3
function.c
dlls/jscript/function.c
+2
-2
global.c
dlls/jscript/global.c
+1
-1
jscript.c
dlls/jscript/jscript.c
+4
-4
No files found.
dlls/jscript/engine.c
View file @
00ce4419
...
@@ -295,7 +295,7 @@ void scope_release(scope_chain_t *scope)
...
@@ -295,7 +295,7 @@ void scope_release(scope_chain_t *scope)
heap_free
(
scope
);
heap_free
(
scope
);
}
}
HRESULT
create_exec_ctx
(
script_ctx_t
*
script_ctx
,
BOOL
is_global
,
exec_ctx_t
**
ret
)
HRESULT
create_exec_ctx
(
script_ctx_t
*
script_ctx
,
exec_ctx_t
**
ret
)
{
{
exec_ctx_t
*
ctx
;
exec_ctx_t
*
ctx
;
...
@@ -304,7 +304,6 @@ HRESULT create_exec_ctx(script_ctx_t *script_ctx, BOOL is_global, exec_ctx_t **r
...
@@ -304,7 +304,6 @@ HRESULT create_exec_ctx(script_ctx_t *script_ctx, BOOL is_global, exec_ctx_t **r
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
ctx
->
ref
=
1
;
ctx
->
ref
=
1
;
ctx
->
is_global
=
is_global
;
script_addref
(
script_ctx
);
script_addref
(
script_ctx
);
ctx
->
script
=
script_ctx
;
ctx
->
script
=
script_ctx
;
...
@@ -2532,7 +2531,7 @@ static HRESULT bind_event_target(script_ctx_t *ctx, function_code_t *func, jsdis
...
@@ -2532,7 +2531,7 @@ static HRESULT bind_event_target(script_ctx_t *ctx, function_code_t *func, jsdis
}
}
static
HRESULT
setup_call_frame
(
exec_ctx_t
*
ctx
,
bytecode_t
*
bytecode
,
function_code_t
*
function
,
scope_chain_t
*
scope
,
static
HRESULT
setup_call_frame
(
exec_ctx_t
*
ctx
,
bytecode_t
*
bytecode
,
function_code_t
*
function
,
scope_chain_t
*
scope
,
IDispatch
*
this_obj
,
jsdisp_t
*
variable_obj
)
IDispatch
*
this_obj
,
BOOL
is_global
,
jsdisp_t
*
variable_obj
)
{
{
call_frame_t
*
frame
;
call_frame_t
*
frame
;
...
@@ -2569,6 +2568,7 @@ static HRESULT setup_call_frame(exec_ctx_t *ctx, bytecode_t *bytecode, function_
...
@@ -2569,6 +2568,7 @@ static HRESULT setup_call_frame(exec_ctx_t *ctx, bytecode_t *bytecode, function_
frame
->
this_obj
=
to_disp
(
ctx
->
script
->
global
);
frame
->
this_obj
=
to_disp
(
ctx
->
script
->
global
);
IDispatch_AddRef
(
frame
->
this_obj
);
IDispatch_AddRef
(
frame
->
this_obj
);
frame
->
is_global
=
is_global
;
frame
->
variable_obj
=
jsdisp_addref
(
variable_obj
);
frame
->
variable_obj
=
jsdisp_addref
(
variable_obj
);
frame
->
exec_ctx
=
ctx
;
frame
->
exec_ctx
=
ctx
;
...
@@ -2579,7 +2579,7 @@ static HRESULT setup_call_frame(exec_ctx_t *ctx, bytecode_t *bytecode, function_
...
@@ -2579,7 +2579,7 @@ static HRESULT setup_call_frame(exec_ctx_t *ctx, bytecode_t *bytecode, function_
}
}
HRESULT
exec_source
(
exec_ctx_t
*
ctx
,
bytecode_t
*
code
,
function_code_t
*
func
,
scope_chain_t
*
scope
,
HRESULT
exec_source
(
exec_ctx_t
*
ctx
,
bytecode_t
*
code
,
function_code_t
*
func
,
scope_chain_t
*
scope
,
IDispatch
*
this_obj
,
jsdisp_t
*
variable_obj
,
jsval_t
*
ret
)
IDispatch
*
this_obj
,
BOOL
is_global
,
jsdisp_t
*
variable_obj
,
jsval_t
*
ret
)
{
{
jsval_t
val
;
jsval_t
val
;
unsigned
i
;
unsigned
i
;
...
@@ -2605,7 +2605,7 @@ HRESULT exec_source(exec_ctx_t *ctx, bytecode_t *code, function_code_t *func, sc
...
@@ -2605,7 +2605,7 @@ HRESULT exec_source(exec_ctx_t *ctx, bytecode_t *code, function_code_t *func, sc
}
}
for
(
i
=
0
;
i
<
func
->
var_cnt
;
i
++
)
{
for
(
i
=
0
;
i
<
func
->
var_cnt
;
i
++
)
{
if
(
!
ctx
->
is_global
||
!
lookup_global_members
(
ctx
->
script
,
func
->
variables
[
i
],
NULL
))
{
if
(
!
is_global
||
!
lookup_global_members
(
ctx
->
script
,
func
->
variables
[
i
],
NULL
))
{
DISPID
id
=
0
;
DISPID
id
=
0
;
hres
=
jsdisp_get_id
(
variable_obj
,
func
->
variables
[
i
],
fdexNameEnsure
,
&
id
);
hres
=
jsdisp_get_id
(
variable_obj
,
func
->
variables
[
i
],
fdexNameEnsure
,
&
id
);
...
@@ -2614,7 +2614,7 @@ HRESULT exec_source(exec_ctx_t *ctx, bytecode_t *code, function_code_t *func, sc
...
@@ -2614,7 +2614,7 @@ HRESULT exec_source(exec_ctx_t *ctx, bytecode_t *code, function_code_t *func, sc
}
}
}
}
hres
=
setup_call_frame
(
ctx
,
code
,
func
,
scope
,
this_obj
,
variable_obj
);
hres
=
setup_call_frame
(
ctx
,
code
,
func
,
scope
,
this_obj
,
is_global
,
variable_obj
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
...
...
dlls/jscript/engine.h
View file @
00ce4419
...
@@ -202,6 +202,7 @@ typedef struct _call_frame_t {
...
@@ -202,6 +202,7 @@ typedef struct _call_frame_t {
IDispatch
*
this_obj
;
IDispatch
*
this_obj
;
jsdisp_t
*
variable_obj
;
jsdisp_t
*
variable_obj
;
BOOL
is_global
;
bytecode_t
*
bytecode
;
bytecode_t
*
bytecode
;
function_code_t
*
function
;
function_code_t
*
function
;
...
@@ -214,7 +215,6 @@ struct _exec_ctx_t {
...
@@ -214,7 +215,6 @@ struct _exec_ctx_t {
LONG
ref
;
LONG
ref
;
script_ctx_t
*
script
;
script_ctx_t
*
script
;
BOOL
is_global
;
};
};
static
inline
void
exec_addref
(
exec_ctx_t
*
ctx
)
static
inline
void
exec_addref
(
exec_ctx_t
*
ctx
)
...
@@ -223,6 +223,6 @@ static inline void exec_addref(exec_ctx_t *ctx)
...
@@ -223,6 +223,6 @@ static inline void exec_addref(exec_ctx_t *ctx)
}
}
void
exec_release
(
exec_ctx_t
*
)
DECLSPEC_HIDDEN
;
void
exec_release
(
exec_ctx_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
create_exec_ctx
(
script_ctx_t
*
,
BOOL
,
exec_ctx_t
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_exec_ctx
(
script_ctx_t
*
,
exec_ctx_t
**
)
DECLSPEC_HIDDEN
;
HRESULT
exec_source
(
exec_ctx_t
*
,
bytecode_t
*
,
function_code_t
*
,
scope_chain_t
*
,
IDispatch
*
,
jsdisp_t
*
,
jsval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
exec_source
(
exec_ctx_t
*
,
bytecode_t
*
,
function_code_t
*
,
scope_chain_t
*
,
IDispatch
*
,
BOOL
,
jsdisp_t
*
,
jsval_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
create_source_function
(
script_ctx_t
*
,
bytecode_t
*
,
function_code_t
*
,
scope_chain_t
*
,
jsdisp_t
**
)
DECLSPEC_HIDDEN
;
HRESULT
create_source_function
(
script_ctx_t
*
,
bytecode_t
*
,
function_code_t
*
,
scope_chain_t
*
,
jsdisp_t
**
)
DECLSPEC_HIDDEN
;
dlls/jscript/function.c
View file @
00ce4419
...
@@ -239,13 +239,13 @@ static HRESULT invoke_source(script_ctx_t *ctx, FunctionInstance *function, IDis
...
@@ -239,13 +239,13 @@ static HRESULT invoke_source(script_ctx_t *ctx, FunctionInstance *function, IDis
hres
=
scope_push
(
function
->
scope_chain
,
var_disp
,
to_disp
(
var_disp
),
&
scope
);
hres
=
scope_push
(
function
->
scope_chain
,
var_disp
,
to_disp
(
var_disp
),
&
scope
);
if
(
SUCCEEDED
(
hres
))
{
if
(
SUCCEEDED
(
hres
))
{
hres
=
create_exec_ctx
(
ctx
,
FALSE
,
&
exec_ctx
);
hres
=
create_exec_ctx
(
ctx
,
&
exec_ctx
);
if
(
SUCCEEDED
(
hres
))
{
if
(
SUCCEEDED
(
hres
))
{
jsdisp_t
*
prev_args
;
jsdisp_t
*
prev_args
;
prev_args
=
function
->
arguments
;
prev_args
=
function
->
arguments
;
function
->
arguments
=
arg_disp
;
function
->
arguments
=
arg_disp
;
hres
=
exec_source
(
exec_ctx
,
function
->
code
,
function
->
func_code
,
scope
,
this_obj
,
var_disp
,
r
);
hres
=
exec_source
(
exec_ctx
,
function
->
code
,
function
->
func_code
,
scope
,
this_obj
,
FALSE
,
var_disp
,
r
);
function
->
arguments
=
prev_args
;
function
->
arguments
=
prev_args
;
exec_release
(
exec_ctx
);
exec_release
(
exec_ctx
);
...
...
dlls/jscript/global.c
View file @
00ce4419
...
@@ -224,7 +224,7 @@ static HRESULT JSGlobal_eval(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns
...
@@ -224,7 +224,7 @@ static HRESULT JSGlobal_eval(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns
}
}
hres
=
exec_source
(
ctx
->
call_ctx
->
exec_ctx
,
code
,
&
code
->
global_code
,
frame
->
scope
,
hres
=
exec_source
(
ctx
->
call_ctx
->
exec_ctx
,
code
,
&
code
->
global_code
,
frame
->
scope
,
frame
->
this_obj
,
frame
->
variable_obj
,
r
);
frame
->
this_obj
,
frame
->
is_global
,
frame
->
variable_obj
,
r
);
release_bytecode
(
code
);
release_bytecode
(
code
);
return
hres
;
return
hres
;
}
}
...
...
dlls/jscript/jscript.c
View file @
00ce4419
...
@@ -105,14 +105,14 @@ static HRESULT exec_global_code(JScript *This, bytecode_t *code)
...
@@ -105,14 +105,14 @@ static HRESULT exec_global_code(JScript *This, bytecode_t *code)
exec_ctx_t
*
exec_ctx
;
exec_ctx_t
*
exec_ctx
;
HRESULT
hres
;
HRESULT
hres
;
hres
=
create_exec_ctx
(
This
->
ctx
,
TRUE
,
&
exec_ctx
);
hres
=
create_exec_ctx
(
This
->
ctx
,
&
exec_ctx
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
return
hres
;
return
hres
;
IActiveScriptSite_OnEnterScript
(
This
->
site
);
IActiveScriptSite_OnEnterScript
(
This
->
site
);
clear_ei
(
This
->
ctx
);
clear_ei
(
This
->
ctx
);
hres
=
exec_source
(
exec_ctx
,
code
,
&
code
->
global_code
,
NULL
,
NULL
,
This
->
ctx
->
global
,
NULL
);
hres
=
exec_source
(
exec_ctx
,
code
,
&
code
->
global_code
,
NULL
,
NULL
,
T
RUE
,
T
his
->
ctx
->
global
,
NULL
);
exec_release
(
exec_ctx
);
exec_release
(
exec_ctx
);
IActiveScriptSite_OnLeaveScript
(
This
->
site
);
IActiveScriptSite_OnLeaveScript
(
This
->
site
);
...
@@ -776,14 +776,14 @@ static HRESULT WINAPI JScriptParse_ParseScriptText(IActiveScriptParse *iface,
...
@@ -776,14 +776,14 @@ static HRESULT WINAPI JScriptParse_ParseScriptText(IActiveScriptParse *iface,
if
(
dwFlags
&
SCRIPTTEXT_ISEXPRESSION
)
{
if
(
dwFlags
&
SCRIPTTEXT_ISEXPRESSION
)
{
exec_ctx_t
*
exec_ctx
;
exec_ctx_t
*
exec_ctx
;
hres
=
create_exec_ctx
(
This
->
ctx
,
TRUE
,
&
exec_ctx
);
hres
=
create_exec_ctx
(
This
->
ctx
,
&
exec_ctx
);
if
(
SUCCEEDED
(
hres
))
{
if
(
SUCCEEDED
(
hres
))
{
jsval_t
r
;
jsval_t
r
;
IActiveScriptSite_OnEnterScript
(
This
->
site
);
IActiveScriptSite_OnEnterScript
(
This
->
site
);
clear_ei
(
This
->
ctx
);
clear_ei
(
This
->
ctx
);
hres
=
exec_source
(
exec_ctx
,
code
,
&
code
->
global_code
,
NULL
,
NULL
,
This
->
ctx
->
global
,
&
r
);
hres
=
exec_source
(
exec_ctx
,
code
,
&
code
->
global_code
,
NULL
,
NULL
,
T
RUE
,
T
his
->
ctx
->
global
,
&
r
);
if
(
SUCCEEDED
(
hres
))
{
if
(
SUCCEEDED
(
hres
))
{
if
(
pvarResult
)
if
(
pvarResult
)
hres
=
jsval_to_variant
(
r
,
pvarResult
);
hres
=
jsval_to_variant
(
r
,
pvarResult
);
...
...
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