[pypy-svn] r69926 - pypy/branch/virtual-forcing/pypy/jit/metainterp/test

arigo at codespeak.net arigo at codespeak.net
Sun Dec 6 18:14:47 CET 2009


Author: arigo
Date: Sun Dec  6 18:14:46 2009
New Revision: 69926

Modified:
   pypy/branch/virtual-forcing/pypy/jit/metainterp/test/test_optimizefindnode.py
   pypy/branch/virtual-forcing/pypy/jit/metainterp/test/test_optimizeopt.py
Log:
Fix the tests for optimizeopt.


Modified: pypy/branch/virtual-forcing/pypy/jit/metainterp/test/test_optimizefindnode.py
==============================================================================
--- pypy/branch/virtual-forcing/pypy/jit/metainterp/test/test_optimizefindnode.py	(original)
+++ pypy/branch/virtual-forcing/pypy/jit/metainterp/test/test_optimizefindnode.py	Sun Dec  6 18:14:46 2009
@@ -105,6 +105,7 @@
     from pypy.jit.metainterp.virtualref import jit_virtual_ref_vtable
     from pypy.jit.metainterp.virtualref import JIT_VIRTUAL_REF
     virtualtokendescr = cpu.fielddescrof(JIT_VIRTUAL_REF, 'virtual_token')
+    virtualrefindexdescr = cpu.fielddescrof(JIT_VIRTUAL_REF,'virtualref_index')
 
     cpu.class_sizes = {cpu.cast_adr_to_int(node_vtable_adr): cpu.sizeof(NODE),
                       cpu.cast_adr_to_int(node_vtable_adr2): cpu.sizeof(NODE2),

Modified: pypy/branch/virtual-forcing/pypy/jit/metainterp/test/test_optimizeopt.py
==============================================================================
--- pypy/branch/virtual-forcing/pypy/jit/metainterp/test/test_optimizeopt.py	(original)
+++ pypy/branch/virtual-forcing/pypy/jit/metainterp/test/test_optimizeopt.py	Sun Dec  6 18:14:46 2009
@@ -2034,7 +2034,7 @@
     def test_vref_nonvirtual(self):
         ops = """
         [p1]
-        p2 = virtual_ref(p1)
+        p2 = virtual_ref(p1, 5)
         jump(p1)
         """
         py.test.raises(compile.GiveUp, self.optimize_loop, ops, 'Not', ops)
@@ -2048,7 +2048,7 @@
         setfield_gc(p1b, 252, descr=valuedescr)
         setfield_gc(p1, p1b, descr=nextdescr)
         #
-        p2 = virtual_ref(p1)
+        p2 = virtual_ref(p1, 3)
         setfield_gc(p0, p2, descr=nextdescr)
         call_may_force(i1, descr=mayforcevirtdescr)
         guard_not_forced() [i1]
@@ -2060,6 +2060,7 @@
         i3 = force_token()
         p2 = new_with_vtable(ConstClass(jit_virtual_ref_vtable))
         setfield_gc(p2, i3, descr=virtualtokendescr)
+        setfield_gc(p2, 3, descr=virtualrefindexdescr)
         setfield_gc(p0, p2, descr=nextdescr)
         call_may_force(i1, descr=mayforcevirtdescr)
         guard_not_forced() [i1]
@@ -2078,7 +2079,7 @@
         setfield_gc(p1b, i1, descr=valuedescr)
         setfield_gc(p1, p1b, descr=nextdescr)
         #
-        p2 = virtual_ref(p1)
+        p2 = virtual_ref(p1, 2)
         setfield_gc(p0, p2, descr=nextdescr)
         call_may_force(i1, descr=mayforcevirtdescr)
         guard_not_forced(descr=fdescr) [p1]
@@ -2090,6 +2091,7 @@
         i3 = force_token()
         p2 = new_with_vtable(ConstClass(jit_virtual_ref_vtable))
         setfield_gc(p2, i3, descr=virtualtokendescr)
+        setfield_gc(p2, 2, descr=virtualrefindexdescr)
         setfield_gc(p0, p2, descr=nextdescr)
         call_may_force(i1, descr=mayforcevirtdescr)
         guard_not_forced(descr=fdescr) [i1]



More information about the Pypy-commit mailing list