Skip to content

Commit 6440d15

Browse files
committed
RJIT: Simplify RubyVM::RJIT::Instruction
1 parent cdece5c commit 6440d15

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

tool/ruby_vm/views/lib/ruby_vm/rjit/instruction.rb.erb

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,12 @@
11
module RubyVM::RJIT # :nodoc: all
2-
Instruction = Struct.new(
3-
:name,
4-
:bin,
5-
:len,
6-
:expr,
7-
:declarations,
8-
:preamble,
9-
:opes,
10-
:pops,
11-
:rets,
12-
:always_leaf?,
13-
:leaf_without_check_ints?,
14-
:handles_sp?,
15-
)
2+
Instruction = Data.define(:name, :bin, :len)
163

174
INSNS = {
185
% RubyVM::Instructions.each_with_index do |insn, i|
196
<%= i %> => Instruction.new(
207
name: :<%= insn.name %>,
218
bin: <%= i %>, # BIN(<%= insn.name %>)
229
len: <%= insn.width %>, # insn_len
23-
% unless insn.name.start_with?('trace_')
24-
expr: <<-EXPR,
25-
<%= insn.expr.expr.dump.sub(/\A"/, '').sub(/"\z/, '').gsub(/\\n/, "\n").gsub(/\\t/, ' ' * 8) %>
26-
EXPR
27-
declarations: <%= insn.declarations.inspect %>,
28-
preamble: <%= insn.preamble.map(&:expr).inspect %>,
29-
opes: <%= insn.opes.inspect %>,
30-
pops: <%= insn.pops.inspect %>,
31-
rets: <%= insn.rets.inspect %>,
32-
always_leaf?: <%= insn.always_leaf? %>,
33-
leaf_without_check_ints?: <%= insn.leaf_without_check_ints? %>,
34-
handles_sp?: <%= insn.handles_sp? %>,
35-
% end
3610
),
3711
% end
3812
}

0 commit comments

Comments
 (0)