[pypy-svn] r63262 - pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/test

arigo at codespeak.net arigo at codespeak.net
Mon Mar 23 21:59:01 CET 2009


Author: arigo
Date: Mon Mar 23 21:59:01 2009
New Revision: 63262

Modified:
   pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/test/test_vable_optimize.py
Log:
Fix test_vable_optimize.


Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/test/test_vable_optimize.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/test/test_vable_optimize.py	(original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/test/test_vable_optimize.py	Mon Mar 23 21:59:01 2009
@@ -83,8 +83,8 @@
     v = BoxInt(frame.node.value)
     v2 = BoxInt(nextnode.value)
     sum2 = BoxInt(0 + frame.node.value)
+    inputargs = [sum, fr]
     ops = [
-        ResOperation('merge_point', [sum, fr], None),
         ResOperation('guard_nonvirtualized', [fr, ConstAddr(xy_vtable, cpu)],
                      None, ofs_node),
         ResOperation('getfield_gc', [fr], n1, ofs_node),
@@ -100,12 +100,12 @@
     ops[1].vdesc = xy_desc
 
 def test_A_find_nodes():
-    spec = PerfectSpecializer(Loop(A.ops))
+    spec = PerfectSpecializer(Loop(A.inputargs, A.ops))
     spec.find_nodes()
     assert spec.nodes[A.fr].virtualized
 
 def test_A_intersect_input_and_output():
-    spec = PerfectSpecializer(Loop(A.ops))
+    spec = PerfectSpecializer(Loop(A.inputargs, A.ops))
     spec.find_nodes()
     spec.intersect_input_and_output()
     assert spec.nodes[A.fr].escaped
@@ -115,12 +115,12 @@
     assert isinstance(spec.specnodes[1], VirtualizableSpecNode)
 
 def test_A_optimize_loop():
-    spec = PerfectSpecializer(Loop(A.ops))
+    spec = PerfectSpecializer(Loop(A.inputargs, A.ops))
     spec.find_nodes()
     spec.intersect_input_and_output()
     spec.optimize_loop()
+    assert spec.loop.inputargs == [A.sum, A.fr, A.v]
     equaloplists(spec.loop.operations, [
-        ResOperation('merge_point', [A.sum, A.fr, A.v], None),
         ResOperation('int_sub', [A.v, ConstInt(1)], A.v2),
         ResOperation('int_add', [A.sum, A.v], A.sum2),
         ResOperation('jump', [A.sum2, A.fr, A.v2], None),
@@ -140,8 +140,8 @@
     fr = BoxPtr(lltype.cast_opaque_ptr(llmemory.GCREF, frame))
     n1 = BoxPtr(lltype.cast_opaque_ptr(llmemory.GCREF, frame.node))
     v = BoxInt(13)
+    inputargs = [fr]
     ops = [
-        ResOperation('merge_point', [fr], None),
         ResOperation('guard_nonvirtualized', [fr, ConstAddr(xy_vtable, cpu)],
                      None, ofs_node),
         ResOperation('getfield_gc', [fr], n1, ofs_node),
@@ -151,7 +151,7 @@
     ops[1].vdesc = xy_desc
 
 def test_B_intersect_input_and_output():
-    spec = PerfectSpecializer(Loop(B.ops))
+    spec = PerfectSpecializer(Loop(B.inputargs, B.ops))
     spec.find_nodes()
     spec.intersect_input_and_output()
     assert spec.nodes[B.fr].escaped
@@ -168,8 +168,8 @@
     locals().update(B.__dict__)
     n2 = BoxPtr(lltype.cast_opaque_ptr(llmemory.GCREF, frame.node))
     v2 = BoxInt(13)
+    inputargs = [fr]
     ops = [
-        ResOperation('merge_point', [fr], None),
         ResOperation('guard_nonvirtualized', [fr, ConstAddr(xy_vtable, cpu)],
                      None, ofs_node),
         #
@@ -186,7 +186,7 @@
     ops[1].vdesc = xy_desc
 
 def test_C_intersect_input_and_output():
-    spec = PerfectSpecializer(Loop(C.ops))
+    spec = PerfectSpecializer(Loop(C.inputargs, C.ops))
     spec.find_nodes()
     spec.intersect_input_and_output()
     assert spec.nodes[C.fr].escaped
@@ -211,8 +211,8 @@
     n2 = BoxPtr(lltype.cast_opaque_ptr(llmemory.GCREF, frame.node))
     v2 = BoxInt(13)
     l = BoxPtr(lltype.cast_opaque_ptr(llmemory.GCREF, frame.node))
+    inputargs = [fr]
     ops = [
-        ResOperation('merge_point', [fr], None),
         ResOperation('guard_nonvirtualized', [fr, ConstAddr(xy_vtable, cpu),
                                               ConstInt(ofs_node)], None),
         #
@@ -226,7 +226,7 @@
 
 def test_D_intersect_input_and_output():
     py.test.skip("XXX")
-    spec = PerfectSpecializer(Loop(D.ops))
+    spec = PerfectSpecializer(Loop(D.inputargs, D.ops))
     spec.find_nodes()
     spec.intersect_input_and_output()
     assert spec.nodes[D.fr].escaped



More information about the Pypy-commit mailing list