}
case MONO_WRAPPER_UNKNOWN:
if (strcmp (method->name, "FastMonitorEnter") == 0) {
- encode_value (MONO_AOT_WRAPPER_MONO_ENTER, p, &p);
+ encode_value (MONO_AOT_WRAPPER_MONITOR_ENTER, p, &p);
} else if (strcmp (method->name, "FastMonitorExit") == 0) {
- encode_value (MONO_AOT_WRAPPER_MONO_EXIT, p, &p);
+ encode_value (MONO_AOT_WRAPPER_MONITOR_EXIT, p, &p);
+ } else if (strcmp (method->name, "FastMonitorEnterV4") == 0) {
+ encode_value (MONO_AOT_WRAPPER_MONITOR_ENTER_V4, p, &p);
} else if (strcmp (method->name, "PtrToStructure") == 0) {
encode_value (MONO_AOT_WRAPPER_PTR_TO_STRUCTURE, p, &p);
encode_klass_ref (acfg, method->klass, p, &p);
add_method (acfg, mono_marshal_get_castclass_with_cache ());
/* isinst_with_check wrapper */
add_method (acfg, mono_marshal_get_isinst_with_cache ());
+
+#if defined(MONO_ARCH_ENABLE_MONITOR_IL_FASTPATH)
+ {
+ MonoMethodDesc *desc;
+ MonoMethod *m;
+
+ desc = mono_method_desc_new ("Monitor:Enter(object,bool&)", FALSE);
+ m = mono_method_desc_search_in_class (desc, mono_defaults.monitor_class);
+ mono_method_desc_free (desc);
+ if (m) {
+ m = mono_monitor_get_fast_path (m);
+ add_method (acfg, m);
+ }
+ }
+#endif
}
/*
ref->method = mono_marshal_get_struct_to_ptr (klass);
}
} else {
- if (subtype == MONO_AOT_WRAPPER_MONO_ENTER)
+ if (subtype == MONO_AOT_WRAPPER_MONITOR_ENTER)
desc = mono_method_desc_new ("Monitor:Enter", FALSE);
- else if (subtype == MONO_AOT_WRAPPER_MONO_EXIT)
+ else if (subtype == MONO_AOT_WRAPPER_MONITOR_EXIT)
desc = mono_method_desc_new ("Monitor:Exit", FALSE);
+ else if (subtype == MONO_AOT_WRAPPER_MONITOR_ENTER_V4)
+ desc = mono_method_desc_new ("Monitor:Enter(object,bool&)", FALSE);
else
g_assert_not_reached ();
orig_method = mono_method_desc_search_in_class (desc, mono_defaults.monitor_class);
MonoMethod *fast_method = NULL;
/*FIXME fix LLVM and AOT support*/
- if (COMPILE_LLVM (cfg) || cfg->compile_aot)
+ if (COMPILE_LLVM (cfg))
return NULL;
/* Avoid infinite recursion */
if (!fast_method)
return NULL;
- return (MonoInst*)mono_emit_method_call (cfg, fast_method, args, NULL);
+ return (MonoInst*)mono_emit_method_call (cfg, fast_method, args, NULL);
}
#endif
/* for MONO_WRAPPER_UNKNOWN/MANAGED_TO_MANAGED subtypes */
enum {
- MONO_AOT_WRAPPER_MONO_ENTER,
- MONO_AOT_WRAPPER_MONO_EXIT,
+ MONO_AOT_WRAPPER_MONITOR_ENTER,
+ MONO_AOT_WRAPPER_MONITOR_EXIT,
MONO_AOT_WRAPPER_ELEMENT_ADDR,
MONO_AOT_WRAPPER_PTR_TO_STRUCTURE,
MONO_AOT_WRAPPER_STRUCTURE_TO_PTR,
MONO_AOT_WRAPPER_CASTCLASS_WITH_CACHE,
MONO_AOT_WRAPPER_ISINST_WITH_CACHE,
+ MONO_AOT_WRAPPER_MONITOR_ENTER_V4,
MONO_AOT_WRAPPER_LAST
};