Jacek Caban : jscript: Don't use OP_var_set.

Alexandre Julliard julliard at winehq.org
Thu Aug 4 17:20:18 CDT 2016


Module: wine
Branch: master
Commit: 7694afff4bb33b25fd5899d07ffce4f31d12474f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7694afff4bb33b25fd5899d07ffce4f31d12474f

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Aug  4 13:39:53 2016 +0200

jscript: Don't use OP_var_set.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/jscript/compile.c |  9 ++++++++-
 dlls/jscript/engine.c  | 15 ---------------
 dlls/jscript/engine.h  |  1 -
 3 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c
index e911373..0087459 100644
--- a/dlls/jscript/compile.c
+++ b/dlls/jscript/compile.c
@@ -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;
     }
diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c
index bc8eb5b..2305998 100644
--- a/dlls/jscript/engine.c
+++ b/dlls/jscript/engine.c
@@ -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)
 {
diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h
index 0434ff1..2aaf831 100644
--- a/dlls/jscript/engine.h
+++ b/dlls/jscript/engine.h
@@ -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)
 




More information about the wine-cvs mailing list