[pypy-svn] r65365 - pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp

antocuni at codespeak.net antocuni at codespeak.net
Sat May 23 18:33:23 CEST 2009


Author: antocuni
Date: Sat May 23 18:33:23 2009
New Revision: 65365

Modified:
   pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/optimize3.py
Log:
(antocuni, after discussion with fijal): move op.clone/spec.new_arguments to
the main optimization loop, as it is something which needs to be done in
general, not only for constant folding. Tests still pass



Modified: pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/optimize3.py
==============================================================================
--- pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/optimize3.py	(original)
+++ pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/optimize3.py	Sat May 23 18:33:23 2009
@@ -83,6 +83,8 @@
                 newop = optimization.handle_op(self, newop)
                 if newop is None:
                     break
+                newop = newop.clone()
+                newop.args = self.new_arguments(op)
             if newop is not None:
                 newoperations.append(newop)
         print "Length of the loop:", len(newoperations)
@@ -132,8 +134,6 @@
 class ConstFold(AbstractOptimization):
 
     def handle_default_op(self, spec, op):
-        op = op.clone()
-        op.args = spec.new_arguments(op)
         if op.is_always_pure():
             for box in op.args:
                 if isinstance(box, Box):



More information about the Pypy-commit mailing list