[pypy-svn] r32442 - in pypy/dist/pypy/jit/timeshifter: . test

arigo at codespeak.net arigo at codespeak.net
Mon Sep 18 15:31:25 CEST 2006


Author: arigo
Date: Mon Sep 18 15:31:23 2006
New Revision: 32442

Modified:
   pypy/dist/pypy/jit/timeshifter/rtimeshift.py
   pypy/dist/pypy/jit/timeshifter/rtyper.py
   pypy/dist/pypy/jit/timeshifter/test/test_timeshift.py
Log:
(arre, arigo)

(Skipped) test for 'yellow calls'.  Typo.


Modified: pypy/dist/pypy/jit/timeshifter/rtimeshift.py
==============================================================================
--- pypy/dist/pypy/jit/timeshifter/rtimeshift.py	(original)
+++ pypy/dist/pypy/jit/timeshifter/rtimeshift.py	Mon Sep 18 15:31:23 2006
@@ -426,7 +426,7 @@
     myframe = jitstate.frame
     if myframe.local_boxes:             # else it's a green Void return
         jitstate.returnbox = myframe.local_boxes[0]
-        # ^^^ fetched by an 'fetch_return' operation
+        # ^^^ fetched by a 'fetch_return' operation
     jitstate.frame = myframe.backframe
     jitstate.exitindex = -1
     return jitstate

Modified: pypy/dist/pypy/jit/timeshifter/rtyper.py
==============================================================================
--- pypy/dist/pypy/jit/timeshifter/rtyper.py	(original)
+++ pypy/dist/pypy/jit/timeshifter/rtyper.py	Mon Sep 18 15:31:23 2006
@@ -355,6 +355,11 @@
             return 'oopspec'
         elif (originalconcretetype(s_result) is not lltype.Void and
               isinstance(r_result, GreenRepr)):
+            for v in spaceop.args:
+                s_arg = self.annotator.binding(v)
+                r_arg = self.getrepr(s_arg)
+                if not isinstance(r_arg, GreenRepr):
+                    return 'yellow'
             return 'green'
         else:
             return 'red'

Modified: pypy/dist/pypy/jit/timeshifter/test/test_timeshift.py
==============================================================================
--- pypy/dist/pypy/jit/timeshifter/test/test_timeshift.py	(original)
+++ pypy/dist/pypy/jit/timeshifter/test/test_timeshift.py	Mon Sep 18 15:31:23 2006
@@ -885,3 +885,17 @@
 
         res = self.timeshift(ll_function, [3], [], policy=P_NOVIRTUAL)
         assert res == 3
+
+    def test_split_on_green_return(self):
+        py.test.skip("in-progress")
+        def ll_two(x):
+            if x > 0:
+                return 17
+            else:
+                return 22
+        def ll_function(x):
+            n = ll_two(x)
+            return n+1
+        res = self.timeshift(ll_function, [-70], [])
+        assert res == 23
+        self.check_insns({'int_gt': 1})



More information about the Pypy-commit mailing list