[pypy-commit] pypy virtual-dicts: translation fixes for some tests, fix x86 tests

alex_gaynor noreply at buildbot.pypy.org
Tue Oct 25 16:17:12 CEST 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: virtual-dicts
Changeset: r48435:ef72b02f3457
Date: 2011-10-25 10:16 -0400
http://bitbucket.org/pypy/pypy/changeset/ef72b02f3457/

Log:	translation fixes for some tests, fix x86 tests

diff --git a/pypy/jit/backend/llsupport/descr.py b/pypy/jit/backend/llsupport/descr.py
--- a/pypy/jit/backend/llsupport/descr.py
+++ b/pypy/jit/backend/llsupport/descr.py
@@ -281,6 +281,9 @@
     def is_float_field(self):
         return self.fielddescr.is_float_field()
 
+    def sort_key(self):
+        return self.fielddescr.sort_key()
+
     def repr_of_descr(self):
         return '<InteriorFieldDescr %s>' % self.fielddescr.repr_of_descr()
 
diff --git a/pypy/jit/metainterp/optimizeopt/optimizer.py b/pypy/jit/metainterp/optimizeopt/optimizer.py
--- a/pypy/jit/metainterp/optimizeopt/optimizer.py
+++ b/pypy/jit/metainterp/optimizeopt/optimizer.py
@@ -209,13 +209,19 @@
     def setfield(self, ofs, value):
         raise NotImplementedError
 
+    def getlength(self):
+        raise NotImplementedError
+
     def getitem(self, index):
         raise NotImplementedError
 
-    def getlength(self):
+    def setitem(self, index, value):
         raise NotImplementedError
 
-    def setitem(self, index, value):
+    def getinteriorfield(self, index, ofs, default):
+        raise NotImplementedError
+
+    def setinteriorfield(self, index, ofs, value):
         raise NotImplementedError
 
 
@@ -283,11 +289,11 @@
             return self.optimizer.optpure.has_pure_result(opnum, args, descr)
         return False
 
-    def get_pure_result(self, key):    
+    def get_pure_result(self, key):
         if self.optimizer.optpure:
             return self.optimizer.optpure.get_pure_result(key)
         return None
-    
+
     def setup(self):
         pass
 
@@ -524,7 +530,7 @@
 
     def replace_op(self, old_op, new_op):
         # XXX: Do we want to cache indexes to prevent search?
-        i = len(self._newoperations) 
+        i = len(self._newoperations)
         while i > 0:
             i -= 1
             if self._newoperations[i] is old_op:
diff --git a/pypy/jit/metainterp/optimizeopt/virtualize.py b/pypy/jit/metainterp/optimizeopt/virtualize.py
--- a/pypy/jit/metainterp/optimizeopt/virtualize.py
+++ b/pypy/jit/metainterp/optimizeopt/virtualize.py
@@ -280,12 +280,12 @@
     def getlength(self):
         return len(self._items)
 
-    def getinteriorfield(self, index, descr, default):
-        return self._items[index].get(descr, default)
+    def getinteriorfield(self, index, ofs, default):
+        return self._items[index].get(ofs, default)
 
-    def setinteriorfield(self, index, descr, itemvalue):
+    def setinteriorfield(self, index, ofs, itemvalue):
         assert isinstance(itemvalue, optimizer.OptValue)
-        self._items[index][descr] = itemvalue
+        self._items[index][ofs] = itemvalue
 
     def _really_force(self, optforce):
         assert self.source_op is not None
@@ -296,7 +296,9 @@
         for index in range(len(self._items)):
             for descr, value in self._items[index].iteritems():
                 subbox = value.force_box(optforce)
-                op = ResOperation(rop.SETINTERIORFIELD_GC, [box, ConstInt(index), subbox], None, descr=descr)
+                op = ResOperation(rop.SETINTERIORFIELD_GC,
+                    [box, ConstInt(index), subbox], None, descr=descr
+                )
                 optforce.emit_operation(op)
 
     def _get_list_of_descrs(self):


More information about the pypy-commit mailing list