[pypy-svn] r53594 - pypy/dist/pypy/rpython/memory/gctransform

arigo at codespeak.net arigo at codespeak.net
Tue Apr 8 19:45:48 CEST 2008

Author: arigo
Date: Tue Apr  8 19:45:46 2008
New Revision: 53594

Fix the CollectAnalyzer to find all operations marked "I can collect" in
lloperation.py.  (The name of the flag is slightly obscure, though.)

Modified: pypy/dist/pypy/rpython/memory/gctransform/framework.py
--- pypy/dist/pypy/rpython/memory/gctransform/framework.py	(original)
+++ pypy/dist/pypy/rpython/memory/gctransform/framework.py	Tue Apr  8 19:45:46 2008
@@ -17,19 +17,18 @@
 from pypy.rpython.memory.gctypelayout import convert_weakref_to, WEAKREFPTR
 from pypy.rpython.memory.gctransform.log import log
 from pypy.tool.sourcetools import func_with_new_name
-from pypy.rpython.lltypesystem.lloperation import llop
+from pypy.rpython.lltypesystem.lloperation import llop, LL_OPERATIONS
 import sys
 class CollectAnalyzer(graphanalyze.GraphAnalyzer):
     def operation_is_true(self, op):
-        if op.opname == 'gc__collect':
-            return True
         if op.opname in ('malloc', 'malloc_varsize'):
             flags = op.args[1].value
             return flags['flavor'] == 'gc' and not flags.get('nocollect', False)
-        if op.opname in ('coalloc', 'coalloc_varsize'):
-            return True
+        else:
+            return (op.opname in LL_OPERATIONS and
+                    LL_OPERATIONS[op.opname].canunwindgc)
 def find_initializing_stores(collect_analyzer, graph):
     from pypy.objspace.flow.model import mkentrymap

More information about the Pypy-commit mailing list