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

jscript: Use bytecode for '>' expression implementation.

parent fb51810a
...@@ -404,6 +404,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr) ...@@ -404,6 +404,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr)
return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_eq); return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_eq);
case EXPR_EQEQ: case EXPR_EQEQ:
return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_eq2); return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_eq2);
case EXPR_GREATER:
return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_gt);
case EXPR_IDENT: case EXPR_IDENT:
return push_instr_bstr(ctx, OP_ident, ((identifier_expression_t*)expr)->identifier); return push_instr_bstr(ctx, OP_ident, ((identifier_expression_t*)expr)->identifier);
case EXPR_IN: case EXPR_IN:
......
...@@ -3058,26 +3058,24 @@ static HRESULT interp_lteq(exec_ctx_t *ctx) ...@@ -3058,26 +3058,24 @@ static HRESULT interp_lteq(exec_ctx_t *ctx)
} }
/* ECMA-262 3rd Edition 11.8.2 */ /* ECMA-262 3rd Edition 11.8.2 */
HRESULT greater_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) static HRESULT interp_gt(exec_ctx_t *ctx)
{ {
binary_expression_t *expr = (binary_expression_t*)_expr; VARIANT *l, *r;
VARIANT rval, lval;
BOOL b; BOOL b;
HRESULT hres; HRESULT hres;
TRACE("\n"); r = stack_pop(ctx);
l = stack_pop(ctx);
hres = get_binary_expr_values(ctx, expr, ei, &lval, &rval); TRACE("%s > %s\n", debugstr_variant(l), debugstr_variant(r));
if(FAILED(hres))
return hres;
hres = less_eval(ctx, &rval, &lval, FALSE, ei, &b); hres = less_eval(ctx->parser->script, r, l, FALSE, &ctx->ei, &b);
VariantClear(&lval); VariantClear(l);
VariantClear(&rval); VariantClear(r);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
return return_bool(ret, b); return stack_push_bool(ctx, b);
} }
/* ECMA-262 3rd Edition 11.8.4 */ /* ECMA-262 3rd Edition 11.8.4 */
......
...@@ -50,6 +50,7 @@ typedef struct _func_stack { ...@@ -50,6 +50,7 @@ typedef struct _func_stack {
X(double, 1, ARG_SBL, 0) \ X(double, 1, ARG_SBL, 0) \
X(eq, 1, 0,0) \ X(eq, 1, 0,0) \
X(eq2, 1, 0,0) \ X(eq2, 1, 0,0) \
X(gt, 1, 0,0) \
X(ident, 1, ARG_BSTR, 0) \ X(ident, 1, ARG_BSTR, 0) \
X(in, 1, 0,0) \ X(in, 1, 0,0) \
X(int, 1, ARG_INT, 0) \ X(int, 1, ARG_INT, 0) \
...@@ -562,7 +563,6 @@ HRESULT post_increment_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcep ...@@ -562,7 +563,6 @@ HRESULT post_increment_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcep
HRESULT post_decrement_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT post_decrement_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN;
HRESULT pre_increment_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT pre_increment_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN;
HRESULT pre_decrement_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT pre_decrement_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;
HRESULT greatereq_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT greatereq_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 left_shift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN;
HRESULT right_shift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT right_shift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN;
......
...@@ -1333,7 +1333,7 @@ static const expression_eval_t expression_eval_table[] = { ...@@ -1333,7 +1333,7 @@ static const expression_eval_t expression_eval_table[] = {
compiled_expression_eval, compiled_expression_eval,
compiled_expression_eval, compiled_expression_eval,
compiled_expression_eval, compiled_expression_eval,
greater_expression_eval, compiled_expression_eval,
greatereq_expression_eval, greatereq_expression_eval,
compiled_expression_eval, compiled_expression_eval,
compiled_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