aboutsummaryrefslogtreecommitdiffstats
path: root/tool/ruby_vm/models
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2020-09-03 11:08:16 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:22 -0400
commitcec197696f3edcff553373e9597130fde2d1f7be (patch)
tree1a68c70ef9f972829fd59c4b9809e21bdc9a1ee7 /tool/ruby_vm/models
parentb0c3f18ec519d505527e1929e25ec264c831a89e (diff)
downloadruby-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.rb65
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