-
Notifications
You must be signed in to change notification settings - Fork 5k
Collapse the recent ILStub generation patterns into a helper #115673
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
Collapse the recent ILStub generation patterns into a helper #115673
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR consolidates the ILStub generation logic into a single helper function to reduce code duplication and improve maintainability.
- Removed duplicate ILStub generation blocks across multiple files.
- Introduced the new helper function FinalizeILStub in ilstubresolver.{h,cpp} that now centralizes IL generation steps, including EH clause processing.
- Updated call sites in unsafeaccessors.cpp, instancecalli.cpp, dllimport.cpp, asyncthunks.cpp, and ilstubcache.cpp to use FinalizeILStub.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/coreclr/vm/unsafeaccessors.cpp | Replaced inline ILStub generation with FinalizeILStub call. |
src/coreclr/vm/instancecalli.cpp | Replaced inline ILStub generation with FinalizeILStub call. |
src/coreclr/vm/ilstubresolver.h | Declared FinalizeILStub helper function. |
src/coreclr/vm/ilstubresolver.cpp | Defined FinalizeILStub with additional EH clause processing. |
src/coreclr/vm/ilstubcache.cpp | Replaced inline ILStub generation with FinalizeILStub call. |
src/coreclr/vm/dllimport.cpp | Replaced inline ILStub generation with FinalizeILStub call. |
src/coreclr/vm/asyncthunks.cpp | Replaced inline ILStub generation with FinalizeILStub call. |
Comments suppressed due to low confidence (4)
src/coreclr/vm/unsafeaccessors.cpp:1010
- This call now integrates EH clause processing (via FinalizeILStub) which was not present in the original inline block. Please confirm that adding EH clause handling here is the intended behavior.
FinalizeILStub(ilResolver, &sl, resolver, methodILDecoder);
src/coreclr/vm/instancecalli.cpp:65
- The newly centralized FinalizeILStub now processes EH clauses which the original block did not. Verify that this change in behavior is acceptable for the instance call site.
FinalizeILStub(ilResolver, &sl, resolver, methodILDecoder);
src/coreclr/vm/dllimport.cpp:6486
- The consolidation into FinalizeILStub adds EH clause processing; confirm that this additional logic does not affect existing assumptions at this call site.
FinalizeILStub(ilResolver, &sl, ppResolver, ppHeader);
src/coreclr/vm/asyncthunks.cpp:56
- The refactored code now includes EH clause handling that was previously omitted here. Please ensure that integrating this logic is intended and does not impact async thunk generation.
FinalizeILStub(ilResolver, &sl, resolver, methodILDecoder);
Tagging subscribers to this area: @dotnet/interop-contrib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
/ba-g Unrelated failures |
No description provided.