diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2020-09-03 11:08:16 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:22 -0400 |
commit | cec197696f3edcff553373e9597130fde2d1f7be (patch) | |
tree | 1a68c70ef9f972829fd59c4b9809e21bdc9a1ee7 /tool/ruby_vm/models | |
parent | b0c3f18ec519d505527e1929e25ec264c831a89e (diff) | |
download | ruby-cec197696f3edcff553373e9597130fde2d1f7be.tar.gz |
Add example handler for ujit and scrape it from vm.o
Diffstat (limited to 'tool/ruby_vm/models')
-rw-r--r-- | tool/ruby_vm/models/instructions.rb | 65 |
1 files changed, 64 insertions, 1 deletions
diff --git a/tool/ruby_vm/models/instructions.rb b/tool/ruby_vm/models/instructions.rb index 1198c7a4a6..83dff9c5b0 100644 --- a/tool/ruby_vm/models/instructions.rb +++ b/tool/ruby_vm/models/instructions.rb @@ -14,9 +14,72 @@ require_relative 'bare_instructions' require_relative 'operands_unifications' require_relative 'instructions_unifications' +class RubyVM::UJITExampleInstructions + include RubyVM::CEscape + + attr_reader :name + + def initialize name + @name = name + end + + def pretty_name + return sprintf "%s(...)(...)(...)", @name + end + + def jump_destination + return @orig.name + end + + def bin + return sprintf "BIN(%s)", @name + end + + def width + 1 + end + + def operands_info + "" + end + + def rets + return ['...'] + end + + def pops + return ['...'] + end + + def attributes + return [] + end + + def has_attribute? *; + return false + end + + def handles_sp? + false + end + + def always_leaf? + false + end + + @all_examples = [new('ujit_call_example')] + + def self.to_a + @all_examples + end +end + RubyVM::Instructions = RubyVM::BareInstructions.to_a + \ RubyVM::OperandsUnifications.to_a + \ - RubyVM::InstructionsUnifications.to_a + RubyVM::InstructionsUnifications.to_a + \ + RubyVM::UJITExampleInstructions.to_a + + require_relative 'trace_instructions' RubyVM::Instructions.freeze |