Commits

bivab  committed e9629f9

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

  • Participants
  • Parent commits 33f2077
  • Branches ppc-jit-backend

Comments (0)

Files changed (1)

File pypy/jit/backend/ppc/ppc_assembler.py

 
     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)
 
 
         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):
         # 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)