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
diff options
context:
space:
mode:
authorAndrew Au <andrewau@microsoft.com>2017-10-06 21:37:59 +0300
committerAndrew Au <andrewau@microsoft.com>2017-10-06 21:37:59 +0300
commit94cb735024ea103e54ad3385d2002b6b8759723d (patch)
tree239fafe666486a3a688a392eb81b2102c40879b1 /src/System.Private.TypeLoader
parentad066ef1adabbffffb7af5af2d86b8c5174cf1d9 (diff)
FuncEvalVirtualDispatch - Enable doing real virtual function dispatch in FuncEval.
[tfs-changeset: 1677518]
Diffstat (limited to 'src/System.Private.TypeLoader')
-rw-r--r--src/System.Private.TypeLoader/src/Internal/Runtime/DebuggerSupport/DebuggerSupport.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/System.Private.TypeLoader/src/Internal/Runtime/DebuggerSupport/DebuggerSupport.cs b/src/System.Private.TypeLoader/src/Internal/Runtime/DebuggerSupport/DebuggerSupport.cs
index 6750b721b..68767c58b 100644
--- a/src/System.Private.TypeLoader/src/Internal/Runtime/DebuggerSupport/DebuggerSupport.cs
+++ b/src/System.Private.TypeLoader/src/Internal/Runtime/DebuggerSupport/DebuggerSupport.cs
@@ -70,6 +70,20 @@ namespace Internal.Runtime.DebuggerSupport
public class TypeSystemHelper
{
+ public static unsafe IntPtr GetVirtualMethodFunctionPointer(IntPtr thisPointer, uint virtualMethodSlot)
+ {
+ // The first pointer in the object is a pointer to the EEType object
+ EEType* eeType = *(EEType**)thisPointer;
+
+ // The vtable of the object can be found at the end of EEType object
+ IntPtr* vtable = eeType->GetVTableStartAddress();
+
+ // Indexing the vtable to find out the actual function entry point
+ IntPtr entryPoint = vtable[virtualMethodSlot];
+
+ return entryPoint;
+ }
+
public static bool CallingConverterDataFromMethodSignature(LowLevelNativeFormatReader reader,
ulong[] externalReferences,
out bool hasThis,