-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Reflection Invoke refactoring to support future byref-like and IL emit features #66357
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
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
7ae039b
Refactoring and perf of reflection Invoke
steveharter 840c463
Stubs for register/unregister GC reporting
AaronRobinsonMSFT f9c0cac
Uptake GC Registration for core (not mono)
steveharter 2587e3f
Remove scaffolding; remove Assert
steveharter fc0c044
Add GCFrameRegistration API to Mono
AaronRobinsonMSFT 7605f5d
Refactor invoker classes to move code to runtime to avoid stackwalk i…
steveharter 54c7970
Misc changes for review prep
steveharter 99d750d
Initial support for passing byrefs to raw value types
steveharter 3334686
Continued by-ref support; still issues with nullables
steveharter 7891c3a
Address nullable issues and other clean up
steveharter 3635c16
Fix merge issue
steveharter 408fea3
Misc mono and caching
steveharter 1ab5f60
Address some CI issues
steveharter 8e9e2a3
Disable new Nullable tests on Mono
steveharter 65ccbee
Assume no padding on arg values
steveharter 8c18cb9
Review feedback
steveharter 791bdb2
Align\pad work; remove TypedReference since it can't be boxed
steveharter b27db5c
Misc micro optimizations
steveharter 61f9deb
Misc naming
steveharter be216b5
Remove support for ByRefLike + null; misc feedback
steveharter 9ade961
Remove support for ByRefLike + null on mono
steveharter bfd1062
Wrap all exceptions thrown from ::InvokeMethod; misc perf refactor
steveharter 6cb7837
Mono tests; cont'd perf refactoring
steveharter 1f81dc6
Additional validation checks
steveharter b8e3967
Merge branch 'main' of https://github.com/steveharter/runtime into Fa…
steveharter c3a8c14
Fix mono error; fix debug-build stack-walk issue
steveharter 59ef825
Don't wrap EntryPointNotFoundException; misc naming
steveharter b667080
Revert previous EntryPointNotFoundException; modify test
steveharter 6cd29a3
Non-functional nits
steveharter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
24 changes: 24 additions & 0 deletions
24
src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethodInvoker.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.Diagnostics; | ||
| using System.Runtime.CompilerServices; | ||
|
|
||
| namespace System.Reflection.Emit | ||
| { | ||
| internal sealed partial class DynamicMethodInvoker | ||
| { | ||
| private readonly DynamicMethod _dynamicMethod; | ||
|
|
||
| public DynamicMethodInvoker(DynamicMethod dynamicMethod) | ||
| { | ||
| _dynamicMethod = dynamicMethod; | ||
| } | ||
|
|
||
| public unsafe object? InvokeUnsafe(object? obj, IntPtr* args, BindingFlags invokeAttr) | ||
| { | ||
| // Todo: add strategy for calling IL Emit-based version | ||
| return _dynamicMethod.InvokeNonEmitUnsafe(obj, args, invokeAttr); | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.