From 6b1077e2cbf4462f7b3e721993db9411f77a22b6 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 16 Dec 2011 11:44:27 +0100 Subject: [PATCH] jscript: Invoke bytecode directly from expr_eval. --- dlls/jscript/engine.c | 28 ++++++++-------------------- dlls/jscript/engine.h | 2 -- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 424659f14f1..00035f9822e 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -54,10 +54,7 @@ static inline HRESULT stat_eval(script_ctx_t *ctx, statement_t *stat, return_typ return stat->eval(ctx, stat, rt, ret); } -static inline HRESULT expr_eval(script_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) -{ - return compiled_expression_eval(ctx, expr, flags, ei, ret); -} +static HRESULT expr_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*); static HRESULT stack_push(exec_ctx_t *ctx, VARIANT *v) { @@ -3122,7 +3119,7 @@ OP_LIST #undef X }; -static HRESULT interp_expression_eval(script_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +static HRESULT expr_eval(script_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { exec_ctx_t *exec_ctx = ctx->exec_ctx; unsigned prev_ip, prev_top; @@ -3131,6 +3128,12 @@ static HRESULT interp_expression_eval(script_ctx_t *ctx, expression_t *expr, DWO TRACE("\n"); + if(expr->instr_off == -1) { + hres = compile_subscript(ctx->exec_ctx->parser, expr, !(flags & EXPR_NOVAL), &expr->instr_off); + if(FAILED(hres)) + return hres; + } + prev_top = exec_ctx->top; prev_ip = exec_ctx->ip; exec_ctx->ip = expr->instr_off; @@ -3161,18 +3164,3 @@ static HRESULT interp_expression_eval(script_ctx_t *ctx, expression_t *expr, DWO ret->u.var = *stack_pop(exec_ctx); return S_OK; } - -HRESULT compiled_expression_eval(script_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) -{ - HRESULT hres; - - TRACE("\n"); - - if(expr->instr_off == -1) { - hres = compile_subscript(ctx->exec_ctx->parser, expr, !(flags & EXPR_NOVAL), &expr->instr_off); - if(FAILED(hres)) - return hres; - } - - return interp_expression_eval(ctx, expr, flags, ei, ret); -} diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 323e9e32fc3..5ff59337f70 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -567,6 +567,4 @@ typedef struct { prop_val_t *property_list; } property_value_expression_t; -HRESULT compiled_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; - HRESULT compile_subscript(parser_ctx_t*,expression_t*,BOOL,unsigned*) DECLSPEC_HIDDEN;