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
f904bc8e
Commit
f904bc8e
authored
Dec 29, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 29, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Always use bytecode for for statement.
parent
2c0920f8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
103 deletions
+1
-103
compile.c
dlls/jscript/compile.c
+1
-8
engine.c
dlls/jscript/engine.c
+0
-94
engine.h
dlls/jscript/engine.h
+0
-1
No files found.
dlls/jscript/compile.c
View file @
f904bc8e
...
...
@@ -1084,11 +1084,9 @@ static HRESULT compile_while_statement(compiler_ctx_t *ctx, while_statement_t *s
static
HRESULT
compile_for_statement
(
compiler_ctx_t
*
ctx
,
for_statement_t
*
stat
)
{
statement_ctx_t
stat_ctx
=
{
0
,
FALSE
,
FALSE
};
unsigned
off_backup
,
expr_off
;
unsigned
expr_off
;
HRESULT
hres
;
off_backup
=
ctx
->
code_off
;
if
(
stat
->
variable_list
)
{
hres
=
compile_variable_list
(
ctx
,
stat
->
variable_list
);
if
(
FAILED
(
hres
))
...
...
@@ -1131,11 +1129,6 @@ static HRESULT compile_for_statement(compiler_ctx_t *ctx, for_statement_t *stat)
return
E_OUTOFMEMORY
;
hres
=
compile_statement
(
ctx
,
&
stat_ctx
,
stat
->
statement
);
if
(
hres
==
E_NOTIMPL
)
{
ctx
->
code_off
=
off_backup
;
stat
->
stat
.
eval
=
for_statement_eval
;
return
compile_interp_fallback
(
ctx
,
&
stat
->
stat
);
}
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/jscript/engine.c
View file @
f904bc8e
...
...
@@ -657,31 +657,6 @@ static HRESULT identifier_eval(script_ctx_t *ctx, BSTR identifier, DWORD flags,
}
/* ECMA-262 3rd Edition 12.2 */
static
HRESULT
variable_list_eval
(
script_ctx_t
*
ctx
,
variable_declaration_t
*
var_list
,
jsexcept_t
*
ei
)
{
variable_declaration_t
*
iter
;
HRESULT
hres
=
S_OK
;
for
(
iter
=
var_list
;
iter
;
iter
=
iter
->
next
)
{
VARIANT
val
;
if
(
!
iter
->
expr
)
continue
;
hres
=
expr_eval
(
ctx
,
iter
->
expr
,
ei
,
&
val
);
if
(
FAILED
(
hres
))
break
;
hres
=
jsdisp_propput_name
(
ctx
->
exec_ctx
->
var_disp
,
iter
->
identifier
,
&
val
,
ei
,
NULL
/*FIXME*/
);
VariantClear
(
&
val
);
if
(
FAILED
(
hres
))
break
;
}
return
hres
;
}
/* ECMA-262 3rd Edition 12.2 */
static
HRESULT
interp_var_set
(
exec_ctx_t
*
ctx
)
{
const
BSTR
name
=
ctx
->
parser
->
code
->
instrs
[
ctx
->
ip
].
arg1
.
bstr
;
...
...
@@ -749,75 +724,6 @@ HRESULT while_statement_eval(script_ctx_t *ctx, statement_t *_stat, return_type_
return
S_OK
;
}
/* ECMA-262 3rd Edition 12.6.3 */
HRESULT
for_statement_eval
(
script_ctx_t
*
ctx
,
statement_t
*
_stat
,
return_type_t
*
rt
,
VARIANT
*
ret
)
{
for_statement_t
*
stat
=
(
for_statement_t
*
)
_stat
;
VARIANT
val
,
tmp
,
retv
;
VARIANT_BOOL
b
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
if
(
stat
->
variable_list
)
{
hres
=
variable_list_eval
(
ctx
,
stat
->
variable_list
,
&
rt
->
ei
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
if
(
stat
->
begin_expr
)
{
hres
=
expr_eval
(
ctx
,
stat
->
begin_expr
,
&
rt
->
ei
,
&
val
);
if
(
FAILED
(
hres
))
return
hres
;
VariantClear
(
&
val
);
}
V_VT
(
&
retv
)
=
VT_EMPTY
;
while
(
1
)
{
if
(
stat
->
expr
)
{
hres
=
expr_eval
(
ctx
,
stat
->
expr
,
&
rt
->
ei
,
&
tmp
);
if
(
FAILED
(
hres
))
break
;
hres
=
to_boolean
(
&
tmp
,
&
b
);
VariantClear
(
&
tmp
);
if
(
FAILED
(
hres
)
||
!
b
)
break
;
}
hres
=
stat_eval
(
ctx
,
stat
->
statement
,
rt
,
&
tmp
);
if
(
FAILED
(
hres
))
break
;
VariantClear
(
&
retv
);
retv
=
tmp
;
if
(
rt
->
type
==
RT_CONTINUE
)
rt
->
type
=
RT_NORMAL
;
else
if
(
rt
->
type
!=
RT_NORMAL
)
break
;
if
(
stat
->
end_expr
)
{
hres
=
expr_eval
(
ctx
,
stat
->
end_expr
,
&
rt
->
ei
,
&
val
);
if
(
FAILED
(
hres
))
break
;
VariantClear
(
&
val
);
}
}
if
(
FAILED
(
hres
))
{
VariantClear
(
&
retv
);
return
hres
;
}
if
(
rt
->
type
==
RT_BREAK
)
rt
->
type
=
RT_NORMAL
;
*
ret
=
retv
;
return
S_OK
;
}
/* ECMA-262 3rd Edition 12.6.4 */
static
HRESULT
interp_forin
(
exec_ctx_t
*
ctx
)
{
...
...
dlls/jscript/engine.h
View file @
f904bc8e
...
...
@@ -414,7 +414,6 @@ typedef struct {
HRESULT
compiled_statement_eval
(
script_ctx_t
*
,
statement_t
*
,
return_type_t
*
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
HRESULT
while_statement_eval
(
script_ctx_t
*
,
statement_t
*
,
return_type_t
*
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
HRESULT
for_statement_eval
(
script_ctx_t
*
,
statement_t
*
,
return_type_t
*
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
HRESULT
continue_statement_eval
(
script_ctx_t
*
,
statement_t
*
,
return_type_t
*
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
HRESULT
break_statement_eval
(
script_ctx_t
*
,
statement_t
*
,
return_type_t
*
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
HRESULT
return_statement_eval
(
script_ctx_t
*
,
statement_t
*
,
return_type_t
*
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
...
...
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