Author: Richard Plangger <planri...@gmail.com> Branch: Changeset: r85553:316ea0980c19 Date: 2016-07-05 11:55 +0200 http://bitbucket.org/pypy/pypy/changeset/316ea0980c19/
Log: (s390x) apply same changes as in 2269d1d, push/pop gcmap callsites/calls modified/added diff --git a/rpython/jit/backend/zarch/arch.py b/rpython/jit/backend/zarch/arch.py --- a/rpython/jit/backend/zarch/arch.py +++ b/rpython/jit/backend/zarch/arch.py @@ -45,10 +45,7 @@ # +------------------------------+ <- assembler begin # | SAVE CONTEXT | # +------------------------------+ -# +--+| BRANCH (saves addr of pool | -# | | in r13) | -# | +------------------------------+ -# | | ... | +#start| ... | # | | LITERAL POOL | <---+ # | | ... | <-+ | # +-->+------------------------------+ | | diff --git a/rpython/jit/backend/zarch/assembler.py b/rpython/jit/backend/zarch/assembler.py --- a/rpython/jit/backend/zarch/assembler.py +++ b/rpython/jit/backend/zarch/assembler.py @@ -309,11 +309,9 @@ # signature of this _frame_realloc_slowpath function: # * on entry, r0 is the new size - # * on entry, r1 is the gcmap # * no managed register must be modified - ofs2 = self.cpu.get_ofs_of_frame_field('jf_gcmap') - mc.STG(r.SCRATCH, l.addr(ofs2, r.SPP)) + # caller already did push_gcmap(store=True) self._push_core_regs_to_jitframe(mc, r.MANAGED_REGS) self._push_fp_regs_to_jitframe(mc) @@ -347,6 +345,7 @@ mc.load(r.r5, r.r5, 0) mc.store(r.r2, r.r5, -WORD) + self.pop_gcmap(mc) # cancel the push_gcmap(store=True) in the caller self._pop_core_regs_from_jitframe(mc, r.MANAGED_REGS) self._pop_fp_regs_from_jitframe(mc) @@ -411,6 +410,7 @@ reg is not r.r4 and reg is not r.r5 and reg is not r.r11] + # the caller already did push_gcmap(store=True) self._push_core_regs_to_jitframe(mc, regs) if supports_floats: self._push_fp_regs_to_jitframe(mc) @@ -420,6 +420,7 @@ # Finish self._reload_frame_if_necessary(mc) + self.pop_gcmap(mc) # cancel the push_gcmap(store=True) in the caller self._pop_core_regs_from_jitframe(mc, saved_regs) if supports_floats: self._pop_fp_regs_from_jitframe(mc) @@ -449,12 +450,11 @@ mc.store_link() mc.push_std_frame() # - ofs2 = self.cpu.get_ofs_of_frame_field('jf_gcmap') - mc.STG(r.r1, l.addr(ofs2, r.SPP)) saved_regs = [reg for reg in r.MANAGED_REGS if reg is not r.RES and reg is not r.RSZ] self._push_core_regs_to_jitframe(mc, saved_regs) self._push_fp_regs_to_jitframe(mc) + # the caller already did push_gcmap(store=True) # if kind == 'fixed': addr = self.cpu.gc_ll_descr.get_malloc_slowpath_addr() @@ -502,6 +502,7 @@ # r.RSZ is loaded from [r1], to make the caller's store a no-op here mc.load(r.RSZ, r.r1, 0) # + self.pop_gcmap(mc) # push_gcmap(store=True) done by the caller mc.restore_link() mc.BCR(c.ANY, r.r14) self.mc = None @@ -588,7 +589,7 @@ # sum -> (14 bytes) mc.write('\x00'*14) mc.load_imm(r.RETURN, self._frame_realloc_slowpath) - self.load_gcmap(mc, r.r1, gcmap) + self.push_gcmap(mc, gcmap, store=True) mc.raw_call() self.frame_depth_to_patch.append((patch_pos, mc.currpos())) @@ -685,6 +686,8 @@ # name = "Loop # %s: %s" % (looptoken.number, loopname) # self.cpu.profile_agent.native_code_written(name, # rawstart, full_size) + #print(hex(rawstart+looppos)) + #import pdb; pdb.set_trace() return AsmInfo(ops_offset, rawstart + looppos, size_excluding_failure_stuff - looppos, rawstart) @@ -867,6 +870,10 @@ ofs = self.cpu.get_ofs_of_frame_field('jf_gcmap') mc.STG(r.SCRATCH, l.addr(ofs, r.SPP)) + def pop_gcmap(self, mc): + ofs = self.cpu.get_ofs_of_frame_field('jf_gcmap') + mc.LG(r.SCRATCH, l.addr(ofs, r.SPP)) + def break_long_loop(self): # If the loop is too long, the guards in it will jump forward # more than 32 KB. We use an approximate hack to know if we @@ -1339,7 +1346,7 @@ # new value of nursery_free_adr in RSZ and the adr of the new object # in RES. - self.load_gcmap(mc, r.r1, gcmap) + self.push_gcmap(mc, gcmap, store=True) mc.branch_absolute(self.malloc_slowpath) # here r1 holds nursery_free_addr @@ -1375,7 +1382,7 @@ # new value of nursery_free_adr in RSZ and the adr of the new object # in RES. - self.load_gcmap(mc, r.r1, gcmap) + self.push_gcmap(mc, gcmap, store=True) mc.branch_absolute(self.malloc_slowpath) offset = mc.currpos() - fast_jmp_pos @@ -1468,7 +1475,7 @@ pmc.overwrite() # # save the gcmap - self.load_gcmap(mc, r.r1, gcmap) + self.push_gcmap(mc, gcmap, store=True) # # load the function into r14 and jump if kind == rewrite.FLAG_ARRAY: _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit