Author: Armin Rigo <ar...@tunes.org> Branch: guard-compatible Changeset: r85229:9840b5902d7e Date: 2016-06-19 19:14 +0100 http://bitbucket.org/pypy/pypy/changeset/9840b5902d7e/
Log: Blindly port the fix to the other backends diff --git a/rpython/jit/backend/arm/opassembler.py b/rpython/jit/backend/arm/opassembler.py --- a/rpython/jit/backend/arm/opassembler.py +++ b/rpython/jit/backend/arm/opassembler.py @@ -179,7 +179,15 @@ descr = op.getdescr() assert isinstance(descr, AbstractFailDescr) - gcmap = allocate_gcmap(self, frame_depth, JITFRAME_FIXED_SIZE) + if op.getopnum() == rop.GUARD_COMPATIBLE: + # In this case, we might stop at the guard but continue + # running anyway. So we must make sure that the gcmap + # ensures that all gcrefs stay alive. + gcmap = self._regalloc.get_gcmap() + else: + # Common case: get an empty gcmap. It will be filled + # with compute_gcmap() in llsupport.assembler. + gcmap = allocate_gcmap(self, frame_depth, JITFRAME_FIXED_SIZE) faildescrindex = self.get_gcref_from_faildescr(descr) token = ArmGuardToken(self.cpu, gcmap, descr, diff --git a/rpython/jit/backend/ppc/opassembler.py b/rpython/jit/backend/ppc/opassembler.py --- a/rpython/jit/backend/ppc/opassembler.py +++ b/rpython/jit/backend/ppc/opassembler.py @@ -275,7 +275,15 @@ def build_guard_token(self, op, frame_depth, arglocs, fcond): descr = op.getdescr() - gcmap = allocate_gcmap(self, frame_depth, r.JITFRAME_FIXED_SIZE) + if op.getopnum() == rop.GUARD_COMPATIBLE: + # In this case, we might stop at the guard but continue + # running anyway. So we must make sure that the gcmap + # ensures that all gcrefs stay alive. + gcmap = self._regalloc.get_gcmap() + else: + # Common case: get an empty gcmap. It will be filled + # with compute_gcmap() in llsupport.assembler. + gcmap = allocate_gcmap(self, frame_depth, r.JITFRAME_FIXED_SIZE) faildescrindex = self.get_gcref_from_faildescr(descr) token = PPCGuardToken(self.cpu, gcmap, descr, op.getfailargs(), arglocs, op.getopnum(), frame_depth, diff --git a/rpython/jit/backend/zarch/opassembler.py b/rpython/jit/backend/zarch/opassembler.py --- a/rpython/jit/backend/zarch/opassembler.py +++ b/rpython/jit/backend/zarch/opassembler.py @@ -636,7 +636,15 @@ def build_guard_token(self, op, frame_depth, arglocs, fcond): descr = op.getdescr() - gcmap = allocate_gcmap(self, frame_depth, r.JITFRAME_FIXED_SIZE) + if op.getopnum() == rop.GUARD_COMPATIBLE: + # In this case, we might stop at the guard but continue + # running anyway. So we must make sure that the gcmap + # ensures that all gcrefs stay alive. + gcmap = self._regalloc.get_gcmap() + else: + # Common case: get an empty gcmap. It will be filled + # with compute_gcmap() in llsupport.assembler. + gcmap = allocate_gcmap(self, frame_depth, r.JITFRAME_FIXED_SIZE) faildescrindex = self.get_gcref_from_faildescr(descr) token = ZARCHGuardToken(self.cpu, gcmap, descr, op.getfailargs(), arglocs, op.getopnum(), frame_depth, _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit