[pypy-svn] r24840 - pypy/branch/explicit-exceptions/rpython/memory

mwh at codespeak.net mwh at codespeak.net
Thu Mar 23 00:52:21 CET 2006


Author: mwh
Date: Thu Mar 23 00:52:20 2006
New Revision: 24840

Modified:
   pypy/branch/explicit-exceptions/rpython/memory/gctransform.py
Log:
we don't need exception_clean any more.
also, remove a few more references to cleanup.


Modified: pypy/branch/explicit-exceptions/rpython/memory/gctransform.py
==============================================================================
--- pypy/branch/explicit-exceptions/rpython/memory/gctransform.py	(original)
+++ pypy/branch/explicit-exceptions/rpython/memory/gctransform.py	Thu Mar 23 00:52:20 2006
@@ -203,14 +203,6 @@
         if self.translator and self.translator.rtyper:
             self.mixlevelannotator.finish()
     
-def exception_clean(graph):
-    c = 0
-    for block in graph.iterblocks():
-        for op in block.operations:
-            if op.opname in ('direct_call', 'indirect_call'):
-                op.cleanup = None
-                c += 1
-    return c
 
 class MinimalGCTransformer(GCTransformer):
     def push_alive_nopyobj(self, var):
@@ -272,7 +264,6 @@
     def __init__(self, translator):
         super(RefcountingGCTransformer, self).__init__(translator)
         self.deallocator_graphs_needing_transforming = []
-        self.graphs_needing_exception_cleaning = {}
         # create incref graph
         def ll_incref(adr):
             if adr:
@@ -293,7 +284,6 @@
             self.decref_ptr = self.inittime_helper(
                 ll_decref, [llmemory.Address, lltype.Ptr(ADDRESS_VOID_FUNC)],
                 lltype.Void)
-            self.graphs_needing_exception_cleaning[self.decref_ptr.value._obj.graph] = 1
             self.no_pointer_dealloc_ptr = self.inittime_helper(
                 ll_no_pointer_dealloc, [llmemory.Address], lltype.Void)
         # cache graphs:
@@ -307,7 +297,7 @@
         adr1 = varoftype(llmemory.Address)
         result = [SpaceOperation("cast_ptr_to_adr", [var], adr1)]
         result.append(SpaceOperation("direct_call", [self.increfptr, adr1],
-                                     varoftype(lltype.Void), cleanup=None))
+                                     varoftype(lltype.Void)))
         return result
 
     def pop_alive_nopyobj(self, var):
@@ -321,7 +311,7 @@
              
         result.append(SpaceOperation("direct_call",
                                      [self.decref_ptr, adr1, cdealloc_fptr],
-                                     varoftype(lltype.Void), cleanup=None))
+                                     varoftype(lltype.Void)))
         return result
 
     def replace_gc_protect(self, op, livevars, block):
@@ -370,12 +360,6 @@
 
     def finish(self):
         super(RefcountingGCTransformer, self).finish()
-        if self.translator and self.translator.rtyper:
-            #for g in self.deallocator_graphs_needing_transforming:
-            #    MinimalGCTransformer(self.translator).transform_graph(g)
-            for g, nsafecalls in self.graphs_needing_exception_cleaning.iteritems():
-                n = exception_clean(g)
-                assert n == nsafecalls
 
     def static_deallocation_funcptr_for_type(self, TYPE):
         if TYPE in self.static_deallocator_funcptrs:
@@ -489,7 +473,6 @@
             gcheader.signed[0] = 0
             llop.gc_call_rtti_destructor(lltype.Void, rtti, addr)
         g, fptr = self.annotate_helper(ll_dealloc, [llmemory.Address], lltype.Void)
-        self.graphs_needing_exception_cleaning[g] = 1
         self.seen_graphs[g] = True
         
         self.dynamic_deallocator_funcptrs[TYPE] = fptr
@@ -566,10 +549,6 @@
 
     def finish(self):
         self.mixlevelannotator.finish()
-        for fptr in self.finalizer_funcptrs.itervalues():
-            if fptr:
-                g = fptr._obj.graph
-                #MinimalGCTransformer(self.translator).transform_graph(g)
 
     def finalizer_funcptr_for_type(self, TYPE):
         if TYPE in self.finalizer_funcptrs:
@@ -1019,13 +998,13 @@
             v = varoftype(llmemory.Address)
             yield SpaceOperation("cast_ptr_to_adr", [var], v)
             yield SpaceOperation("direct_call", [self.push_root_ptr, v],
-                                 varoftype(lltype.Void), cleanup=None)
+                                 varoftype(lltype.Void))
 
     def pop_roots(self, vars):
         for var in vars[::-1]:
             v = varoftype(llmemory.Address)
             yield SpaceOperation("direct_call", [self.pop_root_ptr],
-                                 v, cleanup=None)
+                                 v)
             yield SpaceOperation("gc_reload_possibly_moved", [v, var],
                                  varoftype(lltype.Void))
 



More information about the Pypy-commit mailing list