summaryrefslogtreecommitdiff
path: root/src/ToolBox/superpmi
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2017-04-13 14:17:19 +0900
committerJiyoung Yun <jy910.yun@samsung.com>2017-04-13 14:17:19 +0900
commita56e30c8d33048216567753d9d3fefc2152af8ac (patch)
tree7e5d979695fc4a431740982eb1cfecc2898b23a5 /src/ToolBox/superpmi
parent4b11dc566a5bbfa1378d6266525c281b028abcc8 (diff)
downloadcoreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.tar.gz
coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.tar.bz2
coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.zip
Imported Upstream version 2.0.0.11353upstream/2.0.0.11353
Diffstat (limited to 'src/ToolBox/superpmi')
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/icorjitcompilerimpl.h4
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h44
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/lwmlist.h1
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp50
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/methodcontext.h20
-rw-r--r--src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp20
-rw-r--r--src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp18
-rw-r--r--src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp17
-rw-r--r--src/ToolBox/superpmi/superpmi/icorjitinfo.cpp19
9 files changed, 136 insertions, 57 deletions
diff --git a/src/ToolBox/superpmi/superpmi-shared/icorjitcompilerimpl.h b/src/ToolBox/superpmi/superpmi-shared/icorjitcompilerimpl.h
index e1190d7ab6..0e36562076 100644
--- a/src/ToolBox/superpmi/superpmi-shared/icorjitcompilerimpl.h
+++ b/src/ToolBox/superpmi/superpmi-shared/icorjitcompilerimpl.h
@@ -57,11 +57,7 @@ public:
// When the EE loads the System.Numerics.Vectors assembly, it asks the JIT what length (in bytes) of
// SIMD vector it supports as an intrinsic type. Zero means that the JIT does not support SIMD
// intrinsics, so the EE should use the default size (i.e. the size of the IL implementation).
-#if COR_JIT_EE_VERSION > 460
unsigned getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompileFlags); /* { return 0; } */
-#else
- unsigned getMaxIntrinsicSIMDVectorLength(DWORD cpuCompileFlags); /* { return 0; } */
-#endif
// IL obfuscators sometimes interpose on the EE-JIT interface. This function allows the VM to
// tell the JIT to use a particular ICorJitCompiler to implement the methods of this interface,
diff --git a/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h b/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h
index b847d9bc50..0c5b269899 100644
--- a/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h
+++ b/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h
@@ -125,19 +125,21 @@ public:
unsigned* offsetAfterIndirection /* OUT */
);
+ // Find the virtual method in implementingClass that overrides virtualMethod.
+ // Return null if devirtualization is not possible.
+ CORINFO_METHOD_HANDLE resolveVirtualMethod(
+ CORINFO_METHOD_HANDLE virtualMethod,
+ CORINFO_CLASS_HANDLE implementingClass,
+ CORINFO_CONTEXT_HANDLE ownerType
+ );
+
// If a method's attributes have (getMethodAttribs) CORINFO_FLG_INTRINSIC set,
// getIntrinsicID() returns the intrinsic ID.
// *pMustExpand tells whether or not JIT must expand the intrinsic.
-#if COR_JIT_EE_VERSION > 460
CorInfoIntrinsics getIntrinsicID(
CORINFO_METHOD_HANDLE method,
bool* pMustExpand = NULL /* OUT */
);
-#else
- CorInfoIntrinsics getIntrinsicID(
- CORINFO_METHOD_HANDLE method
- );
-#endif
// Is the given module the System.Numerics.Vectors module?
// This defaults to false.
@@ -229,13 +231,11 @@ public:
// failures during token resolution.
void resolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN * pResolvedToken);
-#if COR_JIT_EE_VERSION > 460
// Attempt to resolve a metadata token into a runtime method handle. Returns true
// if resolution succeeded and false otherwise (e.g. if it encounters invalid metadata
// during token reoslution). This method should be used instead of `resolveToken` in
// situations that need to be resilient to invalid metadata.
bool tryResolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN * pResolvedToken);
-#endif
// Signature information about the call sig
void findSig (
@@ -382,7 +382,7 @@ public:
// in representing of 'cls' from a GC perspective. The class is
// assumed to be an array of machine words
// (of length // getClassSize(cls) / sizeof(void*)),
- // 'gcPtrs' is a poitner to an array of BYTEs of this length.
+ // 'gcPtrs' is a pointer to an array of BYTEs of this length.
// getClassGClayout fills in this array so that gcPtrs[i] is set
// to one of the CorInfoGCType values which is the GC type of
// the i-th machine word of an object of type 'cls'
@@ -454,7 +454,7 @@ public:
// value into a particular location and thus has the signature
// void unboxHelper(void* dest, CORINFO_CLASS_HANDLE cls, Object* obj)
// Otherwise (it is null or points at a FALSE value) it is requesting
- // a helper that returns a poitner to the unboxed data
+ // a helper that returns a pointer to the unboxed data
// void* unboxHelper(CORINFO_CLASS_HANDLE cls, Object* obj)
// The EE has the option of NOT returning the copy style helper
// (But must be able to always honor the non-copy style helper)
@@ -465,7 +465,6 @@ public:
CORINFO_CLASS_HANDLE cls
);
-#if COR_JIT_EE_VERSION > 460
bool getReadyToRunHelper(
CORINFO_RESOLVED_TOKEN * pResolvedToken,
CORINFO_LOOKUP_KIND * pGenericLookupKind,
@@ -476,16 +475,8 @@ public:
void getReadyToRunDelegateCtorHelper(
CORINFO_RESOLVED_TOKEN * pTargetMethod,
CORINFO_CLASS_HANDLE delegateType,
- CORINFO_CONST_LOOKUP * pLookup
+ CORINFO_LOOKUP * pLookup
);
-#else
- void getReadyToRunHelper(
- CORINFO_RESOLVED_TOKEN * pResolvedToken,
- CorInfoHelpFunc id,
- CORINFO_CONST_LOOKUP * pLookup
- );
-#endif
-
const char* getHelperName(
CorInfoHelpFunc
@@ -802,7 +793,6 @@ public:
void ThrowExceptionForHelper(
const CORINFO_HELPER_DESC * throwHelper);
-#if COR_JIT_EE_VERSION > 460
// Runs the given function under an error trap. This allows the JIT to make calls
// to interface functions that may throw exceptions without needing to be aware of
// the EH ABI, exception types, etc. Returns true if the given function completed
@@ -811,7 +801,6 @@ public:
void (*function)(void*), // The function to run
void* parameter // The context parameter that will be passed to the function and the handler
);
-#endif
/*****************************************************************************
* ICorStaticInfo contains EE interface methods which return values that are
@@ -863,16 +852,12 @@ public:
size_t FQNameCapacity /* IN */
);
-#if COR_JIT_EE_VERSION > 460
-
// returns whether the struct is enregisterable. Only valid on a System V VM. Returns true on success, false on failure.
bool getSystemVAmd64PassStructInRegisterDescriptor(
/* IN */ CORINFO_CLASS_HANDLE structHnd,
/* OUT */ SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr
);
-#endif // COR_JIT_EE_VERSION
-
/*****************************************************************************
* ICorDynamicInfo contains EE interface methods which return values that may
* change from invocation to invocation. They cannot be embedded in persisted
@@ -992,8 +977,7 @@ public:
);
// NOTE: the two methods below--getPInvokeUnmanagedTarget and getAddressOfPInvokeFixup--are
- // deprecated. New code (i.e. anything that can depend on COR_JIT_EE_VERSION being
- // greater than 460) should instead use getAddressOfPInvokeTarget, which subsumes the
+ // deprecated. New code should instead use getAddressOfPInvokeTarget, which subsumes the
// functionality of these methods.
// return the unmanaged target *if method has already been prelinked.*
@@ -1008,14 +992,12 @@ public:
void **ppIndirection = NULL
);
-#if COR_JIT_EE_VERSION > 460
// return the address of the PInvoke target. May be a fixup area in the
// case of late-bound PInvoke calls.
void getAddressOfPInvokeTarget(
CORINFO_METHOD_HANDLE method,
CORINFO_CONST_LOOKUP *pLookup
);
-#endif
// Generate a cookie based on the signature that would needs to be passed
// to CORINFO_HELP_PINVOKE_CALLI
@@ -1303,7 +1285,6 @@ public:
//
DWORD getExpectedTargetArchitecture();
-#if COR_JIT_EE_VERSION > 460
// Fetches extended flags for a particular compilation instance. Returns
// the number of bytes written to the provided buffer.
DWORD getJitFlags(
@@ -1311,6 +1292,5 @@ public:
DWORD sizeInBytes /* IN: The size of the buffer. Note that this is effectively a
version number for the CORJIT_FLAGS value. */
);
-#endif
#endif // _ICorJitInfoImpl
diff --git a/src/ToolBox/superpmi/superpmi-shared/lwmlist.h b/src/ToolBox/superpmi/superpmi-shared/lwmlist.h
index de0db3a9bb..6e5f0168fd 100644
--- a/src/ToolBox/superpmi/superpmi-shared/lwmlist.h
+++ b/src/ToolBox/superpmi/superpmi-shared/lwmlist.h
@@ -141,6 +141,7 @@ LWM(IsWriteBarrierHelperRequired, DWORDLONG, DWORD)
LWM(MergeClasses, DLDL, DWORDLONG)
LWM(PInvokeMarshalingRequired, Agnostic_PInvokeMarshalingRequired, DWORD)
LWM(ResolveToken, Agnostic_CORINFO_RESOLVED_TOKENin, Agnostic_CORINFO_RESOLVED_TOKENout)
+LWM(ResolveVirtualMethod, Agnostic_ResolveVirtualMethod, DWORDLONG)
LWM(TryResolveToken, Agnostic_CORINFO_RESOLVED_TOKENin, Agnostic_CORINFO_RESOLVED_TOKENout)
LWM(SatisfiesClassConstraints, DWORDLONG, DWORD)
LWM(SatisfiesMethodConstraints, DLDL, DWORD)
diff --git a/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp b/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp
index 5768d38569..8638e0d825 100644
--- a/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp
+++ b/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp
@@ -2283,7 +2283,7 @@ bool MethodContext::repGetReadyToRunHelper(
void MethodContext::recGetReadyToRunDelegateCtorHelper(
CORINFO_RESOLVED_TOKEN * pTargetMethod,
CORINFO_CLASS_HANDLE delegateType,
- CORINFO_CONST_LOOKUP * pLookup
+ CORINFO_LOOKUP * pLookup
)
{
LogError("GetReadyToRunDelegateCtorHelper NYI");
@@ -2302,7 +2302,7 @@ void MethodContext::dmpGetReadyToRunDelegateCtorHelper(DWORDLONG key, DWORD valu
void MethodContext::repGetReadyToRunDelegateCtorHelper(
CORINFO_RESOLVED_TOKEN * pTargetMethod,
CORINFO_CLASS_HANDLE delegateType,
- CORINFO_CONST_LOOKUP * pLookup
+ CORINFO_LOOKUP * pLookup
)
{
LogError("getReadyToRunDelegateCtorHelper NYI");
@@ -3296,6 +3296,47 @@ void MethodContext::repGetMethodVTableOffset(CORINFO_METHOD_HANDLE method, unsig
DEBUG_REP(dmpGetMethodVTableOffset((DWORDLONG)method, value));
}
+void MethodContext::recResolveVirtualMethod(CORINFO_METHOD_HANDLE virtMethod, CORINFO_CLASS_HANDLE implClass,
+ CORINFO_CONTEXT_HANDLE ownerType, CORINFO_METHOD_HANDLE result)
+{
+ if (ResolveVirtualMethod == nullptr)
+ {
+ ResolveVirtualMethod = new LightWeightMap<Agnostic_ResolveVirtualMethod, DWORDLONG>();
+ }
+
+ Agnostic_ResolveVirtualMethod key;
+ key.virtualMethod = (DWORDLONG)virtMethod;
+ key.implementingClass = (DWORDLONG)implClass;
+ key.ownerType = (DWORDLONG)ownerType;
+ ResolveVirtualMethod->Add(key, (DWORDLONG) result);
+ DEBUG_REC(dmpResolveVirtualMethod(key, result));
+}
+
+void MethodContext::dmpResolveVirtualMethod(const Agnostic_ResolveVirtualMethod& key, DWORDLONG value)
+{
+ printf("ResolveVirtualMethod virtMethod-%016llX, implClass-%016llX, ownerType--%01611X, result-%016llX",
+ key.virtualMethod, key.implementingClass, key.ownerType, value);
+}
+
+CORINFO_METHOD_HANDLE MethodContext::repResolveVirtualMethod(CORINFO_METHOD_HANDLE virtMethod, CORINFO_CLASS_HANDLE implClass,
+ CORINFO_CONTEXT_HANDLE ownerType)
+{
+ Agnostic_ResolveVirtualMethod key;
+ key.virtualMethod = (DWORDLONG)virtMethod;
+ key.implementingClass = (DWORDLONG)implClass;
+ key.ownerType = (DWORDLONG)ownerType;
+
+ AssertCodeMsg(ResolveVirtualMethod != nullptr, EXCEPTIONCODE_MC, "No ResolveVirtualMap map for %016llX-%016llX-%016llX",
+ key.virtualMethod, key.implementingClass, key.ownerType);
+ AssertCodeMsg(ResolveVirtualMethod->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX-%016llx-%016llX",
+ key.virtualMethod, key.implementingClass, key.ownerType);
+ DWORDLONG result = ResolveVirtualMethod->Get(key);
+
+ DEBUG_REP(dmpResolveVirtualMethod(key, result));
+
+ return (CORINFO_METHOD_HANDLE)result;
+}
+
void MethodContext::recGetTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN * pResolvedToken, CORINFO_CLASS_HANDLE result)
{
if (GetTokenTypeAsHandle == nullptr)
@@ -4191,9 +4232,6 @@ void MethodContext::repGetEEInfo(CORINFO_EE_INFO *pEEInfoOut)
pEEInfoOut->osMajor = (unsigned)0;
pEEInfoOut->osMinor = (unsigned)0;
pEEInfoOut->osBuild = (unsigned)0;
-#ifdef DEBUG_REP
- printf("repGetEEInfo - fell to default params\n");
-#endif
}
}
@@ -6165,7 +6203,7 @@ mdMethodDef MethodContext::repGetMethodDefFromMethod(CORINFO_METHOD_HANDLE hMeth
int index = GetMethodDefFromMethod->GetIndex((DWORDLONG)hMethod);
if (index < 0)
- return (mdMethodDef)0x06000001;
+ return (mdMethodDef)0x06000001;
return (mdMethodDef)GetMethodDefFromMethod->Get((DWORDLONG)hMethod);
}
diff --git a/src/ToolBox/superpmi/superpmi-shared/methodcontext.h b/src/ToolBox/superpmi/superpmi-shared/methodcontext.h
index 0d49666e5c..b2224d91ae 100644
--- a/src/ToolBox/superpmi/superpmi-shared/methodcontext.h
+++ b/src/ToolBox/superpmi/superpmi-shared/methodcontext.h
@@ -436,6 +436,13 @@ public:
DWORD result;
};
+ struct Agnostic_ResolveVirtualMethod
+ {
+ DWORDLONG virtualMethod;
+ DWORDLONG implementingClass;
+ DWORDLONG ownerType;
+ };
+
#pragma pack(pop)
MethodContext();
@@ -632,9 +639,9 @@ public:
void dmpGetReadyToRunHelper(DWORDLONG key, DWORD value);
bool repGetReadyToRunHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_LOOKUP_KIND* pGenericLookupKind, CorInfoHelpFunc id, CORINFO_CONST_LOOKUP* pLookup);
- void recGetReadyToRunDelegateCtorHelper(CORINFO_RESOLVED_TOKEN* pTargetMethod, CORINFO_CLASS_HANDLE delegateType, CORINFO_CONST_LOOKUP* pLookup);
+ void recGetReadyToRunDelegateCtorHelper(CORINFO_RESOLVED_TOKEN* pTargetMethod, CORINFO_CLASS_HANDLE delegateType, CORINFO_LOOKUP* pLookup);
void dmpGetReadyToRunDelegateCtorHelper(DWORDLONG key, DWORD value);
- void repGetReadyToRunDelegateCtorHelper(CORINFO_RESOLVED_TOKEN* pTargetMethod, CORINFO_CLASS_HANDLE delegateType, CORINFO_CONST_LOOKUP* pLookup);
+ void repGetReadyToRunDelegateCtorHelper(CORINFO_RESOLVED_TOKEN* pTargetMethod, CORINFO_CLASS_HANDLE delegateType, CORINFO_LOOKUP* pLookup);
void recGetHelperFtn(CorInfoHelpFunc ftnNum, void **ppIndirection, void *result);
void dmpGetHelperFtn(DWORD key, DLDL value);
@@ -698,6 +705,12 @@ public:
void dmpGetMethodVTableOffset(DWORDLONG key, DD value);
void repGetMethodVTableOffset(CORINFO_METHOD_HANDLE method, unsigned *offsetOfIndirection, unsigned* offsetAfterIndirection);
+ void recResolveVirtualMethod(CORINFO_METHOD_HANDLE virtMethod, CORINFO_CLASS_HANDLE implClass,
+ CORINFO_CONTEXT_HANDLE ownerType, CORINFO_METHOD_HANDLE result);
+ void dmpResolveVirtualMethod(const Agnostic_ResolveVirtualMethod& key, DWORDLONG value);
+ CORINFO_METHOD_HANDLE repResolveVirtualMethod(CORINFO_METHOD_HANDLE virtMethod, CORINFO_CLASS_HANDLE implClass,
+ CORINFO_CONTEXT_HANDLE ownerType);
+
void recGetTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN * pResolvedToken, CORINFO_CLASS_HANDLE result);
void dmpGetTokenTypeAsHandle(const Agnostic_CORINFO_RESOLVED_TOKEN& key, DWORDLONG value);
CORINFO_CLASS_HANDLE repGetTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN * pResolvedToken);
@@ -1016,7 +1029,7 @@ private:
// ********************* Please keep this up-to-date to ease adding more ***************
-// Highest packet number: 159
+// Highest packet number: 160
// *************************************************************************************
enum mcPackets
{
@@ -1151,6 +1164,7 @@ enum mcPackets
Packet_MergeClasses = 107,
Packet_PInvokeMarshalingRequired = 108,
Packet_ResolveToken = 109,
+ Packet_ResolveVirtualMethod = 160, // Added 2/13/17
Packet_TryResolveToken = 158, //Added 4/26/2016
Packet_SatisfiesClassConstraints = 110,
Packet_SatisfiesMethodConstraints = 111,
diff --git a/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp
index 1813ed29ff..6d64442a21 100644
--- a/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp
+++ b/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp
@@ -236,6 +236,20 @@ void interceptor_ICJI::getMethodVTableOffset (
mc->recGetMethodVTableOffset(method, offsetOfIndirection, offsetAfterIndirection);
}
+// Find the virtual method in implementingClass that overrides virtualMethod.
+// Return null if devirtualization is not possible.
+CORINFO_METHOD_HANDLE interceptor_ICJI::resolveVirtualMethod(
+ CORINFO_METHOD_HANDLE virtualMethod,
+ CORINFO_CLASS_HANDLE implementingClass,
+ CORINFO_CONTEXT_HANDLE ownerType
+ )
+{
+ mc->cr->AddCall("resolveVirtualMethod");
+ CORINFO_METHOD_HANDLE result = original_ICorJitInfo->resolveVirtualMethod(virtualMethod, implementingClass, ownerType);
+ mc->recResolveVirtualMethod(virtualMethod, implementingClass, ownerType, result);
+ return result;
+}
+
// If a method's attributes have (getMethodAttribs) CORINFO_FLG_INTRINSIC set,
// getIntrinsicID() returns the intrinsic ID.
CorInfoIntrinsics interceptor_ICJI::getIntrinsicID(
@@ -699,7 +713,7 @@ unsigned interceptor_ICJI::getClassAlignmentRequirement (
// in representing of 'cls' from a GC perspective. The class is
// assumed to be an array of machine words
// (of length // getClassSize(cls) / sizeof(void*)),
-// 'gcPtrs' is a poitner to an array of BYTEs of this length.
+// 'gcPtrs' is a pointer to an array of BYTEs of this length.
// getClassGClayout fills in this array so that gcPtrs[i] is set
// to one of the CorInfoGCType values which is the GC type of
// the i-th machine word of an object of type 'cls'
@@ -838,7 +852,7 @@ CorInfoHelpFunc interceptor_ICJI::getBoxHelper(
// value into a particular location and thus has the signature
// void unboxHelper(void* dest, CORINFO_CLASS_HANDLE cls, Object* obj)
// Otherwise (it is null or points at a FALSE value) it is requesting
-// a helper that returns a poitner to the unboxed data
+// a helper that returns a pointer to the unboxed data
// void* unboxHelper(CORINFO_CLASS_HANDLE cls, Object* obj)
// The EE has the option of NOT returning the copy style helper
// (But must be able to always honor the non-copy style helper)
@@ -870,7 +884,7 @@ bool interceptor_ICJI::getReadyToRunHelper(
void interceptor_ICJI::getReadyToRunDelegateCtorHelper(
CORINFO_RESOLVED_TOKEN * pTargetMethod,
CORINFO_CLASS_HANDLE delegateType,
- CORINFO_CONST_LOOKUP * pLookup
+ CORINFO_LOOKUP * pLookup
)
{
mc->cr->AddCall("getReadyToRunDelegateCtorHelper");
diff --git a/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp b/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp
index 448fb1f686..492d08908d 100644
--- a/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp
+++ b/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp
@@ -165,6 +165,18 @@ void interceptor_ICJI::getMethodVTableOffset (
original_ICorJitInfo->getMethodVTableOffset(method, offsetOfIndirection, offsetAfterIndirection);
}
+// Find the virtual method in implementingClass that overrides virtualMethod.
+// Return null if devirtualization is not possible.
+CORINFO_METHOD_HANDLE interceptor_ICJI::resolveVirtualMethod(
+ CORINFO_METHOD_HANDLE virtualMethod,
+ CORINFO_CLASS_HANDLE implementingClass,
+ CORINFO_CONTEXT_HANDLE ownerType
+ )
+{
+ mcs->AddCall("resolveVirtualMethod");
+ return original_ICorJitInfo->resolveVirtualMethod(virtualMethod, implementingClass, ownerType);
+}
+
// If a method's attributes have (getMethodAttribs) CORINFO_FLG_INTRINSIC set,
// getIntrinsicID() returns the intrinsic ID.
CorInfoIntrinsics interceptor_ICJI::getIntrinsicID(
@@ -555,7 +567,7 @@ unsigned interceptor_ICJI::getClassAlignmentRequirement (
// in representing of 'cls' from a GC perspective. The class is
// assumed to be an array of machine words
// (of length // getClassSize(cls) / sizeof(void*)),
-// 'gcPtrs' is a poitner to an array of BYTEs of this length.
+// 'gcPtrs' is a pointer to an array of BYTEs of this length.
// getClassGClayout fills in this array so that gcPtrs[i] is set
// to one of the CorInfoGCType values which is the GC type of
// the i-th machine word of an object of type 'cls'
@@ -671,7 +683,7 @@ CorInfoHelpFunc interceptor_ICJI::getBoxHelper(
// value into a particular location and thus has the signature
// void unboxHelper(void* dest, CORINFO_CLASS_HANDLE cls, Object* obj)
// Otherwise (it is null or points at a FALSE value) it is requesting
-// a helper that returns a poitner to the unboxed data
+// a helper that returns a pointer to the unboxed data
// void* unboxHelper(CORINFO_CLASS_HANDLE cls, Object* obj)
// The EE has the option of NOT returning the copy style helper
// (But must be able to always honor the non-copy style helper)
@@ -700,7 +712,7 @@ bool interceptor_ICJI::getReadyToRunHelper(
void interceptor_ICJI::getReadyToRunDelegateCtorHelper(
CORINFO_RESOLVED_TOKEN * pTargetMethod,
CORINFO_CLASS_HANDLE delegateType,
- CORINFO_CONST_LOOKUP * pLookup
+ CORINFO_LOOKUP * pLookup
)
{
mcs->AddCall("getReadyToRunDelegateCtorHelper");
diff --git a/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp b/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp
index 4d145f6a41..8941685fe3 100644
--- a/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp
+++ b/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp
@@ -153,6 +153,17 @@ void interceptor_ICJI::getMethodVTableOffset (
original_ICorJitInfo->getMethodVTableOffset(method, offsetOfIndirection, offsetAfterIndirection);
}
+// Find the virtual method in implementingClass that overrides virtualMethod.
+// Return null if devirtualization is not possible.
+CORINFO_METHOD_HANDLE interceptor_ICJI::resolveVirtualMethod(
+ CORINFO_METHOD_HANDLE virtualMethod,
+ CORINFO_CLASS_HANDLE implementingClass,
+ CORINFO_CONTEXT_HANDLE ownerType
+ )
+{
+ return original_ICorJitInfo->resolveVirtualMethod(virtualMethod, implementingClass, ownerType);
+}
+
// If a method's attributes have (getMethodAttribs) CORINFO_FLG_INTRINSIC set,
// getIntrinsicID() returns the intrinsic ID.
CorInfoIntrinsics interceptor_ICJI::getIntrinsicID(
@@ -504,7 +515,7 @@ unsigned interceptor_ICJI::getClassAlignmentRequirement (
// in representing of 'cls' from a GC perspective. The class is
// assumed to be an array of machine words
// (of length // getClassSize(cls) / sizeof(void*)),
-// 'gcPtrs' is a poitner to an array of BYTEs of this length.
+// 'gcPtrs' is a pointer to an array of BYTEs of this length.
// getClassGClayout fills in this array so that gcPtrs[i] is set
// to one of the CorInfoGCType values which is the GC type of
// the i-th machine word of an object of type 'cls'
@@ -609,7 +620,7 @@ CorInfoHelpFunc interceptor_ICJI::getBoxHelper(
// value into a particular location and thus has the signature
// void unboxHelper(void* dest, CORINFO_CLASS_HANDLE cls, Object* obj)
// Otherwise (it is null or points at a FALSE value) it is requesting
-// a helper that returns a poitner to the unboxed data
+// a helper that returns a pointer to the unboxed data
// void* unboxHelper(CORINFO_CLASS_HANDLE cls, Object* obj)
// The EE has the option of NOT returning the copy style helper
// (But must be able to always honor the non-copy style helper)
@@ -636,7 +647,7 @@ bool interceptor_ICJI::getReadyToRunHelper(
void interceptor_ICJI::getReadyToRunDelegateCtorHelper(
CORINFO_RESOLVED_TOKEN * pTargetMethod,
CORINFO_CLASS_HANDLE delegateType,
- CORINFO_CONST_LOOKUP * pLookup
+ CORINFO_LOOKUP * pLookup
)
{
original_ICorJitInfo->getReadyToRunDelegateCtorHelper(pTargetMethod, delegateType, pLookup);
diff --git a/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp b/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp
index b746d3f6f7..6478b3c684 100644
--- a/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp
+++ b/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp
@@ -185,6 +185,19 @@ void MyICJI::getMethodVTableOffset (
jitInstance->mc->repGetMethodVTableOffset(method, offsetOfIndirection, offsetAfterIndirection);
}
+// Find the virtual method in implementingClass that overrides virtualMethod.
+// Return null if devirtualization is not possible.
+CORINFO_METHOD_HANDLE MyICJI::resolveVirtualMethod(
+ CORINFO_METHOD_HANDLE virtualMethod,
+ CORINFO_CLASS_HANDLE implementingClass,
+ CORINFO_CONTEXT_HANDLE ownerType
+ )
+{
+ jitInstance->mc->cr->AddCall("resolveVirtualMethod");
+ CORINFO_METHOD_HANDLE result = jitInstance->mc->repResolveVirtualMethod(virtualMethod, implementingClass, ownerType);
+ return result;
+}
+
// If a method's attributes have (getMethodAttribs) CORINFO_FLG_INTRINSIC set,
// getIntrinsicID() returns the intrinsic ID.
CorInfoIntrinsics MyICJI::getIntrinsicID(
@@ -609,7 +622,7 @@ unsigned MyICJI::getClassAlignmentRequirement (
// in representing of 'cls' from a GC perspective. The class is
// assumed to be an array of machine words
// (of length // getClassSize(cls) / sizeof(void*)),
-// 'gcPtrs' is a poitner to an array of BYTEs of this length.
+// 'gcPtrs' is a pointer to an array of BYTEs of this length.
// getClassGClayout fills in this array so that gcPtrs[i] is set
// to one of the CorInfoGCType values which is the GC type of
// the i-th machine word of an object of type 'cls'
@@ -726,7 +739,7 @@ CorInfoHelpFunc MyICJI::getBoxHelper(
// value into a particular location and thus has the signature
// void unboxHelper(void* dest, CORINFO_CLASS_HANDLE cls, Object* obj)
// Otherwise (it is null or points at a FALSE value) it is requesting
-// a helper that returns a poitner to the unboxed data
+// a helper that returns a pointer to the unboxed data
// void* unboxHelper(CORINFO_CLASS_HANDLE cls, Object* obj)
// The EE has the option of NOT returning the copy style helper
// (But must be able to always honor the non-copy style helper)
@@ -756,7 +769,7 @@ bool MyICJI::getReadyToRunHelper(
void MyICJI::getReadyToRunDelegateCtorHelper(
CORINFO_RESOLVED_TOKEN * pTargetMethod,
CORINFO_CLASS_HANDLE delegateType,
- CORINFO_CONST_LOOKUP * pLookup
+ CORINFO_LOOKUP * pLookup
)
{
jitInstance->mc->cr->AddCall("getReadyToRunDelegateCtorHelper");