Skip to content

Commit ae998eb

Browse files
[mono][aot] Avoid compiling the same method multiple times during dedup. (#92178)
Co-authored-by: Zoltan Varga <vargaz@gmail.com>
1 parent 4afeedd commit ae998eb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/mono/mono/mini/aot-compiler.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4326,6 +4326,7 @@ get_method_index (MonoAotCompile *acfg, MonoMethod *method)
43264326
return index - 1;
43274327
}
43284328

4329+
/* Return TRUE if the method can be skipped */
43294330
static gboolean
43304331
collect_dedup_method (MonoAotCompile *acfg, MonoMethod *method)
43314332
{
@@ -4334,14 +4335,16 @@ collect_dedup_method (MonoAotCompile *acfg, MonoMethod *method)
43344335
if (acfg->dedup_phase == DEDUP_SKIP)
43354336
return TRUE;
43364337
// Remember for later
4337-
if (acfg->dedup_phase == DEDUP_COLLECT && !g_hash_table_lookup (dedup_methods, method))
4338+
g_assert (acfg->dedup_phase == DEDUP_COLLECT);
4339+
if (!g_hash_table_lookup (dedup_methods, method))
43384340
g_hash_table_insert (dedup_methods, method, method);
4341+
else
4342+
// Already processed when compiling another assembly
4343+
return TRUE;
43394344
}
43404345
return FALSE;
43414346
}
43424347

4343-
4344-
43454348
static int
43464349
add_method_full (MonoAotCompile *acfg, MonoMethod *method, gboolean extra, int depth)
43474350
{

0 commit comments

Comments
 (0)