Source

pypy / pypy / translator / backendopt / all.py

Diff from to

File pypy/translator/backendopt/all.py

 from pypy.translator.backendopt.stat import print_statistics
 from pypy.translator.backendopt.merge_if_blocks import merge_if_blocks
 from pypy.translator import simplify
-from pypy.translator.backendopt.escape import malloc_to_stack
 from pypy.translator.backendopt import mallocprediction
 from pypy.translator.backendopt.removeassert import remove_asserts
 from pypy.translator.backendopt.support import log
 from pypy.translator.backendopt.checkvirtual import check_virtual_methods
+from pypy.translator.backendopt.storesink import storesink_graph
 from pypy.objspace.flow.model import checkgraph
 
 INLINE_THRESHOLD_FOR_TEST = 33
     if translator.rtyper.type_system.name == 'ootypesystem':
         check_virtual_methods()
 
+    if config.remove_asserts:
+        constfold(config, graphs)
+        remove_asserts(translator, graphs)
+
+    if config.really_remove_asserts:
+        for graph in graphs:
+            removenoops.remove_debug_assert(graph)
+        # the dead operations will be killed by the remove_obvious_noops below
+
     # remove obvious no-ops
     def remove_obvious_noops():
         for graph in graphs:
             print "after clever inlining and malloc removal"
             print_statistics(translator.graphs[0], translator)        
 
+    if config.storesink:
+        for graph in graphs:
+            storesink_graph(graph)
 
     if config.profile_based_inline and not secondary:
         threshold = config.profile_based_inline_threshold
                                     call_count_pred=call_count_pred)
     constfold(config, graphs)
 
-    if config.remove_asserts:
-        remove_asserts(translator, graphs)
-
-    if config.heap2stack:
-        assert graphs is translator.graphs  # XXX for now
-        malloc_to_stack(translator)
-
     if config.merge_if_blocks:
         log.mergeifblocks("starting to merge if blocks")
         for graph in graphs:
         print "after if-to-switch:"
         print_statistics(translator.graphs[0], translator)
 
-    if config.coalloc and not secondary:
-        from pypy.translator.backendopt import coalloc
-        coalloc.malloc_to_coalloc(translator)
-
     remove_obvious_noops()
 
     for graph in graphs: