Skip to content

Delete dead code#114419

Merged
janvorli merged 1 commit into
dotnet:mainfrom
jkotas:deadcode
Apr 9, 2025
Merged

Delete dead code#114419
janvorli merged 1 commit into
dotnet:mainfrom
jkotas:deadcode

Conversation

@jkotas

@jkotas jkotas commented Apr 9, 2025

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 9, 2025 01:22
@ghost ghost added the area-VM-coreclr label Apr 9, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (4)

src/coreclr/vm/threads.cpp:7158

  • The removal of FinalizerBase and consolidation into KickOff for both thread types is clear dead code deletion. Please ensure relevant tests cover the finalizer thread behavior to verify that exception handling and thread kickoff work as expected.
void ManagedThreadBase::KickOff(ADCallBackFcnType pTarget, LPVOID args)

src/coreclr/vm/excep.cpp:4541

  • The call to DefaultCatchHandler has been modified to remove the 'isThreadBaseFilter' and 'sendAppDomainEvents' parameters. Ensure that this change aligns with the new function interface and that the expected exception event handling behavior is maintained.
DefaultCatchHandler(pParam->pExceptionInfo, NULL, useLastThrownObject, TRUE /* sendWindowsEventLog */);

src/coreclr/vm/ceeload.cpp:489

  • The removal of the DACCESS_COMPILE guard around the initialization of m_pJitInlinerTrackingMap is observed. Confirm that this change is intentional and that it does not affect builds targeting DACCESS.
#if !defined(DACCESS_COMPILE)

src/coreclr/vm/appdomain.hpp:1148

  • Changing the signature of OnUnhandledException from returning BOOL to void is a breaking change. Verify that all call sites have been updated to accommodate the new signature and that behavior remains consistent.
static void OnUnhandledException(OBJECTREF *pThrowable);

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

Comment thread src/coreclr/vm/excep.h
enum UnhandledExceptionLocation
{
ProcessWideHandler = 0x000001,
ManagedThread = 0x000002, // Does not terminate the application. CLR swallows the unhandled exception.

@jkotas jkotas Apr 9, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ManagedThread and FinalizerThread were the only two actually used values from this enum, and the one place that they were used was dead code

@jkotas jkotas marked this pull request as draft April 9, 2025 01:26
@jkotas jkotas marked this pull request as ready for review April 9, 2025 01:50
Comment thread src/coreclr/vm/excep.cpp

// ...so, continue search. i.e. let the exception go unhandled.
return EXCEPTION_CONTINUE_SEARCH;
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was always called with swallowing = true, so the rest of this method is dead code. The small piece from the above (ExceptionIsAlwaysSwallowed check) was folded into the caller.

Comment thread src/coreclr/vm/ceeload.cpp

@janvorli janvorli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

@janvorli

janvorli commented Apr 9, 2025

Copy link
Copy Markdown
Member

/ba-g the test failure has been happening consistently on all runs since yesterday. #114426

@janvorli janvorli merged commit 1b35348 into dotnet:main Apr 9, 2025
@jkotas jkotas deleted the deadcode branch April 9, 2025 12:29
@github-actions github-actions Bot locked and limited conversation to collaborators May 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants