[pypy-svn] r22673 - in pypy/dist/pypy/rpython/memory: . test

cfbolz at codespeak.net cfbolz at codespeak.net
Thu Jan 26 10:52:29 CET 2006


Author: cfbolz
Date: Thu Jan 26 10:52:27 2006
New Revision: 22673

Modified:
   pypy/dist/pypy/rpython/memory/gctransform.py
   pypy/dist/pypy/rpython/memory/test/test_gctransform.py
Log:
actually attach the pop_alive operations themselves -- the gctransformers might
want to do strange stuff there after all


Modified: pypy/dist/pypy/rpython/memory/gctransform.py
==============================================================================
--- pypy/dist/pypy/rpython/memory/gctransform.py	(original)
+++ pypy/dist/pypy/rpython/memory/gctransform.py	Thu Jan 26 10:52:27 2006
@@ -49,7 +49,10 @@
         for op in block.operations:
             newops.extend(self.replacement_operations(op))
             if op.opname in ('direct_call', 'indirect_call') and livevars:
-                op.args.append(rmodel.inputconst(lltype.Void, livevars[:]))
+                cleanup_on_exception = []
+                for var in livevars:
+                    cleanup_on_exception.extend(self.pop_alive(var))
+                op.args.append(rmodel.inputconst(lltype.Void, cleanup_on_exception))
             if var_needsgc(op.result):
                 if op.opname not in ('direct_call', 'indirect_call'):
                     newops.extend(self.push_alive(op.result))

Modified: pypy/dist/pypy/rpython/memory/test/test_gctransform.py
==============================================================================
--- pypy/dist/pypy/rpython/memory/test/test_gctransform.py	(original)
+++ pypy/dist/pypy/rpython/memory/test/test_gctransform.py	Thu Jan 26 10:52:27 2006
@@ -102,6 +102,6 @@
     direct_calls = [op for op in ggraph.startblock.operations if op.opname == "direct_call"]
     assert len(direct_calls) == 3
     assert len(direct_calls[0].args) == 1
-    assert direct_calls[1].args[1].value[0] == direct_calls[0].result
-    assert direct_calls[2].args[1].value == [direct_calls[0].result, direct_calls[1].result]
+    assert direct_calls[1].args[1].value[0].args[0] == direct_calls[0].result
+    assert [op.args[0] for op in direct_calls[2].args[1].value] == [direct_calls[0].result, direct_calls[1].result]
 



More information about the Pypy-commit mailing list