Commits

Armin Rigo committed 7cc2d16

progress

Comments (0)

Files changed (3)

pypy/jit/backend/llgraph/runner.py

 
     def get_latest_value_int(self, deadframe, index):
         v = deadframe._values[index]
-        assert isinstance(v, int)
+        assert lltype.typeOf(v) == lltype.Signed
         return v
 
     def get_latest_value_ref(self, deadframe, index):

pypy/jit/metainterp/compile.py

             self._counter = cnt | i
 
     def handle_fail(self, deadframe, metainterp_sd, jitdriver_sd):
-        if self.must_compile(metainterp_sd, jitdriver_sd):
+        if self.must_compile(deadframe, metainterp_sd, jitdriver_sd):
             self.start_compiling()
             try:
                 self._trace_and_compile_from_bridge(deadframe, metainterp_sd,
         metainterp.handle_guard_failure(self, deadframe)
     _trace_and_compile_from_bridge._dont_inline_ = True
 
-    def must_compile(self, metainterp_sd, jitdriver_sd):
+    def must_compile(self, deadframe, metainterp_sd, jitdriver_sd):
         trace_eagerness = jitdriver_sd.warmstate.trace_eagerness
         #
         if self._counter <= self.CNT_BASE_MASK:
             typetag = self._counter & self.CNT_TYPE_MASK
             counters = self._counters
             if typetag == self.CNT_INT:
-                intvalue = metainterp_sd.cpu.get_latest_value_int(index)
+                intvalue = metainterp_sd.cpu.get_latest_value_int(
+                    deadframe, index)
                 if counters is None:
                     self._counters = counters = ResumeGuardCountersInt()
                 else:
                     assert isinstance(counters, ResumeGuardCountersInt)
                 counter = counters.see_int(intvalue)
             elif typetag == self.CNT_REF:
-                refvalue = metainterp_sd.cpu.get_latest_value_ref(index)
+                refvalue = metainterp_sd.cpu.get_latest_value_ref(
+                    deadframe, index)
                 if counters is None:
                     self._counters = counters = ResumeGuardCountersRef()
                 else:
                     assert isinstance(counters, ResumeGuardCountersRef)
                 counter = counters.see_ref(refvalue)
             elif typetag == self.CNT_FLOAT:
-                floatvalue = metainterp_sd.cpu.get_latest_value_float(index)
+                floatvalue = metainterp_sd.cpu.get_latest_value_float(
+                    deadframe, index)
                 if counters is None:
                     self._counters = counters = ResumeGuardCountersFloat()
                 else:

pypy/jit/metainterp/resume.py

         else:
             assert tag == TAGBOX
             if num < 0:
-                num += self.cpu.get_latest_value_count()
+                num += self.cpu.get_latest_value_count(self.deadframe)
             return self.cpu.get_latest_value_int(self.deadframe, num)
 
     def decode_ref(self, tagged):
         else:
             assert tag == TAGBOX
             if num < 0:
-                num += self.cpu.get_latest_value_count()
+                num += self.cpu.get_latest_value_count(self.deadframe)
             return self.cpu.get_latest_value_ref(self.deadframe, num)
 
     def decode_float(self, tagged):
         else:
             assert tag == TAGBOX
             if num < 0:
-                num += self.cpu.get_latest_value_count()
+                num += self.cpu.get_latest_value_count(self.deadframe)
             return self.cpu.get_latest_value_float(self.deadframe, num)
 
     def write_an_int(self, index, int):