Commit 7694afff authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Don't use OP_var_set.

parent 713051d0
...@@ -1095,11 +1095,18 @@ static HRESULT compile_variable_list(compiler_ctx_t *ctx, variable_declaration_t ...@@ -1095,11 +1095,18 @@ static HRESULT compile_variable_list(compiler_ctx_t *ctx, variable_declaration_t
if(!iter->expr) if(!iter->expr)
continue; continue;
hres = push_instr_bstr_uint(ctx, OP_identid, iter->identifier, 0);
if(FAILED(hres))
return hres;
hres = compile_expression(ctx, iter->expr, TRUE); hres = compile_expression(ctx, iter->expr, TRUE);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
hres = push_instr_bstr(ctx, OP_var_set, iter->identifier); if(!push_instr(ctx, OP_assign))
return E_OUTOFMEMORY;
hres = push_instr_uint(ctx, OP_pop, 1);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
} }
......
...@@ -728,21 +728,6 @@ static inline void jmp_abs(script_ctx_t *ctx, unsigned dst) ...@@ -728,21 +728,6 @@ static inline void jmp_abs(script_ctx_t *ctx, unsigned dst)
ctx->call_ctx->ip = dst; ctx->call_ctx->ip = dst;
} }
/* ECMA-262 3rd Edition 12.2 */
static HRESULT interp_var_set(script_ctx_t *ctx)
{
const BSTR name = get_op_bstr(ctx, 0);
jsval_t val;
HRESULT hres;
TRACE("%s\n", debugstr_w(name));
val = stack_pop(ctx);
hres = jsdisp_propput_name(ctx->call_ctx->variable_obj, name, val);
jsval_release(val);
return hres;
}
/* ECMA-262 3rd Edition 12.6.4 */ /* ECMA-262 3rd Edition 12.6.4 */
static HRESULT interp_forin(script_ctx_t *ctx) static HRESULT interp_forin(script_ctx_t *ctx)
{ {
......
...@@ -89,7 +89,6 @@ ...@@ -89,7 +89,6 @@
X(setret, 1, 0,0) \ X(setret, 1, 0,0) \
X(sub, 1, 0,0) \ X(sub, 1, 0,0) \
X(undefined, 1, 0,0) \ X(undefined, 1, 0,0) \
X(var_set, 1, ARG_BSTR, 0) \
X(void, 1, 0,0) \ X(void, 1, 0,0) \
X(xor, 1, 0,0) X(xor, 1, 0,0)
......
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