#include <mono/metadata/assembly.h>
#include <mono/metadata/metadata-internals.h>
#include <mono/metadata/marshal.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
#include <mono/metadata/threads-types.h>
#include <mono/metadata/mono-endian.h>
-#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/mono-logger-internals.h>
#include <mono/utils/mono-mmap.h>
#include <mono/utils/mono-compiler.h>
#include <mono/utils/mono-counters.h>
#include "seq-points.h"
#include "version.h"
#include "debugger-agent.h"
+#include "aot-compiler.h"
#ifndef DISABLE_AOT
break;
}
case MONO_WRAPPER_WRITE_BARRIER: {
- int nursery_bits = decode_value (p, &p);
-
ref->method = mono_gc_get_write_barrier ();
- if (ref->method) {
- /* Sanity check */
- info = mono_marshal_get_wrapper_info (ref->method);
- g_assert (info);
- g_assert (info->d.wbarrier.nursery_bits == nursery_bits);
- }
break;
}
case MONO_WRAPPER_STELEMREF: {
init_amodule_got (MonoAotModule *amodule)
{
MonoJumpInfo *ji;
- MonoMemPool *mp = mono_mempool_new ();
+ MonoMemPool *mp;
MonoJumpInfo *patches;
guint32 got_offsets [128];
int i, npatches;
amodule->got_initializing = TRUE;
+ mp = mono_mempool_new ();
npatches = amodule->info.nshared_got_entries;
for (i = 0; i < npatches; ++i)
got_offsets [i] = i;
amodule->shared_got [i] = NULL;
} else if (ji->type == MONO_PATCH_INFO_GC_NURSERY_START && !mono_gc_is_moving ()) {
amodule->shared_got [i] = NULL;
+ } else if (ji->type == MONO_PATCH_INFO_GC_NURSERY_BITS && !mono_gc_is_moving ()) {
+ amodule->shared_got [i] = NULL;
} else if (ji->type == MONO_PATCH_INFO_IMAGE) {
amodule->shared_got [i] = amodule->assembly->image;
} else if (ji->type == MONO_PATCH_INFO_MSCORLIB_GOT_ADDR) {
for (i = 0; i < npatches; ++i)
amodule->llvm_got [i] = amodule->shared_got [i];
}
+
+ mono_mempool_destroy (mp);
}
static void
mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT: loaded AOT Module for %s.\n", assembly->image->name);
}
-/*
- * mono_aot_register_globals:
- *
- * This is called by the ctor function in AOT images compiled with the
- * 'no-dlsym' option.
- */
-void
-mono_aot_register_globals (gpointer *globals)
-{
- g_assert_not_reached ();
-}
-
/*
* mono_aot_register_module:
*
case MONO_PATCH_INFO_INTERRUPTION_REQUEST_FLAG:
case MONO_PATCH_INFO_GC_CARD_TABLE_ADDR:
case MONO_PATCH_INFO_GC_NURSERY_START:
+ case MONO_PATCH_INFO_GC_NURSERY_BITS:
case MONO_PATCH_INFO_JIT_TLS_ID:
break;
case MONO_PATCH_INFO_CASTCLASS_CACHE:
p = buf;
- patches = mono_mempool_alloc0 (mp, sizeof (MonoJumpInfo) * n_patches);
-
*got_slots = g_malloc (sizeof (guint32) * n_patches);
for (pindex = 0; pindex < n_patches; ++pindex) {
(*got_slots)[pindex] = decode_value (p, &p);
MonoMethod *w1 = mono_marshal_method_from_wrapper (method);
MonoMethod *w2 = mono_marshal_method_from_wrapper (m);
- if (w1->is_inflated && ((MonoMethodInflated *)w1)->declaring == w2) {
+ if ((w1 == w2) || (w1->is_inflated && ((MonoMethodInflated *)w1)->declaring == w2)) {
index = value;
break;
}
}
patches = load_patch_info (amodule, mp, n_patches, llvm, &got_slots, p, &p);
- if (patches == NULL)
+ if (patches == NULL) {
+ mono_mempool_destroy (mp);
goto cleanup;
+ }
for (pindex = 0; pindex < n_patches; ++pindex) {
MonoJumpInfo *ji = &patches [pindex];