Commit 32602170 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Use bytecode interpreter for '!==' expressions.

parent b473f5d5
......@@ -98,7 +98,10 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr)
switch(expr->type) {
case EXPR_EQEQ:
return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_eq2);
case EXPR_NOTEQEQ:
return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_neq2);
default:
assert(expr->eval != compiled_expression_eval);
return compile_interp_fallback(ctx, expr);
}
......
......@@ -2864,26 +2864,24 @@ HRESULT not_equal_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD
}
/* ECMA-262 3rd Edition 11.9.5 */
HRESULT not_equal2_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret)
static HRESULT interp_neq2(exec_ctx_t *ctx)
{
binary_expression_t *expr = (binary_expression_t*)_expr;
VARIANT rval, lval;
VARIANT *l, *r;
BOOL b;
HRESULT hres;
TRACE("\n");
hres = get_binary_expr_values(ctx, expr, ei, &lval, &rval);
if(FAILED(hres))
return hres;
r = stack_pop(ctx);
l = stack_pop(ctx);
hres = equal2_values(&lval, &rval, &b);
VariantClear(&lval);
VariantClear(&rval);
hres = equal2_values(r, l, &b);
VariantClear(l);
VariantClear(r);
if(FAILED(hres))
return hres;
return return_bool(ret, !b);
return stack_push_bool(ctx, !b);
}
/* ECMA-262 3rd Edition 11.8.5 */
......
......@@ -43,6 +43,7 @@ typedef struct _func_stack {
#define OP_LIST \
X(eq2, 1, 0) \
X(neq2, 1, 0) \
X(tree, 1, ARG_EXPR) \
X(ret, 0, 0)
......@@ -541,7 +542,6 @@ HRESULT pre_increment_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept
HRESULT pre_decrement_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN;
HRESULT equal_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN;
HRESULT not_equal_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN;
HRESULT not_equal2_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN;
HRESULT less_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN;
HRESULT lesseq_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN;
HRESULT greater_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN;
......
......@@ -1330,7 +1330,7 @@ static const expression_eval_t expression_eval_table[] = {
equal_expression_eval,
compiled_expression_eval,
not_equal_expression_eval,
not_equal2_expression_eval,
compiled_expression_eval,
less_expression_eval,
lesseq_expression_eval,
greater_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