Commits

Remi Meier committed e998712

fix: put the stm_break_wanted flag on metainterp instead of MIFrame

  • Participants
  • Parent commits 8f981d8
  • Branches stmgc-c4

Comments (0)

Files changed (2)

File pypy/interpreter/pyopcode.py

         try:
             while True:
                 if self.space.config.translation.stm:
+                    # only used for no-jit. The jit-jitdriver is
+                    # in interp_jit.py
                     stmonly_jitdriver.jit_merge_point(
                         self=self, co_code=co_code,
                         next_instr=next_instr, ec=ec)

File rpython/jit/metainterp/pyjitpl.py

 class MIFrame(object):
     debug = False
     # Write resops corresponding to jitcodes
+    # MIFrame corresponds only to one RPython-level frame
 
     def __init__(self, metainterp):
         self.metainterp = metainterp
         self.parent_resumedata_frame_info_list = None
         # counter for unrolling inlined loops
         self.unroll_iterations = 1
-        # for stm: placement of stm_break_point
-        self.stm_break_wanted = False
-        self.stm_break_done = False
 
     @specialize.arg(3)
     def copy_constants(self, registers, constants, ConstClass):
     @arguments("int")
     def opimpl_stm_transaction_break(self, if_there_is_no_other):
         val = bool(if_there_is_no_other)
-        if (self.stm_break_wanted or (val and not self.stm_break_done)):
-            self.stm_break_done = True
-            self.stm_break_wanted = False
-            if not val:
-                print "did an stm_transaction_break(False)"
-            else:
-                print "did an stm_transaction_break(True)"
+        mi = self.metainterp
+        if (mi.stm_break_wanted or (val and not mi.stm_break_done)):
+            mi.stm_break_done = True
+            mi.stm_break_wanted = False
             self.execute(rop.STM_TRANSACTION_BREAK, ConstInt(val))
-        elif not val:
-            print "ignored stm_transaction_break(False)"
-        elif val:
-            print "ignored stm_transaction_break(True)"
     
     for _opimpl in ['int_add', 'int_sub', 'int_mul', 'int_floordiv', 'int_mod',
                     'int_lt', 'int_le', 'int_eq',
             # XXX refactor: direct_libffi_call() is a hack
             if effectinfo.oopspecindex == effectinfo.OS_LIBFFI_CALL:
                 self.metainterp.direct_libffi_call()
-            self.stm_break_wanted = True
+            self.metainterp.stm_break_wanted = True
             return resbox
         else:
             effect = effectinfo.extraeffect
         self.call_ids = []
         self.current_call_id = 0
 
+        # for stm: placement of stm_break_point, used by MIFrame
+        self.stm_break_wanted = False
+        self.stm_break_done = False
+
+        
+
     def retrace_needed(self, trace):
         self.partial_trace = trace
         self.retracing_from = len(self.history.operations) - 1