def redirect_call_assembler(self, oldlooptoken, newlooptoken): # some minimal sanity checking old_nbargs = oldlooptoken.compiled_loop_token._debug_nbargs new_nbargs = newlooptoken.compiled_loop_token._debug_nbargs assert old_nbargs == new_nbargs oldadr = oldlooptoken._ll_function_addr target = newlooptoken._ll_function_addr # copy frame-info data baseofs = self.cpu.get_baseofs_of_frame_field() newlooptoken.compiled_loop_token.update_frame_info( oldlooptoken.compiled_loop_token, baseofs) # we overwrite the instructions at the old _ll_function_addr # to start with a JMP to the new _ll_function_addr. mc = InstrBuilder() mc.load_imm(r.SCRATCH, target) mc.BCR(c.ANY, r.SCRATCH) mc.copy_to_raw_memory(oldadr)
def make_function_returning_stack_pointer(self): mc = InstrBuilder() mc.LGR(r.r2, r.SP) mc.BCR(c.ANY, r.r14) return rffi.cast(lltype.Signed, mc.get_assembler_function())