This repository was archived by the owner on Nov 13, 2026. It is now read-only.
Repository navigation
Implement Delegate.DynamicInvoke - #1460
Merged
Merged
Conversation
| else | ||
| { | ||
| // This is in an else branch for a reason: | ||
| // Not treating e.g. void*& as IntPtr& is intentinal. |
These intrinsics support functionality in: * Delegate.DynamicInvoke * MethodInfo.Invoke * Calling convention converter I had to make the DynamicInvokeParamHelper intrinsic a StubMethod because the declaration of the intrinsic can't be expressed in C# (needs ByRef returns). This can be converted to a real intrinsic when we switch to C# 7. .NET Native for UWP does IL rewriting to make the return type match.
This is implemented with a new thunk that calls into InvokeUtils intrinsics to set up the callsite, unbox arguments, and replace default values in the signature. I'm not implementing the LoadDefaultValueString() override, so default value in the delegate signature are not supported yet. This code is undergoing changes on the TFS side right now.
MichalStrehovsky
force-pushed
the
dynamicInvoke
branch
from
July 7, 2016 16:59
53e176d to
0bdd369
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This has three logical parts (separated in three commits):
InvokeUtilsintrinsics. This is a general purpose dynamic invoke support class used byDelegate.DynamicInvoke,MethodInfo.Invoke, and the calling convention converter (not in the repo yet)I had to make the
DynamicInvokeParamHelperintrinsic aStubMethodbecause the declaration of the intrinsic can't be expressed in C#
(needs ByRef returns). This can be converted to a real intrinsic
when we switch to C# 7. .NET Native for UWP does IL rewriting
to make the return type match.