jscript: Don't use OP_var_set.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2016-08-04 13:39:53 +02:00 committed by Alexandre Julliard
parent 713051d027
commit 7694afff4b
3 changed files with 8 additions and 17 deletions

View File

@ -1095,11 +1095,18 @@ static HRESULT compile_variable_list(compiler_ctx_t *ctx, variable_declaration_t
if(!iter->expr)
continue;
hres = push_instr_bstr_uint(ctx, OP_identid, iter->identifier, 0);
if(FAILED(hres))
return hres;
hres = compile_expression(ctx, iter->expr, TRUE);
if(FAILED(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))
return hres;
}

View File

@ -728,21 +728,6 @@ static inline void jmp_abs(script_ctx_t *ctx, unsigned 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 */
static HRESULT interp_forin(script_ctx_t *ctx)
{

View File

@ -89,7 +89,6 @@
X(setret, 1, 0,0) \
X(sub, 1, 0,0) \
X(undefined, 1, 0,0) \
X(var_set, 1, ARG_BSTR, 0) \
X(void, 1, 0,0) \
X(xor, 1, 0,0)