diff options
author | Takashi Kokubun <[email protected]> | 2023-02-07 11:55:07 -0800 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2023-03-05 22:11:20 -0800 |
commit | d415f1e3178625fa90ab908dcc5636b7e2e21c16 (patch) | |
tree | d33bd2749690ea9de132eac7a1a4e8c72e7c0e9c /lib/ruby_vm/mjit/compiler.rb | |
parent | 47e2ea3a800dae6ac4d427ad9524a7d61dd992ee (diff) |
Get rid of BlockStub
Diffstat (limited to 'lib/ruby_vm/mjit/compiler.rb')
-rw-r--r-- | lib/ruby_vm/mjit/compiler.rb | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/lib/ruby_vm/mjit/compiler.rb b/lib/ruby_vm/mjit/compiler.rb index 0ad289c063..26e3d75d34 100644 --- a/lib/ruby_vm/mjit/compiler.rb +++ b/lib/ruby_vm/mjit/compiler.rb @@ -1,6 +1,5 @@ require 'ruby_vm/mjit/assembler' require 'ruby_vm/mjit/block' -require 'ruby_vm/mjit/block_stub' require 'ruby_vm/mjit/branch_stub' require 'ruby_vm/mjit/code_block' require 'ruby_vm/mjit/context' @@ -68,37 +67,6 @@ module RubyVM::MJIT $stderr.puts e.full_message # TODO: check verbose end - # Continue compilation from a block stub. - # @param block_stub [RubyVM::MJIT::BlockStub] - # @param cfp `RubyVM::MJIT::CPointer::Struct_rb_control_frame_t` - # @return [Integer] The starting address of the compiled block stub - def block_stub_hit(block_stub, cfp) - # Update cfp->pc for `jit.at_current_insn?` - cfp.pc = block_stub.pc - - # Prepare the jump target - jit = JITState.new(iseq: block_stub.iseq, cfp:) - new_asm = Assembler.new.tap do |asm| - compile_block(asm, jit:, pc: block_stub.pc, ctx: block_stub.ctx) - end - - # Rewrite the block stub - if @cb.write_addr == block_stub.end_addr - # If the block stub's jump is the last code, overwrite the jump with the new code. - @cb.set_write_addr(block_stub.start_addr) - @cb.write(new_asm) - else - # If the block stub's jump is old code, change the jump target to the new code. - new_addr = @cb.write(new_asm) - @cb.with_write_addr(block_stub.start_addr) do - asm = Assembler.new - block_stub.change_block.call(asm, new_addr) - @cb.write(asm) - end - new_addr - end - end - # Compile a branch stub. # @param branch_stub [RubyVM::MJIT::BranchStub] # @param cfp `RubyVM::MJIT::CPointer::Struct_rb_control_frame_t` |