Skip to content

Commit 5ef3816

Browse files
Do not emit mangled names in mstat files (#75407)
There's a 16 MB limit on total number of bytes in the string heap of an ECMA-335 module. S.R.Metadata throws an exception when the limit is reached. We can't even generate MSTAT files for an ASP.NET WebApi template. MSTAT files are useful even without this information, but I would like to generate it in the future. Using some different approach. Co-authored-by: Michal Strehovský <[email protected]>
1 parent d920ddc commit 5ef3816

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/MstatObjectDumper.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace ILCompiler
2121
public class MstatObjectDumper : ObjectDumper
2222
{
2323
private const int VersionMajor = 1;
24-
private const int VersionMinor = 0;
24+
private const int VersionMinor = 1;
2525

2626
private readonly string _fileName;
2727
private readonly TypeSystemMetadataEmitter _emitter;
@@ -82,7 +82,8 @@ private void SerializeSimpleEntry(InstructionEncoder encoder, TypeSystemEntity e
8282
{
8383
encoder.OpCode(ILOpCode.Ldtoken);
8484
encoder.Token(_emitter.EmitMetadataHandleForTypeSystemEntity(entity));
85-
encoder.LoadString(_emitter.GetUserStringHandle(mangledName));
85+
// Would like to do this but mangled names are very long and go over the 16 MB string limit quickly.
86+
// encoder.LoadString(_emitter.GetUserStringHandle(mangledName));
8687
encoder.LoadConstantI4(blob.Data.Length);
8788
}
8889

@@ -93,7 +94,8 @@ internal override void End()
9394
{
9495
methods.OpCode(ILOpCode.Ldtoken);
9596
methods.Token(_emitter.EmitMetadataHandleForTypeSystemEntity(m.Key));
96-
methods.LoadString(_emitter.GetUserStringHandle(m.Value.MangledName));
97+
// Would like to do this but mangled names are very long and go over the 16 MB string limit quickly.
98+
// methods.LoadString(_emitter.GetUserStringHandle(m.Value.MangledName));
9799
methods.LoadConstantI4(m.Value.Size);
98100
methods.LoadConstantI4(m.Value.GcInfoSize);
99101
methods.LoadConstantI4(_methodEhInfo.GetValueOrDefault(m.Key));

0 commit comments

Comments
 (0)