[pypy-svn] r80044 - in pypy/branch/jit-unroll-loops/pypy: jit/metainterp jit/metainterp/test module/pypyjit/test

hakanardo at codespeak.net hakanardo at codespeak.net
Mon Dec 13 20:53:52 CET 2010


Author: hakanardo
Date: Mon Dec 13 20:53:50 2010
New Revision: 80044

Modified:
   pypy/branch/jit-unroll-loops/pypy/jit/metainterp/compile.py
   pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test/test_memmgr.py
   pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test/test_optimizebasic.py
   pypy/branch/jit-unroll-loops/pypy/module/pypyjit/test/test_pypy_c.py
Log:
fixed tests

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	Mon Dec 13 20:53:50 2010
@@ -113,12 +113,12 @@
     if loop.preamble.operations is not None:
         send_loop_to_backend(metainterp_sd, loop, "loop")
         record_loop_or_bridge(loop)
+        token = loop.preamble.token
         if full_preamble_needed or not loop.preamble.token.short_preamble:
             send_loop_to_backend(metainterp_sd, loop.preamble, "entry bridge")
             insert_loop_token(old_loop_tokens, loop.preamble.token)
             jitdriver_sd.warmstate.attach_unoptimized_bridge_from_interp(
                 greenkey, loop.preamble.token)
-            token = loop.preamble.token
             record_loop_or_bridge(loop.preamble)
         return token
     else:

Modified: pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test/test_memmgr.py
==============================================================================
--- pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test/test_memmgr.py	(original)
+++ pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test/test_memmgr.py	Mon Dec 13 20:53:50 2010
@@ -132,7 +132,7 @@
         res = self.meta_interp(f, [], loop_longevity=1)
         assert res == 42
         # we should see a loop for each call to g()
-        self.check_tree_loop_count(8 + 20*2)
+        self.check_tree_loop_count(8 + 20*2*2)
 
     def test_throw_away_old_loops(self):
         myjitdriver = JitDriver(greens=['m'], reds=['n'])
@@ -157,7 +157,7 @@
 
         res = self.meta_interp(f, [], loop_longevity=3)
         assert res == 42
-        self.check_tree_loop_count(2 + 10*4)   # 42 :-)
+        self.check_tree_loop_count(2 + 10*4*2)
 
     def test_call_assembler_keep_alive(self):
         myjitdriver1 = JitDriver(greens=['m'], reds=['n'])
@@ -191,7 +191,7 @@
 
         res = self.meta_interp(f, [1], loop_longevity=4, inline=True)
         assert res == 42
-        self.check_tree_loop_count(8)
+        self.check_tree_loop_count(12)
 
 # ____________________________________________________________
 

Modified: pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test/test_optimizebasic.py
==============================================================================
--- pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test/test_optimizebasic.py	(original)
+++ pypy/branch/jit-unroll-loops/pypy/jit/metainterp/test/test_optimizebasic.py	Mon Dec 13 20:53:50 2010
@@ -262,12 +262,14 @@
                                                      OptString,
                                                      OptHeap,
                                                      Optimizer)
+        from pypy.jit.metainterp.optimizeopt.fficall import OptFfiCall
+
         optimizations = [OptIntBounds(),
                          OptRewrite(),
                          OptVirtualize(),
                          OptString(),
                          OptHeap(),
-                         #OptFfiCall(),
+                         OptFfiCall(),
                          ]
         optimizer = Optimizer(metainterp_sd, loop, optimizations)
         optimizer.propagate_all_forward()

Modified: pypy/branch/jit-unroll-loops/pypy/module/pypyjit/test/test_pypy_c.py
==============================================================================
--- pypy/branch/jit-unroll-loops/pypy/module/pypyjit/test/test_pypy_c.py	(original)
+++ pypy/branch/jit-unroll-loops/pypy/module/pypyjit/test/test_pypy_c.py	Mon Dec 13 20:53:50 2010
@@ -422,7 +422,7 @@
                     ([1000], 49500),
                     ([10000], 495000),
                     ([100000], 4950000))
-        assert len(self.loops) == 3
+        assert len(self.rawloops)  + len(self.rawentrybridges) == 4
         op, = self.get_by_bytecode("CALL_FUNCTION_KW")
         # XXX a bit too many guards, but better than before
         assert len(op.get_opnames("guard")) <= 12



More information about the Pypy-commit mailing list