diff options
author | Takashi Kokubun <[email protected]> | 2023-04-02 15:26:46 -0700 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2023-04-02 15:27:40 -0700 |
commit | 6002b12611c3cee921fc8aef76b55db4b2d0fbcd (patch) | |
tree | d1dc5f8749239a5c35ef42eacbb812e3f8eb40f1 /lib/ruby_vm/rjit/exit_compiler.rb | |
parent | 4fc336127e54dde8a744acdb5157c17e7ae857d3 (diff) |
RJIT: Support entry with different PCs
Diffstat (limited to 'lib/ruby_vm/rjit/exit_compiler.rb')
-rw-r--r-- | lib/ruby_vm/rjit/exit_compiler.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/ruby_vm/rjit/exit_compiler.rb b/lib/ruby_vm/rjit/exit_compiler.rb index b7beb22177..1ced2141a4 100644 --- a/lib/ruby_vm/rjit/exit_compiler.rb +++ b/lib/ruby_vm/rjit/exit_compiler.rb @@ -78,6 +78,18 @@ module RubyVM::RJIT asm.ret end + # @param asm [RubyVM::RJIT::Assembler] + # @param entry_stub [RubyVM::RJIT::EntryStub] + def compile_entry_stub(asm, entry_stub) + # Call rb_rjit_entry_stub_hit + asm.comment('entry stub hit') + asm.mov(C_ARGS[0], to_value(entry_stub)) + asm.call(C.rb_rjit_entry_stub_hit) + + # Jump to the address returned by rb_rjit_entry_stub_hit + asm.jmp(:rax) + end + # @param ctx [RubyVM::RJIT::Context] # @param asm [RubyVM::RJIT::Assembler] # @param branch_stub [RubyVM::RJIT::BranchStub] @@ -93,7 +105,7 @@ module RubyVM::RJIT asm.mov(:edx, target0_p ? 1 : 0) asm.call(C.rb_rjit_branch_stub_hit) - # Jump to the address returned by rb_rjit_stub_hit + # Jump to the address returned by rb_rjit_branch_stub_hit asm.jmp(:rax) end |