mirror of
https://github.com/ruby/ruby.git
synced 2025-08-26 14:34:39 +02:00
Implement asm comments
This commit is contained in:
parent
652d63789f
commit
4fe5efbf7f
5 changed files with 36 additions and 7 deletions
|
@ -10,10 +10,13 @@ module RubyVM::MJIT
|
|||
# REX = 0100WR0B
|
||||
REX_W = 0b01001000
|
||||
|
||||
attr_reader :comments
|
||||
|
||||
def initialize
|
||||
@bytes = []
|
||||
@label_id = 0
|
||||
@labels = {}
|
||||
@label_id = 0
|
||||
@comments = Hash.new { |h, k| h[k] = [] }
|
||||
end
|
||||
|
||||
def compile(addr)
|
||||
|
@ -173,6 +176,10 @@ module RubyVM::MJIT
|
|||
end
|
||||
end
|
||||
|
||||
def comment(message)
|
||||
@comments[@bytes.size] << message
|
||||
end
|
||||
|
||||
def new_label(name)
|
||||
Label.new(id: @label_id += 1, name:)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue