Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using ILCompiler.DependencyAnalysis;

using Internal.IL.Stubs;
using Internal.JitInterface;
using Internal.TypeSystem;

namespace ILCompiler
Expand Down Expand Up @@ -77,6 +78,9 @@ public MethodInternKey(IMethodBodyNode node, NodeFactory factory, Dictionary<ISy
var hashCode = default(HashCode);
hashCode.AddBytes(data.Data);

if (factory.Target.IsWasm)
hashCode.Add(WasmLowering.GetSignature(node.Method).FuncType);

// Hash relocations consistently with MethodInternComparer.AreSame so that bodies that only differ
// in their relocation targets (e.g. instantiations over different struct state machines)
// don't all end up in the same bucket.
Expand Down Expand Up @@ -183,6 +187,11 @@ public bool Equals(MethodInternKey a, MethodInternKey b)
&& a.Method.Method.GetTypicalMethodDefinition() != b.Method.Method.GetTypicalMethodDefinition())
return false;

// Identical WASM bodies can still have different types when some parameters are unused.
if (_factory.Target.IsWasm
&& !WasmLowering.GetSignature(a.Method.Method).FuncType.Equals(WasmLowering.GetSignature(b.Method.Method).FuncType))
Comment thread
MichalStrehovsky marked this conversation as resolved.
Resolved
return false;

ObjectNode.ObjectData o1data = ((ObjectNode)a.Method).GetData(_factory, relocsOnly: false);
ObjectNode.ObjectData o2data = ((ObjectNode)b.Method).GetData(_factory, relocsOnly: false);

Expand Down
Loading