@@ -148,6 +148,9 @@ make_counters! {
148148 send_fallback_send_without_block_cfunc_array_variadic,
149149 send_fallback_send_without_block_not_optimized_method_type,
150150 send_fallback_send_without_block_direct_too_many_args,
151+ send_fallback_send_polymorphic,
152+ send_fallback_send_no_profiles,
153+ send_fallback_send_not_optimized_method_type,
151154 send_fallback_ccall_with_frame_too_many_args,
152155 send_fallback_obj_to_string_not_string,
153156 send_fallback_not_optimized_instruction,
@@ -185,20 +188,35 @@ make_counters! {
185188 dynamic_getivar_count,
186189 dynamic_setivar_count,
187190
188- // Method call def_type related to fallback to dynamic dispatch
189- unspecialized_def_type_iseq,
190- unspecialized_def_type_cfunc,
191- unspecialized_def_type_attrset,
192- unspecialized_def_type_ivar,
193- unspecialized_def_type_bmethod,
194- unspecialized_def_type_zsuper,
195- unspecialized_def_type_alias,
196- unspecialized_def_type_undef,
197- unspecialized_def_type_not_implemented,
198- unspecialized_def_type_optimized,
199- unspecialized_def_type_missing,
200- unspecialized_def_type_refined,
201- unspecialized_def_type_null,
191+ // Method call def_type related to send without block fallback to dynamic dispatch
192+ unspecialized_send_without_block_def_type_iseq,
193+ unspecialized_send_without_block_def_type_cfunc,
194+ unspecialized_send_without_block_def_type_attrset,
195+ unspecialized_send_without_block_def_type_ivar,
196+ unspecialized_send_without_block_def_type_bmethod,
197+ unspecialized_send_without_block_def_type_zsuper,
198+ unspecialized_send_without_block_def_type_alias,
199+ unspecialized_send_without_block_def_type_undef,
200+ unspecialized_send_without_block_def_type_not_implemented,
201+ unspecialized_send_without_block_def_type_optimized,
202+ unspecialized_send_without_block_def_type_missing,
203+ unspecialized_send_without_block_def_type_refined,
204+ unspecialized_send_without_block_def_type_null,
205+
206+ // Method call def_type related to send fallback to dynamic dispatch
207+ unspecialized_send_def_type_iseq,
208+ unspecialized_send_def_type_cfunc,
209+ unspecialized_send_def_type_attrset,
210+ unspecialized_send_def_type_ivar,
211+ unspecialized_send_def_type_bmethod,
212+ unspecialized_send_def_type_zsuper,
213+ unspecialized_send_def_type_alias,
214+ unspecialized_send_def_type_undef,
215+ unspecialized_send_def_type_not_implemented,
216+ unspecialized_send_def_type_optimized,
217+ unspecialized_send_def_type_missing,
218+ unspecialized_send_def_type_refined,
219+ unspecialized_send_def_type_null,
202220
203221 // Writes to the VM frame
204222 vm_write_pc_count,
@@ -320,30 +338,54 @@ pub fn send_fallback_counter(reason: crate::hir::SendFallbackReason) -> Counter
320338 SendWithoutBlockCfuncArrayVariadic => send_fallback_send_without_block_cfunc_array_variadic,
321339 SendWithoutBlockNotOptimizedMethodType ( _) => send_fallback_send_without_block_not_optimized_method_type,
322340 SendWithoutBlockDirectTooManyArgs => send_fallback_send_without_block_direct_too_many_args,
341+ SendPolymorphic => send_fallback_send_polymorphic,
342+ SendNoProfiles => send_fallback_send_no_profiles,
343+ SendNotOptimizedMethodType ( _) => send_fallback_send_not_optimized_method_type,
323344 CCallWithFrameTooManyArgs => send_fallback_ccall_with_frame_too_many_args,
324345 ObjToStringNotString => send_fallback_obj_to_string_not_string,
325346 NotOptimizedInstruction ( _) => send_fallback_not_optimized_instruction,
326347 }
327348}
328349
350+ pub fn send_without_block_fallback_counter_for_method_type ( method_type : crate :: hir:: MethodType ) -> Counter {
351+ use crate :: hir:: MethodType :: * ;
352+ use crate :: stats:: Counter :: * ;
353+
354+ match method_type {
355+ Iseq => unspecialized_send_without_block_def_type_iseq,
356+ Cfunc => unspecialized_send_without_block_def_type_cfunc,
357+ Attrset => unspecialized_send_without_block_def_type_attrset,
358+ Ivar => unspecialized_send_without_block_def_type_ivar,
359+ Bmethod => unspecialized_send_without_block_def_type_bmethod,
360+ Zsuper => unspecialized_send_without_block_def_type_zsuper,
361+ Alias => unspecialized_send_without_block_def_type_alias,
362+ Undefined => unspecialized_send_without_block_def_type_undef,
363+ NotImplemented => unspecialized_send_without_block_def_type_not_implemented,
364+ Optimized => unspecialized_send_without_block_def_type_optimized,
365+ Missing => unspecialized_send_without_block_def_type_missing,
366+ Refined => unspecialized_send_without_block_def_type_refined,
367+ Null => unspecialized_send_without_block_def_type_null,
368+ }
369+ }
370+
329371pub fn send_fallback_counter_for_method_type ( method_type : crate :: hir:: MethodType ) -> Counter {
330372 use crate :: hir:: MethodType :: * ;
331373 use crate :: stats:: Counter :: * ;
332374
333375 match method_type {
334- Iseq => unspecialized_def_type_iseq ,
335- Cfunc => unspecialized_def_type_cfunc ,
336- Attrset => unspecialized_def_type_attrset ,
337- Ivar => unspecialized_def_type_ivar ,
338- Bmethod => unspecialized_def_type_bmethod ,
339- Zsuper => unspecialized_def_type_zsuper ,
340- Alias => unspecialized_def_type_alias ,
341- Undefined => unspecialized_def_type_undef ,
342- NotImplemented => unspecialized_def_type_not_implemented ,
343- Optimized => unspecialized_def_type_optimized ,
344- Missing => unspecialized_def_type_missing ,
345- Refined => unspecialized_def_type_refined ,
346- Null => unspecialized_def_type_null ,
376+ Iseq => unspecialized_send_def_type_iseq ,
377+ Cfunc => unspecialized_send_def_type_cfunc ,
378+ Attrset => unspecialized_send_def_type_attrset ,
379+ Ivar => unspecialized_send_def_type_ivar ,
380+ Bmethod => unspecialized_send_def_type_bmethod ,
381+ Zsuper => unspecialized_send_def_type_zsuper ,
382+ Alias => unspecialized_send_def_type_alias ,
383+ Undefined => unspecialized_send_def_type_undef ,
384+ NotImplemented => unspecialized_send_def_type_not_implemented ,
385+ Optimized => unspecialized_send_def_type_optimized ,
386+ Missing => unspecialized_send_def_type_missing ,
387+ Refined => unspecialized_send_def_type_refined ,
388+ Null => unspecialized_send_def_type_null ,
347389 }
348390}
349391
0 commit comments