summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2026-02-13 13:30:39 -0800
committerGitHub <noreply@github.com>2026-02-13 16:30:39 -0500
commit93e68cacc8dde243d8ece47ee73206e0ca334705 (patch)
tree8275f17c03d2ed5b36f9ab1ad4f35fafa6498154
parentbf1ac3f4af16edb613b6795a4af253e9d551bd2c (diff)
ZJIT: unify `hir::Insn::{Send,SendWithoutBlock}` (GH-16143)
After GH-15911, we largely apply the same treatment to these two variants everywhere. In `type_specialize`, there are two ~100 LOC match arms that shared 90% of the code. Unifying these allowed the code to be shared more easily. --- **Note:** In the interest of preserving existing semantics and keeping the diff small for this initial PR, `YARVINSN_send` can currently produce: ```rs Insn::Send { blockiseq: Some(null_ptr), .. } ``` Either way, that can be done in a follow-up PR. --- Follow-up tasks: 1. Unify `reduce_send_to_ccall`/`reduce_send_without_block_to_ccall` 2. Address the `Some(null_ptr)` situation above (discussed on PR) 3. Rename/merge the stats/counters/fallback reasons, if desired Partially addresses Shopify/ruby#941 (TODO: `optimize_c_calls`) [alan: rewrote commit message] Reviewed-by: Alan Wu <XrXr@users.noreply.github.com>
-rw-r--r--zjit/src/codegen.rs4
-rw-r--r--zjit/src/cruby.rs16
-rw-r--r--zjit/src/cruby_methods.rs2
-rw-r--r--zjit/src/hir.rs216
-rw-r--r--zjit/src/hir/opt_tests.rs119
-rw-r--r--zjit/src/hir/tests.rs112
6 files changed, 197 insertions, 272 deletions
diff --git a/zjit/src/codegen.rs b/zjit/src/codegen.rs
index c11610e26c..845f7e6eef 100644
--- a/zjit/src/codegen.rs
+++ b/zjit/src/codegen.rs
@@ -482,10 +482,10 @@ fn gen_insn(cb: &mut CodeBlock, jit: &mut JITState, asm: &mut Assembler, functio
Insn::ToRegexp { opt, values, state } => gen_toregexp(jit, asm, *opt, opnds!(values), &function.frame_state(*state)),
Insn::Param => unreachable!("block.insns should not have Insn::Param"),
Insn::Snapshot { .. } => return Ok(()), // we don't need to do anything for this instruction at the moment
- &Insn::Send { cd, blockiseq, state, reason, .. } => gen_send(jit, asm, cd, blockiseq, &function.frame_state(state), reason),
+ &Insn::Send { cd, blockiseq: None, state, reason, .. } => gen_send_without_block(jit, asm, cd, &function.frame_state(state), reason),
+ &Insn::Send { cd, blockiseq: Some(blockiseq), state, reason, .. } => gen_send(jit, asm, cd, blockiseq, &function.frame_state(state), reason),
&Insn::SendForward { cd, blockiseq, state, reason, .. } => gen_send_forward(jit, asm, cd, blockiseq, &function.frame_state(state), reason),
Insn::SendDirect { cme, iseq, recv, args, kw_bits, blockiseq, state, .. } => gen_send_iseq_direct(cb, jit, asm, *cme, *iseq, opnd!(recv), opnds!(args), *kw_bits, &function.frame_state(*state), *blockiseq),
- &Insn::SendWithoutBlock { cd, state, reason, .. } => gen_send_without_block(jit, asm, cd, &function.frame_state(state), reason),
&Insn::InvokeSuper { cd, blockiseq, state, reason, .. } => gen_invokesuper(jit, asm, cd, blockiseq, &function.frame_state(state), reason),
&Insn::InvokeSuperForward { cd, blockiseq, state, reason, .. } => gen_invokesuperforward(jit, asm, cd, blockiseq, &function.frame_state(state), reason),
&Insn::InvokeBlock { cd, state, reason, .. } => gen_invokeblock(jit, asm, cd, &function.frame_state(state), reason),
diff --git a/zjit/src/cruby.rs b/zjit/src/cruby.rs
index a47d9bf61f..0eb47062c9 100644
--- a/zjit/src/cruby.rs
+++ b/zjit/src/cruby.rs
@@ -1197,6 +1197,15 @@ pub mod test_utils {
})
}
+ /// Evaluate a given Ruby program with compile options
+ pub fn eval_with_options(program: &str, options_expr: &str) -> VALUE {
+ with_rubyvm(|| {
+ let options = eval(options_expr);
+ let wrapped_iseq = compile_to_wrapped_iseq_with_options(&unindent(program, false), options);
+ unsafe { rb_funcallv(wrapped_iseq, ID!(eval), 0, null()) }
+ })
+ }
+
/// Get the #inspect of a given Ruby program in Rust string
pub fn inspect(program: &str) -> String {
let inspect = format!("({program}).inspect");
@@ -1252,10 +1261,15 @@ pub mod test_utils {
/// Compile a program into a RubyVM::InstructionSequence object
fn compile_to_wrapped_iseq(program: &str) -> VALUE {
+ compile_to_wrapped_iseq_with_options(program, Qnil)
+ }
+
+ fn compile_to_wrapped_iseq_with_options(program: &str, options: VALUE) -> VALUE {
let bytes = program.as_bytes().as_ptr() as *const c_char;
unsafe {
let program_str = rb_utf8_str_new(bytes, program.len().try_into().unwrap());
- rb_funcallv(rb_cISeq, ID!(compile), 1, &program_str)
+ let args = [program_str, Qnil, Qnil, VALUE(1_usize.wrapping_shl(1) | 1), options];
+ rb_funcallv(rb_cISeq, ID!(compile), args.len() as c_int, args.as_ptr())
}
}
diff --git a/zjit/src/cruby_methods.rs b/zjit/src/cruby_methods.rs
index 56ff3ca1aa..f44c33845c 100644
--- a/zjit/src/cruby_methods.rs
+++ b/zjit/src/cruby_methods.rs
@@ -322,7 +322,7 @@ fn inline_thread_current(fun: &mut hir::Function, block: hir::BlockId, _recv: hi
fn inline_kernel_itself(_fun: &mut hir::Function, _block: hir::BlockId, recv: hir::InsnId, args: &[hir::InsnId], _state: hir::InsnId) -> Option<hir::InsnId> {
if args.is_empty() {
- // No need to coerce the receiver; that is done by the SendWithoutBlock rewriting.
+ // No need to coerce the receiver; that is done by the Send rewriting.
return Some(recv);
}
None
diff --git a/zjit/src/hir.rs b/zjit/src/hir.rs
index 579c327d44..1888d00a98 100644
--- a/zjit/src/hir.rs
+++ b/zjit/src/hir.rs
@@ -884,7 +884,7 @@ pub enum Insn {
/// Call a C function that pushes a frame
CCallWithFrame {
- cd: *const rb_call_data, // cd for falling back to SendWithoutBlock
+ cd: *const rb_call_data, // cd for falling back to Send
cfunc: *const u8,
recv: InsnId,
args: Vec<InsnId>,
@@ -912,17 +912,10 @@ pub enum Insn {
/// Un-optimized fallback implementation (dynamic dispatch) for send-ish instructions
/// Ignoring keyword arguments etc for now
- SendWithoutBlock {
- recv: InsnId,
- cd: *const rb_call_data,
- args: Vec<InsnId>,
- state: InsnId,
- reason: SendFallbackReason,
- },
Send {
recv: InsnId,
cd: *const rb_call_data,
- blockiseq: IseqPtr,
+ blockiseq: Option<IseqPtr>,
args: Vec<InsnId>,
state: InsnId,
reason: SendFallbackReason,
@@ -1012,7 +1005,7 @@ pub enum Insn {
FixnumLShift { left: InsnId, right: InsnId, state: InsnId },
FixnumRShift { left: InsnId, right: InsnId },
- // Distinct from `SendWithoutBlock` with `mid:to_s` because does not have a patch point for String to_s being redefined
+ // Distinct from `Send` with `mid:to_s` because does not have a patch point for String to_s being redefined
ObjToString { val: InsnId, cd: *const rb_call_data, state: InsnId },
AnyToString { val: InsnId, str: InsnId, state: InsnId },
@@ -1187,7 +1180,6 @@ impl Insn {
}
},
Insn::CCallVariadic { .. } => effects::Any,
- Insn::SendWithoutBlock { .. } => effects::Any,
Insn::Send { .. } => effects::Any,
Insn::SendForward { .. } => effects::Any,
Insn::InvokeSuper { .. } => effects::Any,
@@ -1449,14 +1441,6 @@ impl<'a> std::fmt::Display for InsnPrinter<'a> {
Insn::Jump(target) => { write!(f, "Jump {target}") }
Insn::IfTrue { val, target } => { write!(f, "IfTrue {val}, {target}") }
Insn::IfFalse { val, target } => { write!(f, "IfFalse {val}, {target}") }
- Insn::SendWithoutBlock { recv, cd, args, reason, .. } => {
- write!(f, "SendWithoutBlock {recv}, :{}", ruby_call_method_name(*cd))?;
- for arg in args {
- write!(f, ", {arg}")?;
- }
- write!(f, " # SendFallbackReason: {reason}")?;
- Ok(())
- }
Insn::SendDirect { recv, cd, iseq, args, blockiseq, .. } => {
write!(f, "SendDirect {recv}, {:p}, :{} ({:?})", self.ptr_map.map_ptr(blockiseq), ruby_call_method_name(*cd), self.ptr_map.map_ptr(iseq))?;
for arg in args {
@@ -1468,7 +1452,11 @@ impl<'a> std::fmt::Display for InsnPrinter<'a> {
// For tests, we want to check HIR snippets textually. Addresses change
// between runs, making tests fail. Instead, pick an arbitrary hex value to
// use as a "pointer" so we can check the rest of the HIR.
- write!(f, "Send {recv}, {:p}, :{}", self.ptr_map.map_ptr(blockiseq), ruby_call_method_name(*cd))?;
+ if let Some(blockiseq) = *blockiseq {
+ write!(f, "Send {recv}, {:p}, :{}", self.ptr_map.map_ptr(blockiseq), ruby_call_method_name(*cd))?;
+ } else {
+ write!(f, "Send {recv}, :{}", ruby_call_method_name(*cd))?;
+ }
for arg in args {
write!(f, ", {arg}")?;
}
@@ -2275,13 +2263,6 @@ impl Function {
str: find!(str),
state,
},
- &SendWithoutBlock { recv, cd, ref args, state, reason } => SendWithoutBlock {
- recv: find!(recv),
- cd,
- args: find_vec!(args),
- state,
- reason,
- },
&SendDirect { recv, cd, cme, iseq, ref args, kw_bits, blockiseq, state } => SendDirect {
recv: find!(recv),
cd,
@@ -2402,7 +2383,6 @@ impl Function {
match self.insns.get_mut(insn_id.0).unwrap() {
Send { reason, .. }
| SendForward { reason, .. }
- | SendWithoutBlock { reason, .. }
| InvokeSuper { reason, .. }
| InvokeSuperForward { reason, .. }
| InvokeBlock { reason, .. }
@@ -2522,7 +2502,6 @@ impl Function {
Insn::FixnumLShift { .. } => types::Fixnum,
Insn::FixnumRShift { .. } => types::Fixnum,
Insn::PutSpecialObject { .. } => types::BasicObject,
- Insn::SendWithoutBlock { .. } => types::BasicObject,
Insn::SendDirect { .. } => types::BasicObject,
Insn::Send { .. } => types::BasicObject,
Insn::SendForward { .. } => types::BasicObject,
@@ -3034,7 +3013,7 @@ impl Function {
self.push_insn(block, Insn::GuardNoBitsSet { val: flags, mask: Const::CUInt64(RUBY_ELTS_SHARED as u64), mask_name: Some(ID!(RUBY_ELTS_SHARED)), reason: SideExitReason::GuardNotShared, state });
}
- /// Rewrite eligible Send/SendWithoutBlock opcodes into SendDirect
+ /// Rewrite eligible Send opcodes into SendDirect
/// opcodes if we know the target ISEQ statically. This removes run-time method lookups and
/// opens the door for inlining.
/// Also try and inline constant caches, specialize object allocations, and more.
@@ -3045,11 +3024,12 @@ impl Function {
assert!(self.blocks[block.0].insns.is_empty());
for insn_id in old_insns {
match self.find(insn_id) {
- Insn::SendWithoutBlock { recv, args, state, cd, .. } if ruby_call_method_id(cd) == ID!(freeze) && args.is_empty() =>
+ Insn::Send { recv, blockiseq: None, args, state, cd, .. } if ruby_call_method_id(cd) == ID!(freeze) && args.is_empty() =>
self.try_rewrite_freeze(block, insn_id, recv, state),
- Insn::SendWithoutBlock { recv, args, state, cd, .. } if ruby_call_method_id(cd) == ID!(minusat) && args.is_empty() =>
+ Insn::Send { recv, blockiseq: None, args, state, cd, .. } if ruby_call_method_id(cd) == ID!(minusat) && args.is_empty() =>
self.try_rewrite_uminus(block, insn_id, recv, state),
- Insn::SendWithoutBlock { mut recv, cd, args, state, .. } => {
+ Insn::Send { mut recv, cd, state, blockiseq, args, .. } => {
+ let has_block = blockiseq.is_some();
let frame_state = self.frame_state(state);
let (klass, profiled_type) = match self.resolve_receiver_type(recv, self.type_of(recv), frame_state.insn_idx) {
ReceiverTypeResolution::StaticallyKnown { class } => (class, None),
@@ -3058,21 +3038,24 @@ impl Function {
ReceiverTypeResolution::SkewedMegamorphic { .. }
| ReceiverTypeResolution::Megamorphic => {
if get_option!(stats) {
- self.set_dynamic_send_reason(insn_id, SendWithoutBlockMegamorphic);
+ let reason = if has_block { SendMegamorphic } else { SendWithoutBlockMegamorphic };
+ self.set_dynamic_send_reason(insn_id, reason);
}
self.push_insn_id(block, insn_id);
continue;
}
ReceiverTypeResolution::Polymorphic => {
if get_option!(stats) {
- self.set_dynamic_send_reason(insn_id, SendWithoutBlockPolymorphic);
+ let reason = if has_block { SendPolymorphic } else { SendWithoutBlockPolymorphic };
+ self.set_dynamic_send_reason(insn_id, reason);
}
self.push_insn_id(block, insn_id);
continue;
}
ReceiverTypeResolution::NoProfile => {
if get_option!(stats) {
- self.set_dynamic_send_reason(insn_id, SendWithoutBlockNoProfiles);
+ let reason = if has_block { SendNoProfiles } else { SendWithoutBlockNoProfiles };
+ self.set_dynamic_send_reason(insn_id, reason);
}
self.push_insn_id(block, insn_id);
continue;
@@ -3086,7 +3069,8 @@ impl Function {
// Do method lookup
let mut cme = unsafe { rb_callable_method_entry(klass, mid) };
if cme.is_null() {
- self.set_dynamic_send_reason(insn_id, SendWithoutBlockNotOptimizedMethodType(MethodType::Null));
+ let reason = if has_block { SendNotOptimizedMethodType(MethodType::Null) } else { SendWithoutBlockNotOptimizedMethodType(MethodType::Null) };
+ self.set_dynamic_send_reason(insn_id, reason);
self.push_insn_id(block, insn_id); continue;
}
// Load an overloaded cme if applicable. See vm_search_cc().
@@ -3098,7 +3082,8 @@ impl Function {
(METHOD_VISI_PRIVATE, true) => {}
(METHOD_VISI_PROTECTED, true) => {}
_ => {
- self.set_dynamic_send_reason(insn_id, SendWithoutBlockNotOptimizedNeedPermission);
+ let reason = if has_block { SendNotOptimizedNeedPermission } else { SendWithoutBlockNotOptimizedNeedPermission };
+ self.set_dynamic_send_reason(insn_id, reason);
self.push_insn_id(block, insn_id); continue;
}
}
@@ -3121,7 +3106,7 @@ impl Function {
// Only specialize positional-positional calls
// TODO(max): Handle other kinds of parameter passing
let iseq = unsafe { get_def_iseq_ptr((*cme).def) };
- if !can_direct_send(self, block, iseq, ci, insn_id, args.as_slice(), None) {
+ if !can_direct_send(self, block, iseq, ci, insn_id, args.as_slice(), blockiseq) {
self.push_insn_id(block, insn_id); continue;
}
@@ -3144,9 +3129,9 @@ impl Function {
self.push_insn_id(block, insn_id); continue;
};
- let send_direct = self.push_insn(block, Insn::SendDirect { recv, cd, cme, iseq, args: processed_args, kw_bits, state: send_state, blockiseq: None });
+ let send_direct = self.push_insn(block, Insn::SendDirect { recv, cd, cme, iseq, args: processed_args, kw_bits, state: send_state, blockiseq });
self.make_equal_to(insn_id, send_direct);
- } else if def_type == VM_METHOD_TYPE_BMETHOD {
+ } else if !has_block && def_type == VM_METHOD_TYPE_BMETHOD {
let procv = unsafe { rb_get_def_bmethod_proc((*cme).def) };
let proc = unsafe { rb_jit_get_proc_ptr(procv) };
let proc_block = unsafe { &(*proc).block };
@@ -3187,7 +3172,7 @@ impl Function {
let send_direct = self.push_insn(block, Insn::SendDirect { recv, cd, cme, iseq, args: processed_args, kw_bits, state: send_state, blockiseq: None });
self.make_equal_to(insn_id, send_direct);
- } else if def_type == VM_METHOD_TYPE_IVAR && args.is_empty() {
+ } else if !has_block && def_type == VM_METHOD_TYPE_IVAR && args.is_empty() {
// Check if we're accessing ivars of a Class or Module object as they require single-ractor mode.
// We omit gen_prepare_non_leaf_call on gen_getivar, so it's unsafe to raise for multi-ractor mode.
if self.is_metaclass(klass) && !self.assume_single_ractor_mode(block, state) {
@@ -3207,7 +3192,7 @@ impl Function {
let getivar = self.push_insn(block, Insn::GetIvar { self_val: recv, id, ic: std::ptr::null(), state });
self.make_equal_to(insn_id, getivar);
- } else if let (VM_METHOD_TYPE_ATTRSET, &[val]) = (def_type, args.as_slice()) {
+ } else if let (false, VM_METHOD_TYPE_ATTRSET, &[val]) = (has_block, def_type, args.as_slice()) {
// Check if we're accessing ivars of a Class or Module object as they require single-ractor mode.
// We omit gen_prepare_non_leaf_call on gen_getivar, so it's unsafe to raise for multi-ractor mode.
if self.is_metaclass(klass) && !self.assume_single_ractor_mode(block, state) {
@@ -3222,7 +3207,7 @@ impl Function {
self.push_insn(block, Insn::SetIvar { self_val: recv, id, ic: std::ptr::null(), val, state });
self.make_equal_to(insn_id, val);
- } else if def_type == VM_METHOD_TYPE_OPTIMIZED {
+ } else if !has_block && def_type == VM_METHOD_TYPE_OPTIMIZED {
let opt_type: OptimizedMethodType = unsafe { get_cme_def_body_optimized_type(cme) }.into();
match (opt_type, args.as_slice()) {
(OptimizedMethodType::Call, _) => {
@@ -3309,115 +3294,8 @@ impl Function {
},
};
} else {
- self.set_dynamic_send_reason(insn_id, SendWithoutBlockNotOptimizedMethodType(MethodType::from(def_type)));
- self.push_insn_id(block, insn_id); continue;
- }
- }
- Insn::Send { mut recv, cd, state, blockiseq, args, .. } => {
- let frame_state = self.frame_state(state);
- let (klass, profiled_type) = match self.resolve_receiver_type(recv, self.type_of(recv), frame_state.insn_idx) {
- ReceiverTypeResolution::StaticallyKnown { class } => (class, None),
- ReceiverTypeResolution::Monomorphic { profiled_type }
- | ReceiverTypeResolution::SkewedPolymorphic { profiled_type } => (profiled_type.class(), Some(profiled_type)),
- ReceiverTypeResolution::SkewedMegamorphic { .. }
- | ReceiverTypeResolution::Megamorphic => {
- if get_option!(stats) {
- self.set_dynamic_send_reason(insn_id, SendMegamorphic);
- }
- self.push_insn_id(block, insn_id);
- continue;
- }
- ReceiverTypeResolution::Polymorphic => {
- if get_option!(stats) {
- self.set_dynamic_send_reason(insn_id, SendPolymorphic);
- }
- self.push_insn_id(block, insn_id);
- continue;
- }
- ReceiverTypeResolution::NoProfile => {
- if get_option!(stats) {
- self.set_dynamic_send_reason(insn_id, SendNoProfiles);
- }
- self.push_insn_id(block, insn_id);
- continue;
- }
- };
- let ci = unsafe { get_call_data_ci(cd) }; // info about the call site
-
- let flags = unsafe { rb_vm_ci_flag(ci) };
-
- let mid = unsafe { vm_ci_mid(ci) };
- // Do method lookup
- let mut cme = unsafe { rb_callable_method_entry(klass, mid) };
- if cme.is_null() {
- self.set_dynamic_send_reason(insn_id, SendNotOptimizedMethodType(MethodType::Null));
- self.push_insn_id(block, insn_id); continue;
- }
- // Load an overloaded cme if applicable. See vm_search_cc().
- // It allows you to use a faster ISEQ if possible.
- cme = unsafe { rb_check_overloaded_cme(cme, ci) };
- let visibility = unsafe { METHOD_ENTRY_VISI(cme) };
- match (visibility, flags & VM_CALL_FCALL != 0) {
- (METHOD_VISI_PUBLIC, _) => {}
- (METHOD_VISI_PRIVATE, true) => {}
- (METHOD_VISI_PROTECTED, true) => {}
- _ => {
- self.set_dynamic_send_reason(insn_id, SendNotOptimizedNeedPermission);
- self.push_insn_id(block, insn_id); continue;
- }
- }
- let mut def_type = unsafe { get_cme_def_type(cme) };
- while def_type == VM_METHOD_TYPE_ALIAS {
- cme = unsafe { rb_aliased_callable_method_entry(cme) };
- def_type = unsafe { get_cme_def_type(cme) };
- }
-
- // If the call site info indicates that the `Function` has overly complex arguments, then do not optimize into a `SendDirect`.
- // Optimized methods(`VM_METHOD_TYPE_OPTIMIZED`) handle their own argument constraints (e.g., kw_splat for Proc call).
- if def_type != VM_METHOD_TYPE_OPTIMIZED && unspecializable_call_type(flags) {
- self.count_complex_call_features(block, flags);
- self.set_dynamic_send_reason(insn_id, ComplexArgPass);
- self.push_insn_id(block, insn_id); continue;
- }
-
- if def_type == VM_METHOD_TYPE_ISEQ {
- let iseq = unsafe { get_def_iseq_ptr((*cme).def) };
- if !can_direct_send(self, block, iseq, ci, insn_id, args.as_slice(), Some(blockiseq)) {
- self.push_insn_id(block, insn_id); continue;
- }
-
- // Check singleton class assumption first, before emitting other patchpoints
- if !self.assume_no_singleton_classes(block, klass, state) {
- self.set_dynamic_send_reason(insn_id, SingletonClassSeen);
- self.push_insn_id(block, insn_id); continue;
- }
-
- // Add PatchPoint for method redefinition
- self.push_insn(block, Insn::PatchPoint { invariant: Invariant::MethodRedefined { klass, method: mid, cme }, state });
-
- // Add GuardType for profiled receiver
- if let Some(profiled_type) = profiled_type {
- recv = self.push_insn(block, Insn::GuardType { val: recv, guard_type: Type::from_profiled_type(profiled_type), state });
- }
-
- let Ok((send_state, processed_args, kw_bits)) = self.prepare_direct_send_args(block, &args, ci, iseq, state)
- .inspect_err(|&reason| self.set_dynamic_send_reason(insn_id, reason)) else {
- self.push_insn_id(block, insn_id); continue;
- };
-
- let send_direct = self.push_insn(block, Insn::SendDirect {
- recv,
- cd,
- cme,
- iseq,
- args: processed_args,
- kw_bits,
- blockiseq: Some(blockiseq),
- state: send_state,
- });
- self.make_equal_to(insn_id, send_direct);
- } else {
- self.set_dynamic_send_reason(insn_id, SendNotOptimizedMethodType(MethodType::from(def_type)));
+ let reason = if has_block { SendNotOptimizedMethodType(MethodType::from(def_type)) } else { SendWithoutBlockNotOptimizedMethodType(MethodType::from(def_type)) };
+ self.set_dynamic_send_reason(insn_id, reason);
self.push_insn_id(block, insn_id); continue;
}
}
@@ -3440,7 +3318,7 @@ impl Function {
}
Insn::ObjToString { val, cd, state, .. } => {
if self.is_a(val, types::String) {
- // behaves differently from `SendWithoutBlock` with `mid:to_s` because ObjToString should not have a patch point for String to_s being redefined
+ // behaves differently from `Send` with `mid:to_s` because ObjToString should not have a patch point for String to_s being redefined
self.make_equal_to(insn_id, val); continue;
}
@@ -3457,7 +3335,7 @@ impl Function {
self.make_equal_to(insn_id, guard);
} else {
let recv = self.push_insn(block, Insn::GuardType { val, guard_type: Type::from_profiled_type(recv_type), state});
- let send_to_s = self.push_insn(block, Insn::SendWithoutBlock { recv, cd, args: vec![], state, reason: ObjToStringNotString });
+ let send_to_s = self.push_insn(block, Insn::Send { recv, cd, blockiseq: None, args: vec![], state, reason: ObjToStringNotString });
self.make_equal_to(insn_id, send_to_s);
}
}
@@ -4066,7 +3944,7 @@ impl Function {
self.push_insn(block, Insn::IncrCounterPtr { counter_ptr });
}
- /// Optimize Send/SendWithoutBlock that land in a C method to a direct CCall without
+ /// Optimize Send that land in a C method to a direct CCall without
/// runtime lookup.
fn optimize_c_calls(&mut self) {
if unsafe { rb_zjit_method_tracing_currently_enabled() } {
@@ -4139,7 +4017,11 @@ impl Function {
return Err(());
}
- let blockiseq = if blockiseq.is_null() { None } else { Some(blockiseq) };
+ let blockiseq = match blockiseq {
+ None => unreachable!("went to reduce_send_without_block_to_ccall"),
+ Some(p) if p.is_null() => None,
+ Some(blockiseq) => Some(blockiseq),
+ };
let cfunc = unsafe { get_cme_def_body_cfunc(cme) };
// Find the `argc` (arity) of the C method, which describes the parameters it expects
@@ -4236,7 +4118,7 @@ impl Function {
}
}
- // Try to reduce a SendWithoutBlock insn to a CCall/CCallWithFrame
+ // Try to reduce a Send insn with blockiseq: None to a CCall/CCallWithFrame
fn reduce_send_without_block_to_ccall(
fun: &mut Function,
block: BlockId,
@@ -4244,7 +4126,7 @@ impl Function {
send: Insn,
send_insn_id: InsnId,
) -> Result<(), ()> {
- let Insn::SendWithoutBlock { mut recv, cd, args, state, .. } = send else {
+ let Insn::Send { mut recv, cd, args, state, .. } = send else {
return Err(());
};
@@ -4474,7 +4356,7 @@ impl Function {
for insn_id in old_insns {
let send = self.find(insn_id);
match send {
- send @ Insn::SendWithoutBlock { recv, .. } => {
+ send @ Insn::Send { recv, blockiseq: None, .. } => {
let recv_type = self.type_of(recv);
if reduce_send_without_block_to_ccall(self, block, recv_type, send, insn_id).is_ok() {
continue;
@@ -4877,7 +4759,6 @@ impl Function {
}
&Insn::Send { recv, ref args, state, .. }
| &Insn::SendForward { recv, ref args, state, .. }
- | &Insn::SendWithoutBlock { recv, ref args, state, .. }
| &Insn::CCallVariadic { recv, ref args, state, .. }
| &Insn::CCallWithFrame { recv, ref args, state, .. }
| &Insn::SendDirect { recv, ref args, state, .. }
@@ -5537,8 +5418,7 @@ impl Function {
self.assert_subtype(insn_id, allow_nil, types::BoolExact)
}
// Instructions with recv and a Vec of Ruby objects
- Insn::SendWithoutBlock { recv, ref args, .. }
- | Insn::SendDirect { recv, ref args, .. }
+ Insn::SendDirect { recv, ref args, .. }
| Insn::Send { recv, ref args, .. }
| Insn::SendForward { recv, ref args, .. }
| Insn::InvokeSuper { recv, ref args, .. }
@@ -7030,7 +6910,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: Uncategorized(opcode) });
+ let send = fun.push_insn(block, Insn::Send { recv, cd, blockiseq: None, args, state: exit_id, reason: Uncategorized(opcode) });
state.stack_push(send);
}
YARVINSN_opt_hash_freeze => {
@@ -7153,7 +7033,7 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
let recv = state.stack_pop().unwrap();
let refined_recv = fun.push_insn(block, Insn::RefineType { val: recv, new_type });
state.replace(recv, refined_recv);
- let send = fun.push_insn(block, Insn::SendWithoutBlock { recv: refined_recv, cd, args, state: snapshot, reason: Uncategorized(opcode) });
+ let send = fun.push_insn(block, Insn::Send { recv: refined_recv, cd, blockiseq: None, args, state: snapshot, reason: Uncategorized(opcode) });
state.stack_push(send);
fun.push_insn(block, Insn::Jump(BranchEdge { target: join_block, args: state.as_args(self_param) }));
block
@@ -7186,7 +7066,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 reason = SendWithoutBlockPolymorphicFallback;
- let send = fun.push_insn(block, Insn::SendWithoutBlock { recv, cd, args, state: exit_id, reason });
+ let send = fun.push_insn(block, Insn::Send { recv, cd, blockiseq: None, args, state: exit_id, reason });
state.stack_push(send);
fun.push_insn(block, Insn::Jump(BranchEdge { target: join_block, args: state.as_args(self_param) }));
break; // End the block
@@ -7195,7 +7075,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: Uncategorized(opcode) });
+ let send = fun.push_insn(block, Insn::Send { recv, cd, blockiseq: None, args, state: exit_id, reason: Uncategorized(opcode) });
state.stack_push(send);
}
YARVINSN_send => {
@@ -7213,7 +7093,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: Uncategorized(opcode) });
+ let send = fun.push_insn(block, Insn::Send { recv, cd, blockiseq: Some(blockiseq), args, state: exit_id, reason: Uncategorized(opcode) });
state.stack_push(send);
if !blockiseq.is_null() {
diff --git a/zjit/src/hir/opt_tests.rs b/zjit/src/hir/opt_tests.rs
index d32de872d5..1315555694 100644
--- a/zjit/src/hir/opt_tests.rs
+++ b/zjit/src/hir/opt_tests.rs
@@ -863,6 +863,37 @@ mod hir_opt_tests {
");
}
+ // Regression test: when specialized_instruction is disabled, the compiler
+ // doesn't convert `send` to `opt_send_without_block`, so a no-block call
+ // reaches ZJIT as `YARVINSN_send` with a null blockiseq. This becomes
+ // `Send { blockiseq: Some(null_ptr) }` which must be normalized to None in
+ // reduce_send_to_ccall, otherwise CCallWithFrame gens wrong block handler.
+ #[test]
+ fn test_send_to_cfunc_without_specialized_instruction() {
+ eval_with_options("
+ def test(a) = a.length
+ test([1,2,3]); test([1,2,3])
+ ", "{ specialized_instruction: false }");
+ assert_snapshot!(hir_string("test"), @r"
+ fn test@<compiled>:2:
+ bb0():
+ EntryPoint interpreter
+ v1:BasicObject = LoadSelf
+ v2:BasicObject = GetLocal :a, l0, SP@4
+ Jump bb2(v1, v2)
+ bb1(v5:BasicObject, v6:BasicObject):
+ EntryPoint JIT(0)
+ Jump bb2(v5, v6)
+ bb2(v8:BasicObject, v9:BasicObject):
+ PatchPoint NoSingletonClass(Array@0x1000)
+ PatchPoint MethodRedefined(Array@0x1000, length@0x1008, cme:0x1010)
+ v22:ArrayExact = GuardType v9, ArrayExact
+ v23:BasicObject = CCallWithFrame v22, :Array#length@0x1038
+ CheckInterrupts
+ Return v23
+ ");
+ }
+
#[test]
fn test_optimize_nonexistent_top_level_call() {
eval("
@@ -884,7 +915,7 @@ mod hir_opt_tests {
EntryPoint JIT(0)
Jump bb2(v4)
bb2(v6:BasicObject):
- v11:BasicObject = SendWithoutBlock v6, :foo # SendFallbackReason: SendWithoutBlock: unsupported method type Null
+ v11:BasicObject = Send v6, :foo # SendFallbackReason: SendWithoutBlock: unsupported method type Null
CheckInterrupts
Return v11
");
@@ -1126,7 +1157,7 @@ mod hir_opt_tests {
v28:Fixnum[30] = Const Value(30)
v30:Fixnum[40] = Const Value(40)
v32:Fixnum[50] = Const Value(50)
- v34:BasicObject = SendWithoutBlock v6, :target, v24, v26, v28, v30, v32 # SendFallbackReason: Argument count does not match parameter count
+ v34:BasicObject = Send v6, :target, v24, v26, v28, v30, v32 # SendFallbackReason: Argument count does not match parameter count
v37:ArrayExact = NewArray v45, v49, v34
CheckInterrupts
Return v37
@@ -2689,7 +2720,7 @@ mod hir_opt_tests {
bb2(v6:BasicObject):
v10:Fixnum[1] = Const Value(1)
v12:Fixnum[0] = Const Value(0)
- v14:BasicObject = SendWithoutBlock v10, :itself, v12 # SendFallbackReason: SendWithoutBlock: unsupported method type Cfunc
+ v14:BasicObject = Send v10, :itself, v12 # SendFallbackReason: SendWithoutBlock: unsupported method type Cfunc
CheckInterrupts
Return v14
");
@@ -2984,7 +3015,7 @@ mod hir_opt_tests {
bb2(v6:BasicObject):
v11:Fixnum[1] = Const Value(1)
IncrCounter complex_arg_pass_param_rest
- v13:BasicObject = SendWithoutBlock v6, :foo, v11 # SendFallbackReason: Complex argument passing
+ v13:BasicObject = Send v6, :foo, v11 # SendFallbackReason: Complex argument passing
CheckInterrupts
Return v13
");
@@ -3009,7 +3040,7 @@ mod hir_opt_tests {
bb2(v6:BasicObject):
v11:Fixnum[10] = Const Value(10)
IncrCounter complex_arg_pass_param_post
- v13:BasicObject = SendWithoutBlock v6, :foo, v11 # SendFallbackReason: Complex argument passing
+ v13:BasicObject = Send v6, :foo, v11 # SendFallbackReason: Complex argument passing
CheckInterrupts
Return v13
");
@@ -3248,7 +3279,7 @@ mod hir_opt_tests {
v33:Fixnum[40] = Const Value(40)
v35:Fixnum[50] = Const Value(50)
v37:Fixnum[60] = Const Value(60)
- v39:BasicObject = SendWithoutBlock v6, :target, v27, v29, v31, v33, v35, v37 # SendFallbackReason: Too many arguments for LIR
+ v39:BasicObject = Send v6, :target, v27, v29, v31, v33, v35, v37 # SendFallbackReason: Too many arguments for LIR
v41:ArrayExact = NewArray v49, v53, v39
CheckInterrupts
Return v41
@@ -3303,7 +3334,7 @@ mod hir_opt_tests {
bb2(v6:BasicObject):
v11:Fixnum[1] = Const Value(1)
IncrCounter complex_arg_pass_param_kwrest
- v13:BasicObject = SendWithoutBlock v6, :foo, v11 # SendFallbackReason: Complex argument passing
+ v13:BasicObject = Send v6, :foo, v11 # SendFallbackReason: Complex argument passing
CheckInterrupts
Return v13
");
@@ -3358,7 +3389,7 @@ mod hir_opt_tests {
v11:HashExact[VALUE(0x1000)] = Const Value(VALUE(0x1000))
v12:HashExact = HashDup v11
IncrCounter complex_arg_pass_caller_kw_splat
- v14:BasicObject = SendWithoutBlock v6, :foo, v12 # SendFallbackReason: Complex argument passing
+ v14:BasicObject = Send v6, :foo, v12 # SendFallbackReason: Complex argument passing
CheckInterrupts
Return v14
");
@@ -3383,7 +3414,7 @@ mod hir_opt_tests {
Jump bb2(v4)
bb2(v6:BasicObject):
IncrCounter complex_arg_pass_param_kwrest
- v11:BasicObject = SendWithoutBlock v6, :foo # SendFallbackReason: Complex argument passing
+ v11:BasicObject = Send v6, :foo # SendFallbackReason: Complex argument passing
CheckInterrupts
Return v11
");
@@ -3410,7 +3441,7 @@ mod hir_opt_tests {
v12:StringExact = StringCopy v11
v14:Fixnum[1] = Const Value(1)
IncrCounter complex_arg_pass_caller_kwarg
- v16:BasicObject = SendWithoutBlock v6, :sprintf, v12, v14 # SendFallbackReason: Complex argument passing
+ v16:BasicObject = Send v6, :sprintf, v12, v14 # SendFallbackReason: Complex argument passing
CheckInterrupts
Return v16
");
@@ -3707,7 +3738,7 @@ mod hir_opt_tests {
PatchPoint MethodRedefined(Hash@0x1008, new@0x1009, cme:0x1010)
v46:HashExact = ObjectAllocClass Hash:VALUE(0x1008)
IncrCounter complex_arg_pass_param_block
- v20:BasicObject = SendWithoutBlock v46, :initialize # SendFallbackReason: Complex argument passing
+ v20:BasicObject = Send v46, :initialize # SendFallbackReason: Complex argument passing
CheckInterrupts
CheckInterrupts
Return v46
@@ -3917,7 +3948,7 @@ mod hir_opt_tests {
v17:CInt64 = LoadField v14, :_env_data_index_specval@0x1001
v18:CInt64 = GuardAnyBitSet v17, CUInt64(1)
v19:HeapObject[BlockParamProxy] = Const Value(VALUE(0x1008))
- v21:BasicObject = Send v8, 0x1010, :tap, v19 # SendFallbackReason: Uncategorized(send)
+ v21:BasicObject = Send v8, 0x1000, :tap, v19 # SendFallbackReason: Uncategorized(send)
CheckInterrupts
Return v21
");
@@ -4228,7 +4259,7 @@ mod hir_opt_tests {
v16:ArrayExact = NewArray
v22:ArrayExact = ToArray v16
IncrCounter complex_arg_pass_caller_splat
- v24:BasicObject = SendWithoutBlock v11, :call, v22 # SendFallbackReason: Complex argument passing
+ v24:BasicObject = Send v11, :call, v22 # SendFallbackReason: Complex argument passing
CheckInterrupts
Return v24
");
@@ -4256,7 +4287,7 @@ mod hir_opt_tests {
bb2(v8:BasicObject, v9:BasicObject):
v14:Fixnum[1] = Const Value(1)
IncrCounter complex_arg_pass_caller_kwarg
- v16:BasicObject = SendWithoutBlock v9, :call, v14 # SendFallbackReason: Complex argument passing
+ v16:BasicObject = Send v9, :call, v14 # SendFallbackReason: Complex argument passing
CheckInterrupts
Return v16
");
@@ -4673,7 +4704,7 @@ mod hir_opt_tests {
PatchPoint NoSingletonClass(Hash@0x1000)
PatchPoint MethodRedefined(Hash@0x1000, dup@0x1008, cme:0x1010)
v22:BasicObject = CCallWithFrame v10, :Kernel#dup@0x1038
- v14:BasicObject = SendWithoutBlock v22, :freeze # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v14:BasicObject = Send v22, :freeze # SendFallbackReason: Uncategorized(opt_send_without_block)
CheckInterrupts
Return v14
");
@@ -4696,7 +4727,7 @@ mod hir_opt_tests {
bb2(v6:BasicObject):
v10:HashExact = NewHash
v12:NilClass = Const Value(nil)
- v14:BasicObject = SendWithoutBlock v10, :freeze, v12 # SendFallbackReason: SendWithoutBlock: unsupported method type Cfunc
+ v14:BasicObject = Send v10, :freeze, v12 # SendFallbackReason: SendWithoutBlock: unsupported method type Cfunc
CheckInterrupts
Return v14
");
@@ -4766,7 +4797,7 @@ mod hir_opt_tests {
PatchPoint NoSingletonClass(Array@0x1000)
PatchPoint MethodRedefined(Array@0x1000, dup@0x1008, cme:0x1010)
v22:BasicObject = CCallWithFrame v10, :Kernel#dup@0x1038
- v14:BasicObject = SendWithoutBlock v22, :freeze # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v14:BasicObject = Send v22, :freeze # SendFallbackReason: Uncategorized(opt_send_without_block)
CheckInterrupts
Return v14
");
@@ -4789,7 +4820,7 @@ mod hir_opt_tests {
bb2(v6:BasicObject):
v10:ArrayExact = NewArray
v12:NilClass = Const Value(nil)
- v14:BasicObject = SendWithoutBlock v10, :freeze, v12 # SendFallbackReason: SendWithoutBlock: unsupported method type Cfunc
+ v14:BasicObject = Send v10, :freeze, v12 # SendFallbackReason: SendWithoutBlock: unsupported method type Cfunc
CheckInterrupts
Return v14
");
@@ -4860,7 +4891,7 @@ mod hir_opt_tests {
PatchPoint NoSingletonClass(String@0x1008)
PatchPoint MethodRedefined(String@0x1008, dup@0x1010, cme:0x1018)
v23:BasicObject = CCallWithFrame v11, :String#dup@0x1040
- v15:BasicObject = SendWithoutBlock v23, :freeze # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v15:BasicObject = Send v23, :freeze # SendFallbackReason: Uncategorized(opt_send_without_block)
CheckInterrupts
Return v15
");
@@ -4884,7 +4915,7 @@ mod hir_opt_tests {
v10:StringExact[VALUE(0x1000)] = Const Value(VALUE(0x1000))
v11:StringExact = StringCopy v10
v13:NilClass = Const Value(nil)
- v15:BasicObject = SendWithoutBlock v11, :freeze, v13 # SendFallbackReason: SendWithoutBlock: unsupported method type Cfunc
+ v15:BasicObject = Send v11, :freeze, v13 # SendFallbackReason: SendWithoutBlock: unsupported method type Cfunc
CheckInterrupts
Return v15
");
@@ -4955,7 +4986,7 @@ mod hir_opt_tests {
PatchPoint NoSingletonClass(String@0x1008)
PatchPoint MethodRedefined(String@0x1008, dup@0x1010, cme:0x1018)
v23:BasicObject = CCallWithFrame v11, :String#dup@0x1040
- v15:BasicObject = SendWithoutBlock v23, :-@ # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v15:BasicObject = Send v23, :-@ # SendFallbackReason: Uncategorized(opt_send_without_block)
CheckInterrupts
Return v15
");
@@ -5381,7 +5412,7 @@ mod hir_opt_tests {
bb2(v8:BasicObject, v9:BasicObject):
v16:Fixnum[1] = Const Value(1)
v18:Fixnum[10] = Const Value(10)
- v22:BasicObject = SendWithoutBlock v9, :[]=, v16, v18 # SendFallbackReason: Uncategorized(opt_aset)
+ v22:BasicObject = Send v9, :[]=, v16, v18 # SendFallbackReason: Uncategorized(opt_aset)
CheckInterrupts
Return v18
");
@@ -5517,7 +5548,7 @@ mod hir_opt_tests {
Jump bb2(v4)
bb2(v6:BasicObject):
v11:Fixnum[100] = Const Value(100)
- v13:BasicObject = SendWithoutBlock v6, :identity, v11 # SendFallbackReason: Bmethod: Proc object is not defined by an ISEQ
+ v13:BasicObject = Send v6, :identity, v11 # SendFallbackReason: Bmethod: Proc object is not defined by an ISEQ
CheckInterrupts
Return v13
");
@@ -6389,7 +6420,7 @@ mod hir_opt_tests {
EntryPoint JIT(0)
Jump bb2(v4)
bb2(v6:BasicObject):
- v11:BasicObject = SendWithoutBlock v6, :foo # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v11:BasicObject = Send v6, :foo # SendFallbackReason: Uncategorized(opt_send_without_block)
CheckInterrupts
Return v11
");
@@ -6436,7 +6467,7 @@ mod hir_opt_tests {
IfTrue v14, bb4(v8, v9, v9)
v23:CBool = HasType v9, HeapObject[class_exact:C]
IfTrue v23, bb5(v8, v9, v9)
- v32:BasicObject = SendWithoutBlock v9, :foo # SendFallbackReason: SendWithoutBlock: polymorphic fallback
+ v32:BasicObject = Send v9, :foo # SendFallbackReason: SendWithoutBlock: polymorphic fallback
Jump bb3(v8, v9, v32)
bb4(v15:BasicObject, v16:BasicObject, v17:BasicObject):
v19:HeapObject[class_exact:C] = RefineType v17, HeapObject[class_exact:C]
@@ -6589,7 +6620,7 @@ mod hir_opt_tests {
v19:CInt64 = GuardAnyBitSet v18, CUInt64(1)
v20:HeapObject[BlockParamProxy] = Const Value(VALUE(0x1008))
IncrCounter complex_arg_pass_caller_blockarg
- v22:BasicObject = Send v13, 0x1010, :map, v20 # SendFallbackReason: Complex argument passing
+ v22:BasicObject = Send v13, 0x1000, :map, v20 # SendFallbackReason: Complex argument passing
CheckInterrupts
Return v22
");
@@ -6620,7 +6651,7 @@ mod hir_opt_tests {
v19:CInt64[0] = GuardBitEquals v18, CInt64(0)
v20:NilClass = Const Value(nil)
IncrCounter complex_arg_pass_caller_blockarg
- v22:BasicObject = Send v13, 0x1008, :map, v20 # SendFallbackReason: Complex argument passing
+ v22:BasicObject = Send v13, 0x1000, :map, v20 # SendFallbackReason: Complex argument passing
CheckInterrupts
Return v22
");
@@ -6654,7 +6685,7 @@ mod hir_opt_tests {
v16:CInt64 = GuardAnyBitSet v15, CUInt64(1)
v17:HeapObject[BlockParamProxy] = Const Value(VALUE(0x1008))
IncrCounter complex_arg_pass_caller_blockarg
- v19:BasicObject = Send v10, 0x1010, :map, v17 # SendFallbackReason: Complex argument passing
+ v19:BasicObject = Send v10, 0x1000, :map, v17 # SendFallbackReason: Complex argument passing
CheckInterrupts
Return v19
");
@@ -8609,7 +8640,7 @@ mod hir_opt_tests {
v12:Fixnum[3] = Const Value(3)
v14:Fixnum[3] = Const Value(3)
v16:Fixnum[3] = Const Value(3)
- v18:BasicObject = SendWithoutBlock v10, :foo, v12, v14, v16 # SendFallbackReason: Argument count does not match parameter count
+ v18:BasicObject = Send v10, :foo, v12, v14, v16 # SendFallbackReason: Argument count does not match parameter count
CheckInterrupts
Return v18
");
@@ -8659,7 +8690,7 @@ mod hir_opt_tests {
Jump bb2(v4)
bb2(v6:BasicObject):
v10:Fixnum[0] = Const Value(0)
- v12:BasicObject = SendWithoutBlock v10, :foo # SendFallbackReason: Argument count does not match parameter count
+ v12:BasicObject = Send v10, :foo # SendFallbackReason: Argument count does not match parameter count
CheckInterrupts
Return v12
");
@@ -8682,7 +8713,7 @@ mod hir_opt_tests {
bb2(v6:BasicObject):
v10:Fixnum[4] = Const Value(4)
v12:Fixnum[1] = Const Value(1)
- v14:BasicObject = SendWithoutBlock v10, :succ, v12 # SendFallbackReason: SendWithoutBlock: unsupported method type Cfunc
+ v14:BasicObject = Send v10, :succ, v12 # SendFallbackReason: SendWithoutBlock: unsupported method type Cfunc
CheckInterrupts
Return v14
");
@@ -8836,7 +8867,7 @@ mod hir_opt_tests {
EntryPoint JIT(0)
Jump bb2(v6, v7, v8)
bb2(v10:BasicObject, v11:BasicObject, v12:BasicObject):
- v17:BasicObject = SendWithoutBlock v11, :^ # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v17:BasicObject = Send v11, :^ # SendFallbackReason: Uncategorized(opt_send_without_block)
CheckInterrupts
Return v17
");
@@ -9511,17 +9542,17 @@ mod hir_opt_tests {
v13:ArrayExact = NewArray
v19:ArrayExact = ToArray v13
IncrCounter complex_arg_pass_caller_splat
- v21:BasicObject = SendWithoutBlock v8, :foo, v19 # SendFallbackReason: Complex argument passing
+ v21:BasicObject = Send v8, :foo, v19 # SendFallbackReason: Complex argument passing
v25:StringExact[VALUE(0x1000)] = Const Value(VALUE(0x1000))
v26:StringExact = StringCopy v25
PatchPoint NoEPEscape(test)
v31:ArrayExact = ToArray v13
IncrCounter complex_arg_pass_caller_splat
- v33:BasicObject = SendWithoutBlock v26, :display, v31 # SendFallbackReason: Complex argument passing
+ v33:BasicObject = Send v26, :display, v31 # SendFallbackReason: Complex argument passing
PatchPoint NoEPEscape(test)
v41:ArrayExact = ToArray v13
IncrCounter complex_arg_pass_caller_splat
- v43:BasicObject = SendWithoutBlock v8, :itself, v41 # SendFallbackReason: Complex argument passing
+ v43:BasicObject = Send v8, :itself, v41 # SendFallbackReason: Complex argument passing
CheckInterrupts
Return v43
");
@@ -10322,7 +10353,7 @@ mod hir_opt_tests {
IncrCounter complex_arg_pass_param_rest
IncrCounter complex_arg_pass_param_block
IncrCounter complex_arg_pass_param_kwrest
- v13:BasicObject = SendWithoutBlock v6, :fancy, v11 # SendFallbackReason: Complex argument passing
+ v13:BasicObject = Send v6, :fancy, v11 # SendFallbackReason: Complex argument passing
CheckInterrupts
Return v13
");
@@ -10346,7 +10377,7 @@ mod hir_opt_tests {
Jump bb2(v4)
bb2(v6:BasicObject):
IncrCounter complex_arg_pass_param_forwardable
- v11:BasicObject = SendWithoutBlock v6, :forwardable # SendFallbackReason: Complex argument passing
+ v11:BasicObject = Send v6, :forwardable # SendFallbackReason: Complex argument passing
CheckInterrupts
Return v11
");
@@ -11081,7 +11112,7 @@ mod hir_opt_tests {
PatchPoint SingleRactorMode
PatchPoint StableConstantNames(0x1000, Obj)
v21:HeapObject[VALUE(0x1008)] = Const Value(VALUE(0x1008))
- v13:BasicObject = SendWithoutBlock v21, :secret # SendFallbackReason: SendWithoutBlock: method private or protected and no FCALL
+ v13:BasicObject = Send v21, :secret # SendFallbackReason: SendWithoutBlock: method private or protected and no FCALL
CheckInterrupts
Return v13
");
@@ -11135,7 +11166,7 @@ mod hir_opt_tests {
PatchPoint SingleRactorMode
PatchPoint StableConstantNames(0x1000, Obj)
v21:BasicObjectExact[VALUE(0x1008)] = Const Value(VALUE(0x1008))
- v13:BasicObject = SendWithoutBlock v21, :initialize # SendFallbackReason: SendWithoutBlock: method private or protected and no FCALL
+ v13:BasicObject = Send v21, :initialize # SendFallbackReason: SendWithoutBlock: method private or protected and no FCALL
CheckInterrupts
Return v13
");
@@ -11162,7 +11193,7 @@ mod hir_opt_tests {
PatchPoint SingleRactorMode
PatchPoint StableConstantNames(0x1000, Obj)
v21:ObjectExact[VALUE(0x1008)] = Const Value(VALUE(0x1008))
- v13:BasicObject = SendWithoutBlock v21, :toplevel_method # SendFallbackReason: SendWithoutBlock: method private or protected and no FCALL
+ v13:BasicObject = Send v21, :toplevel_method # SendFallbackReason: SendWithoutBlock: method private or protected and no FCALL
CheckInterrupts
Return v13
");
@@ -11220,7 +11251,7 @@ mod hir_opt_tests {
PatchPoint SingleRactorMode
PatchPoint StableConstantNames(0x1000, Obj)
v21:HeapObject[VALUE(0x1008)] = Const Value(VALUE(0x1008))
- v13:BasicObject = SendWithoutBlock v21, :secret # SendFallbackReason: SendWithoutBlock: method private or protected and no FCALL
+ v13:BasicObject = Send v21, :secret # SendFallbackReason: SendWithoutBlock: method private or protected and no FCALL
CheckInterrupts
Return v13
");
@@ -11259,7 +11290,7 @@ mod hir_opt_tests {
EntryPoint JIT(0)
Jump bb2(v5, v6)
bb2(v8:BasicObject, v9:BasicObject):
- v15:BasicObject = SendWithoutBlock v9, :length # SendFallbackReason: Singleton class previously created for receiver class
+ v15:BasicObject = Send v9, :length # SendFallbackReason: Singleton class previously created for receiver class
CheckInterrupts
Return v15
");
@@ -11783,7 +11814,7 @@ mod hir_opt_tests {
IfTrue v14, bb4(v8, v9, v9)
v23:CBool = HasType v9, HeapObject[class_exact:D]
IfTrue v23, bb5(v8, v9, v9)
- v32:BasicObject = SendWithoutBlock v9, :foo # SendFallbackReason: SendWithoutBlock: polymorphic fallback
+ v32:BasicObject = Send v9, :foo # SendFallbackReason: SendWithoutBlock: polymorphic fallback
Jump bb3(v8, v9, v32)
bb4(v15:BasicObject, v16:BasicObject, v17:BasicObject):
PatchPoint NoSingletonClass(C@0x1000)
@@ -11835,7 +11866,7 @@ mod hir_opt_tests {
IfTrue v14, bb4(v8, v9, v9)
v23:CBool = HasType v9, Fixnum
IfTrue v23, bb5(v8, v9, v9)
- v32:BasicObject = SendWithoutBlock v9, :itself # SendFallbackReason: SendWithoutBlock: polymorphic fallback
+ v32:BasicObject = Send v9, :itself # SendFallbackReason: SendWithoutBlock: polymorphic fallback
Jump bb3(v8, v9, v32)
bb4(v15:BasicObject, v16:BasicObject, v17:BasicObject):
v19:HeapObject[class_exact:C] = RefineType v17, HeapObject[class_exact:C]
diff --git a/zjit/src/hir/tests.rs b/zjit/src/hir/tests.rs
index 0401ffcd7d..8b15d7d23f 100644
--- a/zjit/src/hir/tests.rs
+++ b/zjit/src/hir/tests.rs
@@ -151,7 +151,7 @@ mod snapshot_tests {
v23:Fixnum[7] = Const Value(7)
v25:Fixnum[8] = Const Value(8)
v26:Any = Snapshot FrameState { pc: 0x1008, stack: [v6, v11, v13, v15, v17, v19, v21, v23, v25], locals: [] }
- v27:BasicObject = SendWithoutBlock v6, :foo, v11, v13, v15, v17, v19, v21, v23, v25 # SendFallbackReason: Too many arguments for LIR
+ v27:BasicObject = Send v6, :foo, v11, v13, v15, v17, v19, v21, v23, v25 # SendFallbackReason: Too many arguments for LIR
v28:Any = Snapshot FrameState { pc: 0x1010, stack: [v27], locals: [] }
PatchPoint NoTracePoint
CheckInterrupts
@@ -641,7 +641,7 @@ pub mod hir_build_tests {
bb2(v6:BasicObject):
v10:Fixnum[1] = Const Value(1)
v12:Fixnum[2] = Const Value(2)
- v15:BasicObject = SendWithoutBlock v10, :+, v12 # SendFallbackReason: Uncategorized(opt_plus)
+ v15:BasicObject = Send v10, :+, v12 # SendFallbackReason: Uncategorized(opt_plus)
CheckInterrupts
Return v15
");
@@ -894,11 +894,11 @@ pub mod hir_build_tests {
SetLocal :l1, l1, EP@3, v10
v15:BasicObject = GetLocal :l1, l1, EP@3
v17:BasicObject = GetLocal :l2, l2, EP@4
- v20:BasicObject = SendWithoutBlock v15, :+, v17 # SendFallbackReason: Uncategorized(opt_plus)
+ v20:BasicObject = Send v15, :+, v17 # SendFallbackReason: Uncategorized(opt_plus)
SetLocal :l2, l2, EP@4, v20
v25:BasicObject = GetLocal :l2, l2, EP@4
v27:BasicObject = GetLocal :l3, l3, EP@5
- v30:BasicObject = SendWithoutBlock v25, :+, v27 # SendFallbackReason: Uncategorized(opt_plus)
+ v30:BasicObject = Send v25, :+, v27 # SendFallbackReason: Uncategorized(opt_plus)
SetLocal :l3, l3, EP@5, v30
CheckInterrupts
Return v30
@@ -1268,7 +1268,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v6, v7, v8)
bb2(v10:BasicObject, v11:BasicObject, v12:BasicObject):
- v19:BasicObject = SendWithoutBlock v11, :+, v12 # SendFallbackReason: Uncategorized(opt_plus)
+ v19:BasicObject = Send v11, :+, v12 # SendFallbackReason: Uncategorized(opt_plus)
CheckInterrupts
Return v19
");
@@ -1293,7 +1293,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v6, v7, v8)
bb2(v10:BasicObject, v11:BasicObject, v12:BasicObject):
- v19:BasicObject = SendWithoutBlock v11, :-, v12 # SendFallbackReason: Uncategorized(opt_minus)
+ v19:BasicObject = Send v11, :-, v12 # SendFallbackReason: Uncategorized(opt_minus)
CheckInterrupts
Return v19
");
@@ -1318,7 +1318,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v6, v7, v8)
bb2(v10:BasicObject, v11:BasicObject, v12:BasicObject):
- v19:BasicObject = SendWithoutBlock v11, :*, v12 # SendFallbackReason: Uncategorized(opt_mult)
+ v19:BasicObject = Send v11, :*, v12 # SendFallbackReason: Uncategorized(opt_mult)
CheckInterrupts
Return v19
");
@@ -1343,7 +1343,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v6, v7, v8)
bb2(v10:BasicObject, v11:BasicObject, v12:BasicObject):
- v19:BasicObject = SendWithoutBlock v11, :/, v12 # SendFallbackReason: Uncategorized(opt_div)
+ v19:BasicObject = Send v11, :/, v12 # SendFallbackReason: Uncategorized(opt_div)
CheckInterrupts
Return v19
");
@@ -1368,7 +1368,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v6, v7, v8)
bb2(v10:BasicObject, v11:BasicObject, v12:BasicObject):
- v19:BasicObject = SendWithoutBlock v11, :%, v12 # SendFallbackReason: Uncategorized(opt_mod)
+ v19:BasicObject = Send v11, :%, v12 # SendFallbackReason: Uncategorized(opt_mod)
CheckInterrupts
Return v19
");
@@ -1393,7 +1393,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v6, v7, v8)
bb2(v10:BasicObject, v11:BasicObject, v12:BasicObject):
- v19:BasicObject = SendWithoutBlock v11, :==, v12 # SendFallbackReason: Uncategorized(opt_eq)
+ v19:BasicObject = Send v11, :==, v12 # SendFallbackReason: Uncategorized(opt_eq)
CheckInterrupts
Return v19
");
@@ -1418,7 +1418,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v6, v7, v8)
bb2(v10:BasicObject, v11:BasicObject, v12:BasicObject):
- v19:BasicObject = SendWithoutBlock v11, :!=, v12 # SendFallbackReason: Uncategorized(opt_neq)
+ v19:BasicObject = Send v11, :!=, v12 # SendFallbackReason: Uncategorized(opt_neq)
CheckInterrupts
Return v19
");
@@ -1443,7 +1443,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v6, v7, v8)
bb2(v10:BasicObject, v11:BasicObject, v12:BasicObject):
- v19:BasicObject = SendWithoutBlock v11, :<, v12 # SendFallbackReason: Uncategorized(opt_lt)
+ v19:BasicObject = Send v11, :<, v12 # SendFallbackReason: Uncategorized(opt_lt)
CheckInterrupts
Return v19
");
@@ -1468,7 +1468,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v6, v7, v8)
bb2(v10:BasicObject, v11:BasicObject, v12:BasicObject):
- v19:BasicObject = SendWithoutBlock v11, :<=, v12 # SendFallbackReason: Uncategorized(opt_le)
+ v19:BasicObject = Send v11, :<=, v12 # SendFallbackReason: Uncategorized(opt_le)
CheckInterrupts
Return v19
");
@@ -1493,7 +1493,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v6, v7, v8)
bb2(v10:BasicObject, v11:BasicObject, v12:BasicObject):
- v19:BasicObject = SendWithoutBlock v11, :>, v12 # SendFallbackReason: Uncategorized(opt_gt)
+ v19:BasicObject = Send v11, :>, v12 # SendFallbackReason: Uncategorized(opt_gt)
CheckInterrupts
Return v19
");
@@ -1533,7 +1533,7 @@ pub mod hir_build_tests {
Jump bb4(v10, v16, v20)
bb4(v26:BasicObject, v27:BasicObject, v28:BasicObject):
v32:Fixnum[0] = Const Value(0)
- v35:BasicObject = SendWithoutBlock v28, :>, v32 # SendFallbackReason: Uncategorized(opt_gt)
+ v35:BasicObject = Send v28, :>, v32 # SendFallbackReason: Uncategorized(opt_gt)
CheckInterrupts
v38:CBool = Test v35
v39:Truthy = RefineType v35, Truthy
@@ -1544,9 +1544,9 @@ pub mod hir_build_tests {
Return v27
bb3(v51:BasicObject, v52:BasicObject, v53:BasicObject):
v58:Fixnum[1] = Const Value(1)
- v61:BasicObject = SendWithoutBlock v52, :+, v58 # SendFallbackReason: Uncategorized(opt_plus)
+ v61:BasicObject = Send v52, :+, v58 # SendFallbackReason: Uncategorized(opt_plus)
v66:Fixnum[1] = Const Value(1)
- v69:BasicObject = SendWithoutBlock v53, :-, v66 # SendFallbackReason: Uncategorized(opt_minus)
+ v69:BasicObject = Send v53, :-, v66 # SendFallbackReason: Uncategorized(opt_minus)
Jump bb4(v51, v61, v69)
");
}
@@ -1570,7 +1570,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v6, v7, v8)
bb2(v10:BasicObject, v11:BasicObject, v12:BasicObject):
- v19:BasicObject = SendWithoutBlock v11, :>=, v12 # SendFallbackReason: Uncategorized(opt_ge)
+ v19:BasicObject = Send v11, :>=, v12 # SendFallbackReason: Uncategorized(opt_ge)
CheckInterrupts
Return v19
");
@@ -1639,7 +1639,7 @@ pub mod hir_build_tests {
bb2(v6:BasicObject):
v11:Fixnum[2] = Const Value(2)
v13:Fixnum[3] = Const Value(3)
- v15:BasicObject = SendWithoutBlock v6, :bar, v11, v13 # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v15:BasicObject = Send v6, :bar, v11, v13 # SendFallbackReason: Uncategorized(opt_send_without_block)
CheckInterrupts
Return v15
");
@@ -1726,7 +1726,7 @@ pub mod hir_build_tests {
v18:StringExact = StringCopy v17
v20:StringExact[VALUE(0x1010)] = Const Value(VALUE(0x1010))
v21:StringExact = StringCopy v20
- v23:BasicObject = SendWithoutBlock v6, :unknown_method, v12, v15, v18, v21 # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v23:BasicObject = Send v6, :unknown_method, v12, v15, v18, v21 # SendFallbackReason: Uncategorized(opt_send_without_block)
CheckInterrupts
Return v23
");
@@ -1749,7 +1749,7 @@ pub mod hir_build_tests {
Jump bb2(v5, v6)
bb2(v8:BasicObject, v9:BasicObject):
v15:ArrayExact = ToArray v9
- v17:BasicObject = SendWithoutBlock v8, :foo, v15 # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v17:BasicObject = Send v8, :foo, v15 # SendFallbackReason: Uncategorized(opt_send_without_block)
CheckInterrupts
Return v17
");
@@ -1794,7 +1794,7 @@ pub mod hir_build_tests {
Jump bb2(v5, v6)
bb2(v8:BasicObject, v9:BasicObject):
v14:Fixnum[1] = Const Value(1)
- v16:BasicObject = SendWithoutBlock v8, :foo, v14 # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v16:BasicObject = Send v8, :foo, v14 # SendFallbackReason: Uncategorized(opt_send_without_block)
CheckInterrupts
Return v16
");
@@ -1816,7 +1816,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v5, v6)
bb2(v8:BasicObject, v9:BasicObject):
- v15:BasicObject = SendWithoutBlock v8, :foo, v9 # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v15:BasicObject = Send v8, :foo, v9 # SendFallbackReason: Uncategorized(opt_send_without_block)
CheckInterrupts
Return v15
");
@@ -1951,7 +1951,7 @@ pub mod hir_build_tests {
bb2(v8:BasicObject, v9:BasicObject):
v15:BasicObject = InvokeSuperForward v8, 0x1000, v9 # SendFallbackReason: Uncategorized(invokesuperforward)
v17:Fixnum[1] = Const Value(1)
- v20:BasicObject = SendWithoutBlock v15, :+, v17 # SendFallbackReason: Uncategorized(opt_plus)
+ v20:BasicObject = Send v15, :+, v17 # SendFallbackReason: Uncategorized(opt_plus)
CheckInterrupts
Return v20
");
@@ -2021,12 +2021,12 @@ pub mod hir_build_tests {
v14:Class[VMFrozenCore] = Const Value(VALUE(0x1000))
v16:HashExact = NewHash
PatchPoint NoEPEscape(test)
- v21:BasicObject = SendWithoutBlock v14, :core#hash_merge_kwd, v16, v9 # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v21:BasicObject = Send v14, :core#hash_merge_kwd, v16, v9 # SendFallbackReason: Uncategorized(opt_send_without_block)
v23:Class[VMFrozenCore] = Const Value(VALUE(0x1000))
v26:StaticSymbol[:b] = Const Value(VALUE(0x1008))
v28:Fixnum[1] = Const Value(1)
- v30:BasicObject = SendWithoutBlock v23, :core#hash_merge_ptr, v21, v26, v28 # SendFallbackReason: Uncategorized(opt_send_without_block)
- v32:BasicObject = SendWithoutBlock v8, :foo, v30 # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v30:BasicObject = Send v23, :core#hash_merge_ptr, v21, v26, v28 # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v32:BasicObject = Send v8, :foo, v30 # SendFallbackReason: Uncategorized(opt_send_without_block)
CheckInterrupts
Return v32
");
@@ -2051,7 +2051,7 @@ pub mod hir_build_tests {
v15:ArrayExact = ToNewArray v9
v17:Fixnum[1] = Const Value(1)
ArrayPush v15, v17
- v21:BasicObject = SendWithoutBlock v8, :foo, v15 # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v21:BasicObject = Send v8, :foo, v15 # SendFallbackReason: Uncategorized(opt_send_without_block)
CheckInterrupts
Return v21
");
@@ -2134,11 +2134,11 @@ pub mod hir_build_tests {
v16:CBool = IsMethodCFunc v11, :new
IfFalse v16, bb3(v6, v13, v11)
v18:HeapBasicObject = ObjectAlloc v11
- v20:BasicObject = SendWithoutBlock v18, :initialize # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v20:BasicObject = Send v18, :initialize # SendFallbackReason: Uncategorized(opt_send_without_block)
CheckInterrupts
Jump bb4(v6, v18, v20)
bb3(v24:BasicObject, v25:NilClass, v26:BasicObject):
- v29:BasicObject = SendWithoutBlock v26, :new # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v29:BasicObject = Send v26, :new # SendFallbackReason: Uncategorized(opt_send_without_block)
Jump bb4(v24, v29, v25)
bb4(v32:BasicObject, v33:BasicObject, v34:BasicObject):
CheckInterrupts
@@ -2251,7 +2251,7 @@ pub mod hir_build_tests {
v12:NilClass = Const Value(nil)
Jump bb2(v8, v9, v10, v11, v12)
bb2(v14:BasicObject, v15:BasicObject, v16:BasicObject, v17:NilClass, v18:NilClass):
- v25:BasicObject = SendWithoutBlock v15, :+, v16 # SendFallbackReason: Uncategorized(opt_plus)
+ v25:BasicObject = Send v15, :+, v16 # SendFallbackReason: Uncategorized(opt_plus)
SideExit UnhandledNewarraySend(MIN)
");
}
@@ -2283,13 +2283,13 @@ pub mod hir_build_tests {
v12:NilClass = Const Value(nil)
Jump bb2(v8, v9, v10, v11, v12)
bb2(v14:BasicObject, v15:BasicObject, v16:BasicObject, v17:NilClass, v18:NilClass):
- v25:BasicObject = SendWithoutBlock v15, :+, v16 # SendFallbackReason: Uncategorized(opt_plus)
+ v25:BasicObject = Send v15, :+, v16 # SendFallbackReason: Uncategorized(opt_plus)
PatchPoint BOPRedefined(ARRAY_REDEFINED_OP_FLAG, BOP_HASH)
v32:Fixnum = ArrayHash v15, v16
PatchPoint NoEPEscape(test)
v39:ArrayExact[VALUE(0x1000)] = Const Value(VALUE(0x1000))
v40:ArrayExact = ArrayDup v39
- v42:BasicObject = SendWithoutBlock v14, :puts, v40 # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v42:BasicObject = Send v14, :puts, v40 # SendFallbackReason: Uncategorized(opt_send_without_block)
PatchPoint NoEPEscape(test)
CheckInterrupts
Return v32
@@ -2325,7 +2325,7 @@ pub mod hir_build_tests {
v12:NilClass = Const Value(nil)
Jump bb2(v8, v9, v10, v11, v12)
bb2(v14:BasicObject, v15:BasicObject, v16:BasicObject, v17:NilClass, v18:NilClass):
- v25:BasicObject = SendWithoutBlock v15, :+, v16 # SendFallbackReason: Uncategorized(opt_plus)
+ v25:BasicObject = Send v15, :+, v16 # SendFallbackReason: Uncategorized(opt_plus)
SideExit PatchPoint(BOPRedefined(ARRAY_REDEFINED_OP_FLAG, BOP_HASH))
");
}
@@ -2357,7 +2357,7 @@ pub mod hir_build_tests {
v12:NilClass = Const Value(nil)
Jump bb2(v8, v9, v10, v11, v12)
bb2(v14:BasicObject, v15:BasicObject, v16:BasicObject, v17:NilClass, v18:NilClass):
- v25:BasicObject = SendWithoutBlock v15, :+, v16 # SendFallbackReason: Uncategorized(opt_plus)
+ v25:BasicObject = Send v15, :+, v16 # SendFallbackReason: Uncategorized(opt_plus)
v31:StringExact[VALUE(0x1000)] = Const Value(VALUE(0x1000))
v32:StringExact = StringCopy v31
SideExit UnhandledNewarraySend(PACK)
@@ -2391,7 +2391,7 @@ pub mod hir_build_tests {
v12:NilClass = Const Value(nil)
Jump bb2(v8, v9, v10, v11, v12)
bb2(v14:BasicObject, v15:BasicObject, v16:BasicObject, v17:NilClass, v18:NilClass):
- v25:BasicObject = SendWithoutBlock v15, :+, v16 # SendFallbackReason: Uncategorized(opt_plus)
+ v25:BasicObject = Send v15, :+, v16 # SendFallbackReason: Uncategorized(opt_plus)
v29:StringExact[VALUE(0x1000)] = Const Value(VALUE(0x1000))
v30:StringExact = StringCopy v29
v36:StringExact[VALUE(0x1008)] = Const Value(VALUE(0x1008))
@@ -2435,7 +2435,7 @@ pub mod hir_build_tests {
v12:NilClass = Const Value(nil)
Jump bb2(v8, v9, v10, v11, v12)
bb2(v14:BasicObject, v15:BasicObject, v16:BasicObject, v17:NilClass, v18:NilClass):
- v25:BasicObject = SendWithoutBlock v15, :+, v16 # SendFallbackReason: Uncategorized(opt_plus)
+ v25:BasicObject = Send v15, :+, v16 # SendFallbackReason: Uncategorized(opt_plus)
v29:StringExact[VALUE(0x1000)] = Const Value(VALUE(0x1000))
v30:StringExact = StringCopy v29
v36:StringExact[VALUE(0x1008)] = Const Value(VALUE(0x1008))
@@ -2472,13 +2472,13 @@ pub mod hir_build_tests {
v12:NilClass = Const Value(nil)
Jump bb2(v8, v9, v10, v11, v12)
bb2(v14:BasicObject, v15:BasicObject, v16:BasicObject, v17:NilClass, v18:NilClass):
- v25:BasicObject = SendWithoutBlock v15, :+, v16 # SendFallbackReason: Uncategorized(opt_plus)
+ v25:BasicObject = Send v15, :+, v16 # SendFallbackReason: Uncategorized(opt_plus)
PatchPoint BOPRedefined(ARRAY_REDEFINED_OP_FLAG, BOP_INCLUDE_P)
v33:BoolExact = ArrayInclude v15, v16 | v16
PatchPoint NoEPEscape(test)
v40:ArrayExact[VALUE(0x1000)] = Const Value(VALUE(0x1000))
v41:ArrayExact = ArrayDup v40
- v43:BasicObject = SendWithoutBlock v14, :puts, v41 # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v43:BasicObject = Send v14, :puts, v41 # SendFallbackReason: Uncategorized(opt_send_without_block)
PatchPoint NoEPEscape(test)
CheckInterrupts
Return v33
@@ -2519,7 +2519,7 @@ pub mod hir_build_tests {
v12:NilClass = Const Value(nil)
Jump bb2(v8, v9, v10, v11, v12)
bb2(v14:BasicObject, v15:BasicObject, v16:BasicObject, v17:NilClass, v18:NilClass):
- v25:BasicObject = SendWithoutBlock v15, :+, v16 # SendFallbackReason: Uncategorized(opt_plus)
+ v25:BasicObject = Send v15, :+, v16 # SendFallbackReason: Uncategorized(opt_plus)
SideExit PatchPoint(BOPRedefined(ARRAY_REDEFINED_OP_FLAG, BOP_INCLUDE_P))
");
}
@@ -2598,7 +2598,7 @@ pub mod hir_build_tests {
Jump bb2(v6, v7, v8)
bb2(v10:BasicObject, v11:BasicObject, v12:BasicObject):
v18:ArrayExact = NewArray v11, v12
- v21:BasicObject = SendWithoutBlock v18, :length # SendFallbackReason: Uncategorized(opt_length)
+ v21:BasicObject = Send v18, :length # SendFallbackReason: Uncategorized(opt_length)
CheckInterrupts
Return v21
");
@@ -2623,7 +2623,7 @@ pub mod hir_build_tests {
Jump bb2(v6, v7, v8)
bb2(v10:BasicObject, v11:BasicObject, v12:BasicObject):
v18:ArrayExact = NewArray v11, v12
- v21:BasicObject = SendWithoutBlock v18, :size # SendFallbackReason: Uncategorized(opt_size)
+ v21:BasicObject = Send v18, :size # SendFallbackReason: Uncategorized(opt_size)
CheckInterrupts
Return v21
");
@@ -3020,7 +3020,7 @@ pub mod hir_build_tests {
bb2(v10:BasicObject, v11:BasicObject, v12:BasicObject):
v16:NilClass = Const Value(nil)
v20:Fixnum[1] = Const Value(1)
- v24:BasicObject = SendWithoutBlock v11, :[]=, v12, v20 # SendFallbackReason: Uncategorized(opt_aset)
+ v24:BasicObject = Send v11, :[]=, v12, v20 # SendFallbackReason: Uncategorized(opt_aset)
CheckInterrupts
Return v20
");
@@ -3044,7 +3044,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v6, v7, v8)
bb2(v10:BasicObject, v11:BasicObject, v12:BasicObject):
- v19:BasicObject = SendWithoutBlock v11, :[], v12 # SendFallbackReason: Uncategorized(opt_aref)
+ v19:BasicObject = Send v11, :[], v12 # SendFallbackReason: Uncategorized(opt_aref)
CheckInterrupts
Return v19
");
@@ -3067,7 +3067,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v5, v6)
bb2(v8:BasicObject, v9:BasicObject):
- v15:BasicObject = SendWithoutBlock v9, :empty? # SendFallbackReason: Uncategorized(opt_empty_p)
+ v15:BasicObject = Send v9, :empty? # SendFallbackReason: Uncategorized(opt_empty_p)
CheckInterrupts
Return v15
");
@@ -3090,7 +3090,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v5, v6)
bb2(v8:BasicObject, v9:BasicObject):
- v15:BasicObject = SendWithoutBlock v9, :succ # SendFallbackReason: Uncategorized(opt_succ)
+ v15:BasicObject = Send v9, :succ # SendFallbackReason: Uncategorized(opt_succ)
CheckInterrupts
Return v15
");
@@ -3114,7 +3114,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v6, v7, v8)
bb2(v10:BasicObject, v11:BasicObject, v12:BasicObject):
- v19:BasicObject = SendWithoutBlock v11, :&, v12 # SendFallbackReason: Uncategorized(opt_and)
+ v19:BasicObject = Send v11, :&, v12 # SendFallbackReason: Uncategorized(opt_and)
CheckInterrupts
Return v19
");
@@ -3138,7 +3138,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v6, v7, v8)
bb2(v10:BasicObject, v11:BasicObject, v12:BasicObject):
- v19:BasicObject = SendWithoutBlock v11, :|, v12 # SendFallbackReason: Uncategorized(opt_or)
+ v19:BasicObject = Send v11, :|, v12 # SendFallbackReason: Uncategorized(opt_or)
CheckInterrupts
Return v19
");
@@ -3161,7 +3161,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v5, v6)
bb2(v8:BasicObject, v9:BasicObject):
- v15:BasicObject = SendWithoutBlock v9, :! # SendFallbackReason: Uncategorized(opt_not)
+ v15:BasicObject = Send v9, :! # SendFallbackReason: Uncategorized(opt_not)
CheckInterrupts
Return v15
");
@@ -3185,7 +3185,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v6, v7, v8)
bb2(v10:BasicObject, v11:BasicObject, v12:BasicObject):
- v19:BasicObject = SendWithoutBlock v11, :=~, v12 # SendFallbackReason: Uncategorized(opt_regexpmatch2)
+ v19:BasicObject = Send v11, :=~, v12 # SendFallbackReason: Uncategorized(opt_regexpmatch2)
CheckInterrupts
Return v19
");
@@ -3215,7 +3215,7 @@ pub mod hir_build_tests {
v12:BasicObject = PutSpecialObject CBase
v14:StaticSymbol[:aliased] = Const Value(VALUE(0x1008))
v16:StaticSymbol[:__callee__] = Const Value(VALUE(0x1010))
- v18:BasicObject = SendWithoutBlock v10, :core#set_method_alias, v12, v14, v16 # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v18:BasicObject = Send v10, :core#set_method_alias, v12, v14, v16 # SendFallbackReason: Uncategorized(opt_send_without_block)
CheckInterrupts
Return v18
");
@@ -3317,7 +3317,7 @@ pub mod hir_build_tests {
v17:NilClass = Const Value(nil)
IfTrue v16, bb3(v8, v17, v17)
v19:NotNil = RefineType v9, NotNil
- v21:BasicObject = SendWithoutBlock v19, :itself # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v21:BasicObject = Send v19, :itself # SendFallbackReason: Uncategorized(opt_send_without_block)
Jump bb3(v8, v19, v21)
bb3(v23:BasicObject, v24:BasicObject, v25:BasicObject):
CheckInterrupts
@@ -3359,7 +3359,7 @@ pub mod hir_build_tests {
v25:NilClass = Const Value(nil)
IfTrue v24, bb4(v8, v25, v25)
v27:Truthy = RefineType v18, NotNil
- v29:BasicObject = SendWithoutBlock v27, :itself # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v29:BasicObject = Send v27, :itself # SendFallbackReason: Uncategorized(opt_send_without_block)
CheckInterrupts
Return v29
bb3(v34:BasicObject, v35:Falsy):
@@ -3640,14 +3640,14 @@ pub mod hir_build_tests {
v13:NilClass = Const Value(nil)
v16:Fixnum[0] = Const Value(0)
v18:Fixnum[1] = Const Value(1)
- v21:BasicObject = SendWithoutBlock v9, :[], v16, v18 # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v21:BasicObject = Send v9, :[], v16, v18 # SendFallbackReason: Uncategorized(opt_send_without_block)
CheckInterrupts
v25:CBool = Test v21
v26:Truthy = RefineType v21, Truthy
IfTrue v25, bb3(v8, v9, v13, v9, v16, v18, v26)
v28:Falsy = RefineType v21, Falsy
v31:Fixnum[2] = Const Value(2)
- v34:BasicObject = SendWithoutBlock v9, :[]=, v16, v18, v31 # SendFallbackReason: Uncategorized(opt_send_without_block)
+ v34:BasicObject = Send v9, :[]=, v16, v18, v31 # SendFallbackReason: Uncategorized(opt_send_without_block)
CheckInterrupts
Return v31
bb3(v40:BasicObject, v41:BasicObject, v42:NilClass, v43:BasicObject, v44:Fixnum[0], v45:Fixnum[1], v46:Truthy):
@@ -4001,7 +4001,7 @@ pub mod hir_build_tests {
v21:FalseClass = RefineType v15, Falsy
v23:Fixnum[1] = Const Value(1)
v25:Fixnum[1] = Const Value(1)
- v28:BasicObject = SendWithoutBlock v23, :+, v25 # SendFallbackReason: Uncategorized(opt_plus)
+ v28:BasicObject = Send v23, :+, v25 # SendFallbackReason: Uncategorized(opt_plus)
Jump bb3(v10, v28, v12)
bb3(v31:BasicObject, v32:BasicObject, v33:BasicObject):
CheckInterrupts