[pypy-commit] pypy jit-short_from_state: In this test, the loop is actually specialized to the condition "the first

hakanardo noreply at buildbot.pypy.org
Wed Jul 13 10:16:49 CEST 2011


Author: Hakan Ardo <hakan at debian.org>
Branch: jit-short_from_state
Changeset: r45523:3bff25816dd1
Date: 2011-07-13 10:16 +0200
http://bitbucket.org/pypy/pypy/changeset/3bff25816dd1/

Log:	In this test, the loop is actually specialized to the condition "the
	first input argument is equal to the valuedescr field of myptr". A
	bridge jumping directly to it would need to check that this
	condition is true, and if it is not jump to the preamble or retrace
	instead. Do we relay want that? The intention of the test was most
	likely not to check this so I'll adjust the test to a situation were
	this kind of specialisation does not occure.

diff --git a/pypy/jit/metainterp/optimizeopt/heap.py b/pypy/jit/metainterp/optimizeopt/heap.py
--- a/pypy/jit/metainterp/optimizeopt/heap.py
+++ b/pypy/jit/metainterp/optimizeopt/heap.py
@@ -110,7 +110,7 @@
         assert self._lazy_setfield is None
         cf = CachedField()
         for structvalue, fieldvalue in self._cached_fields.iteritems():
-            op = self._cached_fields_getfield_op.get(structvalue, None)
+            op = self._cached_fields_getfield_op.get(structvalue, None)            
             if op and op.result in short_boxes and short_boxes[op.result] is op:
                 structvalue2 = structvalue.get_cloned(optimizer, valuemap)
                 fieldvalue2  = fieldvalue .get_cloned(optimizer, valuemap)
@@ -140,6 +140,7 @@
                     potential_ops[op.result] = op
 
 
+
 class BogusPureField(JitException):
     pass
 
diff --git a/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py b/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py
--- a/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py
+++ b/pypy/jit/metainterp/optimizeopt/test/test_optimizeopt.py
@@ -1363,12 +1363,19 @@
         ops = """
         [i]
         i1 = getfield_gc(ConstPtr(myptr), descr=valuedescr)
-        jump(i1)
-        """
-        preamble = ops
-        expected = """
+        call(i1, descr=nonwritedescr)
+        jump(i)
+        """
+        preamble = """
         [i]
-        jump(i)
+        i1 = getfield_gc(ConstPtr(myptr), descr=valuedescr)
+        call(i1, descr=nonwritedescr)
+        jump(i, i1)
+        """
+        expected = """
+        [i, i1]
+        call(i1, descr=nonwritedescr)
+        jump(i, i1)
         """
         self.optimize_loop(ops, expected, preamble)
 


More information about the pypy-commit mailing list