Author: Armin Rigo <ar...@tunes.org> Branch: stmgc-c7 Changeset: r72924:dacc3c52da1f Date: 2014-08-20 12:35 +0200 http://bitbucket.org/pypy/pypy/changeset/dacc3c52da1f/
Log: Don't insert the dummy malloc between the final GUARD_NOT_FORCED_2 and the following FINISH! diff --git a/rpython/jit/backend/llsupport/stmrewrite.py b/rpython/jit/backend/llsupport/stmrewrite.py --- a/rpython/jit/backend/llsupport/stmrewrite.py +++ b/rpython/jit/backend/llsupport/stmrewrite.py @@ -27,6 +27,12 @@ self._do_stm_call('stm_hint_commit_soon', [], None, op.stm_location) return + # ---------- jump, finish, guard_not_forced_2 ---------- + if (opnum == rop.JUMP or opnum == rop.FINISH + or opnum == rop.GUARD_NOT_FORCED_2): + self.add_dummy_allocation() + self.newops.append(op) + return # ---------- pure operations, guards ---------- if op.is_always_pure() or op.is_guard() or op.is_ovf(): self.newops.append(op) @@ -84,11 +90,6 @@ ): self.newops.append(op) return - # ---------- jump, finish ---------- - if opnum == rop.JUMP or opnum == rop.FINISH: - self.add_dummy_allocation() - self.newops.append(op) - return # ---------- fall-back ---------- # Check that none of the ops handled here can collect. # This is not done by the fallback here diff --git a/rpython/jit/backend/llsupport/test/test_stmrewrite.py b/rpython/jit/backend/llsupport/test/test_stmrewrite.py --- a/rpython/jit/backend/llsupport/test/test_stmrewrite.py +++ b/rpython/jit/backend/llsupport/test/test_stmrewrite.py @@ -1322,3 +1322,18 @@ $DUMMYALLOC jump(i1) """) + + def test_dummy_alloc_is_before_guard_not_forced_2(self): + self.check_rewrite(""" + [] + escape() + guard_not_forced_2() [] + finish() + """, """ + [] + $INEV + escape() + $DUMMYALLOC + guard_not_forced_2() [] + finish() + """) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit