[pypy-commit] pypy remove-getfield-pure: Fix broken test and screwups from merge

sbauman pypy.commits at gmail.com
Tue Dec 22 14:39:12 EST 2015


Author: Spenser Andrew Bauman <sabauma at gmail.com>
Branch: remove-getfield-pure
Changeset: r81425:1c52e941a48d
Date: 2015-12-22 14:28 -0500
http://bitbucket.org/pypy/pypy/changeset/1c52e941a48d/

Log:	Fix broken test and screwups from merge

diff --git a/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py b/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
--- a/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
+++ b/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py
@@ -9266,7 +9266,7 @@
         guard_value(i1, 5) []
         jump()
         """
-        a = lltype.malloc(lltype.GcArray(lltype.Ptr(self.NODE)), 5, zero=True)
+        a = lltype.malloc(lltype.GcArray(lltype.Ptr(self.NODE3)), 5, zero=True)
         self.optimize_loop(ops, expected, jump_values=[a])
 
 
diff --git a/rpython/jit/metainterp/resoperation.py b/rpython/jit/metainterp/resoperation.py
--- a/rpython/jit/metainterp/resoperation.py
+++ b/rpython/jit/metainterp/resoperation.py
@@ -246,6 +246,11 @@
     def forget_value(self):
         pass
 
+def is_pure_getfield(opnum, descr):
+    if opnum not in (rop.GETFIELD_GC_I, rop.GETFIELD_GC_F, rop.GETFIELD_GC_R):
+        return False
+    return descr is not None and descr.is_always_pure() != False
+
 class AbstractResOp(AbstractResOpOrInputArg):
     """The central ResOperation class, representing one operation."""
 
@@ -1166,6 +1171,20 @@
     #
     '_ALWAYS_PURE_LAST',  # ----- end of always_pure operations -----
 
+    # parameters GC_LOAD
+    # 1: pointer to complex object
+    # 2: integer describing the offset
+    # 3: constant integer. byte size of datatype to load (negative if it is signed)
+    'GC_LOAD/3/rfi',
+    # parameters GC_LOAD_INDEXED
+    # 1: pointer to complex object
+    # 2: integer describing the index
+    # 3: constant integer scale factor
+    # 4: constant integer base offset   (final offset is 'base + scale * index')
+    # 5: constant integer. byte size of datatype to load (negative if it is signed)
+    # (GC_LOAD is equivalent to GC_LOAD_INDEXED with arg3==1, arg4==0)
+    'GC_LOAD_INDEXED/5/rfi',
+
     '_RAW_LOAD_FIRST',
     'GETARRAYITEM_GC/2d/rfi',
     'VEC_GETARRAYITEM_GC/2d/fi',


More information about the pypy-commit mailing list