[pypy-svn] r78599 - in pypy/branch/jit-unroll-loops/pypy/jit/metainterp: . test

cfbolz at codespeak.net cfbolz at codespeak.net
Sun Oct 31 14:12:59 CET 2010


Author: cfbolz
Date: Sun Oct 31 14:12:58 2010
New Revision: 78599

Modified:
   pypy/branch/jit-unroll-loops/pypy/jit/metainterp/compile.py
   pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test/test_loop_nounroll.py
Log:
(hakanardo, cfbolz, arigo): when not using unrolling, always register every loop
as an entry bridge. this is safe, because there is no specialization any more.


Modified: pypy/branch/jit-unroll-loops/pypy/jit/metainterp/compile.py
==============================================================================
--- pypy/branch/jit-unroll-loops/pypy/jit/metainterp/compile.py	(original)
+++ pypy/branch/jit-unroll-loops/pypy/jit/metainterp/compile.py	Sun Oct 31 14:12:58 2010
@@ -79,7 +79,7 @@
         metainterp.staticdata.log("reusing old loop")
         return old_loop_token
 
-    if loop.preamble.operations:
+    if loop.preamble.operations is not None:
         send_loop_to_backend(metainterp_sd, loop, "loop")
         send_loop_to_backend(metainterp_sd, loop.preamble, "entry bridge")
         insert_loop_token(old_loop_tokens, loop.preamble.token)
@@ -89,6 +89,8 @@
     else:
         send_loop_to_backend(metainterp_sd, loop, "loop")
         insert_loop_token(old_loop_tokens, loop_token)
+        jitdriver_sd.warmstate.attach_unoptimized_bridge_from_interp(
+            greenkey, loop.token)
         return loop_token
 
 def insert_loop_token(old_loop_tokens, loop_token):

Modified: pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test/test_loop_nounroll.py
==============================================================================
--- pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test/test_loop_nounroll.py	(original)
+++ pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test/test_loop_nounroll.py	Sun Oct 31 14:12:58 2010
@@ -20,8 +20,11 @@
     def check_jumps(self, maxcount):
         pass
 
+
 class TestLLtype(LoopNoPSpecTest, LLJitMixin):
-    pass
+    def check_tree_loop_count(self, count):
+        # we get one less entry bridge
+        return LLJitMixin.check_tree_loop_count(self, count - 1)
 
 class TestOOtype(LoopNoPSpecTest, OOJitMixin):
     pass



More information about the Pypy-commit mailing list