#include "config.h"
#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include <fcntl.h>
#include <string.h>
#ifndef PLATFORM_WIN32
#include <mono/metadata/assembly.h>
#include <mono/metadata/metadata-internals.h>
#include <mono/metadata/marshal.h>
+#include <mono/metadata/gc-internal.h>
#include <mono/utils/mono-logger.h>
#include "mono/utils/mono-compiler.h"
image = load_image (module, image_index);
if (!image)
return NULL;
- if (mono_metadata_token_code (token) == 0) {
+ if (mono_metadata_token_table (token) == 0) {
klass = mono_class_get (image, MONO_TOKEN_TYPE_DEF + token);
+ } else if (mono_metadata_token_table (token) == MONO_TABLE_TYPESPEC) {
+ klass = mono_class_get (image, token);
} else {
+ g_assert (mono_metadata_token_table (token) == MONO_TABLE_TYPEDEF);
token = MONO_TOKEN_TYPE_DEF + decode_value (buf, &buf);
rank = decode_value (buf, &buf);
if (token == MONO_TOKEN_TYPE_DEF) {
image_index = value >> 24;
*token = MONO_TOKEN_METHOD_DEF | (value & 0xffffff);
+ if (image_index == 255) {
+ /* Methodspec */
+ image_index = decode_value (buf, &buf);
+ *token = decode_value (buf, &buf);
+ }
+
image = load_image (module, image_index);
if (!image)
return NULL;
guint32 flags;
info->vtable_size = decode_value (buf, &buf);
+ if (info->vtable_size == -1)
+ /* Generic type */
+ return FALSE;
flags = decode_value (buf, &buf);
info->ghcimpl = (flags >> 0) & 0x1;
info->has_finalize = (flags >> 1) & 0x1;
case MONO_PATCH_INFO_METHOD:
case MONO_PATCH_INFO_METHODCONST:
case MONO_PATCH_INFO_METHOD_JUMP: {
- guint32 image_index, token, value;
+ guint32 token;
- value = decode_value (p, &p);
- image_index = value >> 24;
- token = MONO_TOKEN_METHOD_DEF | (value & 0xffffff);
-
- image = load_image (aot_module, image_index);
+ image = decode_method_ref (aot_module, &token, p, &p);
if (!image)
goto cleanup;
#ifdef MONO_ARCH_HAVE_CREATE_TRAMPOLINE_FROM_TOKEN
- if (ji->type == MONO_PATCH_INFO_METHOD) {
+ if ((ji->type == MONO_PATCH_INFO_METHOD) && (mono_metadata_token_table (token) == MONO_TABLE_METHOD)) {
ji->data.target = mono_create_jit_trampoline_from_token (image, token);
ji->type = MONO_PATCH_INFO_ABS;
}
g_assert_not_reached ();
break;
}
+ case MONO_WRAPPER_ALLOC: {
+ int atype = decode_value (p, &p);
+
+ ji->type = MONO_PATCH_INFO_METHOD;
+ ji->data.method = mono_gc_get_managed_allocator_by_type (atype);
+ break;
+ }
case MONO_WRAPPER_STELEMREF:
ji->type = MONO_PATCH_INFO_METHOD;
ji->data.method = mono_marshal_get_stelemref ();
}
/*
- * aot_dyn_resolve:
+ * mono_aot_plt_resolve:
*
* This function is called by the entries in the PLT to resolve the actual method that
* needs to be called. It returns a trampoline to the method and patches the PLT entry.
{
}
-MonoJitInfo*
+gpointer
mono_aot_get_method (MonoDomain *domain, MonoMethod *method)
{
return NULL;
return NULL;
}
+gpointer
+mono_aot_plt_resolve (gpointer aot_module, guint32 plt_info_offset, guint8 *code)
+{
+ return NULL;
+}
+
#endif