#include <mono/metadata/appdomain.h>
#include <mono/metadata/tabledefs.h>
#include <mono/arch/x86/x86-codegen.h>
+#include <mono/metadata/mono-debug-debugger.h>
#include "jit.h"
#include "codegen.h"
gpointer
arch_create_jit_trampoline (MonoMethod *method)
{
- MonoDomain *domain = mono_domain_get ();
guint8 *code, *buf;
- GHashTable *jit_code_hash;
/* previously created trampoline code */
if (method->info)
(method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)) {
MonoMethod *nm;
- nm = mono_marshal_get_native_wrapper (method);
- method->info = mono_compile_method (nm);
- return method->info;
- }
-
- /* check if we already have JITed code */
- if (mono_jit_share_code)
- jit_code_hash = mono_root_domain->jit_code_hash;
- else
- jit_code_hash = domain->jit_code_hash;
+ if (!method->addr && (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL))
+ mono_lookup_pinvoke_call (method);
- if ((code = g_hash_table_lookup (jit_code_hash, method))) {
- mono_jit_stats.methods_lookups++;
- return code;
+#ifdef MONO_USE_EXC_TABLES
+ if (mono_method_blittable (method)) {
+ method->info = method->addr;
+ } else {
+#endif
+ nm = mono_marshal_get_native_wrapper (method);
+ method->info = mono_compile_method (nm);
+#ifdef MONO_USE_EXC_TABLES
+ }
+#endif
+ return method->info;
}
if (!mono_generic_trampoline_code) {