mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 14:05:02 +02:00
Implement invalidation after cfunc
This commit is contained in:
parent
494989e87e
commit
aba530e23b
8 changed files with 143 additions and 78 deletions
|
@ -36,6 +36,7 @@ module RubyVM::MJIT
|
|||
@blocks = Hash.new { |h, k| h[k] = [] }
|
||||
@stub_starts = Hash.new { |h, k| h[k] = [] }
|
||||
@stub_ends = Hash.new { |h, k| h[k] = [] }
|
||||
@pos_markers = Hash.new { |h, k| h[k] = [] }
|
||||
end
|
||||
|
||||
def assemble(addr)
|
||||
|
@ -45,6 +46,9 @@ module RubyVM::MJIT
|
|||
|
||||
write_bytes(addr)
|
||||
|
||||
@pos_markers.each do |write_pos, markers|
|
||||
markers.each { |marker| marker.call(addr + write_pos) }
|
||||
end
|
||||
@bytes.size
|
||||
ensure
|
||||
@bytes.clear
|
||||
|
@ -617,6 +621,10 @@ module RubyVM::MJIT
|
|||
@stub_ends[@bytes.size] << stub
|
||||
end
|
||||
|
||||
def pos_marker(&block)
|
||||
@pos_markers[@bytes.size] << block
|
||||
end
|
||||
|
||||
def new_label(name)
|
||||
Label.new(id: @label_id += 1, name:)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue