Author: Maciej Fijalkowski <[email protected]>
Branch: kill-gen-store-back-in
Changeset: r65344:42a502841f60
Date: 2013-07-11 16:30 +0200
http://bitbucket.org/pypy/pypy/changeset/42a502841f60/

Log:    eh, we have to call this hint at the right level, otherwise the JIT
        does not see it at all

diff --git a/pypy/interpreter/generator.py b/pypy/interpreter/generator.py
--- a/pypy/interpreter/generator.py
+++ b/pypy/interpreter/generator.py
@@ -95,7 +95,6 @@
                 self.frame = None
                 raise OperationError(space.w_StopIteration, space.w_None)
             else:
-                jit.hint(frame, force_virtualizable=True)
                 return w_result     # YIELDed
         finally:
             frame.f_backref = jit.vref_None
diff --git a/pypy/module/pypyjit/interp_jit.py 
b/pypy/module/pypyjit/interp_jit.py
--- a/pypy/module/pypyjit/interp_jit.py
+++ b/pypy/module/pypyjit/interp_jit.py
@@ -12,7 +12,7 @@
 from pypy.interpreter.error import OperationError, operationerrfmt
 from pypy.interpreter.pycode import PyCode, CO_GENERATOR
 from pypy.interpreter.pyframe import PyFrame
-from pypy.interpreter.pyopcode import ExitFrame
+from pypy.interpreter.pyopcode import ExitFrame, Yield
 from opcode import opmap
 
 PyFrame._virtualizable_ = ['last_instr', 'pycode',
@@ -73,6 +73,11 @@
                 self.valuestackdepth = hint(self.valuestackdepth, promote=True)
                 next_instr = self.handle_bytecode(co_code, next_instr, ec)
                 is_being_profiled = self.is_being_profiled
+        except Yield:
+            self.last_exception = None
+            w_result = self.popvalue()
+            jit.hint(self, force_virtualizable=True)
+            return w_result
         except ExitFrame:
             self.last_exception = None
             return self.popvalue()
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to