[pypy-svn] r71161 - pypy/trunk/pypy/interpreter

cfbolz at codespeak.net cfbolz at codespeak.net
Mon Feb 8 10:43:17 CET 2010


Author: cfbolz
Date: Mon Feb  8 10:43:16 2010
New Revision: 71161

Modified:
   pypy/trunk/pypy/interpreter/generator.py
Log:
as long as we need to promote the last_instr anyway, let's at least get rid of a
few guards.


Modified: pypy/trunk/pypy/interpreter/generator.py
==============================================================================
--- pypy/trunk/pypy/interpreter/generator.py	(original)
+++ pypy/trunk/pypy/interpreter/generator.py	Mon Feb  8 10:43:16 2010
@@ -44,7 +44,10 @@
                                  space.wrap('generator already executing'))
         if self.frame.frame_finished_execution:
             raise OperationError(space.w_StopIteration, space.w_None)
-        if self.frame.last_instr == -1:
+        # XXX it's not clear that last_instr should be promoted at all
+        # but as long as it is necessary for call_assembler, let's do it early
+        last_instr = hint(self.frame.last_instr, promote=True)
+        if last_instr == -1:
             if w_arg and not space.is_w(w_arg, space.w_None):
                 msg = "can't send non-None value to a just-started generator"
                 raise OperationError(space.w_TypeError, space.wrap(msg))



More information about the Pypy-commit mailing list