Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/8.0] [mono][aot] Avoid compiling the same method multiple times during dedup. #92178

Merged
merged 1 commit into from
Sep 18, 2023
Merged
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
9 changes: 6 additions & 3 deletions src/mono/mono/mini/aot-compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -4326,6 +4326,7 @@ get_method_index (MonoAotCompile *acfg, MonoMethod *method)
return index - 1;
}

/* Return TRUE if the method can be skipped */
static gboolean
collect_dedup_method (MonoAotCompile *acfg, MonoMethod *method)
{
Expand All @@ -4334,14 +4335,16 @@ collect_dedup_method (MonoAotCompile *acfg, MonoMethod *method)
if (acfg->dedup_phase == DEDUP_SKIP)
return TRUE;
// Remember for later
if (acfg->dedup_phase == DEDUP_COLLECT && !g_hash_table_lookup (dedup_methods, method))
g_assert (acfg->dedup_phase == DEDUP_COLLECT);
if (!g_hash_table_lookup (dedup_methods, method))
g_hash_table_insert (dedup_methods, method, method);
else
// Already processed when compiling another assembly
return TRUE;
}
return FALSE;
}



static int
add_method_full (MonoAotCompile *acfg, MonoMethod *method, gboolean extra, int depth)
{
Expand Down
Loading