Author: Maciej Fijalkowski <fij...@gmail.com> Branch: Changeset: r67520:b741f795474c Date: 2013-10-22 20:45 +0200 http://bitbucket.org/pypy/pypy/changeset/b741f795474c/
Log: Don't reset virtuals on call_assembler diff --git a/rpython/jit/metainterp/heapcache.py b/rpython/jit/metainterp/heapcache.py --- a/rpython/jit/metainterp/heapcache.py +++ b/rpython/jit/metainterp/heapcache.py @@ -6,7 +6,7 @@ def __init__(self): self.reset() - def reset(self): + def reset(self, reset_virtuals=True): # contains boxes where the class is already known self.known_class_boxes = {} # store the boxes that contain newly allocated objects, this maps the @@ -14,7 +14,8 @@ # escaped the trace or not (True means the box never escaped, False # means it did escape), its presences in the mapping shows that it was # allocated inside the trace - self.new_boxes = {} + if reset_virtuals: + self.new_boxes = {} # Tracks which boxes should be marked as escaped when the key box # escapes. self.dependencies = {} diff --git a/rpython/jit/metainterp/pyjitpl.py b/rpython/jit/metainterp/pyjitpl.py --- a/rpython/jit/metainterp/pyjitpl.py +++ b/rpython/jit/metainterp/pyjitpl.py @@ -2058,7 +2058,7 @@ duplicates[box] = None def reached_loop_header(self, greenboxes, redboxes, resumedescr): - self.heapcache.reset() + self.heapcache.reset(reset_virtuals=False) duplicates = {} self.remove_consts_and_duplicates(redboxes, len(redboxes), diff --git a/rpython/jit/metainterp/test/test_ajit.py b/rpython/jit/metainterp/test/test_ajit.py --- a/rpython/jit/metainterp/test/test_ajit.py +++ b/rpython/jit/metainterp/test/test_ajit.py @@ -3359,6 +3359,26 @@ assert res == main(1) self.check_resops(call=0, getfield_gc=0) + def test_isvirtual_call_assembler(self): + driver = JitDriver(greens = ['code'], reds = ['n']) + + @look_inside_iff(lambda t1, t2: isvirtual(t1)) + def g(t1, t2): + return t1[0] == t2[0] + + def f(code, n): + while n > 0: + driver.can_enter_jit(code=code, n=n) + driver.jit_merge_point(code=code, n=n) + t = (1, 2, n) + if code: + f(0, 3) + g(t, (1, 2, n)) + n -= 1 + + self.meta_interp(f, [1, 10], inline=True) + self.check_resops(call=0, call_may_force=0, call_assembler=2) + def test_reuse_elidable_result(self): driver = JitDriver(reds=['n', 's'], greens = []) def main(n): _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit