Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Au <andrewau@microsoft.com>2017-05-20 01:15:47 +0300
committerAndrew Au <andrewau@microsoft.com>2017-05-20 01:15:47 +0300
commitfc82237c820e10baf1c6687cf7c9e03b207a4af4 (patch)
treeb48bba9bcd5fe96ac6253b34d6becde2b5b0ff21 /src
parent3ac38ac2bad4ba765a2e634ca01843847a82693e (diff)
Refactoring
[tfs-changeset: 1658966]
Diffstat (limited to 'src')
-rw-r--r--src/System.Private.CoreLib/src/Internal/Runtime/Augments/RuntimeAugments.cs41
-rw-r--r--src/System.Private.CoreLib/src/MembersMustExist.AnalyzerData4
-rw-r--r--src/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs17
-rw-r--r--src/System.Private.Jit/src/Internal/Runtime/JitSupport/RyuJitExecutionStrategy.cs3
-rw-r--r--src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/DebugFuncEval.cs13
-rw-r--r--src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/EETypeCreator.cs4
6 files changed, 62 insertions, 20 deletions
diff --git a/src/System.Private.CoreLib/src/Internal/Runtime/Augments/RuntimeAugments.cs b/src/System.Private.CoreLib/src/Internal/Runtime/Augments/RuntimeAugments.cs
index ce2131230..49da77fd1 100644
--- a/src/System.Private.CoreLib/src/Internal/Runtime/Augments/RuntimeAugments.cs
+++ b/src/System.Private.CoreLib/src/Internal/Runtime/Augments/RuntimeAugments.cs
@@ -1054,6 +1054,47 @@ namespace Internal.Runtime.Augments
{
return typeHandle.LastResortToString;
}
+
+ public static void RhpSetHighLevelDebugFuncEvalHelper(IntPtr highLevelDebugFuncEvalHelper)
+ {
+ RuntimeImports.RhpSetHighLevelDebugFuncEvalHelper(highLevelDebugFuncEvalHelper);
+ }
+
+ public static void RhpSendCustomEventToDebugger(IntPtr payload, int length)
+ {
+ RuntimeImports.RhpSendCustomEventToDebugger(payload, length);
+ }
+
+ public static IntPtr RhpGetFuncEvalTargetAddress()
+ {
+ return RuntimeImports.RhpGetFuncEvalTargetAddress();
+ }
+
+ [CLSCompliant(false)]
+ public static uint RhpGetFuncEvalParameterBufferSize()
+ {
+ return RuntimeImports.RhpGetFuncEvalParameterBufferSize();
+ }
+
+ public static unsafe object RhBoxAny(IntPtr pData, IntPtr pEEType)
+ {
+ return RuntimeImports.RhBoxAny((void*)pData, new EETypePtr(pEEType));
+ }
+
+ public static IntPtr RhHandleAlloc(Object value, GCHandleType type)
+ {
+ return RuntimeImports.RhHandleAlloc(value, type);
+ }
+
+ public static void RhHandleFree(IntPtr handle)
+ {
+ RuntimeImports.RhHandleFree(handle);
+ }
+
+ public static IntPtr RhGetOSModuleForMrt()
+ {
+ return RuntimeImports.RhGetOSModuleForMrt();
+ }
}
}
diff --git a/src/System.Private.CoreLib/src/MembersMustExist.AnalyzerData b/src/System.Private.CoreLib/src/MembersMustExist.AnalyzerData
index c798ffe66..e321c569a 100644
--- a/src/System.Private.CoreLib/src/MembersMustExist.AnalyzerData
+++ b/src/System.Private.CoreLib/src/MembersMustExist.AnalyzerData
@@ -120,11 +120,11 @@ internal static extern System.IntPtr System.Runtime.RuntimeImports.RhGetRuntimeH
internal static extern System.IntPtr System.Runtime.RuntimeImports.RhGetThreadLocalStorageForDynamicType(int index, int tlsStorageSize, int numTlsCells)
internal static extern byte* System.Runtime.RuntimeImports.RhGetThreadStaticFieldAddress(System.EETypePtr pEEType, System.IntPtr fieldCookie)
internal static extern System.IntPtr System.Runtime.RuntimeImports.RhGetUniversalTransitionThunk()
-public static System.IntPtr System.Runtime.RuntimeImports.RhHandleAlloc(object value, System.Runtime.InteropServices.GCHandleType type)
+internal static System.IntPtr System.Runtime.RuntimeImports.RhHandleAlloc(object value, System.Runtime.InteropServices.GCHandleType type)
internal static System.IntPtr System.Runtime.RuntimeImports.RhHandleAllocDependent(object primary, object secondary)
internal static System.IntPtr System.Runtime.RuntimeImports.RhHandleAllocVariable(object value, uint type)
internal static extern uint System.Runtime.RuntimeImports.RhHandleCompareExchangeVariableType(System.IntPtr handle, uint oldType, uint newType)
-public static extern void System.Runtime.RuntimeImports.RhHandleFree(System.IntPtr handle)
+internal static extern void System.Runtime.RuntimeImports.RhHandleFree(System.IntPtr handle)
internal static extern object System.Runtime.RuntimeImports.RhHandleGet(System.IntPtr handle)
internal static extern object System.Runtime.RuntimeImports.RhHandleGetDependent(System.IntPtr handle, out object secondary)
internal static extern uint System.Runtime.RuntimeImports.RhHandleGetVariableType(System.IntPtr handle)
diff --git a/src/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs b/src/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs
index 330580c99..bf7bc1b99 100644
--- a/src/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs
+++ b/src/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs
@@ -31,18 +31,17 @@ namespace System.Runtime
[MethodImpl(MethodImplOptions.InternalCall)]
[RuntimeImport(RuntimeLibrary, "RhpSetHighLevelDebugFuncEvalHelper")]
- public static extern void RhpSetHighLevelDebugFuncEvalHelper(IntPtr highLevelDebugFuncEvalHelper);
+ internal static extern void RhpSetHighLevelDebugFuncEvalHelper(IntPtr highLevelDebugFuncEvalHelper);
[MethodImpl(MethodImplOptions.InternalCall)]
[RuntimeImport(RuntimeLibrary, "RhpSendCustomEventToDebugger")]
- public static extern void RhpSendCustomEventToDebugger(IntPtr payload, int length);
+ internal static extern void RhpSendCustomEventToDebugger(IntPtr payload, int length);
[DllImport(RuntimeLibrary, ExactSpelling = true)]
- public static extern IntPtr RhpGetFuncEvalTargetAddress();
+ internal static extern IntPtr RhpGetFuncEvalTargetAddress();
[DllImport(RuntimeLibrary, ExactSpelling = true)]
- [CLSCompliant(false)]
- public static extern uint RhpGetFuncEvalParameterBufferSize();
+ internal static extern uint RhpGetFuncEvalParameterBufferSize();
//
// calls to GC
@@ -187,7 +186,7 @@ namespace System.Runtime
[RuntimeImport(RuntimeLibrary, "RhpHandleAlloc")]
private static extern IntPtr RhpHandleAlloc(Object value, GCHandleType type);
- public static IntPtr RhHandleAlloc(Object value, GCHandleType type)
+ internal static IntPtr RhHandleAlloc(Object value, GCHandleType type)
{
IntPtr h = RhpHandleAlloc(value, type);
if (h == IntPtr.Zero)
@@ -224,7 +223,7 @@ namespace System.Runtime
// Free handle.
[MethodImpl(MethodImplOptions.InternalCall)]
[RuntimeImport(RuntimeLibrary, "RhHandleFree")]
- public static extern void RhHandleFree(IntPtr handle);
+ internal static extern void RhHandleFree(IntPtr handle);
// Get object reference from handle.
[MethodImpl(MethodImplOptions.InternalCall)]
@@ -298,7 +297,7 @@ namespace System.Runtime
//
[MethodImpl(MethodImplOptions.InternalCall)]
[RuntimeImport(RuntimeLibrary, "RhBoxAny")]
- public static extern unsafe object RhBoxAny(IntPtr pData, IntPtr pEEType);
+ internal static extern unsafe object RhBoxAny(void* pData, EETypePtr pEEType);
[MethodImpl(MethodImplOptions.InternalCall)]
[RuntimeImport(RuntimeLibrary, "RhNewObject")]
@@ -540,7 +539,7 @@ namespace System.Runtime
[MethodImplAttribute(MethodImplOptions.InternalCall)]
[RuntimeImport(RuntimeLibrary, "RhGetOSModuleForMrt")]
- public static extern IntPtr RhGetOSModuleForMrt();
+ internal static extern IntPtr RhGetOSModuleForMrt();
[MethodImplAttribute(MethodImplOptions.InternalCall)]
[RuntimeImport(RuntimeLibrary, "RhGetThreadStaticFieldAddress")]
diff --git a/src/System.Private.Jit/src/Internal/Runtime/JitSupport/RyuJitExecutionStrategy.cs b/src/System.Private.Jit/src/Internal/Runtime/JitSupport/RyuJitExecutionStrategy.cs
index 078258ef8..e67b3b8c4 100644
--- a/src/System.Private.Jit/src/Internal/Runtime/JitSupport/RyuJitExecutionStrategy.cs
+++ b/src/System.Private.Jit/src/Internal/Runtime/JitSupport/RyuJitExecutionStrategy.cs
@@ -8,6 +8,7 @@ using System.Collections.Generic;
using System.Runtime.InteropServices;
using Internal.JitInterface;
+using Internal.Runtime.Augments;
using Internal.Runtime.TypeLoader;
using Internal.TypeSystem;
@@ -62,7 +63,7 @@ namespace Internal.Runtime.JitSupport
{
if (_corInfoImpl == null)
{
- InitJitCodeManager(RuntimeImports.RhGetOSModuleForMrt ());
+ InitJitCodeManager(RuntimeAugments.RhGetOSModuleForMrt ());
// TODO: Recycle jit interface object and TypeSystemContext
_context = TypeSystemContextFactory.Create();
diff --git a/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/DebugFuncEval.cs b/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/DebugFuncEval.cs
index 1e6790327..e3089de06 100644
--- a/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/DebugFuncEval.cs
+++ b/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/DebugFuncEval.cs
@@ -8,6 +8,7 @@ using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Internal.NativeFormat;
+using Internal.Runtime.Augments;
using Internal.Runtime.CallInterceptor;
using Internal.Runtime.CompilerServices;
using Internal.TypeSystem;
@@ -31,7 +32,7 @@ namespace Internal.Runtime.TypeLoader
}
// Obtain the target method address from the runtime
- IntPtr targetAddress = RuntimeImports.RhpGetFuncEvalTargetAddress();
+ IntPtr targetAddress = RuntimeAugments.RhpGetFuncEvalTargetAddress();
LocalVariableType[] returnAndArgumentTypes = new LocalVariableType[param.types.Length];
for (int i = 0; i < returnAndArgumentTypes.Length; i++)
@@ -49,7 +50,7 @@ namespace Internal.Runtime.TypeLoader
{
// Box the return
IntPtr input = arguments.GetAddressOfVarData(0);
- object returnValue = RuntimeImports.RhBoxAny(input, (IntPtr)param.types[0].ToEETypePtr());
+ object returnValue = RuntimeAugments.RhBoxAny(input, (IntPtr)param.types[0].ToEETypePtr());
GCHandle returnValueHandle = GCHandle.Alloc(returnValue);
// Signal to the debugger the func eval completes
@@ -57,7 +58,7 @@ namespace Internal.Runtime.TypeLoader
funcEvalCompleteCommand->commandCode = 0;
funcEvalCompleteCommand->returnAddress = (long)GCHandle.ToIntPtr(returnValueHandle);
IntPtr funcEvalCompleteCommandPointer = new IntPtr(funcEvalCompleteCommand);
- RuntimeImports.RhpSendCustomEventToDebugger(funcEvalCompleteCommandPointer, Unsafe.SizeOf<FuncEvalCompleteCommand>());
+ RuntimeAugments.RhpSendCustomEventToDebugger(funcEvalCompleteCommandPointer, Unsafe.SizeOf<FuncEvalCompleteCommand>());
}
// debugger magic will make sure this function never returns, instead control will be transferred back to the point where the FuncEval begins
@@ -94,7 +95,7 @@ namespace Internal.Runtime.TypeLoader
private static void HighLevelDebugFuncEvalHelper()
{
- uint parameterBufferSize = RuntimeImports.RhpGetFuncEvalParameterBufferSize();
+ uint parameterBufferSize = RuntimeAugments.RhpGetFuncEvalParameterBufferSize();
IntPtr writeParameterCommandPointer;
IntPtr debuggerBufferPointer;
@@ -111,7 +112,7 @@ namespace Internal.Runtime.TypeLoader
writeParameterCommandPointer = new IntPtr(&writeParameterCommand);
- RuntimeImports.RhpSendCustomEventToDebugger(writeParameterCommandPointer, Unsafe.SizeOf<WriteParameterCommand>());
+ RuntimeAugments.RhpSendCustomEventToDebugger(writeParameterCommandPointer, Unsafe.SizeOf<WriteParameterCommand>());
// .. debugger magic ... the debuggerBuffer will be filled with parameter data
@@ -198,7 +199,7 @@ namespace Internal.Runtime.TypeLoader
public static void Initialize()
{
// We needed this function only because the McgIntrinsics attribute cannot be applied on the static constructor
- RuntimeImports.RhpSetHighLevelDebugFuncEvalHelper(AddrofIntrinsics.AddrOf<Action>(HighLevelDebugFuncEvalHelper));
+ RuntimeAugments.RhpSetHighLevelDebugFuncEvalHelper(AddrofIntrinsics.AddrOf<Action>(HighLevelDebugFuncEvalHelper));
}
}
}
diff --git a/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/EETypeCreator.cs b/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/EETypeCreator.cs
index 5fe35d570..5ca8d36b0 100644
--- a/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/EETypeCreator.cs
+++ b/src/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/EETypeCreator.cs
@@ -626,7 +626,7 @@ namespace Internal.Runtime.TypeLoader
{
// CoreRT Abi uses managed heap-allocated GC statics
object obj = RuntimeAugments.NewObject(((EEType*)state.GcStaticEEType)->ToRuntimeTypeHandle());
- gcStaticData = RuntimeImports.RhHandleAlloc(obj, GCHandleType.Normal);
+ gcStaticData = RuntimeAugments.RhHandleAlloc(obj, GCHandleType.Normal);
// CoreRT references statics through an extra level of indirection (a table in the image).
gcStaticsIndirection = MemoryHelpers.AllocateMemory(IntPtr.Size);
@@ -708,7 +708,7 @@ namespace Internal.Runtime.TypeLoader
if (state.AllocatedThreadStaticGCDesc)
MemoryHelpers.FreeMemory(state.ThreadStaticDesc);
if (gcStaticData != IntPtr.Zero)
- RuntimeImports.RhHandleFree(gcStaticData);
+ RuntimeAugments.RhHandleFree(gcStaticData);
if (gcStaticsIndirection != IntPtr.Zero)
MemoryHelpers.FreeMemory(gcStaticsIndirection);
}