mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 14:05:02 +02:00
Rewrite the stub if it's the last code
This commit is contained in:
parent
c3d99d0f12
commit
4b6c738180
5 changed files with 45 additions and 26 deletions
|
@ -37,21 +37,25 @@ module RubyVM::MJIT
|
|||
start_addr
|
||||
end
|
||||
|
||||
def with_addr(addr)
|
||||
old_write_pos = @write_pos
|
||||
def set_write_addr(addr)
|
||||
@write_pos = addr - @mem_block
|
||||
@comments.delete(addr) # TODO: clean up old comments for all overwritten insns?
|
||||
@comments.delete(addr) # TODO: clean up old comments for all the overwritten range?
|
||||
end
|
||||
|
||||
def with_write_addr(addr)
|
||||
old_write_pos = @write_pos
|
||||
set_addr(addr)
|
||||
yield
|
||||
ensure
|
||||
@write_pos = old_write_pos
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def write_addr
|
||||
@mem_block + @write_pos
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def dump_disasm(from, to)
|
||||
C.dump_disasm(from, to).each do |address, mnemonic, op_str|
|
||||
@comments.fetch(address, []).each do |comment|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue