RJIT: Simplify RubyVM::RJIT::Instruction
This commit is contained in:
parent
cdece5cf36
commit
6440d159b3
@ -1,18 +1,5 @@
|
|||||||
module RubyVM::RJIT # :nodoc: all
|
module RubyVM::RJIT # :nodoc: all
|
||||||
Instruction = Struct.new(
|
Instruction = Data.define(:name, :bin, :len)
|
||||||
:name,
|
|
||||||
:bin,
|
|
||||||
:len,
|
|
||||||
:expr,
|
|
||||||
:declarations,
|
|
||||||
:preamble,
|
|
||||||
:opes,
|
|
||||||
:pops,
|
|
||||||
:rets,
|
|
||||||
:always_leaf?,
|
|
||||||
:leaf_without_check_ints?,
|
|
||||||
:handles_sp?,
|
|
||||||
)
|
|
||||||
|
|
||||||
INSNS = {
|
INSNS = {
|
||||||
% RubyVM::Instructions.each_with_index do |insn, i|
|
% RubyVM::Instructions.each_with_index do |insn, i|
|
||||||
@ -20,19 +7,6 @@ module RubyVM::RJIT # :nodoc: all
|
|||||||
name: :<%= insn.name %>,
|
name: :<%= insn.name %>,
|
||||||
bin: <%= i %>, # BIN(<%= insn.name %>)
|
bin: <%= i %>, # BIN(<%= insn.name %>)
|
||||||
len: <%= insn.width %>, # insn_len
|
len: <%= insn.width %>, # insn_len
|
||||||
% unless insn.name.start_with?('trace_')
|
|
||||||
expr: <<-EXPR,
|
|
||||||
<%= insn.expr.expr.dump.sub(/\A"/, '').sub(/"\z/, '').gsub(/\\n/, "\n").gsub(/\\t/, ' ' * 8) %>
|
|
||||||
EXPR
|
|
||||||
declarations: <%= insn.declarations.inspect %>,
|
|
||||||
preamble: <%= insn.preamble.map(&:expr).inspect %>,
|
|
||||||
opes: <%= insn.opes.inspect %>,
|
|
||||||
pops: <%= insn.pops.inspect %>,
|
|
||||||
rets: <%= insn.rets.inspect %>,
|
|
||||||
always_leaf?: <%= insn.always_leaf? %>,
|
|
||||||
leaf_without_check_ints?: <%= insn.leaf_without_check_ints? %>,
|
|
||||||
handles_sp?: <%= insn.handles_sp? %>,
|
|
||||||
% end
|
|
||||||
),
|
),
|
||||||
% end
|
% end
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user