Author: Maciej Fijalkowski <[email protected]>
Branch: continulet-jit-3
Changeset: r58258:2f3784367953
Date: 2012-10-19 19:58 +0200
http://bitbucket.org/pypy/pypy/changeset/2f3784367953/

Log:    one more test, that doesn't do exactly what I wanted, but still
        explodes

diff --git a/pypy/jit/metainterp/test/test_recursive.py 
b/pypy/jit/metainterp/test/test_recursive.py
--- a/pypy/jit/metainterp/test/test_recursive.py
+++ b/pypy/jit/metainterp/test/test_recursive.py
@@ -958,6 +958,36 @@
                                policy=StopAtXPolicy(change))
         assert res == main(0)
 
+    def test_call_assembler_two_virtualizables(self):
+        class Frame(object):
+            _virtualizable2_ = ['thing']
+
+            def __init__(self, thing):
+                self.thing = thing
+
+        driver = JitDriver(greens = ['codeno'],
+                           reds = ['i', 'frame', 'parent_frame'],
+                           virtualizables = ['frame'])
+
+        def portal(codeno, parent_frame):
+            i = 0
+            frame = Frame(codeno)
+            while i < 10:
+                driver.jit_merge_point(i=i, frame=frame, codeno=codeno,
+                                       parent_frame=parent_frame)
+                frame.thing = frame.thing + parent_frame.thing
+                if codeno == 0:
+                    portal((i % 2) + 1, frame)
+                i += 1
+            return frame.thing
+
+        def main():
+            frame = Frame(0)
+            return portal(0, frame)
+
+        res = self.meta_interp(main, [], inline=True)
+        assert res == main()
+
     def test_assembler_call_red_args(self):
         driver = JitDriver(greens = ['codeno'], reds = ['i', 'k'],
                            get_printable_location = lambda codeno : 
str(codeno))
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to