[pypy-commit] pypy jit-short_from_state: dont generalize constants

hakanardo noreply at buildbot.pypy.org
Sun Jul 24 17:23:02 CEST 2011


Author: Hakan Ardo <hakan at debian.org>
Branch: jit-short_from_state
Changeset: r45940:1782e7a6c50a
Date: 2011-07-22 14:41 +0200
http://bitbucket.org/pypy/pypy/changeset/1782e7a6c50a/

Log:	dont generalize constants

diff --git a/pypy/jit/metainterp/optimizeopt/generalize.py b/pypy/jit/metainterp/optimizeopt/generalize.py
--- a/pypy/jit/metainterp/optimizeopt/generalize.py
+++ b/pypy/jit/metainterp/optimizeopt/generalize.py
@@ -10,6 +10,8 @@
 class KillHugeIntBounds(GeneralizationStrategy):
     def apply(self):
         for v in self.optimizer.values.values():
+            if v.is_constant():
+                continue
             if v.intbound.lower < MININT/2:
                 v.intbound.lower = MININT
             if v.intbound.upper > MAXINT/2:
diff --git a/pypy/jit/metainterp/optimizeopt/optimizer.py b/pypy/jit/metainterp/optimizeopt/optimizer.py
--- a/pypy/jit/metainterp/optimizeopt/optimizer.py
+++ b/pypy/jit/metainterp/optimizeopt/optimizer.py
@@ -155,6 +155,7 @@
         assert isinstance(constbox, Const)
         self.box = constbox
         self.level = LEVEL_CONSTANT
+        
         if isinstance(constbox, ConstInt):
             val = constbox.getint()
             self.intbound = IntBound(val, val)


More information about the pypy-commit mailing list