Conversation
Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove unused DEFINE_METHOD identifiers from corelib.h
Remove 19 unused DEFINE_METHOD identifiers from corelib.h
Nov 14, 2025
This was referenced Nov 15, 2025
Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Copilot
AI
changed the title
Remove 19 unused DEFINE_METHOD identifiers from corelib.h
Remove 15 unused DEFINE_METHOD identifiers from corelib.h
Nov 15, 2025
jkotas
reviewed
Nov 15, 2025
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
jkotas
reviewed
Nov 15, 2025
jkotas
reviewed
Nov 15, 2025
Member
|
@copilot Could you please also delete all unused signatures in metasig.h while you are on it? |
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot
AI
changed the title
Remove 15 unused DEFINE_METHOD identifiers from corelib.h
Remove 15 unused DEFINE_METHOD identifiers and orphaned managed method from corelib.h
Nov 15, 2025
jkotas
reviewed
Nov 15, 2025
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Contributor
Author
Done in 455d099. All 6 unused signatures in metasig.h have been deleted:
|
Copilot
AI
changed the title
Remove 15 unused DEFINE_METHOD identifiers and orphaned managed method from corelib.h
Remove 15 unused DEFINE_METHOD identifiers, orphaned methods, and unused metasig signatures
Nov 15, 2025
jkotas
reviewed
Nov 15, 2025
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot
AI
changed the title
Remove 15 unused DEFINE_METHOD identifiers, orphaned methods, and unused metasig signatures
Remove 16 unused DEFINE_METHOD identifiers, orphaned methods, and unused metasig signatures
Nov 15, 2025
3 tasks
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot
AI
changed the title
Remove 16 unused DEFINE_METHOD identifiers, orphaned methods, and unused metasig signatures
Remove 16 unused DEFINE_METHOD identifiers, orphaned methods and classes, and unused metasig signatures
Nov 15, 2025
jkotas
approved these changes
Nov 15, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR removes dead code from CoreCLR by eliminating 16 unused DEFINE_METHOD identifiers from src/coreclr/vm/corelib.h, along with their corresponding managed method implementations, classes, and metasig signatures that became unreferenced.
- Removes 16 DEFINE_METHOD entries across various classes (CLASS, CRITICAL_HANDLE, TASK_1, RT_TYPE_HANDLE, RUNTIME_HELPERS, ASYNC_HELPERS, TIMER_QUEUE, THREAD_POOL, STUBHELPERS)
- Removes 2 orphaned managed methods and 1 orphaned class from StubHelpers.cs
- Removes 6 unused metasig signatures from metasig.h
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/coreclr/vm/corelib.h | Removes 16 unused DEFINE_METHOD macro entries that had no references in the native codebase |
| src/coreclr/vm/metasig.h | Removes 6 metasig signature definitions that were only referenced by the removed DEFINE_METHOD entries |
| src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs | Removes 2 managed methods (KeepAliveViaCleanupList, LayoutDestroyNativeInternal) and 1 class (KeepAliveCleanupWorkListElement) that became orphaned after DEFINE_METHOD removal |
Member
|
This PR breaks #120976
Related #121359 (comment) Fix -> #122068 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes 16 unreferenced DEFINE_METHOD identifiers from
src/coreclr/vm/corelib.hthat were identified as unused dead code. Also removes the orphaned managed method implementations, classes, and unused metasig signatures that became unreferenced after the DEFINE_METHOD removal.Removed Identifiers
CLASS
GET_METHOD_BASE-GetMethodBase(RuntimeType, RuntimeMethodHandleInternal)GET_FIELD_INFO-GetFieldInfo(RuntimeType, IRuntimeFieldInfo)CRITICAL_HANDLE
RELEASE_HANDLE-ReleaseHandle()GET_IS_INVALID-get_IsInvalid()DISPOSE_BOOL-Dispose(bool)DISPOSE-Dispose()TASK_1
GET_RESULTONSUCCESS-get_ResultOnSuccess()RT_TYPE_HANDLE
PVOID_CTOR-.ctor(RuntimeType)RUNTIME_HELPERS
GET_TAILCALL_INFO-GetTailCallInfo()ASYNC_HELPERS
UNSAFE_AWAIT_AWAITER_1-UnsafeAwaitAwaiter<T>()TIMER_QUEUE / THREAD_POOL (TARGET_BROWSER only)
TIMER_HANDLER-TimerHandler()BACKGROUND_JOB_HANDLER-BackgroundJobHandler()STUBHELPERS
KEEP_ALIVE_VIA_CLEANUP_LIST-KeepAliveViaCleanupList()FMT_CLASS_UPDATE_NATIVE_INTERNAL-FmtClassUpdateNativeInternal()FMT_CLASS_UPDATE_CLR_INTERNAL-FmtClassUpdateCLRInternal()LAYOUT_DESTROY_NATIVE_INTERNAL-LayoutDestroyNativeInternal()Removed Managed Methods
LayoutDestroyNativeInternalmethod insrc/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs- This managed method implementation was removed as it had no remaining callers after its corresponding DEFINE_METHOD macro was deleted from corelib.h.KeepAliveViaCleanupListmethod insrc/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs- This managed method implementation was removed as it had no remaining callers after its corresponding DEFINE_METHOD macro was deleted from corelib.h.Removed Managed Classes
KeepAliveCleanupWorkListElementclass insrc/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs- This class was orphaned after deleting theKeepAliveViaCleanupListmethod that was its only consumer.Removed Metasig Signatures
The following unused signature definitions were removed from
src/coreclr/vm/metasig.h:SM(RuntimeType_RuntimeMethodHandleInternal_RetMethodBase, ...)SM(RuntimeType_IRuntimeFieldInfo_RetFieldInfo, ...)SM(Obj_PtrByte_RefCleanupWorkListElement_RetVoid, ...)SM(Obj_PtrByte_RetVoid, ...)IM(RuntimeType_RetVoid, ...)SM(RefCleanupWorkListElement_Obj_RetVoid, ...)SZARRAYHELPER Methods - Preserved
All SZARRAYHELPER methods remain unchanged in their original positions to preserve the ordering invariant required for ILLink. The comment in the code states: "The order of methods here has to match order they are implemented on the interfaces in IEnumerable`1". These methods were initially considered for removal but have been kept to maintain compatibility:
ISREADONLY-get_IsReadOnly()COPYTO-CopyTo()INDEXOF-IndexOf()REMOVEAT-RemoveAt()All removed identifiers, methods, classes, and signatures verified to have zero references in the CoreCLR codebase.
This pull request was created as a result of the following prompt from Copilot chat.
This pull request was created as a result of the following prompt from Copilot chat.
This pull request was created as a result of the following prompt from Copilot chat.
This pull request was created as a result of the following prompt from Copilot chat.
Original prompt
This pull request was created as a result of the following prompt from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.