@@ -13,10 +13,10 @@ use crate::invariants::{track_bop_assumption, track_cme_assumption, track_no_ep_
1313use crate :: gc:: { append_gc_offsets, get_or_create_iseq_payload, get_or_create_iseq_payload_ptr, IseqPayload , IseqStatus } ;
1414use crate :: state:: ZJITState ;
1515use crate :: stats:: { exit_counter_for_compile_error, incr_counter, incr_counter_by, CompileError } ;
16- use crate :: stats:: { counter_ptr, with_time_stat, Counter , Counter :: { compile_time_ns, exit_compile_error} } ;
16+ use crate :: stats:: { counter_ptr, with_time_stat, Counter , send_without_block_def_type_counter , Counter :: { compile_time_ns, exit_compile_error} } ;
1717use crate :: { asm:: CodeBlock , cruby:: * , options:: debug, virtualmem:: CodePtr } ;
1818use crate :: backend:: lir:: { self , asm_comment, asm_ccall, Assembler , Opnd , Target , CFP , C_ARG_OPNDS , C_RET_OPND , EC , NATIVE_STACK_PTR , NATIVE_BASE_PTR , SCRATCH_OPND , SP } ;
19- use crate :: hir:: { iseq_to_hir, Block , BlockId , BranchEdge , Invariant , RangeType , SideExitReason , SideExitReason :: * , SpecialObjectType , SpecialBackrefSymbol , SELF_PARAM_IDX } ;
19+ use crate :: hir:: { iseq_to_hir, Block , BlockId , BranchEdge , Invariant , RangeType , SideExitReason , SideExitReason :: * , SendWithoutBlockDefType , SpecialObjectType , SpecialBackrefSymbol , SELF_PARAM_IDX } ;
2020use crate :: hir:: { Const , FrameState , Function , Insn , InsnId } ;
2121use crate :: hir_type:: { types, Type } ;
2222use crate :: options:: get_option;
@@ -364,10 +364,10 @@ fn gen_insn(cb: &mut CodeBlock, jit: &mut JITState, asm: &mut Assembler, functio
364364 Insn :: IfTrue { val, target } => no_output ! ( gen_if_true( jit, asm, opnd!( val) , target) ) ,
365365 Insn :: IfFalse { val, target } => no_output ! ( gen_if_false( jit, asm, opnd!( val) , target) ) ,
366366 & Insn :: Send { cd, blockiseq, state, .. } => gen_send ( jit, asm, cd, blockiseq, & function. frame_state ( state) ) ,
367- Insn :: SendWithoutBlock { cd, state, .. } => gen_send_without_block ( jit, asm, * cd, & function. frame_state ( * state) ) ,
367+ Insn :: SendWithoutBlock { cd, state, def_type , .. } => gen_send_without_block ( jit, asm, * cd, * def_type , & function. frame_state ( * state) ) ,
368368 // Give up SendWithoutBlockDirect for 6+ args since asm.ccall() doesn't support it.
369369 Insn :: SendWithoutBlockDirect { cd, state, args, .. } if args. len ( ) + 1 > C_ARG_OPNDS . len ( ) => // +1 for self
370- gen_send_without_block ( jit, asm, * cd, & function. frame_state ( * state) ) ,
370+ gen_send_without_block ( jit, asm, * cd, None , & function. frame_state ( * state) ) ,
371371 Insn :: SendWithoutBlockDirect { cme, iseq, recv, args, state, .. } => gen_send_without_block_direct ( cb, jit, asm, * cme, * iseq, opnd ! ( recv) , opnds ! ( args) , & function. frame_state ( * state) ) ,
372372 & Insn :: InvokeSuper { cd, blockiseq, state, .. } => gen_invokesuper ( jit, asm, cd, blockiseq, & function. frame_state ( state) ) ,
373373 Insn :: InvokeBlock { cd, state, .. } => gen_invokeblock ( jit, asm, * cd, & function. frame_state ( * state) ) ,
@@ -1006,11 +1006,16 @@ fn gen_send_without_block(
10061006 jit : & mut JITState ,
10071007 asm : & mut Assembler ,
10081008 cd : * const rb_call_data ,
1009+ def_type : Option < SendWithoutBlockDefType > ,
10091010 state : & FrameState ,
10101011) -> lir:: Opnd {
10111012 gen_incr_counter ( asm, Counter :: dynamic_send_count) ;
10121013 gen_incr_counter ( asm, Counter :: dynamic_send_type_send_without_block) ;
10131014
1015+ if let Some ( def_type) = def_type {
1016+ gen_incr_counter ( asm, send_without_block_def_type_counter ( def_type) ) ;
1017+ }
1018+
10141019 // Note that it's incorrect to use this frame state to side exit because
10151020 // the state might not be on the boundary of an interpreter instruction.
10161021 // For example, `opt_str_uminus` pushes to the stack and then sends.
0 commit comments