Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Delete dead code #114419

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

Merged
merged 1 commit into from
Apr 9, 2025
Merged

Delete dead code #114419

merged 1 commit into from
Apr 9, 2025

Conversation

jkotas
Copy link
Member

@jkotas jkotas commented Apr 9, 2025

No description provided.

@Copilot 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
Copy link
Contributor

@Copilot Copilot AI left a comment

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);

Copy link
Contributor

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

enum UnhandledExceptionLocation
{
ProcessWideHandler = 0x000001,
ManagedThread = 0x000002, // Does not terminate the application. CLR swallows the unhandled exception.
Copy link
Member Author

@jkotas jkotas Apr 9, 2025

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

// ...so, continue search. i.e. let the exception go unhandled.
return EXCEPTION_CONTINUE_SEARCH;
}
Copy link
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.

Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@janvorli
Copy link
Member

janvorli commented Apr 9, 2025

/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
96 of 98 checks passed
@jkotas jkotas deleted the deadcode branch April 9, 2025 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants