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
02ff8d18
Commit
02ff8d18
authored
Dec 28, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Use bytecode for throw statement.
parent
3f4f9f0f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
12 deletions
+18
-12
compile.c
dlls/jscript/compile.c
+14
-0
engine.c
dlls/jscript/engine.c
+2
-10
engine.h
dlls/jscript/engine.h
+1
-1
parser.y
dlls/jscript/parser.y
+1
-1
No files found.
dlls/jscript/compile.c
View file @
02ff8d18
...
...
@@ -1299,6 +1299,18 @@ static HRESULT compile_switch_statement(compiler_ctx_t *ctx, switch_statement_t
return
S_OK
;
}
/* ECMA-262 3rd Edition 12.13 */
static
HRESULT
compile_throw_statement
(
compiler_ctx_t
*
ctx
,
expression_statement_t
*
stat
)
{
HRESULT
hres
;
hres
=
compile_expression
(
ctx
,
stat
->
expr
);
if
(
FAILED
(
hres
))
return
hres
;
return
push_instr
(
ctx
,
OP_throw
)
==
-
1
?
E_OUTOFMEMORY
:
S_OK
;
}
static
HRESULT
compile_statement
(
compiler_ctx_t
*
ctx
,
statement_t
*
stat
)
{
switch
(
stat
->
type
)
{
...
...
@@ -1318,6 +1330,8 @@ static HRESULT compile_statement(compiler_ctx_t *ctx, statement_t *stat)
return
push_instr
(
ctx
,
OP_label
)
==
-
1
?
E_OUTOFMEMORY
:
S_OK
;
/* FIXME */
case
STAT_SWITCH
:
return
compile_switch_statement
(
ctx
,
(
switch_statement_t
*
)
stat
);
case
STAT_THROW
:
return
compile_throw_statement
(
ctx
,
(
expression_statement_t
*
)
stat
);
case
STAT_VAR
:
return
compile_var_statement
(
ctx
,
(
var_statement_t
*
)
stat
);
case
STAT_WHILE
:
...
...
dlls/jscript/engine.c
View file @
02ff8d18
...
...
@@ -1234,19 +1234,11 @@ HRESULT switch_statement_eval(script_ctx_t *ctx, statement_t *_stat, return_type
}
/* ECMA-262 3rd Edition 12.13 */
HRESULT
throw_statement_eval
(
script_ctx_t
*
ctx
,
statement_t
*
_stat
,
return_type_t
*
rt
,
VARIANT
*
ret
)
static
HRESULT
interp_throw
(
exec_ctx_t
*
ctx
)
{
expression_statement_t
*
stat
=
(
expression_statement_t
*
)
_stat
;
VARIANT
val
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
hres
=
expr_eval
(
ctx
,
stat
->
expr
,
&
rt
->
ei
,
&
val
);
if
(
FAILED
(
hres
))
return
hres
;
rt
->
ei
.
var
=
val
;
ctx
->
rt
->
ei
.
var
=
*
stack_pop
(
ctx
);
return
DISP_E_EXCEPTION
;
}
...
...
dlls/jscript/engine.h
View file @
02ff8d18
...
...
@@ -99,6 +99,7 @@ typedef struct _func_stack {
X(rshift2, 1, 0,0) \
X(str, 1, ARG_STR, 0) \
X(this, 1, 0,0) \
X(throw, 0, 0,0) \
X(throw_ref, 0, ARG_UINT, 0) \
X(throw_type, 0, ARG_UINT, ARG_STR) \
X(tonum, 1, 0,0) \
...
...
@@ -413,7 +414,6 @@ HRESULT break_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*)
HRESULT
return_statement_eval
(
script_ctx_t
*
,
statement_t
*
,
return_type_t
*
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
HRESULT
with_statement_eval
(
script_ctx_t
*
,
statement_t
*
,
return_type_t
*
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
HRESULT
switch_statement_eval
(
script_ctx_t
*
,
statement_t
*
,
return_type_t
*
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
HRESULT
throw_statement_eval
(
script_ctx_t
*
,
statement_t
*
,
return_type_t
*
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
HRESULT
try_statement_eval
(
script_ctx_t
*
,
statement_t
*
,
return_type_t
*
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
typedef
struct
{
...
...
dlls/jscript/parser.y
View file @
02ff8d18
...
...
@@ -847,7 +847,7 @@ static const statement_eval_t stat_eval_table[] = {
compiled_statement_eval,
return_statement_eval,
compiled_statement_eval,
throw
_statement_eval,
compiled
_statement_eval,
try_statement_eval,
compiled_statement_eval,
compiled_statement_eval,
...
...
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