Skip to content

Commit

Permalink
Allow gsharedvt methods to be used in place of gshared methods if the…
Browse files Browse the repository at this point in the history
… latter is not found in full-aot mode. Add gsharedvt trampolines for delegates invoke wrappers.
  • Loading branch information
vargaz committed Feb 7, 2013
1 parent dca8d50 commit c4808ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mono/mini/aot-runtime.c
Expand Up @@ -3378,7 +3378,7 @@ mono_aot_get_method (MonoDomain *domain, MonoMethod *method)
g_assert (klass->inited);

/* Find method index */
if (method->is_inflated && mono_method_is_generic_sharable_impl_full (method, FALSE, FALSE, FALSE)) {
if (method->is_inflated && !method->wrapper_type && mono_method_is_generic_sharable_impl_full (method, FALSE, FALSE, FALSE)) {
/*
* For generic methods, we store the fully shared instance in place of the
* original method.
Expand Down Expand Up @@ -3478,10 +3478,10 @@ mono_aot_get_method (MonoDomain *domain, MonoMethod *method)
return code;
}

if (method_index == 0xffffff && method->is_inflated && mini_is_gsharedvt_sharable_method (method)) {
if (method_index == 0xffffff && method->is_inflated && mono_method_is_generic_sharable_impl_full (method, FALSE, FALSE, TRUE)) {
/* gsharedvt */
/* Use the all-vt shared method since this is what was AOTed */
method_index = find_extra_method (mini_get_shared_method_full (method, TRUE, FALSE), &amodule);
method_index = find_extra_method (mini_get_shared_method_full (method, TRUE, TRUE), &amodule);
if (method_index != 0xffffff)
method = mini_get_shared_method_full (method, TRUE, FALSE);
}
Expand Down
1 change: 1 addition & 0 deletions mono/mini/mini-trampolines.c
Expand Up @@ -1103,6 +1103,7 @@ mono_delegate_trampoline (mgreg_t *regs, guint8 *code, gpointer *tramp_data, gui
/* The general, unoptimized case */
m = mono_marshal_get_delegate_invoke (invoke, delegate);
code = mono_compile_method (m);
code = mini_add_method_trampoline (NULL, m, code, NULL, need_rgctx_tramp);
delegate->invoke_impl = mono_get_addr_from_ftnptr (code);
mono_debugger_trampoline_compiled (NULL, m, delegate->invoke_impl);

Expand Down

0 comments on commit c4808ef

Please sign in to comment.