|
|
@@ -4445,12 +4445,28 @@ cleanup_true:
|
|
|
return TRUE;
|
|
|
}
|
|
|
|
|
|
+static gboolean
|
|
|
+always_aot (MonoMethod *method)
|
|
|
+{
|
|
|
+ /*
|
|
|
+ * Calls to these methods do not go through the normal call processing code so
|
|
|
+ * calling code cannot enter the interpreter. So always aot them even in profile guided aot mode.
|
|
|
+ */
|
|
|
+ if (method->klass == mono_get_string_class () && (strstr (method->name, "memcpy") || strstr (method->name, "bzero")))
|
|
|
+ return TRUE;
|
|
|
+ if (method->string_ctor)
|
|
|
+ return TRUE;
|
|
|
+ return FALSE;
|
|
|
+}
|
|
|
+
|
|
|
gboolean
|
|
|
mono_aot_can_enter_interp (MonoMethod *method)
|
|
|
{
|
|
|
MonoAotCompile *acfg = current_acfg;
|
|
|
|
|
|
g_assert (acfg);
|
|
|
+ if (always_aot (method))
|
|
|
+ return FALSE;
|
|
|
if (acfg->aot_opts.profile_only && !g_hash_table_lookup (acfg->profile_methods, method))
|
|
|
return TRUE;
|
|
|
return FALSE;
|
|
|
@@ -8557,17 +8573,23 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method)
|
|
|
|
|
|
if (acfg->aot_opts.profile_only && !g_hash_table_lookup (acfg->profile_methods, method)) {
|
|
|
if (acfg->aot_opts.llvm_only) {
|
|
|
- /* Keep wrappers */
|
|
|
- if (!method->wrapper_type)
|
|
|
- return;
|
|
|
- WrapperInfo *info = mono_marshal_get_wrapper_info (method);
|
|
|
- switch (info->subtype) {
|
|
|
- case WRAPPER_SUBTYPE_PTR_TO_STRUCTURE:
|
|
|
- case WRAPPER_SUBTYPE_STRUCTURE_TO_PTR:
|
|
|
- return;
|
|
|
- default:
|
|
|
- break;
|
|
|
+ gboolean keep = FALSE;
|
|
|
+ if (method->wrapper_type) {
|
|
|
+ /* Keep most wrappers */
|
|
|
+ WrapperInfo *info = mono_marshal_get_wrapper_info (method);
|
|
|
+ switch (info->subtype) {
|
|
|
+ case WRAPPER_SUBTYPE_PTR_TO_STRUCTURE:
|
|
|
+ case WRAPPER_SUBTYPE_STRUCTURE_TO_PTR:
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ keep = TRUE;
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
+ if (always_aot (method))
|
|
|
+ keep = TRUE;
|
|
|
+ if (!keep)
|
|
|
+ return;
|
|
|
} else {
|
|
|
if (!method->is_inflated)
|
|
|
return;
|