[pypy-commit] pypy optinfo-into-bridges-2: fix bugs in revision e1832b3ddde9

cfbolz pypy.commits at gmail.com
Thu Feb 16 12:27:45 EST 2017


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: optinfo-into-bridges-2
Changeset: r90167:a8f437494e4d
Date: 2017-02-16 17:01 +0000
http://bitbucket.org/pypy/pypy/changeset/a8f437494e4d/

Log:	fix bugs in revision e1832b3ddde9

	(branch to debug problems with optinfo-into-bridges)

diff --git a/rpython/jit/metainterp/resume.py b/rpython/jit/metainterp/resume.py
--- a/rpython/jit/metainterp/resume.py
+++ b/rpython/jit/metainterp/resume.py
@@ -1266,9 +1266,6 @@
         assert box.type == kind
         return box
 
-    def next_box_of_type(self, kind):
-        return self.decode_box(self.resumecodereader.next_item(), kind)
-
     def load_box_from_cpu(self, num, kind):
         if num < 0:
             num += len(self.liveboxes)
@@ -1297,7 +1294,7 @@
             kind = FLOAT
         else:
             raise AssertionError(kind)
-        return self.decode_box(tagged, kind)
+        return self.decode_box(self.resumecodereader.next_item(), kind)
     next_box_of_type._annspecialcase_ = 'specialize:arg(1)'
 
     def write_an_int(self, index, box):
@@ -1408,7 +1405,6 @@
         # just reset the token, we'll force it later
         vinfo.reset_token_gcref(virtualizable)
         vinfo.write_from_resume_data_partial(virtualizable, self)
-        return index
 
     def load_next_value_of_type(self, TYPE):
         from rpython.jit.metainterp.warmstate import specialize_value
diff --git a/rpython/jit/metainterp/resumecode.py b/rpython/jit/metainterp/resumecode.py
--- a/rpython/jit/metainterp/resumecode.py
+++ b/rpython/jit/metainterp/resumecode.py
@@ -80,7 +80,7 @@
     return l
 
 class Writer(object):
-    def __init__(self, size):
+    def __init__(self, size=0):
         self.current = objectmodel.newlist_hint(3 * size)
         self.grow(size)
         self.items = 0
@@ -111,6 +111,13 @@
         self.current = l + self.current[1:]
 
 
+def create_numbering(l):
+    w = Writer()
+    for item in l:
+        w.append_int(item)
+    return w.create_numbering()
+
+
 class Reader(object):
     def __init__(self, code):
         self.code = code


More information about the pypy-commit mailing list