Просмотр исходного кода

[interp] Fix interp inline (#11824)

[interp] Fix interp inline


<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->
Vlad Brezae 7 лет назад
Родитель
Сommit
aa8ea8026d
1 измененных файлов с 4 добавлено и 28 удалено
  1. 4 28
      mono/mini/interp/transform.c

+ 4 - 28
mono/mini/interp/transform.c

@@ -1669,6 +1669,10 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target
 
 		if (method == target_method && *(td->ip + 5) == CEE_RET && !(csignature->hasthis && m_class_is_valuetype (target_method->klass))) {
 			int offset;
+
+			if (td->inlined_method)
+				return FALSE;
+
 			if (td->verbose_level)
 				g_print ("Optimize tail call of %s.%s\n", m_class_get_name (target_method->klass), target_method->name);
 
@@ -1682,34 +1686,6 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target
 				++td->ip; /* gobble the CEE_RET if it isn't branched to */				
 			td->ip += 5;
 			return TRUE;
-		} else {
-			MonoMethodHeader *mheader = interp_method_get_header (target_method, error);
-			return_val_if_nok (error, FALSE);
-			/* mheader might not exist if this is a delegate invoc, etc */
-			gboolean has_vt_arg = FALSE;
-			for (i = 0; i < csignature->param_count; i++)
-				has_vt_arg |= !mini_type_is_reference (csignature->params [i]);
-
-			gboolean empty_callee = mheader && *mheader->code == CEE_RET;
-			mono_metadata_free_mh (mheader);
-
-			if (empty_callee && called_inited && !has_vt_arg) {
-				if (td->verbose_level)
-					g_print ("Inline (empty) call of %s.%s\n", m_class_get_name (target_method->klass), target_method->name);
-				for (i = 0; i < csignature->param_count; i++) {
-					ADD_CODE (td, MINT_POP); /*FIX: vt */
-					ADD_CODE (td, 0);
-				}
-				if (csignature->hasthis) {
-					if (is_virtual || need_null_check)
-						ADD_CODE (td, MINT_CKNULL);
-					ADD_CODE (td, MINT_POP);
-					ADD_CODE (td, 0);
-				}
-				td->sp -= csignature->param_count + csignature->hasthis;
-				td->ip += 5;
-				return TRUE;
-			}
 		}
 	}