Commits

Hakan Ardo  committed dacd692

fixed merge error, only insert GUARD_NO_OVERFLOW when needed

  • Participants
  • Parent commits 7ce37a9
  • Branches jit-usable_retrace

Comments (0)

Files changed (2)

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

             fieldvalue  = optheap.getvalue(op.getarg(1))
             self.remember_field_value(structvalue, fieldvalue)
 
-    def get_reconstructed(self, optimizer, valuemap):
+    def get_cloned(self, optimizer, valuemap):
         assert self._lazy_setfield is None
         cf = CachedField()
         for structvalue, fieldvalue in self._cached_fields.iteritems():
-            structvalue2 = structvalue.get_reconstructed(optimizer, valuemap)
-            fieldvalue2  = fieldvalue .get_reconstructed(optimizer, valuemap)
+            structvalue2 = structvalue.get_cloned(optimizer, valuemap)
+            fieldvalue2  = fieldvalue .get_cloned(optimizer, valuemap)
             cf._cached_fields[structvalue2] = fieldvalue2
         return cf
 
             assert 0   # was: new.lazy_setfields = self.lazy_setfields
         
         for descr, d in self.cached_fields.items():
-            new.cached_fields[descr] = d.get_cloneded(optimizer, valuemap)
+            new.cached_fields[descr] = d.get_cloned(optimizer, valuemap)
 
         new.cached_arrayitems = {}
         for descr, d in self.cached_arrayitems.items():

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

         self.boxes_seen_in_short[box] = True
         op = self.optimizer.producer[box]
 
-        ok = False
+        ok = need_ovf_guard = False
         if op.is_always_pure():
             ok = True
         elif op.is_ovf() and op in self.optimizer.overflow_guarded:
             ok = True
+            need_ovf_guard = True
         elif op.has_no_side_effect():
             # FIXME: When are these safe to include? Allow getitems only
             # if they are still in the heap cache?
                 self.produce_box_in_short_preamble(arg)
             if self.short_operations is not None:
                 self.short_operations.append(op)
-                guard = ResOperation(rop.GUARD_NO_OVERFLOW, [], None)
-                self.short_operations.append(guard)
+                if need_ovf_guard:
+                    guard = ResOperation(rop.GUARD_NO_OVERFLOW, [], None)
+                    self.short_operations.append(guard)
         else:
             import pdb; pdb.set_trace()