[pypy-commit] pypy ppc-jit-backend: (edelsohn, bivab): make the call to malloc_slowpath use the raw address using an "internal" ABI to avoid overhead and overriding R11 -.-

bivab noreply at buildbot.pypy.org
Fri Jul 13 15:47:55 CEST 2012


Author: bivab
Branch: ppc-jit-backend
Changeset: r56067:e9629f971c3d
Date: 2012-07-13 06:43 -0700
http://bitbucket.org/pypy/pypy/changeset/e9629f971c3d/

Log:	(edelsohn, bivab): make the call to malloc_slowpath use the raw
	address using an "internal" ABI to avoid overhead and overriding R11
	-.-

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
@@ -326,9 +326,6 @@
 
     def _build_malloc_slowpath(self):
         mc = PPCBuilder()
-        if IS_PPC_64:
-            for _ in range(6):
-                mc.write32(0)
         frame_size = (len(r.MANAGED_FP_REGS) * WORD
                     + (BACKCHAIN_SIZE + MAX_REG_PARAMS) * WORD)
 
@@ -385,8 +382,8 @@
 
         mc.prepare_insts_blocks()
         rawstart = mc.materialize(self.cpu.asmmemmgr, [])
-        if IS_PPC_64:
-            self.write_64_bit_func_descr(rawstart, rawstart+3*WORD)
+        # here we do not need a function descr. This is being only called using
+        # an internal ABI
         self.malloc_slowpath = rawstart
 
     def _build_stack_check_slowpath(self):
@@ -1351,7 +1348,9 @@
         # r3.
         self.mark_gc_roots(self.write_new_force_index(),
                            use_copy_area=True)
-        self.mc.call(self.malloc_slowpath)
+        # We are jumping to malloc_slowpath without a call through a function
+        # descriptor, because it is an internal call and "call" would trash r11
+        self.mc.bl_abs(self.malloc_slowpath)
 
         offset = self.mc.currpos() - fast_jmp_pos
         pmc = OverwritingBuilder(self.mc, fast_jmp_pos, 1)


More information about the pypy-commit mailing list