Commits

Hakan Ardo committed d0466de

interning ints aswell

  • Participants
  • Parent commits 3150cc4

Comments (0)

Files changed (1)

File pypy/jit/metainterp/optimizeopt/optimizer.py

 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
         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 = {}
             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