[pypy-svn] r66960 - pypy/branch/pyjitpl5/pypy/jit/metainterp/test

fijal at codespeak.net fijal at codespeak.net
Wed Aug 19 11:02:18 CEST 2009


Author: fijal
Date: Wed Aug 19 11:02:18 2009
New Revision: 66960

Modified:
   pypy/branch/pyjitpl5/pypy/jit/metainterp/test/oparser.py
   pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_oparser.py
Log:
(pedronis, fijal) Support for a jump to self


Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/test/oparser.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/test/oparser.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/test/oparser.py	Wed Aug 19 11:02:18 2009
@@ -204,6 +204,8 @@
                 jump.jump_target = loop
         else:
             for jump, jump_target in zip(self.jumps, self.jump_targets):
+                if jump_target == 'self':
+                    jump_target = loop
                 jump.jump_target = jump_target
         loop.operations = ops
         loop.inputargs = inpargs

Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_oparser.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_oparser.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_oparser.py	Wed Aug 19 11:02:18 2009
@@ -129,3 +129,14 @@
     loop = parse(x, jump_targets=[obj])
     assert loop.operations[0].jump_target is obj
 
+def test_jump_target_self():
+    x = '''
+    [i2]
+    guard_true(i2)
+        jump()
+    jump()
+    '''
+    obj = object()
+    loop = parse(x, jump_targets=[obj, 'self'])
+    assert loop.operations[-1].jump_target is loop
+    assert loop.operations[0].suboperations[0].jump_target is obj



More information about the Pypy-commit mailing list