Author: Maciej Fijalkowski <fij...@gmail.com> Branch: optresult-unroll Changeset: r78282:3e5b0b9e8a58 Date: 2015-06-18 13:58 +0200 http://bitbucket.org/pypy/pypy/changeset/3e5b0b9e8a58/
Log: more passing tests diff --git a/rpython/jit/metainterp/optimizeopt/optimizer.py b/rpython/jit/metainterp/optimizeopt/optimizer.py --- a/rpython/jit/metainterp/optimizeopt/optimizer.py +++ b/rpython/jit/metainterp/optimizeopt/optimizer.py @@ -77,9 +77,9 @@ opinfo.mark_last_guard(self.optimizer) return opinfo - def getptrinfo(self, op, create=False, is_object=False): + def getptrinfo(self, op, is_object=False): if op.type == 'i': - return self.getrawptrinfo(op, create) + return self.getrawptrinfo(op) elif op.type == 'f': return None assert op.type == 'r' @@ -288,7 +288,12 @@ zzz def setinfo_from_preamble(self, op, old_info): - pass # deal with later + if isinstance(old_info, info.PtrInfo): + if op.is_constant(): + return # nothing we can learn + known_class = old_info.get_known_class(self.cpu) + if known_class: + self.make_constant_class(op, known_class, False) def get_box_replacement(self, op): if op is None: diff --git a/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py b/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py --- a/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py +++ b/rpython/jit/metainterp/optimizeopt/test/test_optimizeopt.py @@ -225,14 +225,14 @@ def test_remove_guard_class_2(self): ops = """ [i0] - p0 = new_with_vtable(ConstClass(node_vtable)) + p0 = new_with_vtable(descr=nodesize) escape_n(p0) guard_class(p0, ConstClass(node_vtable)) [] jump(i0) """ expected = """ [i0] - p0 = new_with_vtable(ConstClass(node_vtable)) + p0 = new_with_vtable(descr=nodesize) escape_n(p0) jump(i0) """ diff --git a/rpython/jit/metainterp/optimizeopt/unroll.py b/rpython/jit/metainterp/optimizeopt/unroll.py --- a/rpython/jit/metainterp/optimizeopt/unroll.py +++ b/rpython/jit/metainterp/optimizeopt/unroll.py @@ -38,8 +38,6 @@ imp.import_value(value) def emit_operation(self, op): - if op.returns_bool_result(): - self.bool_boxes[self.getvalue(op)] = None if self.emitting_dissabled: return if op.is_guard(): diff --git a/rpython/jit/metainterp/optimizeopt/virtualstate.py b/rpython/jit/metainterp/optimizeopt/virtualstate.py --- a/rpython/jit/metainterp/optimizeopt/virtualstate.py +++ b/rpython/jit/metainterp/optimizeopt/virtualstate.py @@ -282,8 +282,10 @@ lenbound = None intbound = None - def __init__(self, box, is_opaque=False): + def __init__(self, cpu, ptrinfo, is_opaque=False): self.level = LEVEL_UNKNOWN + if ptrinfo is not None: + self.known_class = ptrinfo.get_known_class(cpu) return xxx self.is_opaque = is_opaque @@ -599,7 +601,11 @@ def visit_not_virtual(self, box): is_opaque = box in self.optimizer.opaque_pointers - return NotVirtualStateInfo(box, is_opaque) + if box.type == 'r': + ptrinfo = self.optimizer.getptrinfo(box) + else: + return self.visit_not_ptr(box, self.optimizer.getintbound(box)) + return NotVirtualStateInfo(self.optimizer.cpu, ptrinfo, is_opaque) def visit_virtual(self, known_class, fielddescrs): return VirtualStateInfo(known_class, fielddescrs) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit