[wasm][coreclr] Update contract of SystemJS_ExecuteFinalizationCallback#125121
Conversation
After `ManagedThreadBase::KickOff` call was enabled again, the contract needs same treatment as `FinalizerThread::FinalizerThreadStart`
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
There was a problem hiding this comment.
Pull request overview
Updates the CoreCLR finalizer callback contract for Browser/WASM so it matches the exception-trap behavior used by FinalizerThread::FinalizerThreadStart, now that ManagedThreadBase::KickOff is used again in this path.
Changes:
- Adjust
SystemJS_ExecuteFinalizationCallback’sCONTRACTLto beNOTHROWonTARGET_UNIXandTHROWSotherwise, aligning with the existing finalizer thread entrypoint contract.
| #ifdef TARGET_UNIX // because UNINSTALL_UNHANDLED_MANAGED_EXCEPTION_TRAP is catching exceptions only on Unix. On Windows OS is handling that. | ||
| NOTHROW; | ||
| #else // TARGET_UNIX | ||
| THROWS; | ||
| #endif // TARGET_UNIX |
There was a problem hiding this comment.
In TARGET_BROWSER builds, TARGET_UNIX is always defined by the build (see clrdefinitions.cmake), so this #ifdef TARGET_UNIX/#else in the contract is effectively dead code and the inline comment about Windows is misleading in this context. Consider simplifying the contract to a single NOTHROW; (or otherwise keying off whether UNINSTALL_UNHANDLED_MANAGED_EXCEPTION_TRAP is active) to avoid an unreachable branch and reduce confusion.
| #ifdef TARGET_UNIX // because UNINSTALL_UNHANDLED_MANAGED_EXCEPTION_TRAP is catching exceptions only on Unix. On Windows OS is handling that. | |
| NOTHROW; | |
| #else // TARGET_UNIX | |
| THROWS; | |
| #endif // TARGET_UNIX | |
| NOTHROW; |
|
nm, copilot is right, we don't need this change |
After
ManagedThreadBase::KickOffcall was enabled again, the contract needs same treatment as inFinalizerThread::FinalizerThreadStart