@@ -2650,6 +2650,7 @@ interp_inline_method (TransformData *td, MonoMethod *target_method, MonoMethodHe
2650
2650
int prev_n_data_items ;
2651
2651
int i ;
2652
2652
int prev_sp_offset ;
2653
+ int prev_aggressive_inlining ;
2653
2654
MonoGenericContext * generic_context = NULL ;
2654
2655
StackInfo * prev_param_area ;
2655
2656
InterpBasicBlock * * prev_offset_to_bb ;
@@ -2676,6 +2677,7 @@ interp_inline_method (TransformData *td, MonoMethod *target_method, MonoMethodHe
2676
2677
prev_offset_to_bb = td -> offset_to_bb ;
2677
2678
prev_cbb = td -> cbb ;
2678
2679
prev_entry_bb = td -> entry_bb ;
2680
+ prev_aggressive_inlining = td -> aggressive_inlining ;
2679
2681
td -> inlined_method = target_method ;
2680
2682
2681
2683
prev_max_stack_height = td -> max_stack_height ;
@@ -2691,7 +2693,7 @@ interp_inline_method (TransformData *td, MonoMethod *target_method, MonoMethodHe
2691
2693
2692
2694
int const prev_code_size = td -> code_size ;
2693
2695
td -> code_size = header -> code_size ;
2694
-
2696
+ td -> aggressive_inlining = !!( target_method -> iflags & METHOD_IMPL_ATTRIBUTE_AGGRESSIVE_INLINING );
2695
2697
if (td -> verbose_level )
2696
2698
g_print ("Inline start method %s.%s\n" , m_class_get_name (target_method -> klass ), target_method -> name );
2697
2699
@@ -2736,6 +2738,7 @@ interp_inline_method (TransformData *td, MonoMethod *target_method, MonoMethodHe
2736
2738
td -> offset_to_bb = prev_offset_to_bb ;
2737
2739
td -> code_size = prev_code_size ;
2738
2740
td -> entry_bb = prev_entry_bb ;
2741
+ td -> aggressive_inlining = prev_aggressive_inlining ;
2739
2742
2740
2743
g_free (td -> in_offsets );
2741
2744
td -> in_offsets = prev_in_offsets ;
@@ -2973,7 +2976,7 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target
2973
2976
}
2974
2977
2975
2978
/* Don't inline methods that do calls */
2976
- if (op == -1 && td -> inlined_method )
2979
+ if (op == -1 && td -> inlined_method && ! td -> aggressive_inlining )
2977
2980
return FALSE;
2978
2981
2979
2982
/* We need to convert delegate invoke to a indirect call on the interp_invoke_impl field */
@@ -5453,7 +5456,8 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header,
5453
5456
// Inlining failed. Set the method to be executed as part of newobj instruction
5454
5457
newobj_fast -> data [0 ] = get_data_item_index (td , mono_interp_get_imethod (domain , m , error ));
5455
5458
/* The constructor was not inlined, abort inlining of current method */
5456
- INLINE_FAILURE ;
5459
+ if (!td -> aggressive_inlining )
5460
+ INLINE_FAILURE ;
5457
5461
} else {
5458
5462
interp_add_ins (td , MINT_NEWOBJ );
5459
5463
g_assert (!m_class_is_valuetype (klass ));
@@ -5589,7 +5593,8 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header,
5589
5593
5590
5594
break ;
5591
5595
case CEE_THROW :
5592
- INLINE_FAILURE ;
5596
+ if (!td -> aggressive_inlining )
5597
+ INLINE_FAILURE ;
5593
5598
CHECK_STACK (td , 1 );
5594
5599
interp_add_ins (td , MINT_THROW );
5595
5600
interp_ins_set_sreg (td -> last_ins , td -> sp [-1 ].local );
0 commit comments