diff options
author | Takashi Kokubun <[email protected]> | 2023-02-09 21:59:27 -0800 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2023-03-05 22:41:35 -0800 |
commit | b05dbe785efedc5e6bf31b59406bb006ab40efe4 (patch) | |
tree | 27f9d965a7dec8d5c8cdd9fa9ede9e4f905d8cec /lib/ruby_vm | |
parent | 9f805530e21f635566fd4800d833f0ed6ccf49ce (diff) |
Delay SP motion a little
Diffstat (limited to 'lib/ruby_vm')
-rw-r--r-- | lib/ruby_vm/mjit/insn_compiler.rb | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/ruby_vm/mjit/insn_compiler.rb b/lib/ruby_vm/mjit/insn_compiler.rb index df1bdeb733..8c60676e49 100644 --- a/lib/ruby_vm/mjit/insn_compiler.rb +++ b/lib/ruby_vm/mjit/insn_compiler.rb @@ -1198,21 +1198,18 @@ module RubyVM::MJIT asm.mov([SP, C.VALUE.size * local_index], Qnil) end + asm.comment('set up EP with managing data') + ep_offset = ctx.sp_offset + local_size + 2 + asm.mov(:rax, cme.to_i) + asm.mov([SP, C.VALUE.size * (ep_offset - 2)], :rax) + asm.mov([SP, C.VALUE.size * (ep_offset - 1)], C.VM_BLOCK_HANDLER_NONE) + asm.mov([SP, C.VALUE.size * (ep_offset - 0)], frame_type) + # This moves SP register. Don't side-exit after this. asm.comment('move SP register to callee stack') sp_offset = ctx.sp_offset + local_size + 3 asm.add(SP, C.VALUE.size * sp_offset) - asm.comment('set cme') - asm.mov(:rax, cme.to_i) - asm.mov([SP, C.VALUE.size * -3], :rax) - - asm.comment('set specval') - asm.mov([SP, C.VALUE.size * -2], C.VM_BLOCK_HANDLER_NONE) - - asm.comment('set frame type') - asm.mov([SP, C.VALUE.size * -1], frame_type) - asm.comment('move CFP register to callee CFP') asm.sub(CFP, C.rb_control_frame_t.size); |