summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandy Stauner <randy@r4s6.net>2025-11-10 16:16:31 -0700
committerGitHub <noreply@github.com>2025-11-10 23:16:31 +0000
commitf95aa5b2a9d559d6deda1b0aa53aee8198ab3168 (patch)
tree616ad644f2f359f58980357ad2014578063eff81
parentc7f0a9c4cd3ec65a06c6e51252af7a45afa9d358 (diff)
ZJIT: Rename not_optimized_instruction to uncategorized_instruction (#15130)
Make it more obvious that this hasn't been handled and could be broken down more.
-rw-r--r--zjit.rb2
-rw-r--r--zjit/src/codegen.rs2
-rw-r--r--zjit/src/hir.rs14
-rw-r--r--zjit/src/stats.rs8
4 files changed, 13 insertions, 13 deletions
diff --git a/zjit.rb b/zjit.rb
index 29f43acc5b..9728551c3f 100644
--- a/zjit.rb
+++ b/zjit.rb
@@ -162,7 +162,7 @@ class << RubyVM::ZJIT
# Show fallback counters, ordered by the typical amount of fallbacks for the prefix at the time
print_counters_with_prefix(prefix: 'unspecialized_send_def_type_', prompt: 'not optimized method types for send', buf:, stats:, limit: 20)
print_counters_with_prefix(prefix: 'unspecialized_send_without_block_def_type_', prompt: 'not optimized method types for send_without_block', buf:, stats:, limit: 20)
- print_counters_with_prefix(prefix: 'not_optimized_yarv_insn_', prompt: 'not optimized instructions', buf:, stats:, limit: 20)
+ print_counters_with_prefix(prefix: 'uncategorized_fallback_yarv_insn_', prompt: 'instructions with uncategorized fallback reason', buf:, stats:, limit: 20)
print_counters_with_prefix(prefix: 'send_fallback_', prompt: 'send fallback reasons', buf:, stats:, limit: 20)
print_counters_with_prefix(prefix: 'invokeblock_handler_', prompt: 'invokeblock handler', buf:, stats:, limit: 10)
diff --git a/zjit/src/codegen.rs b/zjit/src/codegen.rs
index 58c396ed9b..0fc0b1ce47 100644
--- a/zjit/src/codegen.rs
+++ b/zjit/src/codegen.rs
@@ -1828,7 +1828,7 @@ fn gen_incr_send_fallback_counter(asm: &mut Assembler, reason: SendFallbackReaso
use SendFallbackReason::*;
match reason {
- NotOptimizedInstruction(opcode) => {
+ Uncategorized(opcode) => {
gen_incr_counter_ptr(asm, send_fallback_counter_ptr_for_opcode(opcode));
}
SendWithoutBlockNotOptimizedMethodType(method_type) => {
diff --git a/zjit/src/hir.rs b/zjit/src/hir.rs
index d4053a34e6..85e9bdb00a 100644
--- a/zjit/src/hir.rs
+++ b/zjit/src/hir.rs
@@ -607,7 +607,7 @@ pub enum SendFallbackReason {
ComplexArgPass,
/// Initial fallback reason for every instruction, which should be mutated to
/// a more actionable reason when an attempt to specialize the instruction fails.
- NotOptimizedInstruction(ruby_vminsn_type),
+ Uncategorized(ruby_vminsn_type),
}
/// An instruction in the SSA IR. The output of an instruction is referred to by the index of
@@ -4971,7 +4971,7 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
let args = state.stack_pop_n(argc as usize)?;
let recv = state.stack_pop()?;
- let send = fun.push_insn(block, Insn::SendWithoutBlock { recv, cd, args, state: exit_id, reason: NotOptimizedInstruction(opcode) });
+ let send = fun.push_insn(block, Insn::SendWithoutBlock { recv, cd, args, state: exit_id, reason: Uncategorized(opcode) });
state.stack_push(send);
}
YARVINSN_opt_hash_freeze => {
@@ -5071,7 +5071,7 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
let args = state.stack_pop_n(argc as usize)?;
let recv = state.stack_pop()?;
- let send = fun.push_insn(block, Insn::SendWithoutBlock { recv, cd, args, state: exit_id, reason: NotOptimizedInstruction(opcode) });
+ let send = fun.push_insn(block, Insn::SendWithoutBlock { recv, cd, args, state: exit_id, reason: Uncategorized(opcode) });
state.stack_push(send);
}
YARVINSN_send => {
@@ -5089,7 +5089,7 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
let args = state.stack_pop_n(argc as usize + usize::from(block_arg))?;
let recv = state.stack_pop()?;
- let send = fun.push_insn(block, Insn::Send { recv, cd, blockiseq, args, state: exit_id, reason: NotOptimizedInstruction(opcode) });
+ let send = fun.push_insn(block, Insn::Send { recv, cd, blockiseq, args, state: exit_id, reason: Uncategorized(opcode) });
state.stack_push(send);
if !blockiseq.is_null() {
@@ -5119,7 +5119,7 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
let args = state.stack_pop_n(argc as usize + usize::from(forwarding))?;
let recv = state.stack_pop()?;
- let send_forward = fun.push_insn(block, Insn::SendForward { recv, cd, blockiseq, args, state: exit_id, reason: NotOptimizedInstruction(opcode) });
+ let send_forward = fun.push_insn(block, Insn::SendForward { recv, cd, blockiseq, args, state: exit_id, reason: Uncategorized(opcode) });
state.stack_push(send_forward);
if !blockiseq.is_null() {
@@ -5146,7 +5146,7 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
let args = state.stack_pop_n(argc as usize + usize::from(block_arg))?;
let recv = state.stack_pop()?;
let blockiseq: IseqPtr = get_arg(pc, 1).as_ptr();
- let result = fun.push_insn(block, Insn::InvokeSuper { recv, cd, blockiseq, args, state: exit_id, reason: NotOptimizedInstruction(opcode) });
+ let result = fun.push_insn(block, Insn::InvokeSuper { recv, cd, blockiseq, args, state: exit_id, reason: Uncategorized(opcode) });
state.stack_push(result);
if !blockiseq.is_null() {
@@ -5173,7 +5173,7 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
let argc = unsafe { vm_ci_argc((*cd).ci) };
let block_arg = (flags & VM_CALL_ARGS_BLOCKARG) != 0;
let args = state.stack_pop_n(argc as usize + usize::from(block_arg))?;
- let result = fun.push_insn(block, Insn::InvokeBlock { cd, args, state: exit_id, reason: NotOptimizedInstruction(opcode) });
+ let result = fun.push_insn(block, Insn::InvokeBlock { cd, args, state: exit_id, reason: Uncategorized(opcode) });
state.stack_push(result);
}
YARVINSN_getglobal => {
diff --git a/zjit/src/stats.rs b/zjit/src/stats.rs
index 85e233a43f..3b74cc4533 100644
--- a/zjit/src/stats.rs
+++ b/zjit/src/stats.rs
@@ -186,7 +186,7 @@ make_counters! {
send_fallback_one_or_more_complex_arg_pass,
send_fallback_bmethod_non_iseq_proc,
send_fallback_obj_to_string_not_string,
- send_fallback_not_optimized_instruction,
+ send_fallback_uncategorized,
}
// Optimized send counters that are summed as optimized_send_count
@@ -453,7 +453,7 @@ pub fn send_fallback_counter(reason: crate::hir::SendFallbackReason) -> Counter
SendNotOptimizedMethodType(_) => send_fallback_send_not_optimized_method_type,
CCallWithFrameTooManyArgs => send_fallback_ccall_with_frame_too_many_args,
ObjToStringNotString => send_fallback_obj_to_string_not_string,
- NotOptimizedInstruction(_) => send_fallback_not_optimized_instruction,
+ Uncategorized(_) => send_fallback_uncategorized,
}
}
@@ -621,11 +621,11 @@ pub extern "C" fn rb_zjit_stats(_ec: EcPtr, _self: VALUE, target_key: VALUE) ->
set_stat_usize!(hash, "optimized_send_count", optimized_send_count);
set_stat_usize!(hash, "send_count", dynamic_send_count + optimized_send_count);
- // Set send fallback counters for NotOptimizedInstruction
+ // Set send fallback counters for Uncategorized
let send_fallback_counters = ZJITState::get_send_fallback_counters();
for (op_idx, count) in send_fallback_counters.iter().enumerate().take(VM_INSTRUCTION_SIZE as usize) {
let op_name = insn_name(op_idx);
- let key_string = "not_optimized_yarv_insn_".to_owned() + &op_name;
+ let key_string = "uncategorized_fallback_yarv_insn_".to_owned() + &op_name;
set_stat_usize!(hash, &key_string, *count);
}