Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ public override int CompareToImpl(ISortableNode other, CompilerComparer comparer

public Vertex CreateTypeMap(NodeFactory factory, NativeWriter writer, Section section, INativeFormatTypeReferenceProvider externalReferences)
{
Vertex typeMapGroupVertex = externalReferences.EncodeReferenceToType(writer, TypeMapGroup);
if (map.ThrowingMethodStub is not null)
{
// We don't write out the throwing method stub for R2R
// as emitting loose methods is not supported/very expensive.
// Instead, we defer to the runtime to generate the type map
// and throw on error cases.
return section.Place(writer.GetUnsignedConstant(0)); // Invalid type map state
return section.Place(writer.GetTuple(typeMapGroupVertex, writer.GetUnsignedConstant(0))); // Invalid type map state
}

VertexHashtable typeMapHashTable = new();
Expand All @@ -61,7 +62,6 @@ public Vertex CreateTypeMap(NodeFactory factory, NativeWriter writer, Section se
}

Vertex typeMapStateVertex = writer.GetUnsignedConstant(1); // Valid type map state
Vertex typeMapGroupVertex = externalReferences.EncodeReferenceToType(writer, TypeMapGroup);
Vertex tuple = writer.GetTuple(typeMapGroupVertex, typeMapStateVertex, typeMapHashTable);
return section.Place(tuple);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public override int CompareToImpl(ISortableNode other, CompilerComparer comparer

public Vertex CreateTypeMap(NodeFactory factory, NativeWriter writer, Section section, INativeFormatTypeReferenceProvider ProxyReferences)
{
Vertex typeMapGroupVertex = ProxyReferences.EncodeReferenceToType(writer, TypeMapGroup);
if (map.ThrowingMethodStub is not null)
{
// We don't write out the throwing method stub for R2R
Expand All @@ -45,7 +46,7 @@ public Vertex CreateTypeMap(NodeFactory factory, NativeWriter writer, Section se
// in the managed type system.
// Instead, we defer to the runtime to generate the type map
// and throw on error cases.
return section.Place(writer.GetUnsignedConstant(0)); // Invalid type map state
return section.Place(writer.GetTuple(typeMapGroupVertex, writer.GetUnsignedConstant(0))); // Invalid type map state
}

VertexHashtable typeMapHashTable = new();
Expand All @@ -61,7 +62,6 @@ public Vertex CreateTypeMap(NodeFactory factory, NativeWriter writer, Section se
}

Vertex typeMapStateVertex = writer.GetUnsignedConstant(1); // Valid type map state
Vertex typeMapGroupVertex = ProxyReferences.EncodeReferenceToType(writer, TypeMapGroup);
Vertex tuple = writer.GetTuple(typeMapGroupVertex, typeMapStateVertex, typeMapHashTable);
return section.Place(tuple);
}
Expand Down
Loading