diff options
author | Takashi Kokubun <[email protected]> | 2025-03-03 13:46:53 -0800 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2025-04-18 21:52:59 +0900 |
commit | 0a543daf15e995ad12b0884bf89ea89b6b480dd2 () | |
tree | 8cadafeccd9da51ea8c11014c3b2ab8701848387 /tool | |
parent | 30db473389ca5bb6c68bec72de49330a72a2541c (diff) |
Add zjit_* instructions to profile the interpreter (https://.com/Shopify/zjit/pull/16)
* Add zjit_* instructions to profile the interpreter * Rename FixnumPlus to FixnumAdd * Update a comment about Invalidate * Rename Guard to GuardType * Rename Invalidate to Point * Drop unneeded debug!() * Plan on profiling the types * Use the output of GuardType as type refined outputs
Notes: Merged: https://.com/ruby/ruby/pull/13131
-rw-r--r-- | tool/ruby_vm/models/bare_instructions.rb | 5 | ||||
-rw-r--r-- | tool/ruby_vm/models/instructions.rb | 1 | ||||
-rw-r--r-- | tool/ruby_vm/models/zjit_instructions.rb | 58 | ||||
-rw-r--r-- | tool/ruby_vm/views/_insn_sp_pc_dependency.erb | 27 | ||||
-rw-r--r-- | tool/ruby_vm/views/_zjit_helpers.erb | 14 | ||||
-rw-r--r-- | tool/ruby_vm/views/_zjit_instruction.erb | 8 | ||||
-rw-r--r-- | tool/ruby_vm/views/insns.inc.erb | 5 | ||||
-rw-r--r-- | tool/ruby_vm/views/insns_info.inc.erb | 1 | ||||
-rw-r--r-- | tool/ruby_vm/views/lib/ruby_vm/rjit/instruction.rb.erb | 14 | ||||
-rw-r--r-- | tool/ruby_vm/views/vm.inc.erb | 4 |
10 files changed, 137 insertions, 0 deletions
@@ -148,6 +148,10 @@ class RubyVM::BareInstructions @variables.find { |_, var_info| var_info[:type] == 'CALL_DATA' } end private def check_attribute_consistency @@ -186,6 +190,7 @@ class RubyVM::BareInstructions generate_attribute 'rb_snum_t', 'sp_inc', rets.size - pops.size generate_attribute 'bool', 'handles_sp', default_definition_of_handles_sp generate_attribute 'bool', 'leaf', default_definition_of_leaf end def default_definition_of_handles_sp @@ -17,5 +17,6 @@ RubyVM::Instructions = RubyVM::BareInstructions.to_a + \ RubyVM::OperandsUnifications.to_a + \ RubyVM::InstructionsUnifications.to_a require_relative 'trace_instructions' RubyVM::Instructions.freeze @@ -0,0 +1,58 @@ @@ -0,0 +1,27 @@ @@ -0,0 +1,14 @@ @@ -0,0 +1,8 @@ @@ -12,6 +12,9 @@ edit: __FILE__, } -%> /* BIN : Basic Instruction Name */ #define BIN(n) YARVINSN_##n @@ -24,3 +27,5 @@ enum ruby_vminsn_type { #define ASSERT_VM_INSTRUCTION_SIZE(array) \ STATIC_ASSERT(numberof_##array, numberof(array) == VM_INSTRUCTION_SIZE) @@ -17,5 +17,6 @@ <%= render 'insn_operand_info' %> <%= render 'leaf_helpers' %> <%= render 'sp_inc_helpers' %> <%= render 'attributes' %> <%= render 'comptime_insn_stack_increase' %> @@ -0,0 +1,14 @@ @@ -25,6 +25,10 @@ <%= render 'insn_entry', locals: { insn: insn } -%> % end % % RubyVM::TraceInstructions.to_a.each do |insn| <%= render 'trace_instruction', locals: { insn: insn } -%> % end |