[pypy-svn] pypy commit c9e8ed0461c7: fixed tests

Bitbucket commits-noreply at bitbucket.org
Tue Dec 14 11:41:51 CET 2010


# HG changeset patch -- Bitbucket.org
# Project pypy
# URL http://bitbucket.org/pypy/pypy/overview
# User Hakan Ardo <hakan at debian.org>
# Date 1292270030 0
# Node ID c9e8ed0461c7150566557861a21f2984ab6dc78d
# Parent  f8a367dd165594fb308556aff40b66869cec2bb8
fixed tests

--- a/pypy/jit/metainterp/compile.py
+++ b/pypy/jit/metainterp/compile.py
@@ -113,12 +113,12 @@ def compile_new_loop(metainterp, old_loo
     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:

--- a/pypy/jit/metainterp/test/test_memmgr.py
+++ b/pypy/jit/metainterp/test/test_memmgr.py
@@ -132,7 +132,7 @@ class _TestIntegration(LLJitMixin):
         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 @@ class _TestIntegration(LLJitMixin):
 
         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 @@ class _TestIntegration(LLJitMixin):
 
         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)
 
 # ____________________________________________________________
 

--- a/pypy/module/pypyjit/test/test_pypy_c.py
+++ b/pypy/module/pypyjit/test/test_pypy_c.py
@@ -422,7 +422,7 @@ class PyPyCJITTests(object):
                     ([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

--- a/pypy/jit/metainterp/test/test_optimizebasic.py
+++ b/pypy/jit/metainterp/test/test_optimizebasic.py
@@ -262,12 +262,14 @@ class BaseTestBasic(BaseTest):
                                                      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()



More information about the Pypy-commit mailing list