mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Ruby MJIT (#6028)
This commit is contained in:
parent
277498e2a2
commit
3767c6a90d
Notes:
git
2022-09-05 13:54:11 +09:00
Merged-By: k0kubun <takashikkbn@gmail.com>
30 changed files with 3078 additions and 1191 deletions
40
tool/ruby_vm/views/mjit_instruction.rb.erb
Normal file
40
tool/ruby_vm/views/mjit_instruction.rb.erb
Normal file
|
@ -0,0 +1,40 @@
|
|||
module RubyVM::MJIT
|
||||
Instruction = Struct.new(
|
||||
:name,
|
||||
:bin,
|
||||
:len,
|
||||
:expr,
|
||||
:declarations,
|
||||
:preamble,
|
||||
:opes,
|
||||
:pops,
|
||||
:rets,
|
||||
:always_leaf?,
|
||||
:leaf_without_check_ints?,
|
||||
:handles_sp?,
|
||||
)
|
||||
|
||||
INSNS = {
|
||||
% RubyVM::Instructions.each_with_index do |insn, i|
|
||||
% next if insn.name.start_with?('trace_')
|
||||
<%= i %> => Instruction.new(
|
||||
name: :<%= insn.name %>,
|
||||
bin: <%= i %>, # BIN(<%= insn.name %>)
|
||||
len: <%= insn.width %>, # insn_len
|
||||
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
|
||||
}
|
||||
|
||||
private_constant *constants
|
||||
end if RubyVM::MJIT.enabled?
|
Loading…
Add table
Add a link
Reference in a new issue