[pypy-svn] r14557 - in pypy/dist/pypy: rpython translator translator/goal

arigo at codespeak.net arigo at codespeak.net
Tue Jul 12 19:38:59 CEST 2005


Author: arigo
Date: Tue Jul 12 19:38:56 2005
New Revision: 14557

Modified:
   pypy/dist/pypy/rpython/rtyper.py
   pypy/dist/pypy/translator/goal/translate_pypy.py
   pypy/dist/pypy/translator/translator.py
Log:
Trying to make specialize() not run a.simplify() again...  (messy)


Modified: pypy/dist/pypy/rpython/rtyper.py
==============================================================================
--- pypy/dist/pypy/rpython/rtyper.py	(original)
+++ pypy/dist/pypy/rpython/rtyper.py	Tue Jul 12 19:38:56 2005
@@ -86,10 +86,11 @@
     def bindingrepr(self, var):
         return self.getrepr(self.binding(var))
 
-    def specialize(self):
+    def specialize(self, dont_simplify_again=False):
         """Main entry point: specialize all annotated blocks of the program."""
         # specialize depends on annotator simplifications
-        self.annotator.simplify()
+        if not dont_simplify_again:
+            self.annotator.simplify()
         # first make sure that all functions called in a group have exactly
         # the same signature, by hacking their flow graphs if needed
         perform_normalizations(self)

Modified: pypy/dist/pypy/translator/goal/translate_pypy.py
==============================================================================
--- pypy/dist/pypy/translator/goal/translate_pypy.py	(original)
+++ pypy/dist/pypy/translator/goal/translate_pypy.py	Tue Jul 12 19:38:56 2005
@@ -13,7 +13,6 @@
               defaults to targetpypymain. The .py suffix is optional.
    -text      Don't start the Pygame viewer
    -no-a      Don't infer annotations, just translate everything
-   -no-s      Don't simplify the graph after annotation
    -no-t      Don't type-specialize the graph operations with the C typer
    -no-o      Don't do backend-oriented optimizations
    -no-c      Don't generate the C code
@@ -105,7 +104,7 @@
         sanity_check_exceptblocks(t)
         worstblocks_topten(a, 3)
         find_someobjects(t)
-    if a and not options['-no-s']:
+    if a: #and not options['-no-s']:
         print 'Simplifying...'
         a.simplify()
     if a and options['-fork']:
@@ -113,7 +112,7 @@
         unixcheckpoint.restartable_point(auto='run')
     if a and not options['-no-t']:
         print 'Specializing...'
-        t.specialize()
+        t.specialize(dont_simplify_again=True)
     if not options['-no-o']:
         print 'Back-end optimizations...'
         t.backend_optimizations()
@@ -257,7 +256,6 @@
                '-o':    False,
                '-no-mark-some-objects': False,
                '-no-a': False,
-               '-no-s': False,
                '-no-t': False,
                '-no-o': False,
                '-tcc':  False,
@@ -498,7 +496,7 @@
             targetspec_dic = loaded_dic['targetspec_dic']
             targetspec = loaded_dic['targetspec']
             old_options = loaded_dic['options']
-            for name in '-no-a -no-s -no-t -no-o'.split():
+            for name in '-no-a -no-t -no-o'.split():
                 # if one of these options has not been set, before,
                 # then the action has been done and must be prevented, now.
                 if not old_options[name]:

Modified: pypy/dist/pypy/translator/translator.py
==============================================================================
--- pypy/dist/pypy/translator/translator.py	(original)
+++ pypy/dist/pypy/translator/translator.py	Tue Jul 12 19:38:56 2005
@@ -138,14 +138,14 @@
         for graph in self.flowgraphs.itervalues():
             checkgraph(graph)
 
-    def specialize(self):
+    def specialize(self, dont_simplify_again=False):
         if self.annotator is None:
             raise ValueError("you need to call annotate() first")
         if self.rtyper is not None:
             raise ValueError("cannot specialize() several times")
         from pypy.rpython.rtyper import RPythonTyper
         self.rtyper = RPythonTyper(self.annotator)
-        self.rtyper.specialize()
+        self.rtyper.specialize(dont_simplify_again=dont_simplify_again)
 
     def backend_optimizations(self):
         from pypy.translator.backendoptimization import backend_optimizations



More information about the Pypy-commit mailing list