Author: Maciej Fijalkowski <[email protected]>
Branch: optresult
Changeset: r77575:6e7dc2c5e257
Date: 2015-05-26 14:18 +0200
http://bitbucket.org/pypy/pypy/changeset/6e7dc2c5e257/
Log: fix constant aliasing
diff --git a/rpython/jit/metainterp/optimizeopt/heap.py
b/rpython/jit/metainterp/optimizeopt/heap.py
--- a/rpython/jit/metainterp/optimizeopt/heap.py
+++ b/rpython/jit/metainterp/optimizeopt/heap.py
@@ -52,8 +52,8 @@
# the same or a different structure at runtime.
# XXX constants?
return (self._lazy_setfield is not None
- and (optheap.getptrinfo(self._lazy_setfield.getarg(0))
- is not opinfo))
+ and (not optheap.getptrinfo(
+ self._lazy_setfield.getarg(0)).same_info(opinfo)))
def do_setfield(self, optheap, op):
# Update the state with the SETFIELD_GC/SETARRAYITEM_GC operation 'op'.
diff --git a/rpython/jit/metainterp/optimizeopt/info.py
b/rpython/jit/metainterp/optimizeopt/info.py
--- a/rpython/jit/metainterp/optimizeopt/info.py
+++ b/rpython/jit/metainterp/optimizeopt/info.py
@@ -46,6 +46,9 @@
return INFO_NONNULL
return INFO_UNKNOWN
+ def same_info(self, other):
+ return self is other
+
class NonNullPtrInfo(PtrInfo):
_attrs_ = ('last_guard_pos',)
@@ -310,6 +313,11 @@
return None
return cpu.ts.cls_of_box(self._const)
+ def same_info(self, other):
+ if not isinstance(other, ConstPtrInfo):
+ return False
+ return self._const.same_constant(other._const)
+
def get_last_guard(self, optimizer):
return None
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit