From a6530f4032da470fe9dfa7de9555a355d4ea6654 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 27 Dec 2011 11:16:51 +0100 Subject: [PATCH] jscript: Use bytecode for labelled statement stub. --- dlls/jscript/compile.c | 2 ++ dlls/jscript/engine.c | 2 +- dlls/jscript/engine.h | 2 +- dlls/jscript/parser.y | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index e54c16a75a5..5f255983367 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -1246,6 +1246,8 @@ static HRESULT compile_statement(compiler_ctx_t *ctx, statement_t *stat) return compile_for_statement(ctx, (for_statement_t*)stat); case STAT_IF: return compile_if_statement(ctx, (if_statement_t*)stat); + case STAT_LABEL: + 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_VAR: diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 99c492f829a..fbeee6ffc4e 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -1067,7 +1067,7 @@ HRESULT interp_pop_scope(exec_ctx_t *ctx) } /* ECMA-262 3rd Edition 12.12 */ -HRESULT labelled_statement_eval(script_ctx_t *ctx, statement_t *stat, return_type_t *rt, VARIANT *ret) +HRESULT interp_label(exec_ctx_t *ctx) { FIXME("\n"); return E_NOTIMPL; diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 263548e1d9d..7dbaeb27aeb 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -71,6 +71,7 @@ typedef struct _func_stack { X(int, 1, ARG_INT, 0) \ X(jmp, 0, ARG_ADDR, 0) \ X(jmp_z, 0, ARG_ADDR, 0) \ + X(label, 0, 0,0) \ X(lshift, 1, 0,0) \ X(lt, 1, 0,0) \ X(lteq, 1, 0,0) \ @@ -410,7 +411,6 @@ HRESULT continue_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIAN 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; HRESULT with_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN; -HRESULT labelled_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; diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index aaec6494f25..02d35bd3061 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -844,7 +844,7 @@ static const statement_eval_t stat_eval_table[] = { compiled_statement_eval, forin_statement_eval, compiled_statement_eval, - labelled_statement_eval, + compiled_statement_eval, return_statement_eval, compiled_statement_eval, throw_statement_eval,