*method = mono_marshal_get_runtime_invoke (m, FALSE);
break;
}
+ case MONO_WRAPPER_MANAGED_TO_MANAGED: {
+ int subtype = decode_value (p, &p);
+
+ if (subtype == MONO_AOT_WRAPPER_ELEMENT_ADDR) {
+ int rank = decode_value (p, &p);
+ int elem_size = decode_value (p, &p);
+
+ *method = mono_marshal_get_array_address (rank, elem_size);
+ } else {
+ g_assert_not_reached ();
+ }
+ break;
+ }
default:
g_assert_not_reached ();
}
table_size = table [0];
table ++;
- hash = mono_aot_str_hash (name) % table_size;
+ hash = mono_metadata_str_hash (name) % table_size;
entry = &table [hash * 2];
full_name = g_strdup_printf ("%s.%s", name_space, name);
}
}
- hash = mono_aot_str_hash (full_name) % table_size;
+ hash = mono_metadata_str_hash (full_name) % table_size;
if (full_name != full_name_buf)
g_free (full_name);
if (mono_jit_stats.methods_aot >= mono_last_aot_method)
return NULL;
else if (mono_jit_stats.methods_aot == mono_last_aot_method - 1) {
- if (method)
- printf ("LAST AOT METHOD: %s%s%s.%s.\n", method->klass->name_space, method->klass->name_space [0] ? "." : "", method->klass->name, method->name);
- else
+ if (!method)
+ method = mono_get_method (image, token, NULL);
+ if (method) {
+ char *name = mono_method_full_name (method, TRUE);
+ printf ("LAST AOT METHOD: %s.\n", name);
+ g_free (name);
+ } else {
printf ("LAST AOT METHOD: %p %d\n", code, method_index);
+ }
}
}
code = mono_aot_get_method (domain, m);
if (code) {
- if (mono_method_needs_static_rgctx_invoke (m, FALSE))
- code = mono_create_static_rgctx_trampoline (m, code);
+ if (mono_method_needs_static_rgctx_invoke (m, FALSE)) {
+ code = mono_create_static_rgctx_trampoline (m, mono_create_ftnptr (domain, code));
+ /* The call above returns an ftnptr */
+ code = mono_get_addr_from_ftnptr (code);
+ }
return code;
}
*/
if (ji.type == MONO_PATCH_INFO_ABS || ji.type == MONO_PATCH_INFO_INTERNAL_METHOD || ji.type == MONO_PATCH_INFO_CLASS_INIT || ji.type == MONO_PATCH_INFO_ICALL_ADDR || ji.type == MONO_PATCH_INFO_JIT_ICALL_ADDR || ji.type == MONO_PATCH_INFO_RGCTX_FETCH) {
/* These should already have a function descriptor */
+#ifdef PPC_USES_FUNCTION_DESCRIPTOR
+ /* Our function descriptors have a 0 environment, gcc created ones don't */
+ if (ji.type != MONO_PATCH_INFO_INTERNAL_METHOD && ji.type != MONO_PATCH_INFO_JIT_ICALL_ADDR && ji.type != MONO_PATCH_INFO_ICALL_ADDR)
+ g_assert (((gpointer*)target) [2] == 0);
+#endif
/* Empty */
} else if (!no_ftnptr) {
#ifdef PPC_USES_FUNCTION_DESCRIPTOR
symbol = g_strdup_printf ("rgctx_fetch_trampoline_%u", slot);
code = load_function (mono_defaults.corlib->aot_module, symbol);
g_free (symbol);
- return code;
+ /* The caller expects an ftnptr */
+ return mono_create_ftnptr (mono_domain_get (), code);
}
gpointer