Commits

Remi Meier committed 9af6ff8

also define flush() to maybe be more robust

Comments (0)

Files changed (3)

rpython/jit/metainterp/optimizeopt/stm.py

     def flush_cached(self):
         while self.cached_ops:
             self.emit_operation(self.cached_ops.pop(0))
+
+    def flush(self):
+        # just in case. it shouldn't be necessary
+        self.flush_cached()
         
     def default_emit(self, op):
         self.flush_cached()

rpython/jit/metainterp/optimizeopt/test/test_multilabel.py

                   if op.getopnum()==rop.LABEL]
         prv = 0
         last_label = []
+        stm_info = {}
         for nxt in labels + [len(loop.operations)]:
             assert prv != nxt
             operations = last_label + loop.operations[prv:nxt]
                 operations.append(label)
             part.operations = operations
 
-            self._do_optimize_loop(part, None)
+            self._do_optimize_loop(part, None, stm_info)
             if part.operations[-1].getopnum() == rop.LABEL:
                 last_label = [part.operations.pop()]
             else:
 
 class BaseTestOptimizerRenamingBoxes(BaseTestMultiLabel):
 
-    def _do_optimize_loop(self, loop, call_pure_results):
+    def _do_optimize_loop(self, loop, call_pure_results, stminfo):
         from rpython.jit.metainterp.optimizeopt.unroll import optimize_unroll
         from rpython.jit.metainterp.optimizeopt.util import args_dict
         from rpython.jit.metainterp.optimizeopt.pure import OptPure

rpython/jit/metainterp/optimizeopt/test/test_optimizebasic.py

         if loop.operations[-1].getopnum() == rop.JUMP:
             loop.operations[-1].setdescr(token)
         expected = convert_old_style_to_targets(self.parse(optops), jump=True)
-        self._do_optimize_loop(loop, call_pure_results)
+        self._do_optimize_loop(loop, call_pure_results, {})
         print '\n'.join([str(o) for o in loop.operations])
         self.assert_equal(loop, expected)