Jacek Caban : jscript: Store entry scope chain in call_frame_t.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Mar 25 10:00:39 CDT 2016


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Mar 25 12:04:19 2016 +0100

jscript: Store entry scope chain in call_frame_t.

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

---

 dlls/jscript/engine.c | 8 +++-----
 dlls/jscript/engine.h | 1 +
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c
index 3492bb0..9bf1bfb 100644
--- a/dlls/jscript/engine.c
+++ b/dlls/jscript/engine.c
@@ -2466,7 +2466,6 @@ static HRESULT unwind_exception(exec_ctx_t *ctx)
 static HRESULT enter_bytecode(script_ctx_t *ctx, function_code_t *func, jsval_t *ret)
 {
     exec_ctx_t *exec_ctx = ctx->call_ctx->exec_ctx;
-    scope_chain_t *prev_scope;
     call_frame_t *frame;
     jsop_t op;
     HRESULT hres = S_OK;
@@ -2474,7 +2473,6 @@ static HRESULT enter_bytecode(script_ctx_t *ctx, function_code_t *func, jsval_t
     TRACE("\n");
 
     frame = ctx->call_ctx;
-    prev_scope = frame->scope;
 
     while(frame->ip != -1) {
         op = frame->bytecode->instrs[frame->ip].op;
@@ -2496,13 +2494,13 @@ static HRESULT enter_bytecode(script_ctx_t *ctx, function_code_t *func, jsval_t
     assert(ctx->call_ctx == frame);
 
     if(FAILED(hres)) {
-        while(frame->scope != prev_scope)
+        while(frame->scope != frame->base_scope)
             scope_pop(&frame->scope);
         stack_popn(exec_ctx, exec_ctx->top-frame->stack_base);
     }
 
     assert(exec_ctx->top == frame->stack_base);
-    assert(frame->scope == prev_scope);
+    assert(frame->scope == frame->base_scope);
     ctx->call_ctx = frame->prev_frame;
     release_call_frame(frame);
 
@@ -2565,7 +2563,7 @@ static HRESULT setup_call_frame(exec_ctx_t *ctx, bytecode_t *bytecode, function_
     frame->stack_base = ctx->top;
 
     if(scope)
-        frame->scope = scope_addref(scope);
+        frame->base_scope = frame->scope = scope_addref(scope);
 
     frame->exec_ctx = ctx;
 
diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h
index c46ca7c..82ff4ed 100644
--- a/dlls/jscript/engine.h
+++ b/dlls/jscript/engine.h
@@ -196,6 +196,7 @@ typedef struct _call_frame_t {
     except_frame_t *except_frame;
     unsigned stack_base;
     scope_chain_t *scope;
+    scope_chain_t *base_scope;
 
     bytecode_t *bytecode;
     function_code_t *function;




More information about the wine-cvs mailing list