[pypy-commit] pypy ppc-jit-backend: Only restore temporary register on paths where it was saved.

edelsohn noreply at buildbot.pypy.org
Wed Apr 18 23:22:01 CEST 2012


Author: edelsohn
Branch: ppc-jit-backend
Changeset: r54511:e645b2e016d6
Date: 2012-04-18 17:21 -0400
http://bitbucket.org/pypy/pypy/changeset/e645b2e016d6/

Log:	Only restore temporary register on paths where it was saved.

diff --git a/pypy/jit/backend/ppc/opassembler.py b/pypy/jit/backend/ppc/opassembler.py
--- a/pypy/jit/backend/ppc/opassembler.py
+++ b/pypy/jit/backend/ppc/opassembler.py
@@ -990,7 +990,7 @@
                 #byteofs
                 s = 3 + descr.jit_wb_card_page_shift
 
-                # use r20 as temporay register, save it in FORCE INDEX slot
+                # use r20 as temporary register, save it in FORCE INDEX slot
                 temp_reg = r.r20
                 ENCODING_AREA = len(r.MANAGED_REGS) * WORD
                 self.mc.store(temp_reg.value, r.SPP.value, ENCODING_AREA)
@@ -1012,15 +1012,15 @@
                 self.mc.stbx(r.SCRATCH.value, loc_base.value, temp_reg.value)
                 # done
 
+                # restore temporary register r20
+                self.mc.load(temp_reg.value, r.SPP.value, ENCODING_AREA)
+
                 # patch the JMP above
                 offset = self.mc.currpos()
                 pmc = OverwritingBuilder(self.mc, jmp_location, 1)
                 pmc.b(offset - jmp_location)
                 pmc.overwrite()
 
-                # restore temporary register r20
-                self.mc.load(temp_reg.value, r.SPP.value, ENCODING_AREA)
-
         # patch the JZ above
         offset = self.mc.currpos() - jz_location
         pmc = OverwritingBuilder(self.mc, jz_location, 1)


More information about the pypy-commit mailing list