diff options
author | Hakan Ardo <hakan@debian.org> | 2011-11-03 07:34:36 +0100 |
---|---|---|
committer | Hakan Ardo <hakan@debian.org> | 2011-11-03 07:34:36 +0100 |
commit | 23aa69e8b820f78fea3dce5202cea8650eaf2f6e (patch) | |
tree | 6aaf0f63f38b3e8eb13a4450931a30a50f4a977a /pypy/jit/metainterp/optimizeopt/optimizer.py | |
parent | don't use the JIT strslice optimization if some of the characters are in an u... (diff) | |
download | pypy-23aa69e8b820f78fea3dce5202cea8650eaf2f6e.tar.gz pypy-23aa69e8b820f78fea3dce5202cea8650eaf2f6e.tar.bz2 pypy-23aa69e8b820f78fea3dce5202cea8650eaf2f6e.zip |
interning ints aswell
Diffstat (limited to 'pypy/jit/metainterp/optimizeopt/optimizer.py')
-rw-r--r-- | pypy/jit/metainterp/optimizeopt/optimizer.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pypy/jit/metainterp/optimizeopt/optimizer.py b/pypy/jit/metainterp/optimizeopt/optimizer.py index 917c9315aa..56c7f7da3c 100644 --- a/pypy/jit/metainterp/optimizeopt/optimizer.py +++ b/pypy/jit/metainterp/optimizeopt/optimizer.py @@ -1,6 +1,6 @@ from pypy.jit.metainterp import jitprof, resume, compile from pypy.jit.metainterp.executor import execute_nonspec -from pypy.jit.metainterp.history import BoxInt, BoxFloat, Const, ConstInt, REF +from pypy.jit.metainterp.history import BoxInt, BoxFloat, Const, ConstInt, REF, INT from pypy.jit.metainterp.optimizeopt.intutils import IntBound, IntUnbounded, \ ImmutableIntUnbounded, \ IntLowerBound, MININT, MAXINT @@ -326,6 +326,7 @@ class Optimizer(Optimization): self.bridge = bridge self.values = {} self.interned_refs = self.cpu.ts.new_ref_dict() + self.interned_ints = {} self.resumedata_memo = resume.ResumeDataLoopMemo(metainterp_sd) self.bool_boxes = {} self.producer = {} @@ -398,6 +399,9 @@ class Optimizer(Optimization): if not value: return box return self.interned_refs.setdefault(value, box) + elif constbox.type == INT: + value = constbox.getint() + return self.interned_ints.setdefault(value, box) else: return box |