Skip to content

Commit 15b1b4d

Browse files
committed
Add dedup support.
1 parent 0d7dcfb commit 15b1b4d

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

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

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15097,11 +15097,18 @@ aot_assembly (MonoAssembly *ass, guint32 jit_opts, MonoAotOptions *aot_options)
1509715097
}
1509815098

1509915099
if (acfg->aot_opts.compile_in_child) {
15100-
res = compile_assemblies_in_child (&acfg->image->assembly, 1, acfg->aot_opts.runtime_args, acfg->aot_opts.aot_options);
15101-
if (res)
15102-
return res;
15100+
if (acfg->aot_opts.dedup_include) {
15101+
if (acfg->image->assembly == dedup_assembly)
15102+
return assemble_link (acfg);
15103+
else
15104+
return 0;
15105+
} else {
15106+
res = compile_assemblies_in_child (&acfg->image->assembly, 1, acfg->aot_opts.runtime_args, acfg->aot_opts.aot_options);
15107+
if (res)
15108+
return res;
1510315109

15104-
return assemble_link (acfg);
15110+
return assemble_link (acfg);
15111+
}
1510515112
}
1510615113

1510715114
acfg->method_index = 1;
@@ -15681,15 +15688,20 @@ mono_aot_assemblies (MonoAssembly **assemblies, int nassemblies, guint32 jit_opt
1568115688
res = 1;
1568215689
goto early_exit;
1568315690
}
15684-
// FIXME:
15685-
if (nassemblies > 1)
15691+
if (nassemblies > 1 && !aot_opts.dedup_include)
1568615692
aot_opts.compile_in_child = FALSE;
1568715693
#ifdef HOST_WIN32
1568815694
// Need to create response files
1568915695
aot_opts.compile_in_child = FALSE;
1569015696
#endif
1569115697
}
1569215698

15699+
if (aot_opts.dedup_include && aot_opts.compile_in_child) {
15700+
res = compile_assemblies_in_child (assemblies, nassemblies, aot_opts.runtime_args, aot_opts.aot_options);
15701+
if (res)
15702+
return res;
15703+
}
15704+
1569315705
if (aot_opts.dedup_include) {
1569415706
/* Find the assembly which will contain the dedup-ed code */
1569515707
int dedup_aindex = -1;

0 commit comments

Comments
 (0)