Rename delegate fields for consistency#129635
Conversation
…rameter→_target, _functionPointer→_methodPtr (NAOT) Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
|
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib |
|
Could you review #99200 first? I'm afraid this will cause a bunch of annoying merge conflicts so I'd prefer that merged first if you have no objections. |
There was a problem hiding this comment.
Pull request overview
This PR renames several delegate backing fields across CoreCLR, NativeAOT, and related tooling to better reflect what those fields actually store, while keeping the underlying layouts/offsets consistent.
Changes:
- CoreCLR: rename delegate field
_methodBase→_helperObjectand update VM/BCL usage accordingly. - NativeAOT: rename
_firstParameter→_targetand_functionPointer→_methodPtr, updating delegate implementation logic to use the new names. - Tooling: update field-name lookups and layout comments in AOT/JIT-related tools to match the new field names.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/vm/object.h | Renames the native DelegateObject field to _helperObject and updates related setters/offset comment. |
| src/coreclr/vm/corelib.h | Updates CoreLib binder field mapping from _methodBase to _helperObject. |
| src/coreclr/vm/comdelegate.cpp | Updates collectible delegate construction to set _helperObject and refreshes related comments. |
| src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMethodILEmitter.cs | Updates delegate field lookups used by emitted IL to _target / _methodPtr. |
| src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs | Refreshes delegate layout commentary in EE info offsets to match new naming. |
| src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/TypePreinit.cs | Updates frozen delegate serialization comments/field naming to _target / _methodPtr. |
| src/coreclr/System.Private.CoreLib/src/System/MulticastDelegate.CoreCLR.cs | Updates CoreCLR delegate implementation to use _helperObject instead of _methodBase. |
| src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs | Renames the CoreCLR delegate helper field and updates usages in equality/method resolution paths. |
| src/coreclr/nativeaot/System.Private.CoreLib/src/System/Delegate.cs | Renames NativeAOT delegate backing fields and updates all internal logic to use _target / _methodPtr. |
I have started reviewing it and it is what made me to submit this PR. I do not think the mix and match of different styles and unsafe helpers in that change looks good. |
…elds Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
|
@MichalStrehovsky PTLA. No functional changes. |
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Renames delegate fields to better reflect their actual semantics across CoreCLR and NativeAOT.