[pypy-commit] pypy jitframe-on-heap: store (probably temporarily) rd_count on descr here. this allows us

fijal noreply at buildbot.pypy.org
Wed Jan 9 16:01:34 CET 2013


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: jitframe-on-heap
Changeset: r59886:927621febe6c
Date: 2013-01-08 23:02 +0200
http://bitbucket.org/pypy/pypy/changeset/927621febe6c/

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

diff --git a/pypy/jit/metainterp/compile.py b/pypy/jit/metainterp/compile.py
--- a/pypy/jit/metainterp/compile.py
+++ b/pypy/jit/metainterp/compile.py
@@ -484,9 +484,13 @@
     _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)
@@ -501,6 +505,7 @@
 
     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):
@@ -630,6 +635,7 @@
         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()
diff --git a/pypy/jit/metainterp/resume.py b/pypy/jit/metainterp/resume.py
--- a/pypy/jit/metainterp/resume.py
+++ b/pypy/jit/metainterp/resume.py
@@ -798,8 +798,7 @@
         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):


More information about the pypy-commit mailing list