[pypy-svn] r40546 - in pypy/dist/pypy: config translator

antocuni at codespeak.net antocuni at codespeak.net
Thu Mar 15 17:01:32 CET 2007


Author: antocuni
Date: Thu Mar 15 17:01:30 2007
New Revision: 40546

Modified:
   pypy/dist/pypy/config/translationoption.py
   pypy/dist/pypy/translator/driver.py
Log:
uses the config mechanism for setting default backendopts to use with
ootype.



Modified: pypy/dist/pypy/config/translationoption.py
==============================================================================
--- pypy/dist/pypy/config/translationoption.py	(original)
+++ pypy/dist/pypy/config/translationoption.py	Thu Mar 15 17:01:30 2007
@@ -15,7 +15,13 @@
                default=False, cmdline="--stackless",
                requires=[("translation.type_system", "lltype")]),
     ChoiceOption("type_system", "Type system to use when RTyping",
-                 ["lltype", "ootype"], cmdline=None),
+                 ["lltype", "ootype"], cmdline=None,
+                 requires={
+                     "ootype": [("translation.backendopt.raisingop2direct_call", False),
+                                ("translation.backendopt.constfold", False),
+                                ("translation.backendopt.heap2stack", False),
+                                ("translation.backendopt.clever_malloc_removal", False)]
+                     }),
     ChoiceOption("backend", "Backend to use for code generation",
                  ["c", "llvm", "cli", "jvm", "js", "squeak", "cl"],
                  requires={

Modified: pypy/dist/pypy/translator/driver.py
==============================================================================
--- pypy/dist/pypy/translator/driver.py	(original)
+++ pypy/dist/pypy/translator/driver.py	Thu Mar 15 17:01:30 2007
@@ -338,23 +338,7 @@
 
     def task_backendopt_ootype(self):
         from pypy.translator.backendopt.all import backend_optimizations
-        opt = dict(
-            raisingop2direct_call=False,
-            inline=False,
-            mallocs=False,
-            merge_if_blocks=False,
-            constfold=False,
-            heap2stack=False,
-            clever_malloc_removal=False)
-        if self.config.translation.backend == 'cli':
-            opt['merge_if_blocks'] = True
-            opt['inline'] = True
-            opt['mallocs'] = True
-            
-        if self.config.translation.backend == 'jvm':
-            opt['inline'] = True
-            opt['mallocs'] = True
-        backend_optimizations(self.translator, **opt)
+        backend_optimizations(self.translator)
     #
     task_backendopt_ootype = taskdef(task_backendopt_ootype, 
                                         [OOTYPE], "ootype back-end optimisations")



More information about the Pypy-commit mailing list