diff options
author | David Wrighton <davidwr@microsoft.com> | 2017-05-10 21:43:38 +0300 |
---|---|---|
committer | David Wrighton <davidwr@microsoft.com> | 2017-05-10 21:43:38 +0300 |
commit | 46e14013328c78e790065d43be7e1700a9c414ad (patch) | |
tree | 9f9809dd6032b4e12e2f9e6dc8e0c34e2cf4d47f /src/Runtime.Base | |
parent | 0d74b53baa421a5fba4b76ea0787a440ad59871b (diff) |
Add support for getting the System.Array type from the runtime
- Make it work for all TypeManagerHandle based environments
- Including non INPLACE_RUNTIME based cases
- Uses classlib functions architecture
[tfs-changeset: 1657913]
Diffstat (limited to 'src/Runtime.Base')
-rw-r--r-- | src/Runtime.Base/src/System/Runtime/EEType.Runtime.cs | 11 | ||||
-rw-r--r-- | src/Runtime.Base/src/System/Runtime/ExceptionHandling.cs | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/Runtime.Base/src/System/Runtime/EEType.Runtime.cs b/src/Runtime.Base/src/System/Runtime/EEType.Runtime.cs index b517cb77f..475b77568 100644 --- a/src/Runtime.Base/src/System/Runtime/EEType.Runtime.cs +++ b/src/Runtime.Base/src/System/Runtime/EEType.Runtime.cs @@ -23,8 +23,15 @@ namespace Internal.Runtime internal EEType* GetArrayEEType() { -#if INPLACE_RUNTIME - return EETypePtr.EETypePtrOf<Array>().ToPointer(); + fixed (EEType* pThis = &this) + { + IntPtr pGetArrayEEType = (IntPtr)InternalCalls.RhpGetClasslibFunctionFromEEtype(new IntPtr(pThis), EH.ClassLibFunctionId.GetSystemArrayEEType); + if (pGetArrayEEType != IntPtr.Zero) + return (EEType*)CalliIntrinsics.Call<IntPtr>(pGetArrayEEType); + } +#if CORERT + EH.FallbackFailFast(RhFailFastReason.InternalError, null); + return null; #else fixed (EEType* pThis = &this) return InternalCalls.RhpGetArrayBaseType(pThis); diff --git a/src/Runtime.Base/src/System/Runtime/ExceptionHandling.cs b/src/Runtime.Base/src/System/Runtime/ExceptionHandling.cs index c4f7b07c3..ea552bb34 100644 --- a/src/Runtime.Base/src/System/Runtime/ExceptionHandling.cs +++ b/src/Runtime.Base/src/System/Runtime/ExceptionHandling.cs @@ -152,6 +152,8 @@ namespace System.Runtime FailFast = 1, // UnhandledExceptionHandler = 2, // unused AppendExceptionStackFrame = 3, + CheckStaticClassConstruction = 4, + GetSystemArrayEEType = 5, } // Given an address pointing somewhere into a managed module, get the classlib-defined fail-fast |