From fc4948af2c1de60fd1c8d5587bf40749313e5515 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 8 Dec 2011 12:03:09 +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 9e1ed6a7ed5..0acf483f106 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -613,6 +613,8 @@ static HRESULT compile_expression_noret(compiler_ctx_t *ctx, expression_t *expr, return compile_assign_expression(ctx, (binary_expression_t*)expr, OP_LAST); case EXPR_ASSIGNADD: return compile_assign_expression(ctx, (binary_expression_t*)expr, OP_add); + case EXPR_ASSIGNAND: + return compile_assign_expression(ctx, (binary_expression_t*)expr, OP_and); case EXPR_ASSIGNSUB: return compile_assign_expression(ctx, (binary_expression_t*)expr, OP_sub); case EXPR_ASSIGNMUL: diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 50aab416b66..81033f2470f 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -2164,25 +2164,6 @@ static HRESULT interp_xor(exec_ctx_t *ctx) return stack_push_int(ctx, l^r); } -/* ECMA-262 3rd Edition 11.10 */ -static HRESULT bitand_eval(script_ctx_t *ctx, VARIANT *lval, VARIANT *rval, jsexcept_t *ei, VARIANT *retv) -{ - INT li, ri; - HRESULT hres; - - hres = to_int32(ctx, lval, ei, &li); - if(FAILED(hres)) - return hres; - - hres = to_int32(ctx, rval, ei, &ri); - if(FAILED(hres)) - return hres; - - V_VT(retv) = VT_I4; - V_I4(retv) = li&ri; - return S_OK; -} - /* ECMA-262 3rd Edition 11.10 */ static HRESULT interp_and(exec_ctx_t *ctx) { @@ -3248,16 +3229,6 @@ HRESULT assign_rrshift_expression_eval(script_ctx_t *ctx, expression_t *_expr, D return assign_oper_eval(ctx, expr->expression1, expr->expression2, rshift2_eval, ei, ret); } -/* ECMA-262 3rd Edition 11.13.2 */ -HRESULT assign_and_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, bitand_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 582bc1f0018..9758377b685 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -571,7 +571,6 @@ HRESULT right2_shift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_ HRESULT assign_lshift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT assign_rshift_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 assign_and_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 2d8361cf5cb..6a973070ca0 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -1348,7 +1348,7 @@ static const expression_eval_t expression_eval_table[] = { compiled_expression_eval, compiled_expression_eval, compiled_expression_eval, - assign_and_expression_eval, + compiled_expression_eval, compiled_expression_eval, compiled_expression_eval, compiled_expression_eval,