1. Pypy
  2. Untitled project
  3. pypy

Commits

Armin Rigo  committed 7dad9c7

Pass the first test.

  • Participants
  • Parent commits 3180d37
  • Branches remove-globals-in-jit

Comments (0)

Files changed (2)

File pypy/jit/backend/llsupport/llmodel.py

View file
 from pypy.jit.metainterp import history
 from pypy.jit.codewriter import heaptracker, longlong
 from pypy.jit.backend.model import AbstractCPU
-from pypy.jit.backend.llsupport import symbolic
+from pypy.jit.backend.llsupport import symbolic, jitframe
 from pypy.jit.backend.llsupport.symbolic import WORD, unroll_basic_sizes
 from pypy.jit.backend.llsupport.descr import (
     get_size_descr, get_field_descr, get_array_descr,
                                           self._zer_error_inst)
         return zer_vtable, zer_inst
 
+    def get_latest_descr(self, deadframe):
+        deadframe = lltype.cast_opaque_ptr(jitframe.DEADFRAMEPTR, deadframe)
+        descr = deadframe.jf_descr
+        return history.AbstractDescr.show(self, descr)
+
+    def get_latest_value_int(self, deadframe, index):
+        deadframe = lltype.cast_opaque_ptr(jitframe.DEADFRAMEPTR, deadframe)
+        return deadframe.jf_values[index].int
+
+    def get_latest_value_ref(self, deadframe, index):
+        deadframe = lltype.cast_opaque_ptr(jitframe.DEADFRAMEPTR, deadframe)
+        return deadframe.jf_values[index].ref
+
+    def get_latest_value_float(self, deadframe, index):
+        deadframe = lltype.cast_opaque_ptr(jitframe.DEADFRAMEPTR, deadframe)
+        return deadframe.jf_values[index].float
+
+    def get_latest_value_count(self, deadframe):
+        deadframe = lltype.cast_opaque_ptr(jitframe.DEADFRAMEPTR, deadframe)
+        return len(deadframe.jf_values)
+
     # ____________________________________________________________
 
     def bh_arraylen_gc(self, array, arraydescr):

File pypy/jit/backend/x86/runner.py

View file
         return self.assembler.assemble_bridge(faildescr, inputargs, operations,
                                               original_loop_token, log=log)
 
-    def get_latest_value_int(self, index):
-        return self.assembler.fail_boxes_int.getitem(index)
-
-    def get_latest_value_float(self, index):
-        return self.assembler.fail_boxes_float.getitem(index)
-
-    def get_latest_value_ref(self, index):
-        return self.assembler.fail_boxes_ptr.getitem(index)
-
-    def get_latest_value_count(self):
-        return self.assembler.fail_boxes_count
-
     def clear_latest_values(self, count):
         setitem = self.assembler.fail_boxes_ptr.setitem
         null = lltype.nullptr(llmemory.GCREF.TO)