Author: Stephan <[email protected]>
Branch: 
Changeset: r155:016e321cdb9c
Date: 2011-11-09 14:00 +0100
http://bitbucket.org/pypy/lang-js/changeset/016e321cdb9c/

Log:    added option to disable stack saving

diff --git a/js/jscode.py b/js/jscode.py
--- a/js/jscode.py
+++ b/js/jscode.py
@@ -180,8 +180,10 @@
     def estimated_stack_size(self):
         return self.code.estimated_stack_size()
 
-    def run(self, ctx, check_stack=True):
-        state = _save_stack(ctx, self.estimated_stack_size())
+    def run(self, ctx, check_stack=True, save_stack=True):
+        state = ([], 0)
+        if save_stack:
+            state = _save_stack(ctx, self.estimated_stack_size())
 
         try:
             r = self.run_bytecode(ctx, check_stack)
@@ -189,7 +191,8 @@
         except ReturnException, e:
             return e.value
         finally:
-            _restore_stack(ctx, state)
+            if save_stack:
+                _restore_stack(ctx, state)
 
     def _get_opcode(self, pc):
         assert pc >= 0
diff --git a/js/jsobj.py b/js/jsobj.py
--- a/js/jsobj.py
+++ b/js/jsobj.py
@@ -344,7 +344,7 @@
             newctx.declare_variable(paramname)
             newctx.assign(paramname, value)
 
-        val = self.callfunc.run(ctx=newctx)
+        val = self.callfunc.run(ctx=newctx, save_stack = False)
         return val
 
     def type(self):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to