-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Cleanup some code under FEATURE_STUBS_AS_IL #104731
Conversation
If this helps with code quality, could you please make the same change in runtime/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMethodILEmitter.cs Lines 59 to 60 in 3f607bd
|
The same tests in DI are still failing. Can it be related to the signature instantiation in ILC? runtime/src/coreclr/tools/Common/TypeSystem/IL/Stubs/DelegateMethodILEmitter.cs Lines 63 to 81 in 3f607bd
|
We should not need a special signature instantiation like that in CoreCLR. I suspect that it is related to a special delegate calling convention used for delegate Invocation in some cases. The delegate target cannot be called via pointer - it must be called as Do you know if the Invoke method is used in the DI on a performance critical path? This is proving to be much harder than what I thought it is going to be. |
Co-authored-by: Jan Kotas <[email protected]>
I have pushed a commit with a small change to handle the new IL stub in stub manager. The manual debugger test from #104731 (comment) works fine now. |
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.
LGTM. Thank you!
Do you plan to work on cleaning up the remaining code under the feature switch? |
Aaron suggested me to avoid converting COM interop related code because the effort needed for reviewing. I'm already busy now until October. If you can confirm the review effort on behalf of interop team, I can start to investigate this when I finish urgent tasks. |
I gave it a shot in #108048. |
* Use direct SinglecastDelegateInvokeStub on windows x86 * Cleanup ifdefs * EmitDebugBreak is unused * Use IL stub for Delegate.Invoke * Remove SinglecastDelegateInvokeStub in asm * Fix method name and argument count * Code quality * Delete JIT_InternalThrow and CorInfoException * Apply the same codegen to ilc * Add KeepAlive * Emit recursive call instead * Add tests for indirect delegate invocation * Use public reflection instead. * Use ldvirtftn to bypass this check * Use winner from CompareExchange * Return Stub from GetInvokeMethodStub * Delete NEWSTUB_FL_MULTICAST and dependents * Handle new stub in ILStubManager --------- Co-authored-by: Jan Kotas <[email protected]>
There's no actually no IL stubs under this feature switch now, only asm stubs.
This PR addresses the simple cases. On all platforms except Windows x86, single cast delegate is written in invariant assembly code.
Remaining code under the feature switch is COM call stub, which is more complicated and is better separated out.