[pypy-commit] pypy jit-targets: test_target_loop_kept_alive_or_not relies on send_bridge_to_backend() NOT increasing the generation of its original preamble (its current action on default is to increas the generation of the peeled loop, which is a bit of a no-op). Is this realy the desiered behaviour?

hakanardo noreply at buildbot.pypy.org
Wed Nov 16 20:22:15 CET 2011


Author: Hakan Ardo <hakan at debian.org>
Branch: jit-targets
Changeset: r49477:b07f3eacf8ae
Date: 2011-11-16 20:21 +0100
http://bitbucket.org/pypy/pypy/changeset/b07f3eacf8ae/

Log:	test_target_loop_kept_alive_or_not relies on
	send_bridge_to_backend() NOT increasing the generation of its
	original preamble (its current action on default is to increas the
	generation of the peeled loop, which is a bit of a no-op). Is this
	realy the desiered behaviour?

diff --git a/pypy/jit/metainterp/compile.py b/pypy/jit/metainterp/compile.py
--- a/pypy/jit/metainterp/compile.py
+++ b/pypy/jit/metainterp/compile.py
@@ -294,9 +294,9 @@
     #
     metainterp_sd.logger_ops.log_bridge(inputargs, operations, n, ops_offset)
     #
-    if metainterp_sd.warmrunnerdesc is not None:    # for tests
-        metainterp_sd.warmrunnerdesc.memory_manager.keep_loop_alive(
-            original_loop_token)
+    #if metainterp_sd.warmrunnerdesc is not None:    # for tests
+    #    metainterp_sd.warmrunnerdesc.memory_manager.keep_loop_alive(
+    #        original_loop_token)
 
 # ____________________________________________________________
 
diff --git a/pypy/jit/metainterp/test/test_memmgr.py b/pypy/jit/metainterp/test/test_memmgr.py
--- a/pypy/jit/metainterp/test/test_memmgr.py
+++ b/pypy/jit/metainterp/test/test_memmgr.py
@@ -114,6 +114,8 @@
             # Depending on loop_longevity, either:
             # A. create the loop and the entry bridge for 'g(5)'
             # B. create 8 loops (and throw them away at each iteration)
+            #    Actually, it's 4 loops and 4 exit bridges thrown away
+            #    every second iteration
             for i in range(8):
                 g(5)
             # create another loop and another entry bridge for 'g(7)',
diff --git a/pypy/jit/metainterp/warmstate.py b/pypy/jit/metainterp/warmstate.py
--- a/pypy/jit/metainterp/warmstate.py
+++ b/pypy/jit/metainterp/warmstate.py
@@ -173,6 +173,9 @@
     wref_procedure_token = None
 
     def get_procedure_token(self):
+        if not we_are_translated():
+            from pypy.rlib import rgc
+            rgc.collect(); rgc.collect(); rgc.collect()
         if self.wref_procedure_token is not None:
             return self.wref_procedure_token()
         return None


More information about the pypy-commit mailing list