Commits

Maciej Fijalkowski  committed 8f7d82d

some missing commit

  • Participants
  • Parent commits 44ef020
  • Branches resume-refactor

Comments (0)

Files changed (6)

 
 * do escape analysis in the resume/optimizer.py
 
-* make_a_counter_per_value got screwed, but a bit no clue what it does
+* reimplement make_a_counter_per_value

File rpython/jit/metainterp/compile.py

         self.guard_opnum = guard_op.getopnum()
 
     def make_a_counter_per_value(self, guard_value_op):
+        return # XXXX
         assert guard_value_op.getopnum() == rop.GUARD_VALUE
-        # XXX I have no clue what exactly it does, but we killed failargs
-        #     so i is always 0 now
         box = guard_value_op.getarg(0)
         i = 0
         # used to be i = guard_value_op.getfailargs().index(box)
         else: # we have a GUARD_VALUE that fails.  Make a _counters instance
             # (only now, when the guard is actually failing at least once),
             # and use it to record some statistics about the failing values.
+            assert 0 # XXX this should be dead code until we fix it
             index = self._counter & self.CNT_BASE_MASK
             typetag = self._counter & self.CNT_TYPE_MASK
             counters = self._counters

File rpython/jit/metainterp/optimizeopt/optimizer.py

                 raise ValueError, "invalid optimization"
             self.seen_results[op.result] = None
         self._newoperations.append(op)
-        if (self.delayed_resume_put is not None and
-            self.delayed_resume_put.getarg(0) is op.result):
-            self._newoperations.append(self.delayed_resume_put)
-            self.delayed_resume_put = None
 
     def replace_op(self, old_op, new_op):
         # XXX: Do we want to cache indexes to prevent search?

File rpython/jit/metainterp/optimizeopt/resume.py

 
 from rpython.jit.metainterp.optimizeopt import optimizer
 from rpython.jit.metainterp.optimizeopt.util import make_dispatcher_method
+from rpython.jit.metainterp.history import Const
 
 """ All of this directly emit the ops, without calling emit_operation
 (they also don't have boxes except a resume_put)
 
 class OptResume(optimizer.Optimization):
     def optimize_RESUME_PUT(self, op):
-        if op.getarg(0) in self.optimizer.producer:
+        arg = op.getarg(0)
+        if (isinstance(arg, Const) or arg in self.optimizer.producer or
+            arg in self.optimizer.loop.inputargs):
             self.optimizer.resumebuilder.resume_put(op)
         else:
+            xxx
             self.optimizer.delayed_resume_put = op
             # otherwise we did not emit the operation just yet
 

File rpython/jit/resume/optimizer.py

             no = op.getarg(2).getint()
             self.framestack[op.getarg(1).getint()].values[no] = value
         else:
+            XXX
             self.opt.emit_operation(op)
 
     def new_virtual_with_vtable(self, box, vtable, vvalue):

File rpython/jit/resume/test/support.py

+
+class MockStaticData(object):
+    def __init__(self, jitcodes, descrs):
+        self.alljitcodes = jitcodes
+        self.opcode_descrs = descrs