Commit 96e822a3 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Use bytecode for '>>>' expression implementation.

parent fcdd8526
......@@ -693,6 +693,8 @@ static HRESULT compile_expression_noret(compiler_ctx_t *ctx, expression_t *expr,
return compile_increment_expression(ctx, (unary_expression_t*)expr, OP_preinc, 1);
case EXPR_RSHIFT:
return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_rshift);
case EXPR_RRSHIFT:
return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_rshift2);
case EXPR_SUB:
return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_sub);
case EXPR_THIS:
......
......@@ -3160,13 +3160,20 @@ static HRESULT rshift2_eval(script_ctx_t *ctx, VARIANT *lval, VARIANT *rval, jse
}
/* ECMA-262 3rd Edition 11.7.3 */
HRESULT right2_shift_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret)
static HRESULT interp_rshift2(exec_ctx_t *ctx)
{
binary_expression_t *expr = (binary_expression_t*)_expr;
DWORD r, l;
HRESULT hres;
TRACE("\n");
hres = stack_pop_uint(ctx, &r);
if(FAILED(hres))
return hres;
return binary_expr_eval(ctx, expr, rshift2_eval, ei, ret);
hres = stack_pop_uint(ctx, &l);
if(FAILED(hres))
return hres;
return stack_push_int(ctx, l >> (r&0x1f));
}
/* ECMA-262 3rd Edition 11.13.1 */
......
......@@ -83,6 +83,7 @@ typedef struct _func_stack {
X(preinc, 1, ARG_INT, 0) \
X(regexp, 1, ARG_STR, ARG_INT) \
X(rshift, 1, 0,0) \
X(rshift2, 1, 0,0) \
X(str, 1, ARG_STR, 0) \
X(this, 1, 0,0) \
X(throw, 0, ARG_UINT, 0) \
......@@ -567,7 +568,6 @@ HRESULT instanceof_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*
HRESULT delete_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN;
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 right2_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;
......
......@@ -1338,7 +1338,7 @@ static const expression_eval_t expression_eval_table[] = {
compiled_expression_eval,
left_shift_expression_eval,
compiled_expression_eval,
right2_shift_expression_eval,
compiled_expression_eval,
compiled_expression_eval,
assign_lshift_expression_eval,
compiled_expression_eval,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment