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

[wasm] Enable dedup by default. #80260

Merged
merged 5 commits into from
Jan 18, 2023
Merged
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
2 changes: 1 addition & 1 deletion eng/testing/tests.wasm.targets
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
- for AOT library tests, we use WasmNativeStrip=false, so we already have symbols
-->
<WasmNativeStrip Condition="'$(WasmNativeStrip)' == ''">false</WasmNativeStrip>
<WasmEmitSymbolMap Condition="'$(WasmEmitSymbolMap)' == '' and '$(RunAOTCompilation)' != 'true'">true</WasmEmitSymbolMap>
<WasmEmitSymbolMap Condition="'$(WasmEmitSymbolMap)' == ''">true</WasmEmitSymbolMap>
vargaz marked this conversation as resolved.
Show resolved Hide resolved

<!-- Run only if previous command succeeded -->
<_ShellCommandSeparator Condition="'$(OS)' == 'Windows_NT'">&amp;&amp;</_ShellCommandSeparator>
Expand Down
1 change: 0 additions & 1 deletion src/mono/wasm/Wasm.Build.Tests/WasmTemplateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ public static TheoryData<string, bool, bool> TestDataForConsolePublishAndRun()
{
var data = new TheoryData<string, bool, bool>();
data.Add("Debug", false, false);
data.Add("Debug", false, false);
data.Add("Debug", false, true);
data.Add("Release", false, false); // Release relinks by default

Expand Down
2 changes: 1 addition & 1 deletion src/mono/wasm/build/WasmApp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
-->

<PropertyGroup>
<WasmDedup Condition="'$(WasmDedup)' == ''">false</WasmDedup>
<WasmDedup Condition="'$(WasmDedup)' == ''">true</WasmDedup>
<WasmEnableExceptionHandling Condition="'$(WasmEnableExceptionHandling)' == ''">false</WasmEnableExceptionHandling>
<WasmEnableSIMD Condition="'$(WasmEnableSIMD)' == ''">false</WasmEnableSIMD>

Expand Down
12 changes: 9 additions & 3 deletions src/tasks/AotCompilerTask/MonoAOTCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ private IEnumerable<ITaskItem> EnsureAllAssembliesInTheSameDir(IEnumerable<ITask

ITaskItem newAsm = new TaskItem(newPath);
asmItem.CopyMetadataTo(newAsm);
asmItem.SetMetadata(s_originalFullPathMetadataName, asmPath);
newAsm.SetMetadata(s_originalFullPathMetadataName, asmPath);
newAssemblies.Add(newAsm);
}

Expand Down Expand Up @@ -1076,8 +1076,14 @@ private static List<ITaskItem> ConvertAssembliesDictToOrderedList(ConcurrentDict
List<ITaskItem> outItems = new(originalAssemblies.Count);
foreach (ITaskItem item in originalAssemblies)
{
if (dict.TryGetValue(item.GetMetadata("FullPath"), out ITaskItem? dictItem))
outItems.Add(dictItem);
if (!dict.TryGetValue(item.GetMetadata("FullPath"), out ITaskItem? dictItem))
continue;

string originalFullPath = item.GetMetadata(s_originalFullPathMetadataName);
if (!string.IsNullOrEmpty(originalFullPath))
dictItem.ItemSpec = originalFullPath;

outItems.Add(dictItem);
}
return outItems;
}
Expand Down