[pypy-commit] pypy default: backout e24b51be112d to try and resolve the problem

fijal noreply at buildbot.pypy.org
Wed May 6 08:30:05 CEST 2015


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: 
Changeset: r77152:4d6a621e81ee
Date: 2015-05-06 08:28 +0200
http://bitbucket.org/pypy/pypy/changeset/4d6a621e81ee/

Log:	backout e24b51be112d to try and resolve the problem

diff --git a/pypy/interpreter/generator.py b/pypy/interpreter/generator.py
--- a/pypy/interpreter/generator.py
+++ b/pypy/interpreter/generator.py
@@ -97,7 +97,7 @@
                 self.frame = None
                 raise
             # if the frame is now marked as finished, it was RETURNed from
-            if frame.frame_finished_execution():
+            if frame.frame_finished_execution:
                 self.frame = None
                 raise OperationError(space.w_StopIteration, space.w_None)
             else:
@@ -149,7 +149,7 @@
             raise OperationError(space.w_RuntimeError, space.wrap(msg))
 
     def descr_gi_frame(self, space):
-        if self.frame is not None and not self.frame.frame_finished_execution():
+        if self.frame is not None and not self.frame.frame_finished_execution:
             return self.frame
         else:
             return space.w_None
@@ -193,7 +193,7 @@
                             raise
                         break
                     # if the frame is now marked as finished, it was RETURNed from
-                    if frame.frame_finished_execution():
+                    if frame.frame_finished_execution:
                         break
                     results.append(w_result)     # YIELDed
             finally:
diff --git a/pypy/interpreter/pyframe.py b/pypy/interpreter/pyframe.py
--- a/pypy/interpreter/pyframe.py
+++ b/pypy/interpreter/pyframe.py
@@ -56,6 +56,7 @@
 
     __metaclass__ = extendabletype
 
+    frame_finished_execution = False
     last_instr               = -1
     last_exception           = None
     f_backref                = jit.vref_None
@@ -126,9 +127,6 @@
             return None
         return d.w_locals
 
-    def frame_finished_execution(self):
-        return self.last_instr == -2
-
     def __repr__(self):
         # NOT_RPYTHON: useful in tracebacks
         return "<%s.%s executing %s at line %s" % (
@@ -447,6 +445,7 @@
             w_tb,        #
             self.w_globals,
             w(self.last_instr),
+            w(self.frame_finished_execution),
             w(f_lineno),
             w_fastlocals,
             space.w_None,           #XXX placeholder for f_locals
@@ -466,9 +465,9 @@
         from pypy.module._pickle_support import maker # helper fns
         from pypy.interpreter.pycode import PyCode
         from pypy.interpreter.module import Module
-        args_w = space.unpackiterable(w_args, 17)
+        args_w = space.unpackiterable(w_args, 18)
         w_f_back, w_builtin, w_pycode, w_valuestack, w_blockstack, w_exc_value, w_tb,\
-            w_globals, w_last_instr, w_f_lineno, w_fastlocals, w_f_locals, \
+            w_globals, w_last_instr, w_finished, w_f_lineno, w_fastlocals, w_f_locals, \
             w_f_trace, w_instr_lb, w_instr_ub, w_instr_prev_plus_one, w_cells = args_w
 
         new_frame = self
@@ -513,6 +512,7 @@
                                                       w_exc_value, tb
                                                       )
         new_frame.last_instr = space.int_w(w_last_instr)
+        new_frame.frame_finished_execution = space.is_true(w_finished)
         d = new_frame.getorcreatedebug()
         d.f_lineno = space.int_w(w_f_lineno)
         fastlocals_w = maker.slp_from_tuple_with_nulls(space, w_fastlocals)
diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py
--- a/pypy/interpreter/pyopcode.py
+++ b/pypy/interpreter/pyopcode.py
@@ -449,7 +449,7 @@
             if (block.handling_mask & unroller_kind) != 0:
                 return block
             block.cleanupstack(self)
-        self.last_instr = -2  # makes frame_finished_execution return True
+        self.frame_finished_execution = True  # for generators
         return None
 
     def unrollstack_and_jump(self, unroller):


More information about the pypy-commit mailing list