* domain.c: Documentation updates.
* loader.c (mono_free_method): Do not release the method
information if we are being profiled, as profilers will use this
information at shut down to present some data to the user.
This is needed so that the profiler does not crash, as the
profiler tends to keep MonoMethods around, and they might become
invalid if we free these.
(mono_get_method_constrained): Return the original CIL stream
method as well, so verification can be performed against it.
2006-07-13 Miguel de Icaza <miguel@novell.com>
* mini.c (mono_method_to_ir): Obtain the original method in the
CIL stream and use this to perform validation.
Fixed: #78816
svn path=/trunk/mono/; revision=63014
+2006-07-26 Miguel de Icaza <miguel@novell.com>
+
+ * domain.c: Documentation updates.
+
+ * loader.c (mono_free_method): Do not release the method
+ information if we are being profiled, as profilers will use this
+ information at shut down to present some data to the user.
+
+ This is needed so that the profiler does not crash, as the
+ profiler tends to keep MonoMethods around, and they might become
+ invalid if we free these.
+
+ (mono_get_method_constrained): Return the original CIL stream
+ method as well, so verification can be performed against it.
+
2006-07-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* filewatcher.[ch]: support for inotify file system watcher.
/**
* mono_get_root_domain:
*
- * Returns: the root appdomain.
+ * The root AppDomain is the initial domain created by the runtime when it is
+ * initialized. Programs execute on this AppDomain, but can create new ones
+ * later. Currently there is no unmanaged API to create new AppDomains, this
+ * must be done from managed code.
+ *
+ * Returns: the root appdomain, to obtain the current domain, use mono_domain_get ()
*/
MonoDomain*
mono_get_root_domain (void)
/**
* mono_domain_get:
*
- * Returns: the current domain.
+ * Returns: the current domain, to obtain the root domain use
+ * mono_get_root_domain().
*/
MonoDomain *
mono_domain_get ()
#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>
* 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
typedef gboolean (*MonoStackWalk) (MonoMethod *method, gint32 native_offset, gint32 il_offset, gboolean managed, gpointer data);
MonoMethod *
-mono_get_method (MonoImage *image, guint32 token, MonoClass *klass);
+mono_get_method (MonoImage *image, guint32 token, MonoClass *klass);
MonoMethod *
-mono_get_method_full (MonoImage *image, guint32 token, MonoClass *klass, MonoGenericContext *context);
+mono_get_method_full (MonoImage *image, guint32 token, MonoClass *klass,
+ MonoGenericContext *context);
MonoMethod *
-mono_get_method_constrained (MonoImage *image, guint32 token, MonoClass *constrained_class, MonoGenericContext *context);
+mono_get_method_constrained (MonoImage *image, guint32 token, MonoClass *constrained_class,
+ MonoGenericContext *context, MonoMethod **cil_method);
void
mono_free_method (MonoMethod *method);
MonoMethodSignature*
-mono_method_get_signature_full (MonoMethod *method, MonoImage *image, guint32 token, MonoGenericContext *context);
+mono_method_get_signature_full (MonoMethod *method, MonoImage *image, guint32 token,
+ MonoGenericContext *context);
MonoMethodSignature*
mono_method_get_signature (MonoMethod *method, MonoImage *image, guint32 token);
+2006-07-13 Miguel de Icaza <miguel@novell.com>
+
+ * mini.c (mono_method_to_ir): Obtain the original method in the
+ CIL stream and use this to perform validation.
+
+ Fixed: #78816
+
2006-07-19 Zoltan Varga <vargaz@gmail.com>
* mini-x86.c (mono_arch_get_argument_info): Fix a warning.
n = fsig->param_count + fsig->hasthis;
} else {
+ MonoMethod *cil_method;
+
if (method->wrapper_type != MONO_WRAPPER_NONE) {
cmethod = (MonoMethod *)mono_method_get_wrapper_data (method, token);
+ cil_method = cmethod;
} else if (constrained_call) {
- cmethod = mono_get_method_constrained (image, token, constrained_call, generic_context);
+ cmethod = mono_get_method_constrained (image, token, constrained_call, generic_context, &cil_method);
cmethod = mono_get_inflated_method (cmethod);
} else {
cmethod = mini_get_method (method, token, NULL, generic_context);
+ cil_method = cmethod;
}
if (!cmethod)
goto load_error;
- if (!dont_verify && !can_access_method (method, cmethod))
+ if (!dont_verify && !can_access_method (method, cil_method))
UNVERIFIED;
if (!virtual && (cmethod->flags & METHOD_ATTRIBUTE_ABSTRACT))