Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/coreclr/tests/issues.targets
Original file line number Diff line number Diff line change
Expand Up @@ -1421,12 +1421,6 @@
<ExcludeList Include="$(XunitTestBinBase)JIT/Methodical/tailcall_v4/hijacking/**">
<Issue>https://github.com/dotnet/runtime/issues/34068</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/JIT/Methodical/VT/callconv/_il_dbgjumps4/**">
<Issue>https://github.com/dotnet/runtime/issues/34379</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/JIT/Methodical/VT/callconv/_il_reljumps4/**">
<Issue>needs triage</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/JIT/Methodical/VT/port/_il_dbghuge_gcref/**">
<Issue>needs triage</Issue>
</ExcludeList>
Expand Down
24 changes: 23 additions & 1 deletion src/mono/mono/mini/jit-icalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ ldvirtfn_internal (MonoObject *obj, MonoMethod *method, gboolean gshared)
{
ERROR_DECL (error);
MonoMethod *res;
gpointer addr;

if (obj == NULL) {
mono_error_set_null_reference (error);
Expand All @@ -93,8 +94,29 @@ ldvirtfn_internal (MonoObject *obj, MonoMethod *method, gboolean gshared)
}

/* An rgctx wrapper is added by the trampolines no need to do it here */
gboolean need_unbox = m_class_is_valuetype (res->klass) && !m_class_is_valuetype (method->klass);
if (need_unbox && !mono_use_interpreter) {
/*
* We can't return a jump trampoline here, because the trampoline code
* can't determine whenever to add an unbox trampoline (ldvirtftn) or
* not (ldftn). So compile the method here.
*/
addr = mono_compile_method_checked (res, error);
if (!is_ok (error)) {
mono_error_set_pending_exception (error);
return NULL;
}

if (mono_llvm_only && mono_method_needs_static_rgctx_invoke (res, FALSE))
// FIXME:
g_assert_not_reached ();

addr = mini_add_method_trampoline (res, addr, mono_method_needs_static_rgctx_invoke (res, FALSE), TRUE);
} else {
addr = mono_ldftn (res);
}

return mono_ldftn (res);
return addr;
}

void*
Expand Down