[pypy-commit] pypy ppc-jit-backend: Use IS_PPC_32 instead of IS_PPC_64.

edelsohn noreply at buildbot.pypy.org
Fri Feb 10 03:03:12 CET 2012


Author: edelsohn
Branch: ppc-jit-backend
Changeset: r52345:d73e22ec0e6a
Date: 2012-02-09 21:02 -0500
http://bitbucket.org/pypy/pypy/changeset/d73e22ec0e6a/

Log:	Use IS_PPC_32 instead of IS_PPC_64.

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
@@ -1086,20 +1086,20 @@
         assert old_nbargs == new_nbargs
         oldadr = oldlooptoken._ppc_func_addr
         target = newlooptoken._ppc_func_addr
-        if IS_PPC_64:
+        if IS_PPC_32:
+            # we overwrite the instructions at the old _ppc_func_addr
+            # to start with a JMP to the new _ppc_func_addr.
+            # Ideally we should rather patch all existing CALLs, but well.
+            mc = PPCBuilder()
+            mc.b_abs(target)
+            mc.copy_to_raw_memory(oldadr)
+        else:
             # PPC64 trampolines are data so overwrite the code address
             # in the function descriptor at the old address
             # (TOC and static chain pointer are the same).
             odata = rffi.cast(rffi.CArrayPtr(lltype.Signed), oldadr)
             tdata = rffi.cast(rffi.CArrayPtr(lltype.Signed), target)
             odata[0] = tdata[0]
-        else:
-            # we overwrite the instructions at the old _ppc_func_addr
-            # to start with a JMP to the new _ppc_func_addr.
-            # Ideally we should rather patch all existing CALLs, but well.
-            mc = PPCBuilder()
-            mc.b_abs(target)
-            mc.copy_to_raw_memory(oldadr)
 
     def emit_guard_call_may_force(self, op, guard_op, arglocs, regalloc):
         ENCODING_AREA = len(r.MANAGED_REGS) * WORD


More information about the pypy-commit mailing list