Author: Stephan <[email protected]>
Branch: 
Changeset: r117:76071d1a4a31
Date: 2011-09-04 14:40 +0200
http://bitbucket.org/pypy/lang-js/changeset/76071d1a4a31/

Log:    execute with statement via call to run_block

diff --git a/js/jscode.py b/js/jscode.py
--- a/js/jscode.py
+++ b/js/jscode.py
@@ -174,8 +174,7 @@
         assert pc >= 0
         return self.opcodes[pc]
 
-    def run_bytecode(self, ctx, check_stack=True):
-        pc = 0
+    def run_block(self, ctx, pc=0):
         while True:
             jitdriver.jit_merge_point(pc=pc, self=self, ctx=ctx)
             if pc >= len(self.opcodes):
@@ -207,10 +206,15 @@
                 pc += 1
 
             if isinstance(opcode, WITH_START):
-                ctx = opcode.newctx
+                pc = self.run_block(opcode.newctx, pc)
             elif isinstance(opcode, WITH_END):
-                ctx = ctx.parent
+                break
 
+        return pc
+
+    def run_bytecode(self, ctx, check_stack=True):
+        self.run_block(ctx)
         if check_stack:
             ctx.check_stack()
+
         return ctx.top()
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to