* Patrik Torstensson (patrik.torstensson@labs2.com)
*
* (C) 2001 Ximian, Inc.
+ * Copyright (C) 2002-2006 Novell, Inc.
*
* This file is used by the interpreter and the JIT engine to locate
* assemblies. Used to load AssemblyRef and later to resolve various
#include <mono/metadata/class-internals.h>
#include <mono/metadata/debug-helpers.h>
#include <mono/metadata/reflection.h>
+#include <mono/metadata/profiler.h>
#include <mono/utils/mono-logger.h>
#include <mono/metadata/exception.h>
{
TlsFree (loader_error_thread_id);
- DeleteCriticalSection (&loader_mutex);
+ /*DeleteCriticalSection (&loader_mutex);*/
}
/*
else
msg = g_strdup_printf ("Could not load file or assembly '%s' or one of its dependencies.", error->assembly_name);
- mono_loader_clear_error ();
ex = mono_get_exception_file_not_found2 (msg, mono_string_new (mono_domain_get (), error->assembly_name));
+ mono_loader_clear_error ();
g_free (msg);
break;
}
else
result = (MonoMethod *)mono_mempool_alloc0 (image->mempool, sizeof (MonoMethodNormal));
+ mono_stats.method_count ++;
+
if (!klass) {
guint32 type = mono_metadata_typedef_from_method (image, token);
klass = mono_class_get (image, MONO_TOKEN_TYPE_DEF | type);
* mono_get_method_constrained:
*
* This is used when JITing the `constrained.' opcode.
+ *
+ * This returns two values: the contrained method, which has been inflated
+ * as the function return value; And the original CIL-stream method as
+ * declared in cil_method. The later is used for verification.
*/
MonoMethod *
mono_get_method_constrained (MonoImage *image, guint32 token, MonoClass *constrained_class,
- MonoGenericContext *context)
+ MonoGenericContext *context, MonoMethod **cil_method)
{
MonoMethod *method, *result;
MonoClass *ic = NULL;
mono_loader_lock ();
- method = mono_get_method_from_token (image, token, NULL, context);
- if (!method) {
+ *cil_method = mono_get_method_from_token (image, token, NULL, context);
+ if (!*cil_method) {
mono_loader_unlock ();
return NULL;
}
mono_class_init (constrained_class);
- method = mono_get_inflated_method (method);
+ method = mono_get_inflated_method (*cil_method);
sig = mono_method_signature (method);
if (method->is_inflated && sig->generic_param_count) {
void
mono_free_method (MonoMethod *method)
{
+ if (mono_profiler_get_events () != MONO_PROFILE_NONE)
+ return;
+
if (method->signature) {
/*
* FIXME: This causes crashes because the types inside signatures and