diff options
author | JUNG DONG-HEON <dheon.jung@samsung.com> | 2020-06-08 10:20:14 +0900 |
---|---|---|
committer | 이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com> | 2020-06-18 07:38:46 +0900 |
commit | 7d6fa13ce85654174b882c9e934c000dfd2222fe (patch) | |
tree | 46c473fdedd5747c2ad281170c0416407b74a503 /src/System.Private.CoreLib | |
parent | 488be5d790020489f7f4dd7d43680f43b101dbd4 (diff) | |
download | coreclr-7d6fa13ce85654174b882c9e934c000dfd2222fe.tar.gz coreclr-7d6fa13ce85654174b882c9e934c000dfd2222fe.tar.bz2 coreclr-7d6fa13ce85654174b882c9e934c000dfd2222fe.zip |
Implement instantiating and unboxing through portable stublinker code… (#106)
* Implement instantiating and unboxing through portable stublinker code
- Handle only the cases with register to register moves
- Shares abi processing logic with delegate shuffle thunk creation
- Architecture specific logic is relatively simple
- Do not permit use of HELPERREG in computed instantiating stubs
- Fix GetArgLoc such that it works on all architectures and OS combinations
Add a JIT stress test case for testing all of the various combinations
- Use the same calling convention test architecture that was used as part of tail call work
Rename secure delegates to wrapper delegates
- Secure delegates are no longer a feature of the runtime
- But the wrapper delegate lives on as a workaround for a weird detail of the ARM32 abi
Diffstat (limited to 'src/System.Private.CoreLib')
-rw-r--r-- | src/System.Private.CoreLib/src/System/MulticastDelegate.cs | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/System.Private.CoreLib/src/System/MulticastDelegate.cs b/src/System.Private.CoreLib/src/System/MulticastDelegate.cs index 67b3ef443b..368a462798 100644 --- a/src/System.Private.CoreLib/src/System/MulticastDelegate.cs +++ b/src/System.Private.CoreLib/src/System/MulticastDelegate.cs @@ -17,10 +17,9 @@ namespace System [ComVisible(true)] public abstract class MulticastDelegate : Delegate { - // This is set under 3 circumstances + // This is set under 2 circumstances // 1. Multicast delegate - // 2. Secure/Wrapper delegate - // 3. Inner delegate of secure delegate where the secure delegate security context is a collectible method + // 2. Wrapper delegate private object? _invocationList; // Initialized by VM as needed private IntPtr _invocationCount; @@ -74,7 +73,7 @@ namespace System { // there are 4 kind of delegate kinds that fall into this bucket // 1- Multicast (_invocationList is Object[]) - // 2- Secure/Wrapper (_invocationList is Delegate) + // 2- Wrapper (_invocationList is Delegate) // 3- Unmanaged FntPtr (_invocationList == null) // 4- Open virtual (_invocationCount == MethodDesc of target, _invocationList == null, LoaderAllocator, or DynamicResolver) @@ -90,7 +89,7 @@ namespace System // now we know 'this' is not a special one, so we can work out what the other is if ((d._invocationList as Delegate) != null) - // this is a secure/wrapper delegate so we need to unwrap and check the inner one + // this is a wrapper delegate so we need to unwrap and check the inner one return Equals(d._invocationList); return base.Equals(obj); @@ -99,7 +98,7 @@ namespace System { if (_invocationList is Delegate invocationListDelegate) { - // this is a secure/wrapper delegate so we need to unwrap and check the inner one + // this is a wrapper delegate so we need to unwrap and check the inner one return invocationListDelegate.Equals(obj); } else @@ -124,7 +123,7 @@ namespace System // now we know 'this' is not a special one, so we can work out what the other is if ((d._invocationList as Delegate) != null) - // this is a secure/wrapper delegate so we need to unwrap and check the inner one + // this is a wrapper delegate so we need to unwrap and check the inner one return Equals(d._invocationList); // now we can call on the base @@ -472,7 +471,7 @@ namespace System { if (_invocationList is Delegate t) { - // this is a secure/wrapper delegate so we need to unwrap and check the inner one + // this is a wrapper delegate so we need to unwrap and check the inner one return t.GetHashCode(); } } @@ -499,7 +498,7 @@ namespace System { // _invocationCount != 0 we are in one of these cases: // - Multicast -> return the target of the last delegate in the list - // - Secure/wrapper delegate -> return the target of the inner delegate + // - wrapper delegate -> return the target of the inner delegate // - unmanaged function pointer - return null // - virtual open delegate - return null if (InvocationListLogicallyNull()) @@ -537,7 +536,7 @@ namespace System if (_invocationList is MulticastDelegate innerDelegate) { - // must be a secure/wrapper delegate + // must be a wrapper delegate return innerDelegate.GetMethodImpl(); } } @@ -562,7 +561,7 @@ namespace System return (MethodInfo)_methodBase; } - // Otherwise, must be an inner delegate of a SecureDelegate of an open virtual method. In that case, call base implementation + // Otherwise, must be an inner delegate of a Wrapper of an open virtual method. In that case, call base implementation return base.GetMethodImpl(); } |