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
9daafa87
Commit
9daafa87
authored
Aug 03, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Access arguments directly from stack in arguments object if possible.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b652a978
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
14 deletions
+23
-14
engine.c
dlls/jscript/engine.c
+1
-1
engine.h
dlls/jscript/engine.h
+0
-2
function.c
dlls/jscript/function.c
+22
-11
No files found.
dlls/jscript/engine.c
View file @
9daafa87
...
...
@@ -545,7 +545,7 @@ static HRESULT equal2_values(jsval_t lval, jsval_t rval, BOOL *ret)
* Transfers local variables from stack to variable object.
* It's slow, so we want to avoid it as much as possible.
*/
HRESULT
detach_variable_object
(
script_ctx_t
*
ctx
,
call_frame_t
*
frame
)
static
HRESULT
detach_variable_object
(
script_ctx_t
*
ctx
,
call_frame_t
*
frame
)
{
unsigned
i
;
HRESULT
hres
;
...
...
dlls/jscript/engine.h
View file @
9daafa87
...
...
@@ -226,8 +226,6 @@ typedef struct _call_frame_t {
struct
_call_frame_t
*
prev_frame
;
}
call_frame_t
;
HRESULT
detach_variable_object
(
script_ctx_t
*
,
call_frame_t
*
)
DECLSPEC_HIDDEN
;
#define EXEC_GLOBAL 0x0001
#define EXEC_CONSTRUCTOR 0x0002
#define EXEC_RETURN_TO_INTERP 0x0004
...
...
dlls/jscript/function.c
View file @
9daafa87
...
...
@@ -89,34 +89,45 @@ static unsigned Arguments_idx_length(jsdisp_t *jsdisp)
return
arguments
->
function
->
length
;
}
static
HRESULT
Arguments_idx_get
(
jsdisp_t
*
jsdisp
,
unsigned
idx
,
jsval_t
*
res
)
static
jsval_t
*
get_argument_ref
(
ArgumentsInstance
*
arguments
,
unsigned
idx
)
{
call_frame_t
*
frame
=
arguments
->
scope
->
frame
;
return
frame
?
arguments
->
jsdisp
.
ctx
->
stack
+
frame
->
arguments_off
+
idx
:
NULL
;
}
static
HRESULT
Arguments_idx_get
(
jsdisp_t
*
jsdisp
,
unsigned
idx
,
jsval_t
*
r
)
{
ArgumentsInstance
*
arguments
=
(
ArgumentsInstance
*
)
jsdisp
;
jsval_t
*
ref
;
TRACE
(
"%p[%u]
\n
"
,
arguments
,
idx
);
if
(
arguments
->
scope
->
frame
)
{
HRESULT
hres
;
hres
=
detach_variable_object
(
jsdisp
->
ctx
,
arguments
->
scope
->
frame
);
if
(
FAILED
(
hres
))
return
hres
;
}
if
((
ref
=
get_argument_ref
(
arguments
,
idx
)))
return
jsval_copy
(
*
ref
,
r
);
/* FIXME: Accessing by name won't work for duplicated argument names */
return
jsdisp_propget_name
(
arguments
->
scope
->
jsobj
,
arguments
->
function
->
func_code
->
params
[
idx
],
r
es
);
return
jsdisp_propget_name
(
arguments
->
scope
->
jsobj
,
arguments
->
function
->
func_code
->
params
[
idx
],
r
);
}
static
HRESULT
Arguments_idx_put
(
jsdisp_t
*
jsdisp
,
unsigned
idx
,
jsval_t
val
)
{
ArgumentsInstance
*
arguments
=
(
ArgumentsInstance
*
)
jsdisp
;
jsval_t
*
ref
;
HRESULT
hres
;
TRACE
(
"%p[%u] = %s
\n
"
,
arguments
,
idx
,
debugstr_jsval
(
val
));
if
(
arguments
->
scope
->
frame
)
{
HRESULT
hres
;
hres
=
detach_variable_object
(
jsdisp
->
ctx
,
arguments
->
scope
->
frame
);
if
(
(
ref
=
get_argument_ref
(
arguments
,
idx
))
)
{
jsval_t
copy
;
hres
=
jsval_copy
(
val
,
&
copy
);
if
(
FAILED
(
hres
))
return
hres
;
jsval_release
(
*
ref
);
*
ref
=
copy
;
return
S_OK
;
}
/* FIXME: Accessing by name won't work for duplicated argument names */
...
...
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