Author: David Schneider <[email protected]>
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)
 
 
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to