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

This commit is contained in:
Jacek Caban 2011-12-01 13:23:03 +01:00 committed by Alexandre Julliard
parent e5a31cc2d0
commit fb51810a95
4 changed files with 15 additions and 15 deletions

View File

@ -410,6 +410,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr)
return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_in); return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_in);
case EXPR_LESS: case EXPR_LESS:
return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_lt); return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_lt);
case EXPR_LESSEQ:
return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_lteq);
case EXPR_LITERAL: case EXPR_LITERAL:
return compile_literal(ctx, ((literal_expression_t*)expr)->literal); return compile_literal(ctx, ((literal_expression_t*)expr)->literal);
case EXPR_LOGNEG: case EXPR_LOGNEG:

View File

@ -3036,27 +3036,25 @@ static HRESULT interp_lt(exec_ctx_t *ctx)
return stack_push_bool(ctx, b); return stack_push_bool(ctx, b);
} }
/* ECMA-262 3rd Edition 11.8.3 */ /* ECMA-262 3rd Edition 11.8.1 */
HRESULT lesseq_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) static HRESULT interp_lteq(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));
hres = less_eval(ctx->parser->script, r, l, TRUE, &ctx->ei, &b);
VariantClear(l);
VariantClear(r);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
hres = less_eval(ctx, &rval, &lval, TRUE, ei, &b); return stack_push_bool(ctx, b);
VariantClear(&lval);
VariantClear(&rval);
if(FAILED(hres))
return hres;
return return_bool(ret, b);
} }
/* ECMA-262 3rd Edition 11.8.2 */ /* ECMA-262 3rd Edition 11.8.2 */

View File

@ -57,6 +57,7 @@ typedef struct _func_stack {
X(jmp_nz, 0, ARG_ADDR, 0) \ X(jmp_nz, 0, ARG_ADDR, 0) \
X(jmp_z, 0, ARG_ADDR, 0) \ X(jmp_z, 0, ARG_ADDR, 0) \
X(lt, 1, 0,0) \ X(lt, 1, 0,0) \
X(lteq, 1, 0,0) \
X(minus, 1, 0,0) \ X(minus, 1, 0,0) \
X(mod, 1, 0,0) \ X(mod, 1, 0,0) \
X(mul, 1, 0,0) \ X(mul, 1, 0,0) \
@ -561,7 +562,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 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; 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;

View File

@ -1332,7 +1332,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,
lesseq_expression_eval, compiled_expression_eval,
greater_expression_eval, greater_expression_eval,
greatereq_expression_eval, greatereq_expression_eval,
compiled_expression_eval, compiled_expression_eval,