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

This commit is contained in:
Jacek Caban 2011-12-01 13:23:36 +01:00 committed by Alexandre Julliard
parent f3e18fbf03
commit 9f9f5ae0a7
4 changed files with 14 additions and 14 deletions

View File

@ -406,6 +406,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr)
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_GREATEREQ:
return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_gteq);
case EXPR_IDENT:
return push_instr_bstr(ctx, OP_ident, ((identifier_expression_t*)expr)->identifier);
case EXPR_IN:

View File

@ -3079,26 +3079,24 @@ static HRESULT interp_gt(exec_ctx_t *ctx)
}
/* ECMA-262 3rd Edition 11.8.4 */
HRESULT greatereq_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret)
static HRESULT interp_gteq(exec_ctx_t *ctx)
{
binary_expression_t *expr = (binary_expression_t*)_expr;
VARIANT rval, lval;
VARIANT *l, *r;
BOOL b;
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));
hres = less_eval(ctx->parser->script, l, r, TRUE, &ctx->ei, &b);
VariantClear(l);
VariantClear(r);
if(FAILED(hres))
return hres;
hres = less_eval(ctx, &lval, &rval, TRUE, ei, &b);
VariantClear(&lval);
VariantClear(&rval);
if(FAILED(hres))
return hres;
return return_bool(ret, b);
return stack_push_bool(ctx, b);
}
/* ECMA-262 3rd Edition 11.4.8 */

View File

@ -51,6 +51,7 @@ typedef struct _func_stack {
X(eq, 1, 0,0) \
X(eq2, 1, 0,0) \
X(gt, 1, 0,0) \
X(gteq, 1, 0,0) \
X(ident, 1, ARG_BSTR, 0) \
X(in, 1, 0,0) \
X(int, 1, ARG_INT, 0) \
@ -563,7 +564,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 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 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 right_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;

View File

@ -1334,7 +1334,7 @@ static const expression_eval_t expression_eval_table[] = {
compiled_expression_eval,
compiled_expression_eval,
compiled_expression_eval,
greatereq_expression_eval,
compiled_expression_eval,
compiled_expression_eval,
compiled_expression_eval,
left_shift_expression_eval,