From 7904932a9ed5320391acfd2b43fd0d6c8695a376 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 9 Dec 2011 11:04:45 +0100 Subject: [PATCH] jscript: Use bytecode for '>>>=' expression implementation. --- dlls/jscript/compile.c | 2 ++ dlls/jscript/engine.c | 29 ----------------------------- dlls/jscript/engine.h | 1 - dlls/jscript/parser.y | 2 +- 4 files changed, 3 insertions(+), 31 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index ececd104623..541e9452a8b 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -627,6 +627,8 @@ static HRESULT compile_expression_noret(compiler_ctx_t *ctx, expression_t *expr, return compile_assign_expression(ctx, (binary_expression_t*)expr, OP_or); case EXPR_ASSIGNRSHIFT: return compile_assign_expression(ctx, (binary_expression_t*)expr, OP_rshift); + case EXPR_ASSIGNRRSHIFT: + return compile_assign_expression(ctx, (binary_expression_t*)expr, OP_rshift2); case EXPR_ASSIGNXOR: return compile_assign_expression(ctx, (binary_expression_t*)expr, OP_xor); case EXPR_BAND: diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 1699d844c79..3ebdb83b9ec 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -3141,25 +3141,6 @@ static HRESULT interp_rshift(exec_ctx_t *ctx) } /* ECMA-262 3rd Edition 11.7.3 */ -static HRESULT rshift2_eval(script_ctx_t *ctx, VARIANT *lval, VARIANT *rval, jsexcept_t *ei, VARIANT *retv) -{ - DWORD li, ri; - HRESULT hres; - - hres = to_uint32(ctx, lval, ei, &li); - if(FAILED(hres)) - return hres; - - hres = to_uint32(ctx, rval, ei, &ri); - if(FAILED(hres)) - return hres; - - V_VT(retv) = VT_I4; - V_I4(retv) = li >> (ri&0x1f); - return S_OK; -} - -/* ECMA-262 3rd Edition 11.7.3 */ static HRESULT interp_rshift2(exec_ctx_t *ctx) { DWORD r, l; @@ -3212,16 +3193,6 @@ HRESULT assign_lshift_expression_eval(script_ctx_t *ctx, expression_t *_expr, DW return assign_oper_eval(ctx, expr->expression1, expr->expression2, lshift_eval, ei, ret); } -/* ECMA-262 3rd Edition 11.13.2 */ -HRESULT assign_rrshift_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) -{ - binary_expression_t *expr = (binary_expression_t*)_expr; - - TRACE("\n"); - - return assign_oper_eval(ctx, expr->expression1, expr->expression2, rshift2_eval, ei, ret); -} - static HRESULT interp_undefined(exec_ctx_t *ctx) { VARIANT v; diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 5b0a8699abd..ba2c3a8e83c 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -569,7 +569,6 @@ HRESULT delete_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exp HRESULT typeof_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT left_shift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT assign_lshift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; -HRESULT assign_rrshift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT compiled_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index f07280be230..00fea0bc8e3 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -1342,7 +1342,7 @@ static const expression_eval_t expression_eval_table[] = { compiled_expression_eval, assign_lshift_expression_eval, compiled_expression_eval, - assign_rrshift_expression_eval, + compiled_expression_eval, compiled_expression_eval, compiled_expression_eval, compiled_expression_eval, -- 2.11.4.GIT