@@ -2660,6 +2660,7 @@ interp_inline_method (TransformData *td, MonoMethod *target_method, MonoMethodHe
2660
2660
int prev_n_data_items ;
2661
2661
int i ;
2662
2662
int prev_sp_offset ;
2663
+ int prev_aggressive_inlining ;
2663
2664
MonoGenericContext * generic_context = NULL ;
2664
2665
StackInfo * prev_param_area ;
2665
2666
InterpBasicBlock * * prev_offset_to_bb ;
@@ -2686,6 +2687,7 @@ interp_inline_method (TransformData *td, MonoMethod *target_method, MonoMethodHe
2686
2687
prev_offset_to_bb = td -> offset_to_bb ;
2687
2688
prev_cbb = td -> cbb ;
2688
2689
prev_entry_bb = td -> entry_bb ;
2690
+ prev_aggressive_inlining = td -> aggressive_inlining ;
2689
2691
td -> inlined_method = target_method ;
2690
2692
2691
2693
prev_max_stack_height = td -> max_stack_height ;
@@ -2701,7 +2703,7 @@ interp_inline_method (TransformData *td, MonoMethod *target_method, MonoMethodHe
2701
2703
2702
2704
int const prev_code_size = td -> code_size ;
2703
2705
td -> code_size = header -> code_size ;
2704
-
2706
+ td -> aggressive_inlining = !!( target_method -> iflags & METHOD_IMPL_ATTRIBUTE_AGGRESSIVE_INLINING );
2705
2707
if (td -> verbose_level )
2706
2708
g_print ("Inline start method %s.%s\n" , m_class_get_name (target_method -> klass ), target_method -> name );
2707
2709
@@ -2746,6 +2748,7 @@ interp_inline_method (TransformData *td, MonoMethod *target_method, MonoMethodHe
2746
2748
td -> offset_to_bb = prev_offset_to_bb ;
2747
2749
td -> code_size = prev_code_size ;
2748
2750
td -> entry_bb = prev_entry_bb ;
2751
+ td -> aggressive_inlining = prev_aggressive_inlining ;
2749
2752
2750
2753
g_free (td -> in_offsets );
2751
2754
td -> in_offsets = prev_in_offsets ;
@@ -2983,7 +2986,7 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target
2983
2986
}
2984
2987
2985
2988
/* Don't inline methods that do calls */
2986
- if (op == -1 && td -> inlined_method )
2989
+ if (op == -1 && td -> inlined_method && ! td -> aggressive_inlining )
2987
2990
return FALSE;
2988
2991
2989
2992
/* We need to convert delegate invoke to a indirect call on the interp_invoke_impl field */
@@ -5471,7 +5474,8 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header,
5471
5474
// Inlining failed. Set the method to be executed as part of newobj instruction
5472
5475
newobj_fast -> data [0 ] = get_data_item_index (td , mono_interp_get_imethod (domain , m , error ));
5473
5476
/* The constructor was not inlined, abort inlining of current method */
5474
- INLINE_FAILURE ;
5477
+ if (!td -> aggressive_inlining )
5478
+ INLINE_FAILURE ;
5475
5479
} else {
5476
5480
interp_add_ins (td , MINT_NEWOBJ );
5477
5481
g_assert (!m_class_is_valuetype (klass ));
@@ -5607,7 +5611,8 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header,
5607
5611
5608
5612
break ;
5609
5613
case CEE_THROW :
5610
- INLINE_FAILURE ;
5614
+ if (!td -> aggressive_inlining )
5615
+ INLINE_FAILURE ;
5611
5616
CHECK_STACK (td , 1 );
5612
5617
interp_add_ins (td , MINT_THROW );
5613
5618
interp_ins_set_sreg (td -> last_ins , td -> sp [-1 ].local );
0 commit comments