-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Remove INodeWithSize interface, use IMAGE_REL_SYMBOL_SIZE relocation, and restructure ModuleInfoRow #124202
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
base: main
Are you sure you want to change the base?
Conversation
…SIZE reloc Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
|
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib |
Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReadyToRunHeaderNode.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
|
@copilot please remove the HasEndPointer flag and the Flags field it goes in. Then, update the native ModuleInfoRow type to have a Start field and a Length field instead of Start and End and remove the Flags type there as well. Finally, update the code in ReadyToRunHeaderNode to require alignment before emitting each entry. |
Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
Done. Removed HasEndPointer flag and ModuleInfoFlags enum. Updated ModuleInfoRow to have Start and Length fields instead of Start, End, and Flags. Added alignment requirement before emitting each entry. (5b50167) |
jkoritzinsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot please address this feedback
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ProxyTypeMapObjectNode.cs
Show resolved
Hide resolved
...reclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ExternalTypeMapObjectNode.cs
Show resolved
Hide resolved
Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
…otnet/runtime into copilot/remove-inodewithsize-interface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR removes the INodeWithSize mechanism for tracking emitted node sizes and switches NativeAOT module section size reporting to use RelocType.IMAGE_REL_SYMBOL_SIZE, alongside restructuring the NativeAOT ModuleInfoRow ABI to store a resolved Length directly.
Changes:
- Removed
INodeWithSizeimplementations and per-node manual size tracking (_size/Sizeproperties) across many dependency analysis nodes. - Updated
ReadyToRunHeaderNodeto emit section entries as{ SectionId, Length (IMAGE_REL_SYMBOL_SIZE), Start }and adjustedEntrySizeaccordingly. - Updated the NativeAOT runtime to consume the new
ModuleInfoRowlayout and removed the old flags/end-pointer length computation.
Reviewed changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/TypeMetadataMapNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/StructMarshallingStubMapNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/StaticsInfoHashtableNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/StackTraceMethodMappingNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/StackTraceLineNumbersNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/StackTraceDocumentsNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ResourceIndexNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ResourceDataNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectionVirtualInvokeMapNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectionInvokeMapNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectionFieldMapNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReadyToRunHeaderNode.cs | Emits IMAGE_REL_SYMBOL_SIZE for section lengths; updates EntrySize; removes INodeWithSize definition and old end-pointer logic. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ProxyTypeMapObjectNode.cs | Removes INodeWithSize/Size property and assignment. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/PointerTypeMapNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/NativeLayoutInfoNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ModuleInitializerListNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/MetadataNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/InterfaceGenericVirtualMethodTableNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/GenericVirtualMethodTableNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/GenericTypesTemplateMap.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/GenericTypesHashtableNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/GenericMethodsTemplateMap.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/GenericMethodsHashtableNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/FunctionPointerMapNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ExternalTypeMapObjectNode.cs | Removes INodeWithSize/Size property and assignment. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ExternalReferencesTableNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ExactMethodInstantiationsNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/DelegateMarshallingStubMapNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/DehydratedDataNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ClassConstructorContextMap.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ByRefTypeMapNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ArrayOfFrozenObjectsNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ArrayOfEmbeddedDataNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ArrayMapNode.cs | Removes INodeWithSize and manual _size tracking. |
| src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs | Removes managed ModuleInfoFlags enum. |
| src/coreclr/tools/Common/Compiler/ObjectWriter/ObjectWriter.cs | Always records symbol sizes for offset-0 symbols (enables IMAGE_REL_SYMBOL_SIZE resolution in NativeAOT builds). |
| src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h | Removes native ModuleInfoFlags enum. |
| src/coreclr/nativeaot/Runtime/TypeManager.h | Updates ModuleInfoRow layout to { SectionId, Length, Start }. |
| src/coreclr/nativeaot/Runtime/TypeManager.cpp | Consumes ModuleInfoRow.Length directly; removes old flag/end-pointer length computation. |
|
@copilot please invoke the code-review skill and post your analysis/results as comment on this PR |
🤖 Copilot Code Review — PR #124218Holistic AssessmentMotivation: The change removes boilerplate Approach: Correct. The Summary: Detailed Findings✅ ABI layout correctness verifiedThe managed emitter writes ✅ Size resolution flow verified
✅ Complete removal of INodeWithSizeGrepped the full tree — no references to ✅ Mach-O / ELF / PE compatibilityThe 💡 Double blank lines left by mechanical removal — cosmeticThe removal of |
|
@copilot please remove the double blank lines mentioned in #124202 (comment) |
Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
Collapsed all double blank lines across the 30 affected files. (76c42d9) |
|
@copilot go over the blank lines deleted in this pull request. Make sure a blank line still separates individual method blocks. Make sure a blank line still separates logically different parts of method bodies. |
|
The test failures look related. Pulled down a random crashdump with runfo and looks like GC statics are broken. GC statics are one of the things referenced from R2R header. |
Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Restored single blank lines at all 47 locations across the 30 files. Each location now has exactly one blank line separating method blocks and logical code sections (e.g., between constructor |
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.