Commits

Maciej Fijalkowski committed 927621f

store (probably temporarily) rd_count on descr here. this allows us
to not have to fish it from the CPU

  • Participants
  • Parent commits dce88c3
  • Branches jitframe-on-heap

Comments (0)

Files changed (2)

File pypy/jit/metainterp/compile.py

     _counters = None    # they get stored in _counters then.
 
     # this class also gets the following attributes stored by resume.py code
+    
+    # XXX move all of unused stuff to guard_op, now that we can have
+    #     a separate class, so it does not survive that long
     rd_snapshot = None
     rd_frame_info_list = None
     rd_numb = lltype.nullptr(NUMBERING)
+    rd_count = 0
     rd_consts = None
     rd_virtuals = None
     rd_pendingfields = lltype.nullptr(PENDINGFIELDSP.TO)
 
     def store_final_boxes(self, guard_op, boxes):
         guard_op.setfailargs(boxes)
+        self.rd_count = len(boxes)
         self.guard_opnum = guard_op.getopnum()
 
     def make_a_counter_per_value(self, guard_value_op):
         res.rd_consts = self.rd_consts
         res.rd_virtuals = self.rd_virtuals
         res.rd_pendingfields = self.rd_pendingfields
+        res.rd_count = self.rd_count
 
     def _clone_if_mutable(self):
         res = ResumeGuardDescr()

File pypy/jit/metainterp/resume.py

         self._init(metainterp.cpu, storage)
         self.deadframe = deadframe
         self.metainterp = metainterp
-        count = metainterp.cpu.get_latest_value_count(deadframe)
-        self.liveboxes = [None] * count
+        self.liveboxes = [None] * storage.rd_count
         self._prepare(storage)
 
     def consume_boxes(self, info, boxes_i, boxes_r, boxes_f):