summaryrefslogtreecommitdiff
path: root/tool/ruby_vm/views/lib/ruby_vm/rjit/instruction.rb.erb
diff options
context:
space:
mode:
Diffstat (limited to 'tool/ruby_vm/views/lib/ruby_vm/rjit/instruction.rb.erb')
-rw-r--r--tool/ruby_vm/views/lib/ruby_vm/rjit/instruction.rb.erb14
1 files changed, 14 insertions, 0 deletions
diff --git a/tool/ruby_vm/views/lib/ruby_vm/rjit/instruction.rb.erb b/tool/ruby_vm/views/lib/ruby_vm/rjit/instruction.rb.erb
new file mode 100644
index 0000000000..4f08524a77
--- /dev/null
+++ b/tool/ruby_vm/views/lib/ruby_vm/rjit/instruction.rb.erb
@@ -0,0 +1,14 @@
+module RubyVM::RJIT # :nodoc: all
+ Instruction = Data.define(:name, :bin, :len, :operands)
+
+ INSNS = {
+% RubyVM::Instructions.each_with_index do |insn, i|
+ <%= i %> => Instruction.new(
+ name: :<%= insn.name %>,
+ bin: <%= i %>, # BIN(<%= insn.name %>)
+ len: <%= insn.width %>, # insn_len
+ operands: <%= (insn.operands unless insn.name.start_with?('trace_')).inspect %>,
+ ),
+% end
+ }
+end