[pypy-commit] pypy ppc-jit-backend: (edelsohn, bivab) fix jump conditions in malloc_cond and cond_call_gc_wb to jump on equality

bivab noreply at buildbot.pypy.org
Thu Feb 23 10:46:56 CET 2012


Author: David Schneider <david.schneider at picle.org>
Branch: ppc-jit-backend
Changeset: r52794:6af6f2607858
Date: 2012-02-23 01:45 -0800
http://bitbucket.org/pypy/pypy/changeset/6af6f2607858/

Log:	(edelsohn, bivab) fix jump conditions in malloc_cond and
	cond_call_gc_wb to jump on equality

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
@@ -938,7 +938,7 @@
         # patch the JZ above
         offset = self.mc.currpos() - jz_location
         pmc = OverwritingBuilder(self.mc, jz_location, 1)
-        pmc.bc(4, 2, offset) # jump if the two values are equal
+        pmc.bc(12, 2, offset) # jump if the two values are equal
         pmc.overwrite()
 
     emit_cond_call_gc_wb_array = emit_cond_call_gc_wb
diff --git a/pypy/jit/backend/ppc/ppc_assembler.py b/pypy/jit/backend/ppc/ppc_assembler.py
--- a/pypy/jit/backend/ppc/ppc_assembler.py
+++ b/pypy/jit/backend/ppc/ppc_assembler.py
@@ -343,8 +343,12 @@
         # if r3 == 0 we skip the return above and jump to the exception path
         offset = mc.currpos() - jmp_pos
         pmc = OverwritingBuilder(mc, jmp_pos, 1)
-        pmc.bc(4, 2, offset) 
+        pmc.bc(12, 2, offset) 
         pmc.overwrite()
+        # restore the frame before leaving
+        mc.load(r.SCRATCH.value, r.SP.value, frame_size + ofs) 
+        mc.mtlr(r.SCRATCH.value)
+        mc.addi(r.SP.value, r.SP.value, frame_size)
         mc.b_abs(self.propagate_exception_path)
 
 


More information about the pypy-commit mailing list