Report folded method bodies in the MSTAT file#117459
Report folded method bodies in the MSTAT file#117459MichalStrehovsky merged 2 commits intodotnet:mainfrom
Conversation
So that we have this for statistics or visualizations when needed.
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for reporting folded method bodies in the MSTAT output to improve downstream statistics and visualizations.
- Introduces a
GetNameAPI onIDependencyNodeand implements it in core framework types. - Adds a
ReportFoldedNodehook to the object-dumping infrastructure and invokes it in the object writer. - Enhances
MstatObjectDumperto collect, encode, and emit deduplicated method-body mappings.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/IDependencyNode.cs | Added GetName method to the dependency-node interface |
| src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/DependencyNodeCore.cs | Explicit interface implementation for the new GetName method |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ReachabilityInstrumentationProvider.cs | Provided a GetName implementation on UntrackedSymbol |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/ObjectWriter.cs | Reports folded symbol nodes via ReportFoldedNode |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectDumper.cs | Added default ReportFoldedNode in the dumper base class |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/MstatObjectDumper.cs | Tracks and emits deduplicated method-body data |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/IObjectDumper.cs | Declared new ReportFoldedNode in dumper interface |
Comments suppressed due to low confidence (4)
src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/IDependencyNode.cs:44
- [nitpick] Consider adding an XML doc comment for the new
GetNamemethod to explain its purpose and expected return value.
string GetName(DependencyContextType context);
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectDumper.cs:19
- [nitpick] Add XML documentation to explain when and why
ReportFoldedNodeis called and how implementations should handle it.
public virtual void ReportFoldedNode(NodeFactory factory, ObjectNode originalNode, ISymbolNode targetNode) { }
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/IObjectDumper.cs:11
- [nitpick] Consider adding an XML doc comment to the interface method to describe its contract and potential side effects.
void ReportFoldedNode(NodeFactory factory, ObjectNode originalNode, ISymbolNode targetNode);
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/MstatObjectDumper.cs:183
- New logic for collecting and encoding deduplicated method bodies should be covered by a unit or integration test to verify the MSTAT output includes the expected
DeduplicatedMethodssection.
var deduplicatedMethods = new InstructionEncoder(new BlobBuilder());
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ReachabilityInstrumentationProvider.cs
Outdated
Show resolved
Hide resolved
|
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
…yInstrumentationProvider.cs Co-authored-by: Copilot <[email protected]>
|
@sbomer is this something you'd be comfortable reviewing? |
|
/ba-g wasm deadletters |
So that we have this for statistics or visualizations when needed.
Cc @dotnet/ilc-contrib