[pypy-svn] r26724 - pypy/dist/pypy/rpython/memory

arigo at codespeak.net arigo at codespeak.net
Wed May 3 16:17:04 CEST 2006


Author: arigo
Date: Wed May  3 16:17:03 2006
New Revision: 26724

Modified:
   pypy/dist/pypy/rpython/memory/gctransform.py
Log:
* Preserve the annotation on the graph's inputargs.
* More robust: don't insert the push_alives in a block that will again
  be gc-transformed.


Modified: pypy/dist/pypy/rpython/memory/gctransform.py
==============================================================================
--- pypy/dist/pypy/rpython/memory/gctransform.py	(original)
+++ pypy/dist/pypy/rpython/memory/gctransform.py	Wed May  3 16:17:03 2006
@@ -75,10 +75,7 @@
             if var_needsgc(var):
                 newops.extend(self.push_alive(var))
         if newops:  # only to check if we are going to add any operation at all
-            insert_empty_startblock(None, graph)
-            for var in graph.startblock.inputargs:
-                if var_needsgc(var):
-                    graph.startblock.operations.extend(self.push_alive(var))
+            insert_empty_startblock(self.translator, graph)
 
         for block in graph.iterblocks():
             self.transform_block(block)
@@ -116,6 +113,9 @@
         newops = []
         livevars = [var for var in block.inputargs if var_needsgc(var)]
         newops = []
+        if block.isstartblock:
+            for var in livevars:
+                newops.extend(self.push_alive(var))
         # XXX this is getting obscure.  Maybe we should use the basic
         # graph-transforming capabilities of the RTyper instead, as we
         # seem to run into all the same problems as the ones we already



More information about the Pypy-commit mailing list