+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
const char* s_static = "static";
const char* s_dontInline = "$dontInline ";
const char* s_constructor = "$constructor";
- const char* s_cfnw = "$noSecurityWrap";
#define ifPrint(s, t) \
else if ((s & attribute) == s) \
if (0)
;
ifPrint(CORINFO_FLG_STATIC, s_static) ifPrint(CORINFO_FLG_DONT_INLINE, s_dontInline)
- ifPrint(CORINFO_FLG_CONSTRUCTOR, s_constructor) ifPrint(CORINFO_FLG_NOSECURITYWRAP, s_cfnw) else
+ ifPrint(CORINFO_FLG_CONSTRUCTOR, s_constructor) else
{
LogError("unknown attribute %x", attribute);
__debugbreak();
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#ifndef _CoreClrCommonCallbacks
-#define _CoreClrCommonCallbacks
-
-#include "runtimedetails.h"
-
-IExecutionEngine* STDMETHODCALLTYPE IEE_t();
-HRESULT STDMETHODCALLTYPE GetCORSystemDirectory(LPWSTR pbuffer, DWORD cchBuffer, DWORD* pdwlength);
-
-#endif
ULONG* nativeSizeOfCode /* OUT */
);
-// Some JIT compilers (most notably Phoenix), cache information about EE structures from one invocation
-// of the compiler to the next. This can be a problem when appdomains are unloaded, as some of this
-// cached information becomes stale. The code:ICorJitCompiler.isCacheCleanupRequired is called by the EE
-// early first to see if jit needs these notifications, and if so, the EE will call ClearCache is called
-// whenever the compiler should abandon its cache (eg on appdomain unload)
-void clearCache();
-BOOL isCacheCleanupRequired();
-
// Do any appropriate work at process shutdown. Default impl is to do nothing.
void ProcessShutdownWork(ICorStaticInfo* info); /* {}; */
// intrinsics, so the EE should use the default size (i.e. the size of the IL implementation).
unsigned getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompileFlags); /* { return 0; } */
-// 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,
-// and not to implement those methods itself. The JIT must not return this method when getJit()
-// is called. Instead, it must pass along all calls to this interface from within its own
-// ICorJitCompiler implementation. If 'realJitCompiler' is nullptr, then the JIT should resume
-// executing all the functions itself.
-void setRealJit(ICorJitCompiler* realJitCompiler); /* { } */
-
#endif
BOOL* pfIsOpenDelegate /* is the delegate open */
);
-// Indicates if the method is an instance of the generic
-// method that passes (or has passed) verification
-CorInfoInstantiationVerification isInstantiationOfVerifiedGeneric(CORINFO_METHOD_HANDLE method /* IN */
- );
-
-// Loads the constraints on a typical method definition, detecting cycles;
-// for use in verification.
-void initConstraintsForVerification(CORINFO_METHOD_HANDLE method, /* IN */
- BOOL* pfHasCircularClassConstraints, /* OUT */
- BOOL* pfHasCircularMethodConstraint /* OUT */
- );
-
-// Returns enum whether the method does not require verification
-// Also see ICorModuleInfo::canSkipVerification
-CorInfoCanSkipVerificationResult canSkipMethodVerification(CORINFO_METHOD_HANDLE ftnHandle);
-
// load and restore the method
void methodMustBeLoadedBeforeCodeIsRun(CORINFO_METHOD_HANDLE method);
CORINFO_CLASS_HANDLE getTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken /* IN */);
-// Returns true if the module does not require verification
-//
-// If fQuickCheckOnlyWithoutCommit=TRUE, the function only checks that the
-// module does not currently require verification in the current AppDomain.
-// This decision could change in the future, and so should not be cached.
-// If it is cached, it should only be used as a hint.
-// This is only used by ngen for calculating certain hints.
-//
-
-// Returns enum whether the module does not require verification
-// Also see ICorMethodInfo::canSkipMethodVerification();
-CorInfoCanSkipVerificationResult canSkipVerification(CORINFO_MODULE_HANDLE module /* IN */
- );
-
// Checks if the given metadata token is valid
BOOL isValidToken(CORINFO_MODULE_HANDLE module, /* IN */
unsigned metaTOK /* IN */
int* length /* OUT */
);
-BOOL shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope);
-
/**********************************************************************************/
//
// ICorClassInfo
// GetTypeFromHandle(X) == GetTypeFromHandle(Y) (for CORINFO_INLINE_TYPECHECK_SOURCE_TOKEN)
CorInfoInlineTypeCheck canInlineTypeCheck(CORINFO_CLASS_HANDLE cls, CorInfoInlineTypeCheckSource source);
-// If this method returns true, JIT will do optimization to inline the check for
-// GetTypeFromHandle(handle) == obj.GetType()
-BOOL canInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE cls);
-
// return flags (defined above, CORINFO_FLG_PUBLIC ...)
DWORD getClassAttribs(CORINFO_CLASS_HANDLE cls);
// returns helper to trigger static constructor
CorInfoHelpFunc getSharedCCtorHelper(CORINFO_CLASS_HANDLE clsHnd);
-CorInfoHelpFunc getSecurityPrologHelper(CORINFO_METHOD_HANDLE ftn);
-
// This is not pretty. Boxing nullable<T> actually returns
// a boxed<T> not a boxed Nullable<T>. This call allows the verifier
// to call back to the EE on the 'box' instruction and get the transformed
// return the data member's instance offset
unsigned getFieldOffset(CORINFO_FIELD_HANDLE field);
-// TODO: jit64 should be switched to the same plan as the i386 jits - use
-// getClassGClayout to figure out the need for writebarrier helper, and inline the copying.
-// The interpretted value class copy is slow. Once this happens, USE_WRITE_BARRIER_HELPERS
-bool isWriteBarrierHelperRequired(CORINFO_FIELD_HANDLE field);
-
void getFieldInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken,
CORINFO_METHOD_HANDLE callerHandle,
CORINFO_ACCESS_FLAGS flags,
// Used to allocate memory that needs to handed to the EE.
// For eg, use this to allocated memory for reporting debug info,
// which will be handed to the EE by setVars() and setBoundaries()
-void* allocateArray(ULONG cBytes);
+void* allocateArray(size_t cBytes);
// JitCompiler will free arrays passed by the EE using this
// For eg, The EE returns memory in getVars() and getBoundaries()
// CORINFO_LOOKUP_THISOBJ use vtable pointer of 'this' param
// CORINFO_LOOKUP_CLASSPARAM use vtable hidden param
// CORINFO_LOOKUP_METHODPARAM use enclosing type of method-desc hidden param
-CORINFO_LOOKUP_KIND getLocationOfThisType(CORINFO_METHOD_HANDLE context);
-
-// NOTE: the two methods below--getPInvokeUnmanagedTarget and getAddressOfPInvokeFixup--are
-// deprecated. New code should instead use getAddressOfPInvokeTarget, which subsumes the
-// functionality of these methods.
-
-// return the unmanaged target *if method has already been prelinked.*
-void* getPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void** ppIndirection = NULL);
-
-// return address of fixup area for late-bound PInvoke calls.
-void* getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void** ppIndirection = NULL);
+void getLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND* pLookupKind);
// return the address of the PInvoke target. May be a fixup area in the
// case of late-bound PInvoke calls.
bool convertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN * pResolvedToken, bool fMustConvert);
-// return memory manager that the JIT can use to allocate a regular memory
-IEEMemoryManager* getMemoryManager();
-
// get a block of memory for the code, readonly data, and read-write data
void allocMem(ULONG hotCodeSize, /* IN */
ULONG coldCodeSize, /* IN */
void* allocGCInfo(size_t size /* IN */
);
-void yieldExecution();
-
// Indicate how many exception handler blocks are to be returned.
// This is guaranteed to be called before any 'setEHinfo' call.
// Note that allocMem must be called before this method can be called.
WORD getRelocTypeHint(void* target);
-// A callback to identify the range of address known to point to
-// compiler-generated native entry points that call back into
-// MSIL.
-void getModuleNativeEntryPointRange(void** pStart, /* OUT */
- void** pEnd /* OUT */
- );
-
// For what machine does the VM expect the JIT to generate code? The VM
// returns one of the IMAGE_FILE_MACHINE_* values. Note that if the VM
// is cross-compiling (such as the case for crossgen), it will return a
LWM(CanGetVarArgsHandle, CanGetVarArgsHandleValue, DWORD)
LWM(CanInline, DLDL, Agnostic_CanInline)
LWM(CanInlineTypeCheck, DLD, DWORD)
-LWM(CanInlineTypeCheckWithObjectVTable, DWORDLONG, DWORD)
-LWM(CanSkipMethodVerification, DLD, DWORD)
LWM(CanTailCall, Agnostic_CanTailCall, DWORD)
LWM(CheckMethodModifier, Agnostic_CheckMethodModifier, DWORD)
LWM(CompareTypesForCast, DLDL, DWORD)
LWM(FindCallSiteSig, Agnostic_FindCallSiteSig, Agnostic_CORINFO_SIG_INFO)
LWM(FindNameOfToken, DLD, DLD)
LWM(FindSig, Agnostic_FindSig, Agnostic_CORINFO_SIG_INFO)
-LWM(GetAddressOfPInvokeFixup, DWORDLONG, DLDL)
LWM(GetAddressOfPInvokeTarget, DWORDLONG, DLD)
LWM(GetAddrOfCaptureThreadGlobal, DWORD, DLDL)
LWM(GetArgClass, GetArgClassValue, Agnostic_GetArgClass_Value)
LWM(GetNewArrHelper, DWORDLONG, DWORD)
LWM(GetNewHelper, Agnostic_GetNewHelper, DD)
LWM(GetParentType, DWORDLONG, DWORDLONG)
-LWM(GetPInvokeUnmanagedTarget, DWORDLONG, DLDL)
LWM(GetProfilingHandle, DWORD, Agnostic_GetProfilingHandle)
LWM(GetReadyToRunHelper, GetReadyToRunHelper_TOKENin, GetReadyToRunHelper_TOKENout)
LWM(GetReadyToRunDelegateCtorHelper, GetReadyToRunDelegateCtorHelper_TOKENIn, Agnostic_CORINFO_LOOKUP)
LWM(GetRelocTypeHint, DWORDLONG, DWORD)
-LWM(GetSecurityPrologHelper, DWORDLONG, DWORD)
LWM(GetSharedCCtorHelper, DWORDLONG, DWORD)
LWM(GetStringConfigValue, DWORD, DWORD)
LWM(GetSystemVAmd64PassStructInRegisterDescriptor, DWORDLONG, Agnostic_GetSystemVAmd64PassStructInRegisterDescriptor)
LWM(GetVars, DWORDLONG, Agnostic_GetVars)
DENSELWM(HandleException, DWORD)
LWM(InitClass, Agnostic_InitClass, DWORD)
-LWM(InitConstraintsForVerification, DWORDLONG, DD)
LWM(IsCompatibleDelegate, Agnostic_IsCompatibleDelegate, DD)
LWM(IsDelegateCreationAllowed, DLDL, DWORD)
LWM(IsFieldStatic, DWORDLONG, DWORD)
LWM(IsIntrinsicType, DWORDLONG, DWORD)
-LWM(IsInstantiationOfVerifiedGeneric, DWORDLONG, DWORD)
LWM(IsSDArray, DWORDLONG, DWORD)
LWM(IsStructRequiringStackAllocRetBuf, DWORDLONG, DWORD)
LWM(IsValidStringRef, DLD, DWORD)
LWM(GetStringLiteral, DLD, DD)
LWM(IsValidToken, DLD, DWORD)
LWM(IsValueClass, DWORDLONG, DWORD)
-LWM(IsWriteBarrierHelperRequired, DWORDLONG, DWORD)
LWM(MergeClasses, DLDL, DWORDLONG)
LWM(IsMoreSpecificType, DLDL, DWORD)
LWM(PInvokeMarshalingRequired, PInvokeMarshalingRequiredValue, DWORD)
LWM(TryResolveToken, Agnostic_CORINFO_RESOLVED_TOKENin, TryResolveTokenValue)
LWM(SatisfiesClassConstraints, DWORDLONG, DWORD)
LWM(SatisfiesMethodConstraints, DLDL, DWORD)
-LWM(ShouldEnforceCallvirtRestriction, DWORDLONG, DWORD)
#undef LWM
#undef DENSELWM
return result;
}
-void MethodContext::recIsInstantiationOfVerifiedGeneric(CORINFO_METHOD_HANDLE method,
- CorInfoInstantiationVerification result)
-{
- if (IsInstantiationOfVerifiedGeneric == nullptr)
- IsInstantiationOfVerifiedGeneric = new LightWeightMap<DWORDLONG, DWORD>();
-
- IsInstantiationOfVerifiedGeneric->Add((DWORDLONG)method, result);
- DEBUG_REC(dmpIsInstantiationOfVerifiedGeneric((DWORDLONG)method, (DWORD)result));
-}
-void MethodContext::dmpIsInstantiationOfVerifiedGeneric(DWORDLONG key, DWORD value)
-{
- printf("IsInstantiationOfVerifiedGeneric key ftn-%016llX, value res-%u", key, value);
-}
-CorInfoInstantiationVerification MethodContext::repIsInstantiationOfVerifiedGeneric(CORINFO_METHOD_HANDLE method)
-{
- CorInfoInstantiationVerification result =
- (CorInfoInstantiationVerification)IsInstantiationOfVerifiedGeneric->Get((DWORDLONG)method);
- DEBUG_REP(dmpIsInstantiationOfVerifiedGeneric((DWORDLONG)method, (DWORD)result));
- return result;
-}
-
void MethodContext::recAsCorInfoType(CORINFO_CLASS_HANDLE cls, CorInfoType result)
{
if (AsCorInfoType == nullptr)
return result;
}
-void MethodContext::recGetSecurityPrologHelper(CORINFO_METHOD_HANDLE ftn, CorInfoHelpFunc result)
-{
- if (GetSecurityPrologHelper == nullptr)
- GetSecurityPrologHelper = new LightWeightMap<DWORDLONG, DWORD>();
-
- GetSecurityPrologHelper->Add((DWORDLONG)ftn, result);
- DEBUG_REC(dmpGetSecurityPrologHelper((DWORDLONG)ftn, (DWORD)result));
-}
-void MethodContext::dmpGetSecurityPrologHelper(DWORDLONG key, DWORD value)
-{
- printf("GetSecurityPrologHelper key ftn-%016llX, value res-%u", key, value);
-}
-CorInfoHelpFunc MethodContext::repGetSecurityPrologHelper(CORINFO_METHOD_HANDLE ftn)
-{
- CorInfoHelpFunc result = (CorInfoHelpFunc)GetSecurityPrologHelper->Get((DWORDLONG)ftn);
- DEBUG_REP(dmpGetSecurityPrologHelper((DWORDLONG)ftn, (DWORD)result));
- return result;
-}
-
void MethodContext::recGetTypeForBox(CORINFO_CLASS_HANDLE cls, CORINFO_CLASS_HANDLE result)
{
if (GetTypeForBox == nullptr)
if (GetFieldInfo->GetIndex(key) == -1)
{
#ifdef sparseMC
- key.flags = origFlag ^ (DWORD)CORINFO_ACCESS_UNWRAP;
+ key.flags = origFlag ^ ((DWORD)CORINFO_ACCESS_THIS);
if (GetFieldInfo->GetIndex(key) != -1)
{
- LogDebug("Sparse - repGetFieldInfo found value with inverted CORINFO_ACCESS_UNWRAP");
+ LogDebug(
+ "Sparse - repGetFieldInfo found value with inverted CORINFO_ACCESS_THIS");
}
else
{
- key.flags = origFlag ^ ((DWORD)CORINFO_ACCESS_THIS | (DWORD)CORINFO_ACCESS_UNWRAP);
+ key.flags = origFlag ^ (DWORD)CORINFO_ACCESS_INLINECHECK;
if (GetFieldInfo->GetIndex(key) != -1)
{
- LogDebug(
- "Sparse - repGetFieldInfo found value with inverted CORINFO_ACCESS_UNWRAP|CORINFO_ACCESS_THIS");
+ LogDebug("Sparse - repGetFieldInfo found value with inverted CORINFO_ACCESS_INLINECHECK");
}
else
{
- key.flags = origFlag ^ (DWORD)CORINFO_ACCESS_INLINECHECK;
- if (GetFieldInfo->GetIndex(key) != -1)
- {
- LogDebug("Sparse - repGetFieldInfo found value with inverted CORINFO_ACCESS_INLINECHECK");
- }
- else
- {
- LogException(EXCEPTIONCODE_MC, "Didn't find %x", pResolvedToken->token);
- }
+ LogException(EXCEPTIONCODE_MC, "Didn't find %x", pResolvedToken->token);
}
}
#else
value.offsetOfDelegateInstance = (DWORD)pEEInfoOut->offsetOfDelegateInstance;
value.offsetOfDelegateFirstTarget = (DWORD)pEEInfoOut->offsetOfDelegateFirstTarget;
value.offsetOfWrapperDelegateIndirectCell = (DWORD)pEEInfoOut->offsetOfWrapperDelegateIndirectCell;
- value.offsetOfTransparentProxyRP = (DWORD)pEEInfoOut->offsetOfTransparentProxyRP;
- value.offsetOfRealProxyServer = (DWORD)pEEInfoOut->offsetOfRealProxyServer;
- value.offsetOfObjArrayData = (DWORD)pEEInfoOut->offsetOfObjArrayData;
value.sizeOfReversePInvokeFrame = (DWORD)pEEInfoOut->sizeOfReversePInvokeFrame;
value.osPageSize = (DWORD)pEEInfoOut->osPageSize;
value.maxUncheckedOffsetForNullObject = (DWORD)pEEInfoOut->maxUncheckedOffsetForNullObject;
value.targetAbi = (DWORD)pEEInfoOut->targetAbi;
value.osType = (DWORD)pEEInfoOut->osType;
- value.osMajor = (DWORD)pEEInfoOut->osMajor;
- value.osMinor = (DWORD)pEEInfoOut->osMinor;
- value.osBuild = (DWORD)pEEInfoOut->osBuild;
GetEEInfo->Add((DWORD)0, value);
DEBUG_REC(dmpGetEEInfo((DWORD)0, value));
void MethodContext::dmpGetEEInfo(DWORD key, const Agnostic_CORINFO_EE_INFO& value)
{
printf("GetEEInfo key %u, value icfi{sz-%u ogs-%u ofv-%u ofl-%u ocsp-%u ocsfp-%u oct-%u ora-%u} "
- "otf-%u ogcs-%u odi-%u odft-%u osdic-%u otrp-%u orps-%u ooad-%u srpf-%u osps-%u muono-%u tabi-%u osType-%u "
- "osMajor-%u osMinor-%u osBuild-%u",
+ "otf-%u ogcs-%u odi-%u odft-%u osdic-%u srpf-%u osps-%u muono-%u tabi-%u osType-%u",
key, value.inlinedCallFrameInfo.size, value.inlinedCallFrameInfo.offsetOfGSCookie,
value.inlinedCallFrameInfo.offsetOfFrameVptr, value.inlinedCallFrameInfo.offsetOfFrameLink,
value.inlinedCallFrameInfo.offsetOfCallSiteSP, value.inlinedCallFrameInfo.offsetOfCalleeSavedFP,
value.inlinedCallFrameInfo.offsetOfCallTarget, value.inlinedCallFrameInfo.offsetOfReturnAddress,
value.offsetOfThreadFrame, value.offsetOfGCState, value.offsetOfDelegateInstance,
value.offsetOfDelegateFirstTarget, value.offsetOfWrapperDelegateIndirectCell,
- value.offsetOfTransparentProxyRP, value.offsetOfRealProxyServer, value.offsetOfObjArrayData,
value.sizeOfReversePInvokeFrame, value.osPageSize, value.maxUncheckedOffsetForNullObject, value.targetAbi,
- value.osType, value.osMajor, value.osMinor, value.osBuild);
+ value.osType);
}
void MethodContext::repGetEEInfo(CORINFO_EE_INFO* pEEInfoOut)
{
pEEInfoOut->offsetOfDelegateInstance = (unsigned)value.offsetOfDelegateInstance;
pEEInfoOut->offsetOfDelegateFirstTarget = (unsigned)value.offsetOfDelegateFirstTarget;
pEEInfoOut->offsetOfWrapperDelegateIndirectCell= (unsigned)value.offsetOfWrapperDelegateIndirectCell;
- pEEInfoOut->offsetOfTransparentProxyRP = (unsigned)value.offsetOfTransparentProxyRP;
- pEEInfoOut->offsetOfRealProxyServer = (unsigned)value.offsetOfRealProxyServer;
- pEEInfoOut->offsetOfObjArrayData = (unsigned)value.offsetOfObjArrayData;
pEEInfoOut->sizeOfReversePInvokeFrame = (unsigned)value.sizeOfReversePInvokeFrame;
pEEInfoOut->osPageSize = (size_t)value.osPageSize;
pEEInfoOut->maxUncheckedOffsetForNullObject = (size_t)value.maxUncheckedOffsetForNullObject;
pEEInfoOut->targetAbi = (CORINFO_RUNTIME_ABI)value.targetAbi;
pEEInfoOut->osType = (CORINFO_OS)value.osType;
- pEEInfoOut->osMajor = (unsigned)value.osMajor;
- pEEInfoOut->osMinor = (unsigned)value.osMinor;
- pEEInfoOut->osBuild = (unsigned)value.osBuild;
DEBUG_REP(dmpGetEEInfo((DWORD)0, value));
}
else
pEEInfoOut->offsetOfDelegateInstance = (unsigned)0x8;
pEEInfoOut->offsetOfDelegateFirstTarget = (unsigned)0x18;
pEEInfoOut->offsetOfWrapperDelegateIndirectCell = (unsigned)0x40;
- pEEInfoOut->offsetOfTransparentProxyRP = (unsigned)0x8;
- pEEInfoOut->offsetOfRealProxyServer = (unsigned)0x18;
- pEEInfoOut->offsetOfObjArrayData = (unsigned)0x18;
pEEInfoOut->sizeOfReversePInvokeFrame = (unsigned)0x8;
pEEInfoOut->osPageSize = (size_t)0x1000;
pEEInfoOut->maxUncheckedOffsetForNullObject = (size_t)((32 * 1024) - 1);
#else
pEEInfoOut->osType = CORINFO_WINNT;
#endif
-
- pEEInfoOut->osMajor = (unsigned)0;
- pEEInfoOut->osMinor = (unsigned)0;
- pEEInfoOut->osBuild = (unsigned)0;
}
}
printf("GetLocationOfThisType key ftn-%016llX, value %s", key,
SpmiDumpHelper::DumpAgnostic_CORINFO_LOOKUP_KIND(value).c_str());
}
-CORINFO_LOOKUP_KIND MethodContext::repGetLocationOfThisType(CORINFO_METHOD_HANDLE context)
+void MethodContext::repGetLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND* pLookupKind)
{
Agnostic_CORINFO_LOOKUP_KIND value = GetLocationOfThisType->Get((DWORDLONG)context);
- return SpmiRecordsHelper::RestoreCORINFO_LOOKUP_KIND(value);
+ *pLookupKind = SpmiRecordsHelper::RestoreCORINFO_LOOKUP_KIND(value);
}
void MethodContext::recGetDelegateCtor(CORINFO_METHOD_HANDLE methHnd,
return (CorInfoInlineTypeCheck)CanInlineTypeCheck->Get(key);
}
-void MethodContext::recCanInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE cls, BOOL result)
-{
- if (CanInlineTypeCheckWithObjectVTable == nullptr)
- CanInlineTypeCheckWithObjectVTable = new LightWeightMap<DWORDLONG, DWORD>();
-
- CanInlineTypeCheckWithObjectVTable->Add((DWORDLONG)cls, (DWORD)result);
-}
-void MethodContext::dmpCanInlineTypeCheckWithObjectVTable(DWORDLONG key, DWORD value)
-{
- printf("CanInlineTypeCheckWithObjectVTable key cls-%016llX, value res-%u", key, value);
-}
-BOOL MethodContext::repCanInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE cls)
-{
- AssertCodeMsg(CanInlineTypeCheckWithObjectVTable != nullptr, EXCEPTIONCODE_MC,
- "No map for CanInlineTypeCheckWithObjectVTable");
- return (BOOL)CanInlineTypeCheckWithObjectVTable->Get((DWORDLONG)cls);
-}
-
void MethodContext::recSatisfiesMethodConstraints(CORINFO_CLASS_HANDLE parent,
CORINFO_METHOD_HANDLE method,
BOOL result)
return value;
}
-void MethodContext::recInitConstraintsForVerification(CORINFO_METHOD_HANDLE method,
- BOOL* pfHasCircularClassConstraints,
- BOOL* pfHasCircularMethodConstraint)
-{
- if (InitConstraintsForVerification == nullptr)
- InitConstraintsForVerification = new LightWeightMap<DWORDLONG, DD>();
-
- DD value;
-
- value.A = (DWORD)*pfHasCircularClassConstraints;
- value.B = (DWORD)*pfHasCircularMethodConstraint;
-
- InitConstraintsForVerification->Add((DWORDLONG)method, value);
-}
-void MethodContext::dmpInitConstraintsForVerification(DWORDLONG key, DD value)
-{
- printf("InitConstraintsForVerification key ftn-%016llX, value circ-%u cirm-%u", key, value.A, value.B);
-}
-void MethodContext::repInitConstraintsForVerification(CORINFO_METHOD_HANDLE method,
- BOOL* pfHasCircularClassConstraints,
- BOOL* pfHasCircularMethodConstraint)
-{
- DD value;
-
- value = InitConstraintsForVerification->Get((DWORDLONG)method);
-
- *pfHasCircularClassConstraints = (BOOL)value.A;
- *pfHasCircularMethodConstraint = (BOOL)value.B;
-}
-
void MethodContext::recIsValidStringRef(CORINFO_MODULE_HANDLE module, unsigned metaTOK, BOOL result)
{
if (IsValidStringRef == nullptr)
printf("HandleException key %u, value %u", key, value);
}
-void MethodContext::recGetAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void** ppIndirection, void* result)
-{
- if (GetAddressOfPInvokeFixup == nullptr)
- GetAddressOfPInvokeFixup = new LightWeightMap<DWORDLONG, DLDL>();
-
- DLDL value;
-
- if (ppIndirection != nullptr)
- value.A = (DWORDLONG)*ppIndirection;
- else
- value.A = (DWORDLONG)0;
- value.B = (DWORDLONG)result;
-
- GetAddressOfPInvokeFixup->Add((DWORDLONG)method, value);
-}
-void MethodContext::dmpGetAddressOfPInvokeFixup(DWORDLONG key, DLDL value)
-{
- printf("GetAddressOfPInvokeFixup key ftn-%016llX, value pp-%016llX res-%016llX", key, value.A, value.B);
-}
-void* MethodContext::repGetAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void** ppIndirection)
-{
- DLDL value;
-
- value = GetAddressOfPInvokeFixup->Get((DWORDLONG)method);
-
- if (ppIndirection != nullptr)
- *ppIndirection = (void*)value.A;
- return (void*)value.B;
-}
void MethodContext::recGetAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP* pLookup)
{
if (GetAddressOfPInvokeTarget == nullptr)
return (BOOL)value;
}
-void MethodContext::recCanSkipMethodVerification(CORINFO_METHOD_HANDLE ftnHandle,
- BOOL skip,
- CorInfoCanSkipVerificationResult result)
-{
- if (CanSkipMethodVerification == nullptr)
- CanSkipMethodVerification = new LightWeightMap<DLD, DWORD>();
-
- DLD key;
- ZeroMemory(&key, sizeof(DLD)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
- // out padding too
-
- key.A = (DWORDLONG)ftnHandle;
- key.B = (DWORD)skip;
-
- CanSkipMethodVerification->Add(key, (DWORD)result);
- DEBUG_REC(dmpCanSkipMethodVerification(key, (DWORD)result));
-}
-void MethodContext::dmpCanSkipMethodVerification(DLD key, DWORD value)
-{
- printf("CanSkipMethodVerification key ftn-%016llX skp-%u, value res-%u", key.A, key.B, value);
-}
-CorInfoCanSkipVerificationResult MethodContext::repCanSkipMethodVerification(CORINFO_METHOD_HANDLE ftnHandle, BOOL skip)
-{
- DLD key;
- ZeroMemory(&key, sizeof(DLD)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
- // out padding too
-
- key.A = (DWORDLONG)ftnHandle;
- key.B = (DWORD)skip;
-
- AssertCodeMsg(CanSkipMethodVerification != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX",
- (DWORDLONG)ftnHandle);
- AssertCodeMsg(CanSkipMethodVerification->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX",
- (DWORDLONG)ftnHandle);
-
- CorInfoCanSkipVerificationResult temp = (CorInfoCanSkipVerificationResult)CanSkipMethodVerification->Get(key);
- DEBUG_REP(dmpCanSkipMethodVerification(key, (DWORD)temp));
- return temp;
-}
-
void MethodContext::recFindCallSiteSig(CORINFO_MODULE_HANDLE module,
unsigned methTOK,
CORINFO_CONTEXT_HANDLE context,
DEBUG_REP(dmpFindCallSiteSig(key, value));
}
-void MethodContext::recShouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope, BOOL result)
-{
- if (ShouldEnforceCallvirtRestriction == nullptr)
- ShouldEnforceCallvirtRestriction = new LightWeightMap<DWORDLONG, DWORD>();
- ShouldEnforceCallvirtRestriction->Add((DWORDLONG)scope, (DWORD)result);
- DEBUG_REC(dmpShouldEnforceCallvirtRestriction((DWORDLONG)scope, (DWORD)result));
-}
-void MethodContext::dmpShouldEnforceCallvirtRestriction(DWORDLONG key, DWORD value)
-{
- printf("ShouldEnforceCallvirtRestriction key %016llX, value %u", key, value);
-}
-BOOL MethodContext::repShouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope)
-{
- AssertCodeMsg(ShouldEnforceCallvirtRestriction != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX",
- (DWORDLONG)scope);
- AssertCodeMsg(ShouldEnforceCallvirtRestriction->GetIndex((DWORDLONG)scope) != -1, EXCEPTIONCODE_MC,
- "Didn't find %016llX", (DWORDLONG)scope);
- BOOL temp = (BOOL)ShouldEnforceCallvirtRestriction->Get((DWORDLONG)scope);
- DEBUG_REC(dmpShouldEnforceCallvirtRestriction((DWORDLONG)scope, (DWORD)temp));
- return temp;
-}
-
void MethodContext::recGetMethodSync(CORINFO_METHOD_HANDLE ftn, void** ppIndirection, void* result)
{
if (GetMethodSync == nullptr)
return retVal;
}
-void MethodContext::recIsWriteBarrierHelperRequired(CORINFO_FIELD_HANDLE field, bool result)
-{
- if (IsWriteBarrierHelperRequired == nullptr)
- IsWriteBarrierHelperRequired = new LightWeightMap<DWORDLONG, DWORD>();
-
- IsWriteBarrierHelperRequired->Add((DWORDLONG)field, (DWORD)result);
- DEBUG_REC(dmpIsWriteBarrierHelperRequired((DWORDLONG)field, (DWORD)result));
-}
-void MethodContext::dmpIsWriteBarrierHelperRequired(DWORDLONG key, DWORD value)
-{
- printf("IsWriteBarrierHelperRequired key fld-%016llX, value res-%u", key, value);
-}
-bool MethodContext::repIsWriteBarrierHelperRequired(CORINFO_FIELD_HANDLE field)
-{
- bool result = IsWriteBarrierHelperRequired->Get((DWORDLONG)field) != 0;
- DEBUG_REP(dmpIsWriteBarrierHelperRequired((DWORDLONG)field, result));
- return result;
-}
-
void MethodContext::recIsValidToken(CORINFO_MODULE_HANDLE module, unsigned metaTOK, BOOL result)
{
if (IsValidToken == nullptr)
return value;
}
-void MethodContext::recGetPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void** ppIndirection, void* result)
-{
- if (GetPInvokeUnmanagedTarget == nullptr)
- GetPInvokeUnmanagedTarget = new LightWeightMap<DWORDLONG, DLDL>();
- DLDL temp;
- temp.A = (DWORDLONG)*ppIndirection;
- temp.B = (DWORDLONG)result;
-
- GetPInvokeUnmanagedTarget->Add((DWORDLONG)method, temp);
- DEBUG_REC(dmpGetPInvokeUnmanagedTarget((DWORDLONG)method, temp));
-}
-void MethodContext::dmpGetPInvokeUnmanagedTarget(DWORDLONG key, DLDL value)
-{
- printf("GetPInvokeUnmanagedTarget key ftn-%016llX, value pp-%016llX res-%016llX", key, value.A, value.B);
-}
-void* MethodContext::repGetPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void** ppIndirection)
-{
- DLDL temp = (DLDL)GetPInvokeUnmanagedTarget->Get((DWORDLONG)method);
- *ppIndirection = (void*)temp.A;
- DEBUG_REP(dmpGetPInvokeUnmanagedTarget((DWORDLONG)method, temp));
-
- return (void*)temp.B;
-}
-
void MethodContext::recGetArrayRank(CORINFO_CLASS_HANDLE cls, unsigned result)
{
if (GetArrayRank == nullptr)
DWORD offsetOfDelegateInstance;
DWORD offsetOfDelegateFirstTarget;
DWORD offsetOfWrapperDelegateIndirectCell;
- DWORD offsetOfTransparentProxyRP;
- DWORD offsetOfRealProxyServer;
- DWORD offsetOfObjArrayData;
DWORD sizeOfReversePInvokeFrame;
DWORD osPageSize;
DWORD maxUncheckedOffsetForNullObject;
DWORD targetAbi;
DWORD osType;
- DWORD osMajor;
- DWORD osMinor;
- DWORD osBuild;
};
struct Agnostic_GetFieldAddress
{
void dmpGetUnmanagedCallConv(DWORDLONG key, DWORD result);
CorInfoUnmanagedCallConv repGetUnmanagedCallConv(CORINFO_METHOD_HANDLE method);
- void recIsInstantiationOfVerifiedGeneric(CORINFO_METHOD_HANDLE method, CorInfoInstantiationVerification result);
- void dmpIsInstantiationOfVerifiedGeneric(DWORDLONG key, DWORD value);
- CorInfoInstantiationVerification repIsInstantiationOfVerifiedGeneric(CORINFO_METHOD_HANDLE method);
-
void recAsCorInfoType(CORINFO_CLASS_HANDLE cls, CorInfoType result);
void dmpAsCorInfoType(DWORDLONG key, DWORD value);
CorInfoType repAsCorInfoType(CORINFO_CLASS_HANDLE cls);
void dmpGetSharedCCtorHelper(DWORDLONG key, DWORD value);
CorInfoHelpFunc repGetSharedCCtorHelper(CORINFO_CLASS_HANDLE clsHnd);
- void recGetSecurityPrologHelper(CORINFO_METHOD_HANDLE ftn, CorInfoHelpFunc result);
- void dmpGetSecurityPrologHelper(DWORDLONG key, DWORD value);
- CorInfoHelpFunc repGetSecurityPrologHelper(CORINFO_METHOD_HANDLE ftn);
-
void recGetTypeForBox(CORINFO_CLASS_HANDLE cls, CORINFO_CLASS_HANDLE result);
void dmpGetTypeForBox(DWORDLONG key, DWORDLONG value);
CORINFO_CLASS_HANDLE repGetTypeForBox(CORINFO_CLASS_HANDLE cls);
void recGetLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND* result);
void dmpGetLocationOfThisType(DWORDLONG key, const Agnostic_CORINFO_LOOKUP_KIND& value);
- CORINFO_LOOKUP_KIND repGetLocationOfThisType(CORINFO_METHOD_HANDLE context);
+ void repGetLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND* pLookupKind);
void recGetDelegateCtor(CORINFO_METHOD_HANDLE methHnd,
CORINFO_CLASS_HANDLE clsHnd,
CorInfoInlineTypeCheck result);
void dmpCanInlineTypeCheck(DLD key, DWORD value);
CorInfoInlineTypeCheck repCanInlineTypeCheck(CORINFO_CLASS_HANDLE cls, CorInfoInlineTypeCheckSource source);
- void recCanInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE cls, BOOL result);
- void dmpCanInlineTypeCheckWithObjectVTable(DWORDLONG key, DWORD value);
- BOOL repCanInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE cls);
void recSatisfiesMethodConstraints(CORINFO_CLASS_HANDLE parent, CORINFO_METHOD_HANDLE method, BOOL result);
void dmpSatisfiesMethodConstraints(DLDL key, DWORD value);
BOOL repSatisfiesMethodConstraints(CORINFO_CLASS_HANDLE parent, CORINFO_METHOD_HANDLE method);
- void recInitConstraintsForVerification(CORINFO_METHOD_HANDLE method,
- BOOL* pfHasCircularClassConstraints,
- BOOL* pfHasCircularMethodConstraint);
- void dmpInitConstraintsForVerification(DWORDLONG key, DD value);
- void repInitConstraintsForVerification(CORINFO_METHOD_HANDLE method,
- BOOL* pfHasCircularClassConstraints,
- BOOL* pfHasCircularMethodConstraint);
-
void recIsValidStringRef(CORINFO_MODULE_HANDLE module, unsigned metaTOK, BOOL result);
void dmpIsValidStringRef(DLD key, DWORD value);
BOOL repIsValidStringRef(CORINFO_MODULE_HANDLE module, unsigned metaTOK);
void recHandleException(struct _EXCEPTION_POINTERS* pExceptionPointers);
void dmpHandleException(DWORD key, DWORD value);
- void recGetAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void** ppIndirection, void* result);
- void dmpGetAddressOfPInvokeFixup(DWORDLONG key, DLDL value);
- void* repGetAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void** ppIndirection);
-
void recGetAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP* pLookup);
void dmpGetAddressOfPInvokeTarget(DWORDLONG key, DLD value);
void repGetAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP* pLookup);
void dmpIsDelegateCreationAllowed(DLDL key, DWORD value);
BOOL repIsDelegateCreationAllowed(CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeHnd);
- void recCanSkipMethodVerification(CORINFO_METHOD_HANDLE ftnHandle,
- BOOL skip,
- CorInfoCanSkipVerificationResult result);
- void dmpCanSkipMethodVerification(DLD key, DWORD value);
- CorInfoCanSkipVerificationResult repCanSkipMethodVerification(CORINFO_METHOD_HANDLE ftnHandle, BOOL skip);
-
void recFindCallSiteSig(CORINFO_MODULE_HANDLE module,
unsigned methTOK,
CORINFO_CONTEXT_HANDLE context,
CORINFO_CONTEXT_HANDLE context,
CORINFO_SIG_INFO* sig);
- void recShouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope, BOOL result);
- void dmpShouldEnforceCallvirtRestriction(DWORDLONG key, DWORD value);
- BOOL repShouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope);
-
void recGetMethodSync(CORINFO_METHOD_HANDLE ftn, void** ppIndirection, void* result);
void dmpGetMethodSync(DWORDLONG key, DLDL value);
void* repGetMethodSync(CORINFO_METHOD_HANDLE ftn, void** ppIndirection);
void dmpGetRelocTypeHint(DWORDLONG key, DWORD value);
WORD repGetRelocTypeHint(void* target);
- void recIsWriteBarrierHelperRequired(CORINFO_FIELD_HANDLE field, bool result);
- void dmpIsWriteBarrierHelperRequired(DWORDLONG key, DWORD value);
- bool repIsWriteBarrierHelperRequired(CORINFO_FIELD_HANDLE field);
-
void recIsValidToken(CORINFO_MODULE_HANDLE module, unsigned metaTOK, BOOL result);
void dmpIsValidToken(DLD key, DWORD value);
BOOL repIsValidToken(CORINFO_MODULE_HANDLE module, unsigned metaTOK);
void dmpCheckMethodModifier(const Agnostic_CheckMethodModifier& key, DWORD value);
BOOL repCheckMethodModifier(CORINFO_METHOD_HANDLE hMethod, LPCSTR modifier, BOOL fOptional);
- void recGetPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void** ppIndirection, void* result);
- void dmpGetPInvokeUnmanagedTarget(DWORDLONG key, DLDL value);
- void* repGetPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void** ppIndirection);
-
void recGetArrayRank(CORINFO_CLASS_HANDLE cls, unsigned result);
void dmpGetArrayRank(DWORDLONG key, DWORD value);
unsigned repGetArrayRank(CORINFO_CLASS_HANDLE cls);
Packet_CanInline = 9,
Packet_CanInlineTypeCheck = 173, // Added 11/15/2018 as a replacement for CanInlineTypeCheckWithObjectVTable
Packet_CanInlineTypeCheckWithObjectVTable = 10,
- Packet_CanSkipMethodVerification = 11,
+ Packet_CanSkipMethodVerification = 11, // Retired 2/18/2020
Packet_CanTailCall = 12,
Retired4 = 13,
Packet_CheckMethodModifier = 142, // retired as 13 on 2013/07/04
Packet_FindNameOfToken = 145, // Added 7/19/2013 - adjusted members to proper types
Packet_GetSystemVAmd64PassStructInRegisterDescriptor = 156, // Added 2/17/2016
Packet_FindSig = 25,
- Packet_GetAddressOfPInvokeFixup = 26,
+ Packet_GetAddressOfPInvokeFixup = 26, // Retired 2/18/2020
Packet_GetAddressOfPInvokeTarget = 153, // Added 2/3/2016
Packet_GetAddrOfCaptureThreadGlobal = 27,
Retired1 = 28,
Packet_GetNewArrHelper = 79,
Packet_GetNewHelper = 80,
Packet_GetParentType = 81,
- Packet_GetPInvokeUnmanagedTarget = 82,
+ Packet_GetPInvokeUnmanagedTarget = 82, // Retired 2/18/2020
Packet_GetProfilingHandle = 83,
Packet_GetRelocTypeHint = 84,
- Packet_GetSecurityPrologHelper = 85,
+ Packet_GetSecurityPrologHelper = 85, // Retired 2/18/2020
Packet_GetSharedCCtorHelper = 86,
Packet_GetTailCallCopyArgsThunk = 87,
Packet_GetThreadTLSIndex = 88,
Packet_GetVars = 96,
Packet_HandleException = 135,
Packet_InitClass = 97,
- Packet_InitConstraintsForVerification = 98,
+ Packet_InitConstraintsForVerification = 98, // Retired 2/18/2020
Packet_IsCompatibleDelegate = 99,
Packet_IsDelegateCreationAllowed = 155,
Packet_IsFieldStatic = 137, // Added 4/9/2013 - needed for 4.5.1
Packet_IsIntrinsicType = 148, // Added 10/26/2019 - SIMD support
- Packet_IsInstantiationOfVerifiedGeneric = 100,
+ Packet_IsInstantiationOfVerifiedGeneric = 100, // Retired 2/18/2020
Packet_IsSDArray = 101,
Packet_IsStructRequiringStackAllocRetBuf = 102,
Packet_IsValidStringRef = 103,
Retired6 = 104,
Packet_IsValidToken = 144, // Added 7/19/2013 - adjusted members to proper types
Packet_IsValueClass = 105,
- Packet_IsWriteBarrierHelperRequired = 106,
+ Packet_IsWriteBarrierHelperRequired = 106, // Retired 2/18/2020
Packet_MergeClasses = 107,
Packet_IsMoreSpecificType = 174, // Added 2/14/2019
Packet_PInvokeMarshalingRequired = 108,
Packet_TryResolveToken = 158, // Added 4/26/2016
Packet_SatisfiesClassConstraints = 110,
Packet_SatisfiesMethodConstraints = 111,
- Packet_ShouldEnforceCallvirtRestriction = 112,
+ Packet_ShouldEnforceCallvirtRestriction = 112, // Retired 2/18/2020
PacketCR_AddressMap = 113,
PacketCR_AllocMethodBlockCounts = 131,
// Jit Exports
typedef ICorJitCompiler*(__stdcall* PgetJit)();
typedef void(__stdcall* PjitStartup)(ICorJitHost* host);
-typedef void(__stdcall* PsxsJitStartup)(CoreClrCallbacks const& cccallbacks);
#endif
AddFlag(CORINFO_FLG_SHAREDINST);
AddFlag(CORINFO_FLG_DELEGATE_INVOKE);
AddFlag(CORINFO_FLG_PINVOKE);
- AddFlag(CORINFO_FLG_SECURITYCHECK);
AddFlag(CORINFO_FLG_NOGCCHECK);
AddFlag(CORINFO_FLG_INTRINSIC);
AddFlag(CORINFO_FLG_CONSTRUCTOR);
AddFlag(CORINFO_FLG_AGGRESSIVE_OPT);
AddFlag(CORINFO_FLG_DISABLE_TIER0_FOR_LOOPS);
- AddFlag(CORINFO_FLG_NOSECURITYWRAP);
AddFlag(CORINFO_FLG_DONT_INLINE);
AddFlag(CORINFO_FLG_DONT_INLINE_CALLER);
AddFlag(CORINFO_FLG_JIT_INTRINSIC);
AddFlag(CORINFO_FLG_ARRAY);
AddFlag(CORINFO_FLG_OVERLAPPING_FIELDS);
AddFlag(CORINFO_FLG_INTERFACE);
- AddFlag(CORINFO_FLG_CONTEXTFUL);
AddFlag(CORINFO_FLG_CUSTOMLAYOUT);
AddFlag(CORINFO_FLG_CONTAINS_GC_PTR);
AddFlag(CORINFO_FLG_DELEGATE);
- AddFlag(CORINFO_FLG_MARSHAL_BYREF);
AddFlag(CORINFO_FLG_CONTAINS_STACK_PTR);
AddFlag(CORINFO_FLG_VARIANCE);
AddFlag(CORINFO_FLG_BEFOREFIELDINIT);
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
include_directories(../superpmi-shared)
set(SUPERPMI_SHIM_COLLECTOR_SOURCES
- coreclrcallbacks.cpp
jithost.cpp
icorjitcompiler.cpp
icorjitinfo.cpp
- ieememorymanager.cpp
- iexecutionengine.cpp
superpmi-shim-collector.cpp
../superpmi-shared/callutils.cpp
../superpmi-shared/compileresult.cpp
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#include "standardpch.h"
-#include "coreclrcallbacks.h"
-#include "iexecutionengine.h"
-
-CoreClrCallbacks* original_CoreClrCallbacks = nullptr;
-
-IExecutionEngine* STDMETHODCALLTYPE IEE_t()
-{
- interceptor_IEE* iee = new interceptor_IEE();
- iee->original_IEE = original_CoreClrCallbacks->m_pfnIEE();
- return iee;
-}
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#ifndef _CoreClrCallbacks
-#define _CoreClrCallbacks
-
-#include "coreclrcommoncallbacks.h"
-
-extern CoreClrCallbacks* original_CoreClrCallbacks;
-
-#endif
#include "superpmi-shim-collector.h"
#define fatMC // this is nice to have on so ildump works...
-interceptor_IEEMM* current_IEEMM = nullptr; // we want this to live beyond the scope of a single compileMethodCall
CorJitResult __stdcall interceptor_ICJC::compileMethod(ICorJitInfo* comp, /* IN */
struct CORINFO_METHOD_INFO* info, /* IN */
interceptor_ICJI our_ICorJitInfo;
our_ICorJitInfo.original_ICorJitInfo = comp;
- if (current_IEEMM == nullptr)
- current_IEEMM = new interceptor_IEEMM();
-
auto* mc = new MethodContext();
if (g_ourJitHost != nullptr)
{
return temp;
}
-void interceptor_ICJC::clearCache()
-{
- original_ICorJitCompiler->clearCache();
-}
-
-BOOL interceptor_ICJC::isCacheCleanupRequired()
-{
- return original_ICorJitCompiler->isCacheCleanupRequired();
-}
-
void interceptor_ICJC::ProcessShutdownWork(ICorStaticInfo* info)
{
original_ICorJitCompiler->ProcessShutdownWork(info);
{
return original_ICorJitCompiler->getMaxIntrinsicSIMDVectorLength(cpuCompileFlags);
}
-
-void interceptor_ICJC::setRealJit(ICorJitCompiler* realJitCompiler)
-{
- original_ICorJitCompiler->setRealJit(realJitCompiler);
-}
#define _ICorJitCompiler
#include "runtimedetails.h"
-#include "ieememorymanager.h"
class interceptor_ICJC : public ICorJitCompiler
{
HANDLE hFile;
};
-extern interceptor_IEEMM* current_IEEMM; // we want this to live beyond the scope of a single compileMethodCall
-
#endif
#include "standardpch.h"
#include "icorjitinfo.h"
#include "superpmi-shim-collector.h"
-#include "ieememorymanager.h"
#include "icorjitcompiler.h"
#include "methodcontext.h"
#include "errorhandling.h"
return temp;
}
-// Indicates if the method is an instance of the generic
-// method that passes (or has passed) verification
-CorInfoInstantiationVerification interceptor_ICJI::isInstantiationOfVerifiedGeneric(CORINFO_METHOD_HANDLE method /* IN
- */
- )
-{
- mc->cr->AddCall("isInstantiationOfVerifiedGeneric");
- CorInfoInstantiationVerification temp = original_ICorJitInfo->isInstantiationOfVerifiedGeneric(method);
- mc->recIsInstantiationOfVerifiedGeneric(method, temp);
- return temp;
-}
-
-// Loads the constraints on a typical method definition, detecting cycles;
-// for use in verification.
-void interceptor_ICJI::initConstraintsForVerification(CORINFO_METHOD_HANDLE method, /* IN */
- BOOL* pfHasCircularClassConstraints, /* OUT */
- BOOL* pfHasCircularMethodConstraint /* OUT */
- )
-{
- mc->cr->AddCall("initConstraintsForVerification");
- original_ICorJitInfo->initConstraintsForVerification(method, pfHasCircularClassConstraints,
- pfHasCircularMethodConstraint);
- mc->recInitConstraintsForVerification(method, pfHasCircularClassConstraints, pfHasCircularMethodConstraint);
-}
-
-// Returns enum whether the method does not require verification
-// Also see ICorModuleInfo::canSkipVerification
-CorInfoCanSkipVerificationResult interceptor_ICJI::canSkipMethodVerification(CORINFO_METHOD_HANDLE ftnHandle)
-{
- mc->cr->AddCall("canSkipMethodVerification");
- CorInfoCanSkipVerificationResult temp = original_ICorJitInfo->canSkipMethodVerification(ftnHandle);
- mc->recCanSkipMethodVerification(ftnHandle, FALSE, temp);
- return temp;
-}
-
// load and restore the method
void interceptor_ICJI::methodMustBeLoadedBeforeCodeIsRun(CORINFO_METHOD_HANDLE method)
{
return temp;
}
-// Returns true if the module does not require verification
-//
-// If fQuickCheckOnlyWithoutCommit=TRUE, the function only checks that the
-// module does not currently require verification in the current AppDomain.
-// This decision could change in the future, and so should not be cached.
-// If it is cached, it should only be used as a hint.
-// This is only used by ngen for calculating certain hints.
-//
-// Returns enum whether the module does not require verification
-// Also see ICorMethodInfo::canSkipMethodVerification();
-CorInfoCanSkipVerificationResult interceptor_ICJI::canSkipVerification(CORINFO_MODULE_HANDLE module /* IN */
- )
-{
- mc->cr->AddCall("canSkipVerification");
- return original_ICorJitInfo->canSkipVerification(module);
-}
-
// Checks if the given metadata token is valid
BOOL interceptor_ICJI::isValidToken(CORINFO_MODULE_HANDLE module, /* IN */
unsigned metaTOK /* IN */
return temp;
}
-BOOL interceptor_ICJI::shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope)
-{
- mc->cr->AddCall("shouldEnforceCallvirtRestriction");
- BOOL temp = original_ICorJitInfo->shouldEnforceCallvirtRestriction(scope);
- mc->recShouldEnforceCallvirtRestriction(scope, temp);
- return temp;
-}
-
/**********************************************************************************/
//
// ICorClassInfo
return temp;
}
-// If this method returns true, JIT will do optimization to inline the check for
-// GetTypeFromHandle(handle) == obj.GetType()
-BOOL interceptor_ICJI::canInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE cls)
-{
- mc->cr->AddCall("canInlineTypeCheckWithObjectVTable");
- BOOL temp = original_ICorJitInfo->canInlineTypeCheckWithObjectVTable(cls);
- mc->recCanInlineTypeCheckWithObjectVTable(cls, temp);
- return temp;
-}
-
// return flags (defined above, CORINFO_FLG_PUBLIC ...)
DWORD interceptor_ICJI::getClassAttribs(CORINFO_CLASS_HANDLE cls)
{
return temp;
}
-CorInfoHelpFunc interceptor_ICJI::getSecurityPrologHelper(CORINFO_METHOD_HANDLE ftn)
-{
- mc->cr->AddCall("getSecurityPrologHelper");
- CorInfoHelpFunc temp = original_ICorJitInfo->getSecurityPrologHelper(ftn);
- mc->recGetSecurityPrologHelper(ftn, temp);
- return temp;
-}
-
// This is not pretty. Boxing nullable<T> actually returns
// a boxed<T> not a boxed Nullable<T>. This call allows the verifier
// to call back to the EE on the 'box' instruction and get the transformed
return temp;
}
-// TODO: jit64 should be switched to the same plan as the i386 jits - use
-// getClassGClayout to figure out the need for writebarrier helper, and inline the copying.
-// The interpretted value class copy is slow. Once this happens, USE_WRITE_BARRIER_HELPERS
-bool interceptor_ICJI::isWriteBarrierHelperRequired(CORINFO_FIELD_HANDLE field)
-{
- mc->cr->AddCall("isWriteBarrierHelperRequired");
- bool result = original_ICorJitInfo->isWriteBarrierHelperRequired(field);
- mc->recIsWriteBarrierHelperRequired(field, result);
- return result;
-}
-
void interceptor_ICJI::getFieldInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken,
CORINFO_METHOD_HANDLE callerHandle,
CORINFO_ACCESS_FLAGS flags,
// Used to allocate memory that needs to handed to the EE.
// For eg, use this to allocated memory for reporting debug info,
// which will be handed to the EE by setVars() and setBoundaries()
-void* interceptor_ICJI::allocateArray(ULONG cBytes)
+void* interceptor_ICJI::allocateArray(size_t cBytes)
{
mc->cr->AddCall("allocateArray");
return original_ICorJitInfo->allocateArray(cBytes);
// CORINFO_LOOKUP_THISOBJ use vtable pointer of 'this' param
// CORINFO_LOOKUP_CLASSPARAM use vtable hidden param
// CORINFO_LOOKUP_METHODPARAM use enclosing type of method-desc hidden param
-CORINFO_LOOKUP_KIND interceptor_ICJI::getLocationOfThisType(CORINFO_METHOD_HANDLE context)
+void interceptor_ICJI::getLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND* pLookupKind)
{
mc->cr->AddCall("getLocationOfThisType");
- CORINFO_LOOKUP_KIND temp = original_ICorJitInfo->getLocationOfThisType(context);
- mc->recGetLocationOfThisType(context, &temp);
- return temp;
-}
-
-// return the unmanaged target *if method has already been prelinked.*
-void* interceptor_ICJI::getPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void** ppIndirection)
-{
- mc->cr->AddCall("getPInvokeUnmanagedTarget");
- void* result = original_ICorJitInfo->getPInvokeUnmanagedTarget(method, ppIndirection);
- mc->recGetPInvokeUnmanagedTarget(method, ppIndirection, result);
- return result;
-}
-
-// return address of fixup area for late-bound PInvoke calls.
-void* interceptor_ICJI::getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void** ppIndirection)
-{
- mc->cr->AddCall("getAddressOfPInvokeFixup");
- void* temp = original_ICorJitInfo->getAddressOfPInvokeFixup(method, ppIndirection);
- mc->recGetAddressOfPInvokeFixup(method, ppIndirection, temp);
- return temp;
+ original_ICorJitInfo->getLocationOfThisType(context, pLookupKind);
+ mc->recGetLocationOfThisType(context, pLookupKind);
}
// return address of fixup area for late-bound PInvoke calls.
return original_ICorJitInfo->runWithErrorTrap(function, param);
}
-// return memory manager that the JIT can use to allocate a regular memory
-IEEMemoryManager* interceptor_ICJI::getMemoryManager()
-{
- mc->cr->AddCall("getMemoryManager");
- if (current_IEEMM->original_IEEMM == nullptr)
- current_IEEMM->original_IEEMM = original_ICorJitInfo->getMemoryManager();
- return current_IEEMM;
-}
-
// get a block of memory for the code, readonly data, and read-write data
void interceptor_ICJI::allocMem(ULONG hotCodeSize, /* IN */
ULONG coldCodeSize, /* IN */
return temp;
}
-// only used on x64
-void interceptor_ICJI::yieldExecution()
-{
- mc->cr->AddCall("yieldExecution"); // Nothing to record
- original_ICorJitInfo->yieldExecution();
-}
-
// Indicate how many exception handler blocks are to be returned.
// This is guaranteed to be called before any 'setEHinfo' call.
// Note that allocMem must be called before this method can be called.
return result;
}
-// A callback to identify the range of address known to point to
-// compiler-generated native entry points that call back into
-// MSIL.
-void interceptor_ICJI::getModuleNativeEntryPointRange(void** pStart, /* OUT */
- void** pEnd /* OUT */
- )
-{
- mc->cr->AddCall("getModuleNativeEntryPointRange");
- original_ICorJitInfo->getModuleNativeEntryPointRange(pStart, pEnd);
-}
-
// For what machine does the VM expect the JIT to generate code? The VM
// returns one of the IMAGE_FILE_MACHINE_* values. Note that if the VM
// is cross-compiling (such as the case for crossgen), it will return a
#define _ICorJitInfo
#include "runtimedetails.h"
-#include "ieememorymanager.h"
#include "methodcontext.h"
class interceptor_ICJI : public ICorJitInfo
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#include "standardpch.h"
-#include "ieememorymanager.h"
-#include "superpmi-shim-collector.h"
-
-//***************************************************************************
-// IUnknown methods
-//***************************************************************************
-HRESULT STDMETHODCALLTYPE interceptor_IEEMM::QueryInterface(REFIID id, void** pInterface)
-{
- return original_IEEMM->QueryInterface(id, pInterface);
-}
-ULONG STDMETHODCALLTYPE interceptor_IEEMM::AddRef()
-{
- return original_IEEMM->AddRef();
-}
-ULONG STDMETHODCALLTYPE interceptor_IEEMM::Release()
-{
- return original_IEEMM->Release();
-}
-
-//***************************************************************************
-// IEEMemoryManager methods for locking
-//***************************************************************************
-LPVOID STDMETHODCALLTYPE interceptor_IEEMM::ClrVirtualAlloc(LPVOID lpAddress,
- SIZE_T dwSize,
- DWORD flAllocationType,
- DWORD flProtect)
-{
- return original_IEEMM->ClrVirtualAlloc(lpAddress, dwSize, flAllocationType, flProtect);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEEMM::ClrVirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType)
-{
- return original_IEEMM->ClrVirtualFree(lpAddress, dwSize, dwFreeType);
-}
-SIZE_T STDMETHODCALLTYPE interceptor_IEEMM::ClrVirtualQuery(LPCVOID lpAddress,
- PMEMORY_BASIC_INFORMATION lpBuffer,
- SIZE_T dwLength)
-{
- return original_IEEMM->ClrVirtualQuery(lpAddress, lpBuffer, dwLength);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEEMM::ClrVirtualProtect(LPVOID lpAddress,
- SIZE_T dwSize,
- DWORD flNewProtect,
- PDWORD lpflOldProtect)
-{
- return original_IEEMM->ClrVirtualProtect(lpAddress, dwSize, flNewProtect, lpflOldProtect);
-}
-HANDLE STDMETHODCALLTYPE interceptor_IEEMM::ClrGetProcessHeap()
-{
- return original_IEEMM->ClrGetProcessHeap();
-}
-HANDLE STDMETHODCALLTYPE interceptor_IEEMM::ClrHeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize)
-{
- return original_IEEMM->ClrHeapCreate(flOptions, dwInitialSize, dwMaximumSize);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEEMM::ClrHeapDestroy(HANDLE hHeap)
-{
- return original_IEEMM->ClrHeapDestroy(hHeap);
-}
-LPVOID STDMETHODCALLTYPE interceptor_IEEMM::ClrHeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes)
-{
- return original_IEEMM->ClrHeapAlloc(hHeap, dwFlags, dwBytes);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEEMM::ClrHeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem)
-{
- return original_IEEMM->ClrHeapFree(hHeap, dwFlags, lpMem);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEEMM::ClrHeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem)
-{
- return original_IEEMM->ClrHeapValidate(hHeap, dwFlags, lpMem);
-}
-HANDLE STDMETHODCALLTYPE interceptor_IEEMM::ClrGetProcessExecutableHeap()
-{
- return original_IEEMM->ClrGetProcessExecutableHeap();
-}
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#ifndef _IEEMemoryManager
-#define _IEEMemoryManager
-
-#include "runtimedetails.h"
-
-class interceptor_IEEMM : public IEEMemoryManager
-{
-public:
- interceptor_IEEMM() : original_IEEMM(nullptr)
- {
- }
-
-private:
- //***************************************************************************
- // IUnknown methods
- //***************************************************************************
- HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, void** pInterface);
- ULONG STDMETHODCALLTYPE AddRef();
- ULONG STDMETHODCALLTYPE Release();
-
- //***************************************************************************
- // IEEMemoryManager methods for locking
- //***************************************************************************
- LPVOID STDMETHODCALLTYPE ClrVirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect);
- BOOL STDMETHODCALLTYPE ClrVirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType);
- SIZE_T STDMETHODCALLTYPE ClrVirtualQuery(LPCVOID lpAddress, PMEMORY_BASIC_INFORMATION lpBuffer, SIZE_T dwLength);
- BOOL STDMETHODCALLTYPE ClrVirtualProtect(LPVOID lpAddress,
- SIZE_T dwSize,
- DWORD flNewProtect,
- PDWORD lpflOldProtect);
- HANDLE STDMETHODCALLTYPE ClrGetProcessHeap();
- HANDLE STDMETHODCALLTYPE ClrHeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize);
- BOOL STDMETHODCALLTYPE ClrHeapDestroy(HANDLE hHeap);
- LPVOID STDMETHODCALLTYPE ClrHeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes);
- BOOL STDMETHODCALLTYPE ClrHeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem);
- BOOL STDMETHODCALLTYPE ClrHeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem);
- HANDLE STDMETHODCALLTYPE ClrGetProcessExecutableHeap();
-
-public:
- IEEMemoryManager* original_IEEMM;
-};
-#endif
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-//----------------------------------------------------------
-// IExecutionEngine.cpp - core shim implementation for IEE stuff
-//----------------------------------------------------------
-
-#include "standardpch.h"
-#include "iexecutionengine.h"
-#include "superpmi-shim-collector.h"
-
-//***************************************************************************
-// IUnknown methods
-//***************************************************************************
-HRESULT STDMETHODCALLTYPE interceptor_IEE::QueryInterface(REFIID id, void** pInterface)
-{
- return original_IEE->QueryInterface(id, pInterface);
-}
-ULONG STDMETHODCALLTYPE interceptor_IEE::AddRef()
-{
- return original_IEE->AddRef();
-}
-ULONG STDMETHODCALLTYPE interceptor_IEE::Release()
-{
- return original_IEE->Release();
-}
-
-//***************************************************************************
-// IExecutionEngine methods for TLS
-//***************************************************************************
-// Associate a callback for cleanup with a TLS slot
-VOID STDMETHODCALLTYPE interceptor_IEE::TLS_AssociateCallback(DWORD slot, PTLS_CALLBACK_FUNCTION callback)
-{
- original_IEE->TLS_AssociateCallback(slot, callback);
-}
-// Get the TLS block for fast Get/Set operations
-LPVOID* STDMETHODCALLTYPE interceptor_IEE::TLS_GetDataBlock()
-{
- return original_IEE->TLS_GetDataBlock();
-}
-// Get the value at a slot
-LPVOID STDMETHODCALLTYPE interceptor_IEE::TLS_GetValue(DWORD slot)
-{
- return original_IEE->TLS_GetValue(slot);
-}
-// Get the value at a slot, return FALSE if TLS info block doesn't exist
-BOOL STDMETHODCALLTYPE interceptor_IEE::TLS_CheckValue(DWORD slot, LPVOID* pValue)
-{
- return original_IEE->TLS_CheckValue(slot, pValue);
-}
-// Set the value at a slot
-VOID STDMETHODCALLTYPE interceptor_IEE::TLS_SetValue(DWORD slot, LPVOID pData)
-{
- original_IEE->TLS_SetValue(slot, pData);
-}
-// Free TLS memory block and make callback
-VOID STDMETHODCALLTYPE interceptor_IEE::TLS_ThreadDetaching()
-{
- original_IEE->TLS_ThreadDetaching();
-}
-
-//***************************************************************************
-// IExecutionEngine methods for locking
-//***************************************************************************
-CRITSEC_COOKIE STDMETHODCALLTYPE interceptor_IEE::CreateLock(LPCSTR szTag, LPCSTR level, CrstFlags flags)
-{
- return original_IEE->CreateLock(szTag, level, flags);
-}
-void STDMETHODCALLTYPE interceptor_IEE::DestroyLock(CRITSEC_COOKIE lock)
-{
- original_IEE->DestroyLock(lock);
-}
-void STDMETHODCALLTYPE interceptor_IEE::AcquireLock(CRITSEC_COOKIE lock)
-{
- original_IEE->AcquireLock(lock);
-}
-void STDMETHODCALLTYPE interceptor_IEE::ReleaseLock(CRITSEC_COOKIE lock)
-{
- original_IEE->ReleaseLock(lock);
-}
-EVENT_COOKIE STDMETHODCALLTYPE interceptor_IEE::CreateAutoEvent(BOOL bInitialState)
-{
- return original_IEE->CreateAutoEvent(bInitialState);
-}
-EVENT_COOKIE STDMETHODCALLTYPE interceptor_IEE::CreateManualEvent(BOOL bInitialState)
-{
- return original_IEE->CreateManualEvent(bInitialState);
-}
-void STDMETHODCALLTYPE interceptor_IEE::CloseEvent(EVENT_COOKIE event)
-{
- original_IEE->CloseEvent(event);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEE::ClrSetEvent(EVENT_COOKIE event)
-{
- return original_IEE->ClrSetEvent(event);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEE::ClrResetEvent(EVENT_COOKIE event)
-{
- return original_IEE->ClrResetEvent(event);
-}
-DWORD STDMETHODCALLTYPE interceptor_IEE::WaitForEvent(EVENT_COOKIE event, DWORD dwMilliseconds, BOOL bAlertable)
-{
- return original_IEE->WaitForEvent(event, dwMilliseconds, bAlertable);
-}
-DWORD STDMETHODCALLTYPE interceptor_IEE::WaitForSingleObject(HANDLE handle, DWORD dwMilliseconds)
-{
- return original_IEE->WaitForSingleObject(handle, dwMilliseconds);
-}
-SEMAPHORE_COOKIE STDMETHODCALLTYPE interceptor_IEE::ClrCreateSemaphore(DWORD dwInitial, DWORD dwMax)
-{
- return original_IEE->ClrCreateSemaphore(dwInitial, dwMax);
-}
-void STDMETHODCALLTYPE interceptor_IEE::ClrCloseSemaphore(SEMAPHORE_COOKIE semaphore)
-{
- original_IEE->ClrCloseSemaphore(semaphore);
-}
-DWORD STDMETHODCALLTYPE interceptor_IEE::ClrWaitForSemaphore(SEMAPHORE_COOKIE semaphore,
- DWORD dwMilliseconds,
- BOOL bAlertable)
-{
- return original_IEE->ClrWaitForSemaphore(semaphore, dwMilliseconds, bAlertable);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEE::ClrReleaseSemaphore(SEMAPHORE_COOKIE semaphore,
- LONG lReleaseCount,
- LONG* lpPreviousCount)
-{
- return original_IEE->ClrReleaseSemaphore(semaphore, lReleaseCount, lpPreviousCount);
-}
-MUTEX_COOKIE STDMETHODCALLTYPE interceptor_IEE::ClrCreateMutex(LPSECURITY_ATTRIBUTES lpMutexAttributes,
- BOOL bInitialOwner,
- LPCTSTR lpName)
-{
- return original_IEE->ClrCreateMutex(lpMutexAttributes, bInitialOwner, lpName);
-}
-void STDMETHODCALLTYPE interceptor_IEE::ClrCloseMutex(MUTEX_COOKIE mutex)
-{
- original_IEE->ClrCloseMutex(mutex);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEE::ClrReleaseMutex(MUTEX_COOKIE mutex)
-{
- return original_IEE->ClrReleaseMutex(mutex);
-}
-DWORD STDMETHODCALLTYPE interceptor_IEE::ClrWaitForMutex(MUTEX_COOKIE mutex, DWORD dwMilliseconds, BOOL bAlertable)
-{
- return original_IEE->ClrWaitForMutex(mutex, dwMilliseconds, bAlertable);
-}
-DWORD STDMETHODCALLTYPE interceptor_IEE::ClrSleepEx(DWORD dwMilliseconds, BOOL bAlertable)
-{
- return original_IEE->ClrSleepEx(dwMilliseconds, bAlertable);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEE::ClrAllocationDisallowed()
-{
- return original_IEE->ClrAllocationDisallowed();
-}
-void STDMETHODCALLTYPE interceptor_IEE::GetLastThrownObjectExceptionFromThread(void** ppvException)
-{
- original_IEE->GetLastThrownObjectExceptionFromThread(ppvException);
-}
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-//----------------------------------------------------------
-// IExecutionEngine.h - core shim implementation for IEE stuff
-//----------------------------------------------------------
-#ifndef _IExecutionEngine
-#define _IExecutionEngine
-
-#include "ieememorymanager.h"
-
-class interceptor_IEE : public IExecutionEngine
-{
-private:
- //***************************************************************************
- // IUnknown methods
- //***************************************************************************
- HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, void** pInterface);
- ULONG STDMETHODCALLTYPE AddRef();
- ULONG STDMETHODCALLTYPE Release();
-
- //***************************************************************************
- // IExecutionEngine methods for TLS
- //***************************************************************************
- // Associate a callback for cleanup with a TLS slot
- VOID STDMETHODCALLTYPE TLS_AssociateCallback(DWORD slot, PTLS_CALLBACK_FUNCTION callback);
- // Get the TLS block for fast Get/Set operations
- LPVOID* STDMETHODCALLTYPE TLS_GetDataBlock();
- // Get the value at a slot
- LPVOID STDMETHODCALLTYPE TLS_GetValue(DWORD slot);
- // Get the value at a slot, return FALSE if TLS info block doesn't exist
- BOOL STDMETHODCALLTYPE TLS_CheckValue(DWORD slot, LPVOID* pValue);
- // Set the value at a slot
- VOID STDMETHODCALLTYPE TLS_SetValue(DWORD slot, LPVOID pData);
- // Free TLS memory block and make callback
- VOID STDMETHODCALLTYPE TLS_ThreadDetaching();
-
- //***************************************************************************
- // IExecutionEngine methods for locking
- //***************************************************************************
- CRITSEC_COOKIE STDMETHODCALLTYPE CreateLock(LPCSTR szTag, LPCSTR level, CrstFlags flags);
- void STDMETHODCALLTYPE DestroyLock(CRITSEC_COOKIE lock);
- void STDMETHODCALLTYPE AcquireLock(CRITSEC_COOKIE lock);
- void STDMETHODCALLTYPE ReleaseLock(CRITSEC_COOKIE lock);
- EVENT_COOKIE STDMETHODCALLTYPE CreateAutoEvent(BOOL bInitialState);
- EVENT_COOKIE STDMETHODCALLTYPE CreateManualEvent(BOOL bInitialState);
- void STDMETHODCALLTYPE CloseEvent(EVENT_COOKIE event);
- BOOL STDMETHODCALLTYPE ClrSetEvent(EVENT_COOKIE event);
- BOOL STDMETHODCALLTYPE ClrResetEvent(EVENT_COOKIE event);
- DWORD STDMETHODCALLTYPE WaitForEvent(EVENT_COOKIE event, DWORD dwMilliseconds, BOOL bAlertable);
- DWORD STDMETHODCALLTYPE WaitForSingleObject(HANDLE handle, DWORD dwMilliseconds);
- SEMAPHORE_COOKIE STDMETHODCALLTYPE ClrCreateSemaphore(DWORD dwInitial, DWORD dwMax);
- void STDMETHODCALLTYPE ClrCloseSemaphore(SEMAPHORE_COOKIE semaphore);
- DWORD STDMETHODCALLTYPE ClrWaitForSemaphore(SEMAPHORE_COOKIE semaphore, DWORD dwMilliseconds, BOOL bAlertable);
- BOOL STDMETHODCALLTYPE ClrReleaseSemaphore(SEMAPHORE_COOKIE semaphore, LONG lReleaseCount, LONG* lpPreviousCount);
- MUTEX_COOKIE STDMETHODCALLTYPE ClrCreateMutex(LPSECURITY_ATTRIBUTES lpMutexAttributes,
- BOOL bInitialOwner,
- LPCTSTR lpName);
- void STDMETHODCALLTYPE ClrCloseMutex(MUTEX_COOKIE mutex);
- BOOL STDMETHODCALLTYPE ClrReleaseMutex(MUTEX_COOKIE mutex);
- DWORD STDMETHODCALLTYPE ClrWaitForMutex(MUTEX_COOKIE mutex, DWORD dwMilliseconds, BOOL bAlertable);
- DWORD STDMETHODCALLTYPE ClrSleepEx(DWORD dwMilliseconds, BOOL bAlertable);
- BOOL STDMETHODCALLTYPE ClrAllocationDisallowed();
- void STDMETHODCALLTYPE GetLastThrownObjectExceptionFromThread(void** ppvException);
-
-public:
- IExecutionEngine* original_IEE; // Our extra value that holds a pointer to the original IEE we'll pass calls along
- // to
-};
-
-#endif
\ No newline at end of file
//----------------------------------------------------------
#include "standardpch.h"
-#include "coreclrcallbacks.h"
#include "icorjitcompiler.h"
#include "runtimedetails.h"
#include "errorhandling.h"
return pJitInstance;
}
-
-extern "C" DLLEXPORT void __stdcall sxsJitStartup(CoreClrCallbacks const& original_cccallbacks)
-{
- PsxsJitStartup pnsxsJitStartup;
-
- SetDefaultPaths();
- SetLibName();
-
- if (!LoadRealJitLib(g_hRealJit, g_realJitPath))
- {
- return;
- }
-
- // get entry point
- pnsxsJitStartup = (PsxsJitStartup)::GetProcAddress(g_hRealJit, "sxsJitStartup");
-
- if (pnsxsJitStartup != nullptr)
- {
- // Setup CoreClrCallbacks and call sxsJitStartup
- original_CoreClrCallbacks = new CoreClrCallbacks();
- original_CoreClrCallbacks->m_hmodCoreCLR = original_cccallbacks.m_hmodCoreCLR;
- original_CoreClrCallbacks->m_pfnIEE = original_cccallbacks.m_pfnIEE;
- original_CoreClrCallbacks->m_pfnGetCORSystemDirectory = original_cccallbacks.m_pfnGetCORSystemDirectory;
-
- CoreClrCallbacks* temp = new CoreClrCallbacks();
-
- temp->m_hmodCoreCLR = original_cccallbacks.m_hmodCoreCLR;
- temp->m_pfnIEE = IEE_t;
- temp->m_pfnGetCORSystemDirectory = original_cccallbacks.m_pfnGetCORSystemDirectory;
-
- pnsxsJitStartup(*temp);
- }
-}
EXPORTS
getJit
jitStartup
- sxsJitStartup
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
include_directories(../superpmi-shared)
set(SUPERPMI_SHIM_COUNTER_SOURCES
- coreclrcallbacks.cpp
jithost.cpp
icorjitcompiler.cpp
icorjitinfo.cpp
- ieememorymanager.cpp
- iexecutionengine.cpp
methodcallsummarizer.cpp
superpmi-shim-counter.cpp
../superpmi-shared/callutils.cpp
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#include "standardpch.h"
-#include "coreclrcallbacks.h"
-#include "iexecutionengine.h"
-
-CoreClrCallbacks* original_CoreClrCallbacks = nullptr;
-
-IExecutionEngine* STDMETHODCALLTYPE IEE_t()
-{
- interceptor_IEE* iee = new interceptor_IEE();
- iee->original_IEE = original_CoreClrCallbacks->m_pfnIEE();
- return iee;
-}
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#ifndef _CoreClrCallbacks
-#define _CoreClrCallbacks
-
-#include "coreclrcommoncallbacks.h"
-
-extern CoreClrCallbacks* original_CoreClrCallbacks;
-
-#endif
#include "icorjitcompiler.h"
#include "icorjitinfo.h"
-interceptor_IEEMM* current_IEEMM = nullptr; // we want this to live beyond the scope of a single compileMethodCall
-
CorJitResult __stdcall interceptor_ICJC::compileMethod(ICorJitInfo* comp, /* IN */
struct CORINFO_METHOD_INFO* info, /* IN */
unsigned /* code:CorJitFlag */ flags, /* IN */
interceptor_ICJI our_ICorJitInfo;
our_ICorJitInfo.original_ICorJitInfo = comp;
- if (current_IEEMM == nullptr)
- current_IEEMM = new interceptor_IEEMM();
our_ICorJitInfo.mcs = mcs;
mcs->AddCall("compileMethod");
return temp;
}
-void interceptor_ICJC::clearCache()
-{
- mcs->AddCall("clearCache");
- original_ICorJitCompiler->clearCache();
-}
-
-BOOL interceptor_ICJC::isCacheCleanupRequired()
-{
- mcs->AddCall("isCacheCleanupRequired");
- return original_ICorJitCompiler->isCacheCleanupRequired();
-}
-
void interceptor_ICJC::ProcessShutdownWork(ICorStaticInfo* info)
{
mcs->AddCall("ProcessShutdownWork");
mcs->AddCall("getMaxIntrinsicSIMDVectorLength");
return original_ICorJitCompiler->getMaxIntrinsicSIMDVectorLength(cpuCompileFlags);
}
-
-void interceptor_ICJC::setRealJit(ICorJitCompiler* realJitCompiler)
-{
- mcs->AddCall("setRealJit");
- original_ICorJitCompiler->setRealJit(realJitCompiler);
-}
#include "runtimedetails.h"
#include "methodcallsummarizer.h"
-#include "ieememorymanager.h"
class interceptor_ICJC : public ICorJitCompiler
{
MethodCallSummarizer* mcs;
};
-extern interceptor_IEEMM* current_IEEMM; // we want this to live beyond the scope of a single compileMethodCall
-
#endif
#include "standardpch.h"
#include "icorjitinfo.h"
#include "superpmi-shim-counter.h"
-#include "ieememorymanager.h"
#include "icorjitcompiler.h"
#include "spmiutil.h"
return original_ICorJitInfo->isCompatibleDelegate(objCls, methodParentCls, method, delegateCls, pfIsOpenDelegate);
}
-// Indicates if the method is an instance of the generic
-// method that passes (or has passed) verification
-CorInfoInstantiationVerification interceptor_ICJI::isInstantiationOfVerifiedGeneric(CORINFO_METHOD_HANDLE method /* IN
- */
- )
-{
- mcs->AddCall("isInstantiationOfVerifiedGeneric");
- return original_ICorJitInfo->isInstantiationOfVerifiedGeneric(method);
-}
-
-// Loads the constraints on a typical method definition, detecting cycles;
-// for use in verification.
-void interceptor_ICJI::initConstraintsForVerification(CORINFO_METHOD_HANDLE method, /* IN */
- BOOL* pfHasCircularClassConstraints, /* OUT */
- BOOL* pfHasCircularMethodConstraint /* OUT */
- )
-{
- mcs->AddCall("initConstraintsForVerification");
- original_ICorJitInfo->initConstraintsForVerification(method, pfHasCircularClassConstraints,
- pfHasCircularMethodConstraint);
-}
-
-// Returns enum whether the method does not require verification
-// Also see ICorModuleInfo::canSkipVerification
-CorInfoCanSkipVerificationResult interceptor_ICJI::canSkipMethodVerification(CORINFO_METHOD_HANDLE ftnHandle)
-{
- mcs->AddCall("canSkipMethodVerification");
- return original_ICorJitInfo->canSkipMethodVerification(ftnHandle);
-}
-
// load and restore the method
void interceptor_ICJI::methodMustBeLoadedBeforeCodeIsRun(CORINFO_METHOD_HANDLE method)
{
// This is only used by ngen for calculating certain hints.
//
-// Returns enum whether the module does not require verification
-// Also see ICorMethodInfo::canSkipMethodVerification();
-CorInfoCanSkipVerificationResult interceptor_ICJI::canSkipVerification(CORINFO_MODULE_HANDLE module /* IN */
- )
-{
- mcs->AddCall("canSkipVerification");
- return original_ICorJitInfo->canSkipVerification(module);
-}
-
// Checks if the given metadata token is valid
BOOL interceptor_ICJI::isValidToken(CORINFO_MODULE_HANDLE module, /* IN */
unsigned metaTOK /* IN */
return original_ICorJitInfo->getStringLiteral(module, metaTOK, length);
}
-BOOL interceptor_ICJI::shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope)
-{
- mcs->AddCall("shouldEnforceCallvirtRestriction");
- return original_ICorJitInfo->shouldEnforceCallvirtRestriction(scope);
-}
-
/**********************************************************************************/
//
// ICorClassInfo
return original_ICorJitInfo->canInlineTypeCheck(cls, source);
}
-// If this method returns true, JIT will do optimization to inline the check for
-// GetTypeFromHandle(handle) == obj.GetType()
-BOOL interceptor_ICJI::canInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE cls)
-{
- mcs->AddCall("canInlineTypeCheckWithObjectVTable");
- return original_ICorJitInfo->canInlineTypeCheckWithObjectVTable(cls);
-}
-
// return flags (defined above, CORINFO_FLG_PUBLIC ...)
DWORD interceptor_ICJI::getClassAttribs(CORINFO_CLASS_HANDLE cls)
{
return original_ICorJitInfo->getSharedCCtorHelper(clsHnd);
}
-CorInfoHelpFunc interceptor_ICJI::getSecurityPrologHelper(CORINFO_METHOD_HANDLE ftn)
-{
- mcs->AddCall("getSecurityPrologHelper");
- return original_ICorJitInfo->getSecurityPrologHelper(ftn);
-}
-
// This is not pretty. Boxing nullable<T> actually returns
// a boxed<T> not a boxed Nullable<T>. This call allows the verifier
// to call back to the EE on the 'box' instruction and get the transformed
return original_ICorJitInfo->getFieldOffset(field);
}
-// TODO: jit64 should be switched to the same plan as the i386 jits - use
-// getClassGClayout to figure out the need for writebarrier helper, and inline the copying.
-// The interpretted value class copy is slow. Once this happens, USE_WRITE_BARRIER_HELPERS
-bool interceptor_ICJI::isWriteBarrierHelperRequired(CORINFO_FIELD_HANDLE field)
-{
- mcs->AddCall("isWriteBarrierHelperRequired");
- return original_ICorJitInfo->isWriteBarrierHelperRequired(field);
-}
-
void interceptor_ICJI::getFieldInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken,
CORINFO_METHOD_HANDLE callerHandle,
CORINFO_ACCESS_FLAGS flags,
// Used to allocate memory that needs to handed to the EE.
// For eg, use this to allocated memory for reporting debug info,
// which will be handed to the EE by setVars() and setBoundaries()
-void* interceptor_ICJI::allocateArray(ULONG cBytes)
+void* interceptor_ICJI::allocateArray(size_t cBytes)
{
mcs->AddCall("allocateArray");
return original_ICorJitInfo->allocateArray(cBytes);
// CORINFO_LOOKUP_THISOBJ use vtable pointer of 'this' param
// CORINFO_LOOKUP_CLASSPARAM use vtable hidden param
// CORINFO_LOOKUP_METHODPARAM use enclosing type of method-desc hidden param
-CORINFO_LOOKUP_KIND interceptor_ICJI::getLocationOfThisType(CORINFO_METHOD_HANDLE context)
+void interceptor_ICJI::getLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND* pLookupKind)
{
mcs->AddCall("getLocationOfThisType");
- return original_ICorJitInfo->getLocationOfThisType(context);
-}
-
-// return the unmanaged target *if method has already been prelinked.*
-void* interceptor_ICJI::getPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void** ppIndirection)
-{
- mcs->AddCall("getPInvokeUnmanagedTarget");
- return original_ICorJitInfo->getPInvokeUnmanagedTarget(method, ppIndirection);
-}
-
-// return address of fixup area for late-bound PInvoke calls.
-void* interceptor_ICJI::getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void** ppIndirection)
-{
- mcs->AddCall("getAddressOfPInvokeFixup");
- return original_ICorJitInfo->getAddressOfPInvokeFixup(method, ppIndirection);
+ original_ICorJitInfo->getLocationOfThisType(context, pLookupKind);
}
// return address of fixup area for late-bound PInvoke calls.
return original_ICorJitInfo->runWithErrorTrap(function, param);
}
-// return memory manager that the JIT can use to allocate a regular memory
-IEEMemoryManager* interceptor_ICJI::getMemoryManager()
-{
- mcs->AddCall("getMemoryManager");
- if (current_IEEMM->original_IEEMM == nullptr)
- current_IEEMM->original_IEEMM = original_ICorJitInfo->getMemoryManager();
-
- return current_IEEMM;
-}
-
// get a block of memory for the code, readonly data, and read-write data
void interceptor_ICJI::allocMem(ULONG hotCodeSize, /* IN */
ULONG coldCodeSize, /* IN */
return original_ICorJitInfo->allocGCInfo(size);
}
-// only used on x64
-void interceptor_ICJI::yieldExecution()
-{
- mcs->AddCall("yieldExecution");
- original_ICorJitInfo->yieldExecution();
-}
-
// Indicate how many exception handler blocks are to be returned.
// This is guaranteed to be called before any 'setEHinfo' call.
// Note that allocMem must be called before this method can be called.
return original_ICorJitInfo->getRelocTypeHint(target);
}
-// A callback to identify the range of address known to point to
-// compiler-generated native entry points that call back into
-// MSIL.
-void interceptor_ICJI::getModuleNativeEntryPointRange(void** pStart, /* OUT */
- void** pEnd /* OUT */
- )
-{
- mcs->AddCall("getModuleNativeEntryPointRange");
- original_ICorJitInfo->getModuleNativeEntryPointRange(pStart, pEnd);
-}
-
// For what machine does the VM expect the JIT to generate code? The VM
// returns one of the IMAGE_FILE_MACHINE_* values. Note that if the VM
// is cross-compiling (such as the case for crossgen), it will return a
#define _ICorJitInfo
#include "runtimedetails.h"
-#include "ieememorymanager.h"
#include "methodcallsummarizer.h"
class interceptor_ICJI : public ICorJitInfo
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#include "standardpch.h"
-#include "ieememorymanager.h"
-#include "superpmi-shim-counter.h"
-
-//***************************************************************************
-// IUnknown methods
-//***************************************************************************
-HRESULT STDMETHODCALLTYPE interceptor_IEEMM::QueryInterface(REFIID id, void** pInterface)
-{
- return original_IEEMM->QueryInterface(id, pInterface);
-}
-ULONG STDMETHODCALLTYPE interceptor_IEEMM::AddRef()
-{
- return original_IEEMM->AddRef();
-}
-ULONG STDMETHODCALLTYPE interceptor_IEEMM::Release()
-{
- return original_IEEMM->Release();
-}
-
-//***************************************************************************
-// IEEMemoryManager methods for locking
-//***************************************************************************
-LPVOID STDMETHODCALLTYPE interceptor_IEEMM::ClrVirtualAlloc(LPVOID lpAddress,
- SIZE_T dwSize,
- DWORD flAllocationType,
- DWORD flProtect)
-{
- return original_IEEMM->ClrVirtualAlloc(lpAddress, dwSize, flAllocationType, flProtect);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEEMM::ClrVirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType)
-{
- return original_IEEMM->ClrVirtualFree(lpAddress, dwSize, dwFreeType);
-}
-SIZE_T STDMETHODCALLTYPE interceptor_IEEMM::ClrVirtualQuery(LPCVOID lpAddress,
- PMEMORY_BASIC_INFORMATION lpBuffer,
- SIZE_T dwLength)
-{
- return original_IEEMM->ClrVirtualQuery(lpAddress, lpBuffer, dwLength);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEEMM::ClrVirtualProtect(LPVOID lpAddress,
- SIZE_T dwSize,
- DWORD flNewProtect,
- PDWORD lpflOldProtect)
-{
- return original_IEEMM->ClrVirtualProtect(lpAddress, dwSize, flNewProtect, lpflOldProtect);
-}
-HANDLE STDMETHODCALLTYPE interceptor_IEEMM::ClrGetProcessHeap()
-{
- return original_IEEMM->ClrGetProcessHeap();
-}
-HANDLE STDMETHODCALLTYPE interceptor_IEEMM::ClrHeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize)
-{
- return original_IEEMM->ClrHeapCreate(flOptions, dwInitialSize, dwMaximumSize);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEEMM::ClrHeapDestroy(HANDLE hHeap)
-{
- return original_IEEMM->ClrHeapDestroy(hHeap);
-}
-LPVOID STDMETHODCALLTYPE interceptor_IEEMM::ClrHeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes)
-{
- return original_IEEMM->ClrHeapAlloc(hHeap, dwFlags, dwBytes);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEEMM::ClrHeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem)
-{
- return original_IEEMM->ClrHeapFree(hHeap, dwFlags, lpMem);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEEMM::ClrHeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem)
-{
- return original_IEEMM->ClrHeapValidate(hHeap, dwFlags, lpMem);
-}
-HANDLE STDMETHODCALLTYPE interceptor_IEEMM::ClrGetProcessExecutableHeap()
-{
- return original_IEEMM->ClrGetProcessExecutableHeap();
-}
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#ifndef _IEEMemoryManager
-#define _IEEMemoryManager
-
-#include "runtimedetails.h"
-
-/*
-interface IEEMemoryManager : IUnknown
-{
- LPVOID ClrVirtualAlloc(
- [in] LPVOID lpAddress, // region to reserve or commit
- [in] SIZE_T dwSize, // size of region
- [in] DWORD flAllocationType, // type of allocation
- [in] DWORD flProtect // type of access protection
- )
-
- BOOL ClrVirtualFree(
- [in] LPVOID lpAddress, // address of region
- [in] SIZE_T dwSize, // size of region
- [in] DWORD dwFreeType // operation type
- )
-
- SIZE_T ClrVirtualQuery(
- [in] const void* lpAddress, // address of region
- [in] PMEMORY_BASIC_INFORMATION lpBuffer, // information buffer
- [in] SIZE_T dwLength // size of buffer
- )
-
- BOOL ClrVirtualProtect(
- [in] LPVOID lpAddress, // region of committed pages
- [in] SIZE_T dwSize, // size of the region
- [in] DWORD flNewProtect, // desired access protection
- [in] DWORD* lpflOldProtect // old protection
- )
-
- HANDLE ClrGetProcessHeap()
-
- HANDLE ClrHeapCreate(
- [in] DWORD flOptions, // heap allocation attributes
- [in] SIZE_T dwInitialSize, // initial heap size
- [in] SIZE_T dwMaximumSize // maximum heap size
- )
-
- BOOL ClrHeapDestroy(
- [in] HANDLE hHeap // handle to heap
- )
-
- LPVOID ClrHeapAlloc(
- [in] HANDLE hHeap, // handle to private heap block
- [in] DWORD dwFlags, // heap allocation control
- [in] SIZE_T dwBytes // number of bytes to allocate
- )
-
- BOOL ClrHeapFree(
- [in] HANDLE hHeap, // handle to heap
- [in] DWORD dwFlags, // heap free options
- [in] LPVOID lpMem // pointer to memory
- )
-
- BOOL ClrHeapValidate(
- [in] HANDLE hHeap, // handle to heap
- [in] DWORD dwFlags, // heap access options
- [in] const void* lpMem // optional pointer to memory block
- )
-
- HANDLE ClrGetProcessExecutableHeap()
-
-}; // interface IEEMemoryManager
-
-*/
-
-class interceptor_IEEMM : public IEEMemoryManager
-{
-private:
- //***************************************************************************
- // IUnknown methods
- //***************************************************************************
-
- HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, void** pInterface);
- ULONG STDMETHODCALLTYPE AddRef();
- ULONG STDMETHODCALLTYPE Release();
-
- //***************************************************************************
- // IEEMemoryManager methods for locking
- //***************************************************************************
- LPVOID STDMETHODCALLTYPE ClrVirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect);
- BOOL STDMETHODCALLTYPE ClrVirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType);
- SIZE_T STDMETHODCALLTYPE ClrVirtualQuery(LPCVOID lpAddress, PMEMORY_BASIC_INFORMATION lpBuffer, SIZE_T dwLength);
- BOOL STDMETHODCALLTYPE ClrVirtualProtect(LPVOID lpAddress,
- SIZE_T dwSize,
- DWORD flNewProtect,
- PDWORD lpflOldProtect);
- HANDLE STDMETHODCALLTYPE ClrGetProcessHeap();
- HANDLE STDMETHODCALLTYPE ClrHeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize);
- BOOL STDMETHODCALLTYPE ClrHeapDestroy(HANDLE hHeap);
- LPVOID STDMETHODCALLTYPE ClrHeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes);
- BOOL STDMETHODCALLTYPE ClrHeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem);
- BOOL STDMETHODCALLTYPE ClrHeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem);
- HANDLE STDMETHODCALLTYPE ClrGetProcessExecutableHeap();
-
-public:
- IEEMemoryManager* original_IEEMM;
-};
-
-#endif
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#include "standardpch.h"
-#include "iexecutionengine.h"
-#include "superpmi-shim-counter.h"
-
-//***************************************************************************
-// IUnknown methods
-//***************************************************************************
-HRESULT STDMETHODCALLTYPE interceptor_IEE::QueryInterface(REFIID id, void** pInterface)
-{
- return original_IEE->QueryInterface(id, pInterface);
-}
-ULONG STDMETHODCALLTYPE interceptor_IEE::AddRef()
-{
- return original_IEE->AddRef();
-}
-ULONG STDMETHODCALLTYPE interceptor_IEE::Release()
-{
- return original_IEE->Release();
-}
-
-//***************************************************************************
-// IExecutionEngine methods for TLS
-//***************************************************************************
-// Associate a callback for cleanup with a TLS slot
-VOID STDMETHODCALLTYPE interceptor_IEE::TLS_AssociateCallback(DWORD slot, PTLS_CALLBACK_FUNCTION callback)
-{
- original_IEE->TLS_AssociateCallback(slot, callback);
-}
-// Get the TLS block for fast Get/Set operations
-LPVOID* STDMETHODCALLTYPE interceptor_IEE::TLS_GetDataBlock()
-{
- return original_IEE->TLS_GetDataBlock();
-}
-// Get the value at a slot
-LPVOID STDMETHODCALLTYPE interceptor_IEE::TLS_GetValue(DWORD slot)
-{
- return original_IEE->TLS_GetValue(slot);
-}
-
-// Get the value at a slot, return FALSE if TLS info block doesn't exist
-BOOL STDMETHODCALLTYPE interceptor_IEE::TLS_CheckValue(DWORD slot, LPVOID* pValue)
-{
- return original_IEE->TLS_CheckValue(slot, pValue);
-}
-// Set the value at a slot
-VOID STDMETHODCALLTYPE interceptor_IEE::TLS_SetValue(DWORD slot, LPVOID pData)
-{
- original_IEE->TLS_SetValue(slot, pData);
-}
-// Free TLS memory block and make callback
-VOID STDMETHODCALLTYPE interceptor_IEE::TLS_ThreadDetaching()
-{
- original_IEE->TLS_ThreadDetaching();
-}
-
-//***************************************************************************
-// IExecutionEngine methods for locking
-//***************************************************************************
-CRITSEC_COOKIE STDMETHODCALLTYPE interceptor_IEE::CreateLock(LPCSTR szTag, LPCSTR level, CrstFlags flags)
-{
- return original_IEE->CreateLock(szTag, level, flags);
-}
-void STDMETHODCALLTYPE interceptor_IEE::DestroyLock(CRITSEC_COOKIE lock)
-{
- original_IEE->DestroyLock(lock);
-}
-void STDMETHODCALLTYPE interceptor_IEE::AcquireLock(CRITSEC_COOKIE lock)
-{
- original_IEE->AcquireLock(lock);
-}
-void STDMETHODCALLTYPE interceptor_IEE::ReleaseLock(CRITSEC_COOKIE lock)
-{
- original_IEE->ReleaseLock(lock);
-}
-
-EVENT_COOKIE STDMETHODCALLTYPE interceptor_IEE::CreateAutoEvent(BOOL bInitialState)
-{
- return original_IEE->CreateAutoEvent(bInitialState);
-}
-EVENT_COOKIE STDMETHODCALLTYPE interceptor_IEE::CreateManualEvent(BOOL bInitialState)
-{
- return original_IEE->CreateManualEvent(bInitialState);
-}
-void STDMETHODCALLTYPE interceptor_IEE::CloseEvent(EVENT_COOKIE event)
-{
- original_IEE->CloseEvent(event);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEE::ClrSetEvent(EVENT_COOKIE event)
-{
- return original_IEE->ClrSetEvent(event);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEE::ClrResetEvent(EVENT_COOKIE event)
-{
- return original_IEE->ClrResetEvent(event);
-}
-DWORD STDMETHODCALLTYPE interceptor_IEE::WaitForEvent(EVENT_COOKIE event, DWORD dwMilliseconds, BOOL bAlertable)
-{
- return original_IEE->WaitForEvent(event, dwMilliseconds, bAlertable);
-}
-DWORD STDMETHODCALLTYPE interceptor_IEE::WaitForSingleObject(HANDLE handle, DWORD dwMilliseconds)
-{
- return original_IEE->WaitForSingleObject(handle, dwMilliseconds);
-}
-SEMAPHORE_COOKIE STDMETHODCALLTYPE interceptor_IEE::ClrCreateSemaphore(DWORD dwInitial, DWORD dwMax)
-{
- return original_IEE->ClrCreateSemaphore(dwInitial, dwMax);
-}
-void STDMETHODCALLTYPE interceptor_IEE::ClrCloseSemaphore(SEMAPHORE_COOKIE semaphore)
-{
- original_IEE->ClrCloseSemaphore(semaphore);
-}
-DWORD STDMETHODCALLTYPE interceptor_IEE::ClrWaitForSemaphore(SEMAPHORE_COOKIE semaphore,
- DWORD dwMilliseconds,
- BOOL bAlertable)
-{
- return original_IEE->ClrWaitForSemaphore(semaphore, dwMilliseconds, bAlertable);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEE::ClrReleaseSemaphore(SEMAPHORE_COOKIE semaphore,
- LONG lReleaseCount,
- LONG* lpPreviousCount)
-{
- return original_IEE->ClrReleaseSemaphore(semaphore, lReleaseCount, lpPreviousCount);
-}
-MUTEX_COOKIE STDMETHODCALLTYPE interceptor_IEE::ClrCreateMutex(LPSECURITY_ATTRIBUTES lpMutexAttributes,
- BOOL bInitialOwner,
- LPCTSTR lpName)
-{
- return original_IEE->ClrCreateMutex(lpMutexAttributes, bInitialOwner, lpName);
-}
-void STDMETHODCALLTYPE interceptor_IEE::ClrCloseMutex(MUTEX_COOKIE mutex)
-{
- original_IEE->ClrCloseMutex(mutex);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEE::ClrReleaseMutex(MUTEX_COOKIE mutex)
-{
- return original_IEE->ClrReleaseMutex(mutex);
-}
-DWORD STDMETHODCALLTYPE interceptor_IEE::ClrWaitForMutex(MUTEX_COOKIE mutex, DWORD dwMilliseconds, BOOL bAlertable)
-{
- return original_IEE->ClrWaitForMutex(mutex, dwMilliseconds, bAlertable);
-}
-
-DWORD STDMETHODCALLTYPE interceptor_IEE::ClrSleepEx(DWORD dwMilliseconds, BOOL bAlertable)
-{
- return original_IEE->ClrSleepEx(dwMilliseconds, bAlertable);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEE::ClrAllocationDisallowed()
-{
- return original_IEE->ClrAllocationDisallowed();
-}
-void STDMETHODCALLTYPE interceptor_IEE::GetLastThrownObjectExceptionFromThread(void** ppvException)
-{
- original_IEE->GetLastThrownObjectExceptionFromThread(ppvException);
-}
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#ifndef _IExecutionEngine
-#define _IExecutionEngine
-
-#include "ieememorymanager.h"
-
-/*
-interface IExecutionEngine : IUnknown
-{
- // Thread Local Storage is based on logical threads. The underlying
- // implementation could be threads, fibers, or something more exotic.
- // Slot numbers are predefined. This is not a general extensibility
- // mechanism.
-
- // Associate a callback function for releasing TLS on thread/fiber death.
- // This can be NULL.
- void TLS_AssociateCallback([in] DWORD slot, [in] PTLS_CALLBACK_FUNCTION callback)
-
- // May be called once to get the master TLS block slot for fast Get/Set operations
- DWORD TLS_GetMasterSlotIndex()
-
- // Get the value at a slot
- PVOID TLS_GetValue([in] DWORD slot)
-
- // Get the value at a slot, return FALSE if TLS info block doesn't exist
- BOOL TLS_CheckValue([in] DWORD slot, [out] PVOID * pValue)
-
- // Set the value at a slot
- void TLS_SetValue([in] DWORD slot, [in] PVOID pData)
-
- // Free TLS memory block and make callback
- void TLS_ThreadDetaching()
-
- // Critical Sections are sometimes exposed to the host and therefore need to be
- // reflected from all CLR DLLs to the EE.
- //
- // In addition, we always monitor interactions between the lock & the GC, based
- // on the GC mode in which the lock is acquired and we restrict what operations
- // are permitted while holding the lock based on this.
- //
- // Finally, we we rank all our locks to prevent deadlock across all the DLLs of
- // the CLR. This is the level argument to CreateLock.
- //
- // All usage of these locks must be exception-safe. To achieve this, we suggest
- // using Holders (see holder.h & crst.h). In fact, within the EE code cannot
- // hold locks except by using exception-safe holders.
-
- CRITSEC_COOKIE CreateLock([in] LPCSTR szTag, [in] LPCSTR level, [in] CrstFlags flags)
-
- void DestroyLock([in] CRITSEC_COOKIE lock)
-
- void AcquireLock([in] CRITSEC_COOKIE lock)
-
- void ReleaseLock([in] CRITSEC_COOKIE lock)
-
- EVENT_COOKIE CreateAutoEvent([in] BOOL bInitialState)
- EVENT_COOKIE CreateManualEvent([in] BOOL bInitialState)
- void CloseEvent([in] EVENT_COOKIE event)
- BOOL ClrSetEvent([in] EVENT_COOKIE event)
- BOOL ClrResetEvent([in] EVENT_COOKIE event)
- DWORD WaitForEvent([in] EVENT_COOKIE event, [in] DWORD dwMilliseconds, [in] BOOL bAlertable)
- DWORD WaitForSingleObject([in] HANDLE handle, [in] DWORD dwMilliseconds)
-
- // OS header file defines CreateSemaphore.
- SEMAPHORE_COOKIE ClrCreateSemaphore([in] DWORD dwInitial, [in] DWORD dwMax)
- void ClrCloseSemaphore([in] SEMAPHORE_COOKIE semaphore)
- DWORD ClrWaitForSemaphore([in] SEMAPHORE_COOKIE semaphore, [in] DWORD dwMilliseconds, [in] BOOL bAlertable)
- BOOL ClrReleaseSemaphore([in] SEMAPHORE_COOKIE semaphore, [in] LONG lReleaseCount, [in] LONG *lpPreviousCount)
-
- MUTEX_COOKIE ClrCreateMutex([in]LPSECURITY_ATTRIBUTES lpMutexAttributes, [in]BOOL bInitialOwner, [in]LPCTSTR lpName)
- DWORD ClrWaitForMutex([in] MUTEX_COOKIE mutex, [in] DWORD dwMilliseconds, [in] BOOL bAlertable)
- BOOL ClrReleaseMutex([in] MUTEX_COOKIE mutex)
- void ClrCloseMutex([in] MUTEX_COOKIE mutex)
-
- DWORD ClrSleepEx([in] DWORD dwMilliseconds, [in] BOOL bAlertable)
-
- BOOL ClrAllocationDisallowed()
-
- void GetLastThrownObjectExceptionFromThread([out] void **ppvException)
-
-}; // interface IExecutionEngine
-*/
-
-class interceptor_IEE : public IExecutionEngine
-{
-private:
- //***************************************************************************
- // IUnknown methods
- //***************************************************************************
- HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, void** pInterface);
- ULONG STDMETHODCALLTYPE AddRef();
- ULONG STDMETHODCALLTYPE Release();
-
- //***************************************************************************
- // IExecutionEngine methods for TLS
- //***************************************************************************
- // Associate a callback for cleanup with a TLS slot
- VOID STDMETHODCALLTYPE TLS_AssociateCallback(DWORD slot, PTLS_CALLBACK_FUNCTION callback);
- // Get the TLS block for fast Get/Set operations
- LPVOID* STDMETHODCALLTYPE TLS_GetDataBlock();
- // Get the value at a slot
- LPVOID STDMETHODCALLTYPE TLS_GetValue(DWORD slot);
- // Get the value at a slot, return FALSE if TLS info block doesn't exist
- BOOL STDMETHODCALLTYPE TLS_CheckValue(DWORD slot, LPVOID* pValue);
- // Set the value at a slot
- VOID STDMETHODCALLTYPE TLS_SetValue(DWORD slot, LPVOID pData);
- // Free TLS memory block and make callback
- VOID STDMETHODCALLTYPE TLS_ThreadDetaching();
-
- //***************************************************************************
- // IExecutionEngine methods for locking
- //***************************************************************************
- CRITSEC_COOKIE STDMETHODCALLTYPE CreateLock(LPCSTR szTag, LPCSTR level, CrstFlags flags);
- void STDMETHODCALLTYPE DestroyLock(CRITSEC_COOKIE lock);
- void STDMETHODCALLTYPE AcquireLock(CRITSEC_COOKIE lock);
- void STDMETHODCALLTYPE ReleaseLock(CRITSEC_COOKIE lock);
- EVENT_COOKIE STDMETHODCALLTYPE CreateAutoEvent(BOOL bInitialState);
- EVENT_COOKIE STDMETHODCALLTYPE CreateManualEvent(BOOL bInitialState);
- void STDMETHODCALLTYPE CloseEvent(EVENT_COOKIE event);
- BOOL STDMETHODCALLTYPE ClrSetEvent(EVENT_COOKIE event);
- BOOL STDMETHODCALLTYPE ClrResetEvent(EVENT_COOKIE event);
- DWORD STDMETHODCALLTYPE WaitForEvent(EVENT_COOKIE event, DWORD dwMilliseconds, BOOL bAlertable);
- DWORD STDMETHODCALLTYPE WaitForSingleObject(HANDLE handle, DWORD dwMilliseconds);
- SEMAPHORE_COOKIE STDMETHODCALLTYPE ClrCreateSemaphore(DWORD dwInitial, DWORD dwMax);
- void STDMETHODCALLTYPE ClrCloseSemaphore(SEMAPHORE_COOKIE semaphore);
- DWORD STDMETHODCALLTYPE ClrWaitForSemaphore(SEMAPHORE_COOKIE semaphore, DWORD dwMilliseconds, BOOL bAlertable);
- BOOL STDMETHODCALLTYPE ClrReleaseSemaphore(SEMAPHORE_COOKIE semaphore, LONG lReleaseCount, LONG* lpPreviousCount);
- MUTEX_COOKIE STDMETHODCALLTYPE ClrCreateMutex(LPSECURITY_ATTRIBUTES lpMutexAttributes,
- BOOL bInitialOwner,
- LPCTSTR lpName);
- void STDMETHODCALLTYPE ClrCloseMutex(MUTEX_COOKIE mutex);
- BOOL STDMETHODCALLTYPE ClrReleaseMutex(MUTEX_COOKIE mutex);
- DWORD STDMETHODCALLTYPE ClrWaitForMutex(MUTEX_COOKIE mutex, DWORD dwMilliseconds, BOOL bAlertable);
- DWORD STDMETHODCALLTYPE ClrSleepEx(DWORD dwMilliseconds, BOOL bAlertable);
- BOOL STDMETHODCALLTYPE ClrAllocationDisallowed();
- void STDMETHODCALLTYPE GetLastThrownObjectExceptionFromThread(void** ppvException);
-
-public:
- IExecutionEngine* original_IEE;
-};
-
-#endif
\ No newline at end of file
#include "standardpch.h"
#include "superpmi-shim-counter.h"
#include "runtimedetails.h"
-#include "coreclrcallbacks.h"
#include "icorjitcompiler.h"
#include "errorhandling.h"
#include "logging.h"
pJitInstance->mcs = g_globalContext;
return pJitInstance;
}
-
-extern "C" DLLEXPORT void __stdcall sxsJitStartup(CoreClrCallbacks const& original_cccallbacks)
-{
- PsxsJitStartup pnsxsJitStartup;
-
- SetDefaultPaths();
- SetLibName();
-
- if (!LoadRealJitLib(g_hRealJit, g_realJitPath))
- {
- return;
- }
-
- // get entry point
- pnsxsJitStartup = (PsxsJitStartup)::GetProcAddress(g_hRealJit, "sxsJitStartup");
-
- if (pnsxsJitStartup != nullptr)
- {
- // Setup CoreClrCallbacks and call sxsJitStartup
- original_CoreClrCallbacks = new CoreClrCallbacks();
- original_CoreClrCallbacks->m_hmodCoreCLR = original_cccallbacks.m_hmodCoreCLR;
- original_CoreClrCallbacks->m_pfnIEE = original_cccallbacks.m_pfnIEE;
- original_CoreClrCallbacks->m_pfnGetCORSystemDirectory = original_cccallbacks.m_pfnGetCORSystemDirectory;
-
- CoreClrCallbacks* temp = new CoreClrCallbacks();
-
- temp->m_hmodCoreCLR = original_cccallbacks.m_hmodCoreCLR;
- temp->m_pfnIEE = IEE_t;
- temp->m_pfnGetCORSystemDirectory = original_cccallbacks.m_pfnGetCORSystemDirectory;
-
- pnsxsJitStartup(*temp);
- }
-}
EXPORTS
getJit
jitStartup
- sxsJitStartup
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
include_directories(../superpmi-shared)
set(SUPERPMI_SHIM_SIMPLE_SOURCES
- coreclrcallbacks.cpp
jithost.cpp
icorjitcompiler.cpp
icorjitinfo.cpp
- ieememorymanager.cpp
- iexecutionengine.cpp
superpmi-shim-simple.cpp
../superpmi-shared/callutils.cpp
../superpmi-shared/compileresult.cpp
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#include "standardpch.h"
-#include "coreclrcallbacks.h"
-#include "iexecutionengine.h"
-
-CoreClrCallbacks* original_CoreClrCallbacks = nullptr;
-
-IExecutionEngine* STDMETHODCALLTYPE IEE_t()
-{
- interceptor_IEE* iee = new interceptor_IEE();
- iee->original_IEE = original_CoreClrCallbacks->m_pfnIEE();
- return iee;
-}
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#ifndef _CoreClrCallbacks
-#define _CoreClrCallbacks
-
-#include "coreclrcommoncallbacks.h"
-
-// Added to allow us to persist a copy of the original callbacks
-extern CoreClrCallbacks* original_CoreClrCallbacks;
-
-#endif
#include "icorjitcompiler.h"
#include "icorjitinfo.h"
-interceptor_IEEMM* current_IEEMM = nullptr; // we want this to live beyond the scope of a single compileMethodCall
-
CorJitResult __stdcall interceptor_ICJC::compileMethod(ICorJitInfo* comp, /* IN */
struct CORINFO_METHOD_INFO* info, /* IN */
unsigned /* code:CorJitFlag */ flags, /* IN */
interceptor_ICJI our_ICorJitInfo;
our_ICorJitInfo.original_ICorJitInfo = comp;
- if (current_IEEMM == nullptr)
- current_IEEMM = new interceptor_IEEMM();
-
CorJitResult temp =
original_ICorJitCompiler->compileMethod(&our_ICorJitInfo, info, flags, nativeEntry, nativeSizeOfCode);
return temp;
}
-void interceptor_ICJC::clearCache()
-{
- original_ICorJitCompiler->clearCache();
-}
-
-BOOL interceptor_ICJC::isCacheCleanupRequired()
-{
- return original_ICorJitCompiler->isCacheCleanupRequired();
-}
-
void interceptor_ICJC::ProcessShutdownWork(ICorStaticInfo* info)
{
original_ICorJitCompiler->ProcessShutdownWork(info);
{
return original_ICorJitCompiler->getMaxIntrinsicSIMDVectorLength(cpuCompileFlags);
}
-
-void interceptor_ICJC::setRealJit(ICorJitCompiler* realJitCompiler)
-{
- original_ICorJitCompiler->setRealJit(realJitCompiler);
-}
#define _ICorJitCompiler
#include "runtimedetails.h"
-#include "ieememorymanager.h"
class interceptor_ICJC : public ICorJitCompiler
{
ICorJitCompiler* original_ICorJitCompiler;
};
-extern interceptor_IEEMM* current_IEEMM; // we want a pointer to the memory manager to live beyond the scope of a single
- // compileMethodCall (jit32 expects this)
-
#endif
#include "standardpch.h"
#include "icorjitinfo.h"
#include "superpmi-shim-simple.h"
-#include "ieememorymanager.h"
#include "icorjitcompiler.h"
#include "spmiutil.h"
return original_ICorJitInfo->isCompatibleDelegate(objCls, methodParentCls, method, delegateCls, pfIsOpenDelegate);
}
-// Indicates if the method is an instance of the generic
-// method that passes (or has passed) verification
-CorInfoInstantiationVerification interceptor_ICJI::isInstantiationOfVerifiedGeneric(CORINFO_METHOD_HANDLE method /* IN
- */
- )
-{
- return original_ICorJitInfo->isInstantiationOfVerifiedGeneric(method);
-}
-
-// Loads the constraints on a typical method definition, detecting cycles;
-// for use in verification.
-void interceptor_ICJI::initConstraintsForVerification(CORINFO_METHOD_HANDLE method, /* IN */
- BOOL* pfHasCircularClassConstraints, /* OUT */
- BOOL* pfHasCircularMethodConstraint /* OUT */
- )
-{
- original_ICorJitInfo->initConstraintsForVerification(method, pfHasCircularClassConstraints,
- pfHasCircularMethodConstraint);
-}
-
-CorInfoCanSkipVerificationResult interceptor_ICJI::canSkipMethodVerification(CORINFO_METHOD_HANDLE ftnHandle)
-{
- return original_ICorJitInfo->canSkipMethodVerification(ftnHandle);
-}
-
// load and restore the method
void interceptor_ICJI::methodMustBeLoadedBeforeCodeIsRun(CORINFO_METHOD_HANDLE method)
{
return original_ICorJitInfo->getTokenTypeAsHandle(pResolvedToken);
}
-// Returns true if the module does not require verification
-//
-// If fQuickCheckOnlyWithoutCommit=TRUE, the function only checks that the
-// module does not currently require verification in the current AppDomain.
-// This decision could change in the future, and so should not be cached.
-// If it is cached, it should only be used as a hint.
-// This is only used by ngen for calculating certain hints.
-//
-
-// Returns enum whether the module does not require verification
-// Also see ICorMethodInfo::canSkipMethodVerification();
-CorInfoCanSkipVerificationResult interceptor_ICJI::canSkipVerification(CORINFO_MODULE_HANDLE module /* IN */
- )
-{
- return original_ICorJitInfo->canSkipVerification(module);
-}
-
// Checks if the given metadata token is valid
BOOL interceptor_ICJI::isValidToken(CORINFO_MODULE_HANDLE module, /* IN */
unsigned metaTOK /* IN */
return original_ICorJitInfo->getStringLiteral(module, metaTOK, length);
}
-BOOL interceptor_ICJI::shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope)
-{
- return original_ICorJitInfo->shouldEnforceCallvirtRestriction(scope);
-}
-
/**********************************************************************************/
//
// ICorClassInfo
return original_ICorJitInfo->canInlineTypeCheck(cls, source);
}
-// If this method returns true, JIT will do optimization to inline the check for
-// GetTypeFromHandle(handle) == obj.GetType()
-BOOL interceptor_ICJI::canInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE cls)
-{
- return original_ICorJitInfo->canInlineTypeCheckWithObjectVTable(cls);
-}
-
// return flags (defined above, CORINFO_FLG_PUBLIC ...)
DWORD interceptor_ICJI::getClassAttribs(CORINFO_CLASS_HANDLE cls)
{
return original_ICorJitInfo->getSharedCCtorHelper(clsHnd);
}
-CorInfoHelpFunc interceptor_ICJI::getSecurityPrologHelper(CORINFO_METHOD_HANDLE ftn)
-{
- return original_ICorJitInfo->getSecurityPrologHelper(ftn);
-}
-
// This is not pretty. Boxing nullable<T> actually returns
// a boxed<T> not a boxed Nullable<T>. This call allows the verifier
// to call back to the EE on the 'box' instruction and get the transformed
return original_ICorJitInfo->getFieldOffset(field);
}
-// TODO: jit64 should be switched to the same plan as the i386 jits - use
-// getClassGClayout to figure out the need for writebarrier helper, and inline the copying.
-// The interpretted value class copy is slow. Once this happens, USE_WRITE_BARRIER_HELPERS
-bool interceptor_ICJI::isWriteBarrierHelperRequired(CORINFO_FIELD_HANDLE field)
-{
- return original_ICorJitInfo->isWriteBarrierHelperRequired(field);
-}
-
void interceptor_ICJI::getFieldInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken,
CORINFO_METHOD_HANDLE callerHandle,
CORINFO_ACCESS_FLAGS flags,
// Used to allocate memory that needs to handed to the EE.
// For eg, use this to allocated memory for reporting debug info,
// which will be handed to the EE by setVars() and setBoundaries()
-void* interceptor_ICJI::allocateArray(ULONG cBytes)
+void* interceptor_ICJI::allocateArray(size_t cBytes)
{
return original_ICorJitInfo->allocateArray(cBytes);
}
// CORINFO_LOOKUP_THISOBJ use vtable pointer of 'this' param
// CORINFO_LOOKUP_CLASSPARAM use vtable hidden param
// CORINFO_LOOKUP_METHODPARAM use enclosing type of method-desc hidden param
-CORINFO_LOOKUP_KIND interceptor_ICJI::getLocationOfThisType(CORINFO_METHOD_HANDLE context)
-{
- return original_ICorJitInfo->getLocationOfThisType(context);
-}
-
-// return the unmanaged target *if method has already been prelinked.*
-void* interceptor_ICJI::getPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void** ppIndirection)
-{
- return original_ICorJitInfo->getPInvokeUnmanagedTarget(method, ppIndirection);
-}
-
-// return address of fixup area for late-bound PInvoke calls.
-void* interceptor_ICJI::getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void** ppIndirection)
+void interceptor_ICJI::getLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND* pLookupKind)
{
- return original_ICorJitInfo->getAddressOfPInvokeFixup(method, ppIndirection);
+ original_ICorJitInfo->getLocationOfThisType(context, pLookupKind);
}
// return address of fixup area for late-bound PInvoke calls.
return original_ICorJitInfo->runWithErrorTrap(function, param);
}
-// return memory manager that the JIT can use to allocate a regular memory
-IEEMemoryManager* interceptor_ICJI::getMemoryManager()
-{
- if (current_IEEMM->original_IEEMM == nullptr)
- current_IEEMM->original_IEEMM = original_ICorJitInfo->getMemoryManager();
-
- return current_IEEMM;
-}
-
// get a block of memory for the code, readonly data, and read-write data
void interceptor_ICJI::allocMem(ULONG hotCodeSize, /* IN */
ULONG coldCodeSize, /* IN */
return original_ICorJitInfo->allocGCInfo(size);
}
-// only used on x64
-void interceptor_ICJI::yieldExecution()
-{
- original_ICorJitInfo->yieldExecution();
-}
-
// Indicate how many exception handler blocks are to be returned.
// This is guaranteed to be called before any 'setEHinfo' call.
// Note that allocMem must be called before this method can be called.
return original_ICorJitInfo->getRelocTypeHint(target);
}
-// A callback to identify the range of address known to point to
-// compiler-generated native entry points that call back into
-// MSIL.
-void interceptor_ICJI::getModuleNativeEntryPointRange(void** pStart, /* OUT */
- void** pEnd /* OUT */
- )
-{
- original_ICorJitInfo->getModuleNativeEntryPointRange(pStart, pEnd);
-}
-
// For what machine does the VM expect the JIT to generate code? The VM
// returns one of the IMAGE_FILE_MACHINE_* values. Note that if the VM
// is cross-compiling (such as the case for crossgen), it will return a
#define _ICorJitInfo
#include "runtimedetails.h"
-#include "ieememorymanager.h"
class interceptor_ICJI : public ICorJitInfo
{
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#include "standardpch.h"
-#include "ieememorymanager.h"
-#include "superpmi-shim-simple.h"
-
-//***************************************************************************
-// IUnknown methods
-//***************************************************************************
-HRESULT STDMETHODCALLTYPE interceptor_IEEMM::QueryInterface(REFIID id, void** pInterface)
-{
- return original_IEEMM->QueryInterface(id, pInterface);
-}
-ULONG STDMETHODCALLTYPE interceptor_IEEMM::AddRef()
-{
- return original_IEEMM->AddRef();
-}
-ULONG STDMETHODCALLTYPE interceptor_IEEMM::Release()
-{
- return original_IEEMM->Release();
-}
-
-//***************************************************************************
-// IEEMemoryManager methods for locking
-//***************************************************************************
-LPVOID STDMETHODCALLTYPE interceptor_IEEMM::ClrVirtualAlloc(LPVOID lpAddress,
- SIZE_T dwSize,
- DWORD flAllocationType,
- DWORD flProtect)
-{
- return original_IEEMM->ClrVirtualAlloc(lpAddress, dwSize, flAllocationType, flProtect);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEEMM::ClrVirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType)
-{
- return original_IEEMM->ClrVirtualFree(lpAddress, dwSize, dwFreeType);
-}
-SIZE_T STDMETHODCALLTYPE interceptor_IEEMM::ClrVirtualQuery(LPCVOID lpAddress,
- PMEMORY_BASIC_INFORMATION lpBuffer,
- SIZE_T dwLength)
-{
- return original_IEEMM->ClrVirtualQuery(lpAddress, lpBuffer, dwLength);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEEMM::ClrVirtualProtect(LPVOID lpAddress,
- SIZE_T dwSize,
- DWORD flNewProtect,
- PDWORD lpflOldProtect)
-{
- return original_IEEMM->ClrVirtualProtect(lpAddress, dwSize, flNewProtect, lpflOldProtect);
-}
-HANDLE STDMETHODCALLTYPE interceptor_IEEMM::ClrGetProcessHeap()
-{
- return original_IEEMM->ClrGetProcessHeap();
-}
-HANDLE STDMETHODCALLTYPE interceptor_IEEMM::ClrHeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize)
-{
- return original_IEEMM->ClrHeapCreate(flOptions, dwInitialSize, dwMaximumSize);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEEMM::ClrHeapDestroy(HANDLE hHeap)
-{
- return original_IEEMM->ClrHeapDestroy(hHeap);
-}
-LPVOID STDMETHODCALLTYPE interceptor_IEEMM::ClrHeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes)
-{
- return original_IEEMM->ClrHeapAlloc(hHeap, dwFlags, dwBytes);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEEMM::ClrHeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem)
-{
- return original_IEEMM->ClrHeapFree(hHeap, dwFlags, lpMem);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEEMM::ClrHeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem)
-{
- return original_IEEMM->ClrHeapValidate(hHeap, dwFlags, lpMem);
-}
-HANDLE STDMETHODCALLTYPE interceptor_IEEMM::ClrGetProcessExecutableHeap()
-{
- return original_IEEMM->ClrGetProcessExecutableHeap();
-}
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#ifndef _IEEMemoryManager
-#define _IEEMemoryManager
-
-#include "runtimedetails.h"
-
-/*
-interface IEEMemoryManager : IUnknown
-{
- LPVOID ClrVirtualAlloc(
- [in] LPVOID lpAddress, // region to reserve or commit
- [in] SIZE_T dwSize, // size of region
- [in] DWORD flAllocationType, // type of allocation
- [in] DWORD flProtect // type of access protection
- )
-
- BOOL ClrVirtualFree(
- [in] LPVOID lpAddress, // address of region
- [in] SIZE_T dwSize, // size of region
- [in] DWORD dwFreeType // operation type
- )
-
- SIZE_T ClrVirtualQuery(
- [in] const void* lpAddress, // address of region
- [in] PMEMORY_BASIC_INFORMATION lpBuffer, // information buffer
- [in] SIZE_T dwLength // size of buffer
- )
-
- BOOL ClrVirtualProtect(
- [in] LPVOID lpAddress, // region of committed pages
- [in] SIZE_T dwSize, // size of the region
- [in] DWORD flNewProtect, // desired access protection
- [in] DWORD* lpflOldProtect // old protection
- )
-
- HANDLE ClrGetProcessHeap()
-
- HANDLE ClrHeapCreate(
- [in] DWORD flOptions, // heap allocation attributes
- [in] SIZE_T dwInitialSize, // initial heap size
- [in] SIZE_T dwMaximumSize // maximum heap size
- )
-
- BOOL ClrHeapDestroy(
- [in] HANDLE hHeap // handle to heap
- )
-
- LPVOID ClrHeapAlloc(
- [in] HANDLE hHeap, // handle to private heap block
- [in] DWORD dwFlags, // heap allocation control
- [in] SIZE_T dwBytes // number of bytes to allocate
- )
-
- BOOL ClrHeapFree(
- [in] HANDLE hHeap, // handle to heap
- [in] DWORD dwFlags, // heap free options
- [in] LPVOID lpMem // pointer to memory
- )
-
- BOOL ClrHeapValidate(
- [in] HANDLE hHeap, // handle to heap
- [in] DWORD dwFlags, // heap access options
- [in] const void* lpMem // optional pointer to memory block
- )
-
- HANDLE ClrGetProcessExecutableHeap()
-
-}; // interface IEEMemoryManager
-
-*/
-
-class interceptor_IEEMM : public IEEMemoryManager
-{
-private:
- //***************************************************************************
- // IUnknown methods
- //***************************************************************************
-
- HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, void** pInterface);
- ULONG STDMETHODCALLTYPE AddRef();
- ULONG STDMETHODCALLTYPE Release();
-
- //***************************************************************************
- // IEEMemoryManager methods for locking
- //***************************************************************************
- LPVOID STDMETHODCALLTYPE ClrVirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect);
- BOOL STDMETHODCALLTYPE ClrVirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType);
- SIZE_T STDMETHODCALLTYPE ClrVirtualQuery(LPCVOID lpAddress, PMEMORY_BASIC_INFORMATION lpBuffer, SIZE_T dwLength);
- BOOL STDMETHODCALLTYPE ClrVirtualProtect(LPVOID lpAddress,
- SIZE_T dwSize,
- DWORD flNewProtect,
- PDWORD lpflOldProtect);
- HANDLE STDMETHODCALLTYPE ClrGetProcessHeap();
- HANDLE STDMETHODCALLTYPE ClrHeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize);
- BOOL STDMETHODCALLTYPE ClrHeapDestroy(HANDLE hHeap);
- LPVOID STDMETHODCALLTYPE ClrHeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes);
- BOOL STDMETHODCALLTYPE ClrHeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem);
- BOOL STDMETHODCALLTYPE ClrHeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem);
- HANDLE STDMETHODCALLTYPE ClrGetProcessExecutableHeap();
-
-public:
- // Added so we know where to make the real calls to.
- IEEMemoryManager* original_IEEMM;
-};
-
-#endif
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#include "standardpch.h"
-#include "iexecutionengine.h"
-#include "superpmi-shim-simple.h"
-
-//***************************************************************************
-// IUnknown methods
-//***************************************************************************
-HRESULT STDMETHODCALLTYPE interceptor_IEE::QueryInterface(REFIID id, void** pInterface)
-{
- return original_IEE->QueryInterface(id, pInterface);
-}
-ULONG STDMETHODCALLTYPE interceptor_IEE::AddRef()
-{
- return original_IEE->AddRef();
-}
-ULONG STDMETHODCALLTYPE interceptor_IEE::Release()
-{
- return original_IEE->Release();
-}
-
-//***************************************************************************
-// IExecutionEngine methods for TLS
-//***************************************************************************
-// Associate a callback for cleanup with a TLS slot
-VOID STDMETHODCALLTYPE interceptor_IEE::TLS_AssociateCallback(DWORD slot, PTLS_CALLBACK_FUNCTION callback)
-{
- original_IEE->TLS_AssociateCallback(slot, callback);
-}
-// Get the TLS block for fast Get/Set operations
-LPVOID* STDMETHODCALLTYPE interceptor_IEE::TLS_GetDataBlock()
-{
- return original_IEE->TLS_GetDataBlock();
-}
-
-// Get the value at a slot
-LPVOID STDMETHODCALLTYPE interceptor_IEE::TLS_GetValue(DWORD slot)
-{
- return original_IEE->TLS_GetValue(slot);
-}
-
-// Get the value at a slot, return FALSE if TLS info block doesn't exist
-BOOL STDMETHODCALLTYPE interceptor_IEE::TLS_CheckValue(DWORD slot, LPVOID* pValue)
-{
- return original_IEE->TLS_CheckValue(slot, pValue);
-}
-// Set the value at a slot
-VOID STDMETHODCALLTYPE interceptor_IEE::TLS_SetValue(DWORD slot, LPVOID pData)
-{
- original_IEE->TLS_SetValue(slot, pData);
-}
-// Free TLS memory block and make callback
-VOID STDMETHODCALLTYPE interceptor_IEE::TLS_ThreadDetaching()
-{
- original_IEE->TLS_ThreadDetaching();
-}
-
-//***************************************************************************
-// IExecutionEngine methods for locking
-//***************************************************************************
-CRITSEC_COOKIE STDMETHODCALLTYPE interceptor_IEE::CreateLock(LPCSTR szTag, LPCSTR level, CrstFlags flags)
-{
- return original_IEE->CreateLock(szTag, level, flags);
-}
-void STDMETHODCALLTYPE interceptor_IEE::DestroyLock(CRITSEC_COOKIE lock)
-{
- original_IEE->DestroyLock(lock);
-}
-void STDMETHODCALLTYPE interceptor_IEE::AcquireLock(CRITSEC_COOKIE lock)
-{
- original_IEE->AcquireLock(lock);
-}
-void STDMETHODCALLTYPE interceptor_IEE::ReleaseLock(CRITSEC_COOKIE lock)
-{
- original_IEE->ReleaseLock(lock);
-}
-
-EVENT_COOKIE STDMETHODCALLTYPE interceptor_IEE::CreateAutoEvent(BOOL bInitialState)
-{
- return original_IEE->CreateAutoEvent(bInitialState);
-}
-EVENT_COOKIE STDMETHODCALLTYPE interceptor_IEE::CreateManualEvent(BOOL bInitialState)
-{
- return original_IEE->CreateManualEvent(bInitialState);
-}
-void STDMETHODCALLTYPE interceptor_IEE::CloseEvent(EVENT_COOKIE event)
-{
- original_IEE->CloseEvent(event);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEE::ClrSetEvent(EVENT_COOKIE event)
-{
- return original_IEE->ClrSetEvent(event);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEE::ClrResetEvent(EVENT_COOKIE event)
-{
- return original_IEE->ClrResetEvent(event);
-}
-DWORD STDMETHODCALLTYPE interceptor_IEE::WaitForEvent(EVENT_COOKIE event, DWORD dwMilliseconds, BOOL bAlertable)
-{
- return original_IEE->WaitForEvent(event, dwMilliseconds, bAlertable);
-}
-DWORD STDMETHODCALLTYPE interceptor_IEE::WaitForSingleObject(HANDLE handle, DWORD dwMilliseconds)
-{
- return original_IEE->WaitForSingleObject(handle, dwMilliseconds);
-}
-SEMAPHORE_COOKIE STDMETHODCALLTYPE interceptor_IEE::ClrCreateSemaphore(DWORD dwInitial, DWORD dwMax)
-{
- return original_IEE->ClrCreateSemaphore(dwInitial, dwMax);
-}
-void STDMETHODCALLTYPE interceptor_IEE::ClrCloseSemaphore(SEMAPHORE_COOKIE semaphore)
-{
- original_IEE->ClrCloseSemaphore(semaphore);
-}
-DWORD STDMETHODCALLTYPE interceptor_IEE::ClrWaitForSemaphore(SEMAPHORE_COOKIE semaphore,
- DWORD dwMilliseconds,
- BOOL bAlertable)
-{
- return original_IEE->ClrWaitForSemaphore(semaphore, dwMilliseconds, bAlertable);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEE::ClrReleaseSemaphore(SEMAPHORE_COOKIE semaphore,
- LONG lReleaseCount,
- LONG* lpPreviousCount)
-{
- return original_IEE->ClrReleaseSemaphore(semaphore, lReleaseCount, lpPreviousCount);
-}
-MUTEX_COOKIE STDMETHODCALLTYPE interceptor_IEE::ClrCreateMutex(LPSECURITY_ATTRIBUTES lpMutexAttributes,
- BOOL bInitialOwner,
- LPCTSTR lpName)
-{
- return original_IEE->ClrCreateMutex(lpMutexAttributes, bInitialOwner, lpName);
-}
-void STDMETHODCALLTYPE interceptor_IEE::ClrCloseMutex(MUTEX_COOKIE mutex)
-{
- original_IEE->ClrCloseMutex(mutex);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEE::ClrReleaseMutex(MUTEX_COOKIE mutex)
-{
- return original_IEE->ClrReleaseMutex(mutex);
-}
-DWORD STDMETHODCALLTYPE interceptor_IEE::ClrWaitForMutex(MUTEX_COOKIE mutex, DWORD dwMilliseconds, BOOL bAlertable)
-{
- return original_IEE->ClrWaitForMutex(mutex, dwMilliseconds, bAlertable);
-}
-
-DWORD STDMETHODCALLTYPE interceptor_IEE::ClrSleepEx(DWORD dwMilliseconds, BOOL bAlertable)
-{
- return original_IEE->ClrSleepEx(dwMilliseconds, bAlertable);
-}
-BOOL STDMETHODCALLTYPE interceptor_IEE::ClrAllocationDisallowed()
-{
- return original_IEE->ClrAllocationDisallowed();
-}
-void STDMETHODCALLTYPE interceptor_IEE::GetLastThrownObjectExceptionFromThread(void** ppvException)
-{
- original_IEE->GetLastThrownObjectExceptionFromThread(ppvException);
-}
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#ifndef _IExecutionEngine
-#define _IExecutionEngine
-
-#include "ieememorymanager.h"
-
-/*
-interface IExecutionEngine : IUnknown
-{
- // Thread Local Storage is based on logical threads. The underlying
- // implementation could be threads, fibers, or something more exotic.
- // Slot numbers are predefined. This is not a general extensibility
- // mechanism.
-
- // Associate a callback function for releasing TLS on thread/fiber death.
- // This can be NULL.
- void TLS_AssociateCallback([in] DWORD slot, [in] PTLS_CALLBACK_FUNCTION callback)
-
- // May be called once to get the master TLS block slot for fast Get/Set operations
- DWORD TLS_GetMasterSlotIndex()
-
- // Get the value at a slot
- PVOID TLS_GetValue([in] DWORD slot)
-
- // Get the value at a slot, return FALSE if TLS info block doesn't exist
- BOOL TLS_CheckValue([in] DWORD slot, [out] PVOID * pValue)
-
- // Set the value at a slot
- void TLS_SetValue([in] DWORD slot, [in] PVOID pData)
-
- // Free TLS memory block and make callback
- void TLS_ThreadDetaching()
-
- // Critical Sections are sometimes exposed to the host and therefore need to be
- // reflected from all CLR DLLs to the EE.
- //
- // In addition, we always monitor interactions between the lock & the GC, based
- // on the GC mode in which the lock is acquired and we restrict what operations
- // are permitted while holding the lock based on this.
- //
- // Finally, we we rank all our locks to prevent deadlock across all the DLLs of
- // the CLR. This is the level argument to CreateLock.
- //
- // All usage of these locks must be exception-safe. To achieve this, we suggest
- // using Holders (see holder.h & crst.h). In fact, within the EE code cannot
- // hold locks except by using exception-safe holders.
-
- CRITSEC_COOKIE CreateLock([in] LPCSTR szTag, [in] LPCSTR level, [in] CrstFlags flags)
-
- void DestroyLock([in] CRITSEC_COOKIE lock)
-
- void AcquireLock([in] CRITSEC_COOKIE lock)
-
- void ReleaseLock([in] CRITSEC_COOKIE lock)
-
- EVENT_COOKIE CreateAutoEvent([in] BOOL bInitialState)
- EVENT_COOKIE CreateManualEvent([in] BOOL bInitialState)
- void CloseEvent([in] EVENT_COOKIE event)
- BOOL ClrSetEvent([in] EVENT_COOKIE event)
- BOOL ClrResetEvent([in] EVENT_COOKIE event)
- DWORD WaitForEvent([in] EVENT_COOKIE event, [in] DWORD dwMilliseconds, [in] BOOL bAlertable)
- DWORD WaitForSingleObject([in] HANDLE handle, [in] DWORD dwMilliseconds)
-
- // OS header file defines CreateSemaphore.
- SEMAPHORE_COOKIE ClrCreateSemaphore([in] DWORD dwInitial, [in] DWORD dwMax)
- void ClrCloseSemaphore([in] SEMAPHORE_COOKIE semaphore)
- DWORD ClrWaitForSemaphore([in] SEMAPHORE_COOKIE semaphore, [in] DWORD dwMilliseconds, [in] BOOL bAlertable)
- BOOL ClrReleaseSemaphore([in] SEMAPHORE_COOKIE semaphore, [in] LONG lReleaseCount, [in] LONG *lpPreviousCount)
-
- MUTEX_COOKIE ClrCreateMutex([in]LPSECURITY_ATTRIBUTES lpMutexAttributes, [in]BOOL bInitialOwner, [in]LPCTSTR lpName)
- DWORD ClrWaitForMutex([in] MUTEX_COOKIE mutex, [in] DWORD dwMilliseconds, [in] BOOL bAlertable)
- BOOL ClrReleaseMutex([in] MUTEX_COOKIE mutex)
- void ClrCloseMutex([in] MUTEX_COOKIE mutex)
-
- DWORD ClrSleepEx([in] DWORD dwMilliseconds, [in] BOOL bAlertable)
-
- BOOL ClrAllocationDisallowed()
-
- void GetLastThrownObjectExceptionFromThread([out] void **ppvException)
-
-}; // interface IExecutionEngine
-*/
-
-class interceptor_IEE : public IExecutionEngine
-{
-private:
- //***************************************************************************
- // IUnknown methods
- //***************************************************************************
- HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, void** pInterface);
- ULONG STDMETHODCALLTYPE AddRef();
- ULONG STDMETHODCALLTYPE Release();
-
- //***************************************************************************
- // IExecutionEngine methods for TLS
- //***************************************************************************
- // Associate a callback for cleanup with a TLS slot
- VOID STDMETHODCALLTYPE TLS_AssociateCallback(DWORD slot, PTLS_CALLBACK_FUNCTION callback);
- // Get the TLS block for fast Get/Set operations
- LPVOID* STDMETHODCALLTYPE TLS_GetDataBlock();
- // Get the value at a slot
- LPVOID STDMETHODCALLTYPE TLS_GetValue(DWORD slot);
- // Get the value at a slot, return FALSE if TLS info block doesn't exist
- BOOL STDMETHODCALLTYPE TLS_CheckValue(DWORD slot, LPVOID* pValue);
- // Set the value at a slot
- VOID STDMETHODCALLTYPE TLS_SetValue(DWORD slot, LPVOID pData);
- // Free TLS memory block and make callback
- VOID STDMETHODCALLTYPE TLS_ThreadDetaching();
-
- //***************************************************************************
- // IExecutionEngine methods for locking
- //***************************************************************************
- CRITSEC_COOKIE STDMETHODCALLTYPE CreateLock(LPCSTR szTag, LPCSTR level, CrstFlags flags);
- void STDMETHODCALLTYPE DestroyLock(CRITSEC_COOKIE lock);
- void STDMETHODCALLTYPE AcquireLock(CRITSEC_COOKIE lock);
- void STDMETHODCALLTYPE ReleaseLock(CRITSEC_COOKIE lock);
- EVENT_COOKIE STDMETHODCALLTYPE CreateAutoEvent(BOOL bInitialState);
- EVENT_COOKIE STDMETHODCALLTYPE CreateManualEvent(BOOL bInitialState);
- void STDMETHODCALLTYPE CloseEvent(EVENT_COOKIE event);
- BOOL STDMETHODCALLTYPE ClrSetEvent(EVENT_COOKIE event);
- BOOL STDMETHODCALLTYPE ClrResetEvent(EVENT_COOKIE event);
- DWORD STDMETHODCALLTYPE WaitForEvent(EVENT_COOKIE event, DWORD dwMilliseconds, BOOL bAlertable);
- DWORD STDMETHODCALLTYPE WaitForSingleObject(HANDLE handle, DWORD dwMilliseconds);
- SEMAPHORE_COOKIE STDMETHODCALLTYPE ClrCreateSemaphore(DWORD dwInitial, DWORD dwMax);
- void STDMETHODCALLTYPE ClrCloseSemaphore(SEMAPHORE_COOKIE semaphore);
- DWORD STDMETHODCALLTYPE ClrWaitForSemaphore(SEMAPHORE_COOKIE semaphore, DWORD dwMilliseconds, BOOL bAlertable);
- BOOL STDMETHODCALLTYPE ClrReleaseSemaphore(SEMAPHORE_COOKIE semaphore, LONG lReleaseCount, LONG* lpPreviousCount);
- MUTEX_COOKIE STDMETHODCALLTYPE ClrCreateMutex(LPSECURITY_ATTRIBUTES lpMutexAttributes,
- BOOL bInitialOwner,
- LPCTSTR lpName);
- void STDMETHODCALLTYPE ClrCloseMutex(MUTEX_COOKIE mutex);
- BOOL STDMETHODCALLTYPE ClrReleaseMutex(MUTEX_COOKIE mutex);
- DWORD STDMETHODCALLTYPE ClrWaitForMutex(MUTEX_COOKIE mutex, DWORD dwMilliseconds, BOOL bAlertable);
- DWORD STDMETHODCALLTYPE ClrSleepEx(DWORD dwMilliseconds, BOOL bAlertable);
- BOOL STDMETHODCALLTYPE ClrAllocationDisallowed();
- void STDMETHODCALLTYPE GetLastThrownObjectExceptionFromThread(void** ppvException);
-
-public:
- // Added so we know where to make the real calls to.
- IExecutionEngine* original_IEE;
-};
-
-#endif
\ No newline at end of file
#include "standardpch.h"
#include "superpmi-shim-simple.h"
#include "runtimedetails.h"
-#include "coreclrcallbacks.h"
#include "icorjitcompiler.h"
#include "errorhandling.h"
#include "logging.h"
pJitInstance->original_ICorJitCompiler = tICJI;
return pJitInstance;
}
-
-extern "C" DLLEXPORT void __stdcall sxsJitStartup(CoreClrCallbacks const& original_cccallbacks)
-{
- PsxsJitStartup pnsxsJitStartup;
-
- SetDefaultPaths();
- SetLibName();
-
- // Load Library
- if (g_hRealJit == 0)
- {
- g_hRealJit = ::LoadLibraryW(g_realJitPath);
- if (g_hRealJit == 0)
- {
- LogError("sxsJitStartup() - LoadLibrary failed to load '%ws' (0x%08x)", g_realJitPath, ::GetLastError());
- return;
- }
- }
-
- // get entry point
- pnsxsJitStartup = (PsxsJitStartup)::GetProcAddress(g_hRealJit, "sxsJitStartup");
-
- if (pnsxsJitStartup != nullptr)
- {
- // Setup CoreClrCallbacks and call sxsJitStartup
- original_CoreClrCallbacks = new CoreClrCallbacks();
- original_CoreClrCallbacks->m_hmodCoreCLR = original_cccallbacks.m_hmodCoreCLR;
- original_CoreClrCallbacks->m_pfnIEE = original_cccallbacks.m_pfnIEE;
- original_CoreClrCallbacks->m_pfnGetCORSystemDirectory = original_cccallbacks.m_pfnGetCORSystemDirectory;
-
- CoreClrCallbacks* temp = new CoreClrCallbacks();
-
- temp->m_hmodCoreCLR = original_cccallbacks.m_hmodCoreCLR;
- temp->m_pfnIEE = IEE_t;
- temp->m_pfnGetCORSystemDirectory = original_cccallbacks.m_pfnGetCORSystemDirectory;
-
- pnsxsJitStartup(*temp);
- }
-}
EXPORTS
getJit
jitStartup
- sxsJitStartup
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
set(SUPERPMI_SOURCES
commandline.cpp
- coreclrcallbacks.cpp
cycletimer.cpp
icorjitinfo.cpp
- ieememorymanager.cpp
- iexecutionengine.cpp
jitdebugger.cpp
jitinstance.cpp
methodstatsemitter.cpp
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#include "standardpch.h"
-#include "spmiutil.h"
-#include "coreclrcallbacks.h"
-#include "iexecutionengine.h"
-
-IExecutionEngine* STDMETHODCALLTYPE IEE_t()
-{
- MyIEE* iee = InitIExecutionEngine();
- return iee;
-}
-
-/*#pragma warning( suppress :4996 ) //deprecated
-HRESULT STDMETHODCALLTYPE GetCORSystemDirectory(LPWSTR pbuffer, DWORD cchBuffer, DWORD* pdwlength)
-{
- DebugBreakorAV(131);
- return 0;
-}
-*/
-
-HANDLE ourHeap = nullptr;
-
-CoreClrCallbacks* InitCoreClrCallbacks()
-{
- CoreClrCallbacks* temp = new CoreClrCallbacks();
- ::ZeroMemory(temp, sizeof(CoreClrCallbacks));
-
- temp->m_hmodCoreCLR = (HINSTANCE)(size_t)0xbadbad01; // any non-null value seems okay...
- temp->m_pfnIEE = IEE_t;
- temp->m_pfnGetCORSystemDirectory = nullptr; // GetCORSystemDirectory;
-
- return temp;
-}
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#ifndef _CoreClrCallbacks
-#define _CoreClrCallbacks
-
-#include "coreclrcommoncallbacks.h"
-
-CoreClrCallbacks* InitCoreClrCallbacks();
-
-#endif
return jitInstance->mc->repIsCompatibleDelegate(objCls, methodParentCls, method, delegateCls, pfIsOpenDelegate);
}
-// Indicates if the method is an instance of the generic
-// method that passes (or has passed) verification
-CorInfoInstantiationVerification MyICJI::isInstantiationOfVerifiedGeneric(CORINFO_METHOD_HANDLE method /* IN */
- )
-{
- jitInstance->mc->cr->AddCall("isInstantiationOfVerifiedGeneric");
- return jitInstance->mc->repIsInstantiationOfVerifiedGeneric(method);
-}
-
-// Loads the constraints on a typical method definition, detecting cycles;
-// for use in verification.
-void MyICJI::initConstraintsForVerification(CORINFO_METHOD_HANDLE method, /* IN */
- BOOL* pfHasCircularClassConstraints, /* OUT */
- BOOL* pfHasCircularMethodConstraint /* OUT */
- )
-{
- jitInstance->mc->cr->AddCall("initConstraintsForVerification");
- jitInstance->mc->repInitConstraintsForVerification(method, pfHasCircularClassConstraints,
- pfHasCircularMethodConstraint);
-}
-
-// Returns enum whether the method does not require verification
-// Also see ICorModuleInfo::canSkipVerification
-CorInfoCanSkipVerificationResult MyICJI::canSkipMethodVerification(CORINFO_METHOD_HANDLE ftnHandle)
-{
- jitInstance->mc->cr->AddCall("canSkipMethodVerification");
- return jitInstance->mc->repCanSkipMethodVerification(ftnHandle, FALSE);
-}
-
// load and restore the method
void MyICJI::methodMustBeLoadedBeforeCodeIsRun(CORINFO_METHOD_HANDLE method)
{
return jitInstance->mc->repGetTokenTypeAsHandle(pResolvedToken);
}
-// Returns true if the module does not require verification
-//
-// If fQuickCheckOnlyWithoutCommit=TRUE, the function only checks that the
-// module does not currently require verification in the current AppDomain.
-// This decision could change in the future, and so should not be cached.
-// If it is cached, it should only be used as a hint.
-// This is only used by ngen for calculating certain hints.
-//
-
-// Returns enum whether the module does not require verification
-// Also see ICorMethodInfo::canSkipMethodVerification();
-CorInfoCanSkipVerificationResult MyICJI::canSkipVerification(CORINFO_MODULE_HANDLE module /* IN */
- )
-{
- jitInstance->mc->cr->AddCall("canSkipVerification");
- LogError("Hit unimplemented canSkipVerification");
- DebugBreakorAV(22);
- return CORINFO_VERIFICATION_CANNOT_SKIP;
-}
-
// Checks if the given metadata token is valid
BOOL MyICJI::isValidToken(CORINFO_MODULE_HANDLE module, /* IN */
unsigned metaTOK /* IN */
return jitInstance->mc->repGetStringLiteral(module, metaTOK, length);
}
-BOOL MyICJI::shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope)
-{
- jitInstance->mc->cr->AddCall("shouldEnforceCallvirtRestriction");
- return jitInstance->mc->repShouldEnforceCallvirtRestriction(scope);
-}
-
/**********************************************************************************/
//
// ICorClassInfo
return jitInstance->mc->repCanInlineTypeCheck(cls, source);
}
-// If this method returns true, JIT will do optimization to inline the check for
-// GetTypeFromHandle(handle) == obj.GetType()
-BOOL MyICJI::canInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE cls)
-{
- jitInstance->mc->cr->AddCall("canInlineTypeCheckWithObjectVTable");
- return jitInstance->mc->repCanInlineTypeCheckWithObjectVTable(cls);
-}
-
// return flags (defined above, CORINFO_FLG_PUBLIC ...)
DWORD MyICJI::getClassAttribs(CORINFO_CLASS_HANDLE cls)
{
return jitInstance->mc->repGetSharedCCtorHelper(clsHnd);
}
-CorInfoHelpFunc MyICJI::getSecurityPrologHelper(CORINFO_METHOD_HANDLE ftn)
-{
- jitInstance->mc->cr->AddCall("getSecurityPrologHelper");
- return jitInstance->mc->repGetSecurityPrologHelper(ftn);
-}
-
// This is not pretty. Boxing nullable<T> actually returns
// a boxed<T> not a boxed Nullable<T>. This call allows the verifier
// to call back to the EE on the 'box' instruction and get the transformed
return jitInstance->mc->repGetFieldOffset(field);
}
-// TODO: jit64 should be switched to the same plan as the i386 jits - use
-// getClassGClayout to figure out the need for writebarrier helper, and inline the copying.
-// The interpretted value class copy is slow. Once this happens, USE_WRITE_BARRIER_HELPERS
-bool MyICJI::isWriteBarrierHelperRequired(CORINFO_FIELD_HANDLE field)
-{
- jitInstance->mc->cr->AddCall("isWriteBarrierHelperRequired");
- bool result = jitInstance->mc->repIsWriteBarrierHelperRequired(field);
- return result;
-}
-
void MyICJI::getFieldInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken,
CORINFO_METHOD_HANDLE callerHandle,
CORINFO_ACCESS_FLAGS flags,
// Used to allocate memory that needs to handed to the EE.
// For eg, use this to allocated memory for reporting debug info,
// which will be handed to the EE by setVars() and setBoundaries()
-void* MyICJI::allocateArray(ULONG cBytes)
+void* MyICJI::allocateArray(size_t cBytes)
{
return jitInstance->allocateArray(cBytes);
}
// CORINFO_LOOKUP_THISOBJ use vtable pointer of 'this' param
// CORINFO_LOOKUP_CLASSPARAM use vtable hidden param
// CORINFO_LOOKUP_METHODPARAM use enclosing type of method-desc hidden param
-CORINFO_LOOKUP_KIND MyICJI::getLocationOfThisType(CORINFO_METHOD_HANDLE context)
+void MyICJI::getLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND* pLookupKind)
{
jitInstance->mc->cr->AddCall("getLocationOfThisType");
- return jitInstance->mc->repGetLocationOfThisType(context);
-}
-
-// return the unmanaged target *if method has already been prelinked.*
-void* MyICJI::getPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void** ppIndirection)
-{
- jitInstance->mc->cr->AddCall("getPInvokeUnmanagedTarget");
- void* result = jitInstance->mc->repGetPInvokeUnmanagedTarget(method, ppIndirection);
- return result;
-}
-
-// return address of fixup area for late-bound PInvoke calls.
-void* MyICJI::getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void** ppIndirection)
-{
- jitInstance->mc->cr->AddCall("getAddressOfPInvokeFixup");
- return jitInstance->mc->repGetAddressOfPInvokeFixup(method, ppIndirection);
+ jitInstance->mc->repGetLocationOfThisType(context, pLookupKind);
}
// return address of fixup area for late-bound PInvoke calls.
return RunWithErrorTrap(function, param);
}
-// return memory manager that the JIT can use to allocate a regular memory
-IEEMemoryManager* MyICJI::getMemoryManager()
-{
- return InitIEEMemoryManager(jitInstance);
-}
-
// get a block of memory for the code, readonly data, and read-write data
void MyICJI::allocMem(ULONG hotCodeSize, /* IN */
ULONG coldCodeSize, /* IN */
return temp;
}
-// Only used on x64.
-void MyICJI::yieldExecution()
-{
- jitInstance->mc->cr->AddCall("yieldExecution");
-}
-
// Indicate how many exception handler blocks are to be returned.
// This is guaranteed to be called before any 'setEHinfo' call.
// Note that allocMem must be called before this method can be called.
return result;
}
-// A callback to identify the range of address known to point to
-// compiler-generated native entry points that call back into
-// MSIL.
-void MyICJI::getModuleNativeEntryPointRange(void** pStart, /* OUT */
- void** pEnd /* OUT */
- )
-{
- jitInstance->mc->cr->AddCall("getModuleNativeEntryPointRange");
- LogError("Hit unimplemented getModuleNativeEntryPointRange");
- DebugBreakorAV(128);
-}
-
// For what machine does the VM expect the JIT to generate code? The VM
// returns one of the IMAGE_FILE_MACHINE_* values. Note that if the VM
// is cross-compiling (such as the case for crossgen), it will return a
#define _ICorJitInfo
#include "runtimedetails.h"
-#include "ieememorymanager.h"
+#include "jitinstance.h"
extern ICorJitInfo* pICJI;
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#include "standardpch.h"
-#include "spmiutil.h"
-#include "ieememorymanager.h"
-
-IEEMemoryManager* pIEEMM = nullptr;
-HANDLE processHeap = INVALID_HANDLE_VALUE;
-
-//***************************************************************************
-// IUnknown methods
-//***************************************************************************
-
-HRESULT STDMETHODCALLTYPE MyIEEMM::QueryInterface(REFIID id, void** pInterface)
-{
- DebugBreakorAV(133);
- return 0;
-}
-ULONG STDMETHODCALLTYPE MyIEEMM::AddRef()
-{
- DebugBreakorAV(134);
- return 0;
-}
-ULONG STDMETHODCALLTYPE MyIEEMM::Release()
-{
- DebugBreakorAV(135);
- return 0;
-}
-
-HANDLE virtHeap = INVALID_HANDLE_VALUE;
-
-//***************************************************************************
-// IEEMemoryManager methods for locking
-//***************************************************************************
-LPVOID STDMETHODCALLTYPE MyIEEMM::ClrVirtualAlloc(LPVOID lpAddress,
- SIZE_T dwSize,
- DWORD flAllocationType,
- DWORD flProtect)
-{
- if (virtHeap == INVALID_HANDLE_VALUE)
- virtHeap = HeapCreate(0, 0xFFFF, 0);
- if (virtHeap != INVALID_HANDLE_VALUE)
- return HeapAlloc(virtHeap, HEAP_ZERO_MEMORY, dwSize);
- return nullptr;
-}
-BOOL STDMETHODCALLTYPE MyIEEMM::ClrVirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType)
-{
- return HeapFree(virtHeap, 0, lpAddress);
-}
-SIZE_T STDMETHODCALLTYPE MyIEEMM::ClrVirtualQuery(LPCVOID lpAddress,
- PMEMORY_BASIC_INFORMATION lpBuffer,
- SIZE_T dwLength)
-{
- DebugBreakorAV(136);
- return 0;
-}
-BOOL STDMETHODCALLTYPE MyIEEMM::ClrVirtualProtect(LPVOID lpAddress,
- SIZE_T dwSize,
- DWORD flNewProtect,
- PDWORD lpflOldProtect)
-{
- DebugBreakorAV(137);
- return 0;
-}
-HANDLE STDMETHODCALLTYPE MyIEEMM::ClrGetProcessHeap()
-{
- DebugBreakorAV(138);
- return 0;
-}
-HANDLE STDMETHODCALLTYPE MyIEEMM::ClrHeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize)
-{
- DebugBreakorAV(139);
- return 0;
-}
-BOOL STDMETHODCALLTYPE MyIEEMM::ClrHeapDestroy(HANDLE hHeap)
-{
- DebugBreakorAV(140);
- return 0;
-}
-LPVOID STDMETHODCALLTYPE MyIEEMM::ClrHeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes)
-{
- return HeapAlloc(hHeap, dwFlags, dwBytes);
-}
-BOOL STDMETHODCALLTYPE MyIEEMM::ClrHeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem)
-{
- return HeapFree(hHeap, dwFlags, lpMem);
-}
-BOOL STDMETHODCALLTYPE MyIEEMM::ClrHeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem)
-{
- DebugBreakorAV(141);
- return 0;
-}
-HANDLE STDMETHODCALLTYPE MyIEEMM::ClrGetProcessExecutableHeap()
-{
- if (processHeap == INVALID_HANDLE_VALUE)
- {
- DWORD flOptions = 0;
-#ifndef TARGET_UNIX // TODO-Review: PAL doesn't have HEAP_CREATE_ENABLE_EXECUTE. Is this ok?
- flOptions = HEAP_CREATE_ENABLE_EXECUTE;
-#endif // !TARGET_UNIX
- processHeap = HeapCreate(flOptions, 10000, 0);
- }
- return processHeap;
-}
-
-IEEMemoryManager* InitIEEMemoryManager(JitInstance* jitInstance)
-{
- if (pIEEMM == nullptr)
- {
- MyIEEMM* ieemm = new MyIEEMM();
- ieemm->jitInstance = jitInstance;
- pIEEMM = ieemm;
- }
- return pIEEMM;
-}
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#ifndef _IEEMemoryManager
-#define _IEEMemoryManager
-
-#include "runtimedetails.h"
-#include "jitinstance.h"
-
-/*
-interface IEEMemoryManager : IUnknown
-{
- LPVOID ClrVirtualAlloc(
- [in] LPVOID lpAddress, // region to reserve or commit
- [in] SIZE_T dwSize, // size of region
- [in] DWORD flAllocationType, // type of allocation
- [in] DWORD flProtect // type of access protection
- )
-
- BOOL ClrVirtualFree(
- [in] LPVOID lpAddress, // address of region
- [in] SIZE_T dwSize, // size of region
- [in] DWORD dwFreeType // operation type
- )
-
- SIZE_T ClrVirtualQuery(
- [in] const void* lpAddress, // address of region
- [in] PMEMORY_BASIC_INFORMATION lpBuffer, // information buffer
- [in] SIZE_T dwLength // size of buffer
- )
-
- BOOL ClrVirtualProtect(
- [in] LPVOID lpAddress, // region of committed pages
- [in] SIZE_T dwSize, // size of the region
- [in] DWORD flNewProtect, // desired access protection
- [in] DWORD* lpflOldProtect // old protection
- )
-
- HANDLE ClrGetProcessHeap()
-
- HANDLE ClrHeapCreate(
- [in] DWORD flOptions, // heap allocation attributes
- [in] SIZE_T dwInitialSize, // initial heap size
- [in] SIZE_T dwMaximumSize // maximum heap size
- )
-
- BOOL ClrHeapDestroy(
- [in] HANDLE hHeap // handle to heap
- )
-
- LPVOID ClrHeapAlloc(
- [in] HANDLE hHeap, // handle to private heap block
- [in] DWORD dwFlags, // heap allocation control
- [in] SIZE_T dwBytes // number of bytes to allocate
- )
-
- BOOL ClrHeapFree(
- [in] HANDLE hHeap, // handle to heap
- [in] DWORD dwFlags, // heap free options
- [in] LPVOID lpMem // pointer to memory
- )
-
- BOOL ClrHeapValidate(
- [in] HANDLE hHeap, // handle to heap
- [in] DWORD dwFlags, // heap access options
- [in] const void* lpMem // optional pointer to memory block
- )
-
- HANDLE ClrGetProcessExecutableHeap()
-
-}; // interface IEEMemoryManager
-
-*/
-extern HANDLE virtHeap;
-extern IEEMemoryManager* pIEEMM;
-extern HANDLE processHeap;
-class MyIEEMM : public IEEMemoryManager
-{
-private:
- //***************************************************************************
- // IUnknown methods
- //***************************************************************************
-
- HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, void** pInterface);
- ULONG STDMETHODCALLTYPE AddRef();
- ULONG STDMETHODCALLTYPE Release();
-
- //***************************************************************************
- // IEEMemoryManager methods for locking
- //***************************************************************************
- LPVOID STDMETHODCALLTYPE ClrVirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect);
- BOOL STDMETHODCALLTYPE ClrVirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType);
- SIZE_T STDMETHODCALLTYPE ClrVirtualQuery(LPCVOID lpAddress, PMEMORY_BASIC_INFORMATION lpBuffer, SIZE_T dwLength);
- BOOL STDMETHODCALLTYPE ClrVirtualProtect(LPVOID lpAddress,
- SIZE_T dwSize,
- DWORD flNewProtect,
- PDWORD lpflOldProtect);
- HANDLE STDMETHODCALLTYPE ClrGetProcessHeap();
- HANDLE STDMETHODCALLTYPE ClrHeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize);
- BOOL STDMETHODCALLTYPE ClrHeapDestroy(HANDLE hHeap);
- LPVOID STDMETHODCALLTYPE ClrHeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes);
- BOOL STDMETHODCALLTYPE ClrHeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem);
- BOOL STDMETHODCALLTYPE ClrHeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem);
- HANDLE STDMETHODCALLTYPE ClrGetProcessExecutableHeap();
-
-public:
- // Added extras... todo add padding to detect corruption?
- JitInstance* jitInstance;
-};
-
-IEEMemoryManager* InitIEEMemoryManager(JitInstance* jitInstance);
-
-#endif
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#include "standardpch.h"
-#include "spmiutil.h"
-#include "iexecutionengine.h"
-
-LPVOID TLS_Slots[MAX_PREDEFINED_TLS_SLOT];
-class MyIEE;
-IExecutionEngine* pIEE = nullptr;
-
-//***************************************************************************
-// IUnknown methods
-//***************************************************************************
-
-HRESULT STDMETHODCALLTYPE MyIEE::QueryInterface(REFIID id, void** pInterface)
-{
- // TODO-Cleanup: check the rid
- *pInterface = InitIEEMemoryManager(nullptr);
- return 0;
-}
-ULONG STDMETHODCALLTYPE MyIEE::AddRef()
-{
- DebugBreakorAV(142);
- return 0;
-}
-ULONG STDMETHODCALLTYPE MyIEE::Release()
-{
- DebugBreakorAV(143);
- return 0;
-}
-
-//***************************************************************************
-// IExecutionEngine methods for TLS
-//***************************************************************************
-
-// Associate a callback for cleanup with a TLS slot
-VOID STDMETHODCALLTYPE MyIEE::TLS_AssociateCallback(DWORD slot, PTLS_CALLBACK_FUNCTION callback)
-{
- // TODO-Cleanup: figure an appropriate realish value for this
-}
-
-// Get the TLS block for fast Get/Set operations
-LPVOID* STDMETHODCALLTYPE MyIEE::TLS_GetDataBlock()
-{
- // We were previously allocating a TlsIndex with
- // the master slot index set to a nullptr
- // so in the new version we just return nullptr
- // and it seems to be working for now
- return nullptr;
-}
-
-// Get the value at a slot
-LPVOID STDMETHODCALLTYPE MyIEE::TLS_GetValue(DWORD slot)
-{
- /* if(slot>MAX_PREDEFINED_TLS_SLOT)
- __debugbreak();
- void *thing = TlsGetValue(TlsIndex);
-
- // if(slot == 0x9)
- //return 0; //trick out the contract system to be as off as possible.
- //TODO-Cleanup: does anything beyond contracts care? This seems like a pretty thin mock.
- */
- return TLS_Slots[slot];
-}
-
-// Get the value at a slot, return FALSE if TLS info block doesn't exist
-BOOL STDMETHODCALLTYPE MyIEE::TLS_CheckValue(DWORD slot, LPVOID* pValue)
-{
- DebugBreakorAV(144);
- // TODO-Cleanup: does anything beyond contracts care? This seems like a pretty thin mock.
- return true;
-}
-// Set the value at a slot
-VOID STDMETHODCALLTYPE MyIEE::TLS_SetValue(DWORD slot, LPVOID pData)
-{
- if (slot > MAX_PREDEFINED_TLS_SLOT)
- {
- DebugBreakorAV(143);
- return;
- }
-
- // TODO-Cleanup: does anything beyond contracts care? This seems like a pretty thin mock.
- TLS_Slots[slot] = pData;
-}
-// Free TLS memory block and make callback
-VOID STDMETHODCALLTYPE MyIEE::TLS_ThreadDetaching()
-{
- DebugBreakorAV(145);
-}
-
-//***************************************************************************
-// IExecutionEngine methods for locking
-//***************************************************************************
-
-CRITSEC_COOKIE STDMETHODCALLTYPE MyIEE::CreateLock(LPCSTR szTag, LPCSTR level, CrstFlags flags)
-{
- return (CRITSEC_COOKIE)(size_t)0xbad01241;
-}
-void STDMETHODCALLTYPE MyIEE::DestroyLock(CRITSEC_COOKIE lock)
-{
- DebugBreakorAV(146);
-}
-void STDMETHODCALLTYPE MyIEE::AcquireLock(CRITSEC_COOKIE lock)
-{
-}
-void STDMETHODCALLTYPE MyIEE::ReleaseLock(CRITSEC_COOKIE lock)
-{
-}
-
-EVENT_COOKIE STDMETHODCALLTYPE MyIEE::CreateAutoEvent(BOOL bInitialState)
-{
- DebugBreakorAV(147);
- return 0;
-}
-EVENT_COOKIE STDMETHODCALLTYPE MyIEE::CreateManualEvent(BOOL bInitialState)
-{
- DebugBreakorAV(148);
- return 0;
-}
-void STDMETHODCALLTYPE MyIEE::CloseEvent(EVENT_COOKIE event)
-{
- DebugBreakorAV(149);
-}
-BOOL STDMETHODCALLTYPE MyIEE::ClrSetEvent(EVENT_COOKIE event)
-{
- DebugBreakorAV(150);
- return 0;
-}
-BOOL STDMETHODCALLTYPE MyIEE::ClrResetEvent(EVENT_COOKIE event)
-{
- DebugBreakorAV(151);
- return 0;
-}
-DWORD STDMETHODCALLTYPE MyIEE::WaitForEvent(EVENT_COOKIE event, DWORD dwMilliseconds, BOOL bAlertable)
-{
- DebugBreakorAV(152);
- return 0;
-}
-DWORD STDMETHODCALLTYPE MyIEE::WaitForSingleObject(HANDLE handle, DWORD dwMilliseconds)
-{
- DebugBreakorAV(153);
- return 0;
-}
-SEMAPHORE_COOKIE STDMETHODCALLTYPE MyIEE::ClrCreateSemaphore(DWORD dwInitial, DWORD dwMax)
-{
- DebugBreakorAV(154);
- return 0;
-}
-void STDMETHODCALLTYPE MyIEE::ClrCloseSemaphore(SEMAPHORE_COOKIE semaphore)
-{
- DebugBreakorAV(155);
-}
-DWORD STDMETHODCALLTYPE MyIEE::ClrWaitForSemaphore(SEMAPHORE_COOKIE semaphore, DWORD dwMilliseconds, BOOL bAlertable)
-{
- DebugBreakorAV(156);
- return 0;
-}
-BOOL STDMETHODCALLTYPE MyIEE::ClrReleaseSemaphore(SEMAPHORE_COOKIE semaphore, LONG lReleaseCount, LONG* lpPreviousCount)
-{
- DebugBreakorAV(157);
- return 0;
-}
-MUTEX_COOKIE STDMETHODCALLTYPE MyIEE::ClrCreateMutex(LPSECURITY_ATTRIBUTES lpMutexAttributes,
- BOOL bInitialOwner,
- LPCTSTR lpName)
-{
- DebugBreakorAV(158);
- return 0;
-}
-void STDMETHODCALLTYPE MyIEE::ClrCloseMutex(MUTEX_COOKIE mutex)
-{
- DebugBreakorAV(159);
-}
-BOOL STDMETHODCALLTYPE MyIEE::ClrReleaseMutex(MUTEX_COOKIE mutex)
-{
- DebugBreakorAV(160);
- return 0;
-}
-DWORD STDMETHODCALLTYPE MyIEE::ClrWaitForMutex(MUTEX_COOKIE mutex, DWORD dwMilliseconds, BOOL bAlertable)
-{
- DebugBreakorAV(161);
- return 0;
-}
-
-DWORD STDMETHODCALLTYPE MyIEE::ClrSleepEx(DWORD dwMilliseconds, BOOL bAlertable)
-{
- DebugBreakorAV(162);
- return 0;
-}
-BOOL STDMETHODCALLTYPE MyIEE::ClrAllocationDisallowed()
-{
- DebugBreakorAV(163);
- return 0;
-}
-void STDMETHODCALLTYPE MyIEE::GetLastThrownObjectExceptionFromThread(void** ppvException)
-{
- DebugBreakorAV(164);
-}
-
-MyIEE* InitIExecutionEngine()
-{
- MyIEE* iee = new MyIEE();
- pIEE = iee;
- return iee;
-}
+++ /dev/null
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-#ifndef _IExecutionEngine
-#define _IExecutionEngine
-
-#include "ieememorymanager.h"
-
-/*
-interface IExecutionEngine : IUnknown
-{
- // Thread Local Storage is based on logical threads. The underlying
- // implementation could be threads, fibers, or something more exotic.
- // Slot numbers are predefined. This is not a general extensibility
- // mechanism.
-
- // Associate a callback function for releasing TLS on thread/fiber death.
- // This can be NULL.
- void TLS_AssociateCallback([in] DWORD slot, [in] PTLS_CALLBACK_FUNCTION callback)
-
- // May be called once to get the master TLS block slot for fast Get/Set operations
- DWORD TLS_GetMasterSlotIndex()
-
- // Get the value at a slot
- PVOID TLS_GetValue([in] DWORD slot)
-
- // Get the value at a slot, return FALSE if TLS info block doesn't exist
- BOOL TLS_CheckValue([in] DWORD slot, [out] PVOID * pValue)
-
- // Set the value at a slot
- void TLS_SetValue([in] DWORD slot, [in] PVOID pData)
-
- // Free TLS memory block and make callback
- void TLS_ThreadDetaching()
-
- // Critical Sections are sometimes exposed to the host and therefore need to be
- // reflected from all CLR DLLs to the EE.
- //
- // In addition, we always monitor interactions between the lock & the GC, based
- // on the GC mode in which the lock is acquired and we restrict what operations
- // are permitted while holding the lock based on this.
- //
- // Finally, we we rank all our locks to prevent deadlock across all the DLLs of
- // the CLR. This is the level argument to CreateLock.
- //
- // All usage of these locks must be exception-safe. To achieve this, we suggest
- // using Holders (see holder.h & crst.h). In fact, within the EE code cannot
- // hold locks except by using exception-safe holders.
-
- CRITSEC_COOKIE CreateLock([in] LPCSTR szTag, [in] LPCSTR level, [in] CrstFlags flags)
-
- void DestroyLock([in] CRITSEC_COOKIE lock)
-
- void AcquireLock([in] CRITSEC_COOKIE lock)
-
- void ReleaseLock([in] CRITSEC_COOKIE lock)
-
- EVENT_COOKIE CreateAutoEvent([in] BOOL bInitialState)
- EVENT_COOKIE CreateManualEvent([in] BOOL bInitialState)
- void CloseEvent([in] EVENT_COOKIE event)
- BOOL ClrSetEvent([in] EVENT_COOKIE event)
- BOOL ClrResetEvent([in] EVENT_COOKIE event)
- DWORD WaitForEvent([in] EVENT_COOKIE event, [in] DWORD dwMilliseconds, [in] BOOL bAlertable)
- DWORD WaitForSingleObject([in] HANDLE handle, [in] DWORD dwMilliseconds)
-
- // OS header file defines CreateSemaphore.
- SEMAPHORE_COOKIE ClrCreateSemaphore([in] DWORD dwInitial, [in] DWORD dwMax)
- void ClrCloseSemaphore([in] SEMAPHORE_COOKIE semaphore)
- DWORD ClrWaitForSemaphore([in] SEMAPHORE_COOKIE semaphore, [in] DWORD dwMilliseconds, [in] BOOL bAlertable)
- BOOL ClrReleaseSemaphore([in] SEMAPHORE_COOKIE semaphore, [in] LONG lReleaseCount, [in] LONG *lpPreviousCount)
-
- MUTEX_COOKIE ClrCreateMutex([in]LPSECURITY_ATTRIBUTES lpMutexAttributes, [in]BOOL bInitialOwner, [in]LPCTSTR lpName)
- DWORD ClrWaitForMutex([in] MUTEX_COOKIE mutex, [in] DWORD dwMilliseconds, [in] BOOL bAlertable)
- BOOL ClrReleaseMutex([in] MUTEX_COOKIE mutex)
- void ClrCloseMutex([in] MUTEX_COOKIE mutex)
-
- DWORD ClrSleepEx([in] DWORD dwMilliseconds, [in] BOOL bAlertable)
-
- BOOL ClrAllocationDisallowed()
-
- void GetLastThrownObjectExceptionFromThread([out] void **ppvException)
-
-}; // interface IExecutionEngine
-*/
-
-extern LPVOID TLS_Slots[MAX_PREDEFINED_TLS_SLOT];
-extern IExecutionEngine* pIEE;
-
-class MyIEE : public IExecutionEngine
-{
-private:
- //***************************************************************************
- // IUnknown methods
- //***************************************************************************
- HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, void** pInterface);
- ULONG STDMETHODCALLTYPE AddRef();
- ULONG STDMETHODCALLTYPE Release();
-
- //***************************************************************************
- // IExecutionEngine methods for TLS
- //***************************************************************************
- // Associate a callback for cleanup with a TLS slot
- VOID STDMETHODCALLTYPE TLS_AssociateCallback(DWORD slot, PTLS_CALLBACK_FUNCTION callback);
-
- // Get the TLS block for fast Get/Set operations
- LPVOID* STDMETHODCALLTYPE TLS_GetDataBlock();
- // Get the value at a slot
- LPVOID STDMETHODCALLTYPE TLS_GetValue(DWORD slot);
- // Get the value at a slot, return FALSE if TLS info block doesn't exist
- BOOL STDMETHODCALLTYPE TLS_CheckValue(DWORD slot, LPVOID* pValue);
- // Set the value at a slot
- VOID STDMETHODCALLTYPE TLS_SetValue(DWORD slot, LPVOID pData);
- // Free TLS memory block and make callback
- VOID STDMETHODCALLTYPE TLS_ThreadDetaching();
-
- //***************************************************************************
- // IExecutionEngine methods for locking
- //***************************************************************************
- CRITSEC_COOKIE STDMETHODCALLTYPE CreateLock(LPCSTR szTag, LPCSTR level, CrstFlags flags);
- void STDMETHODCALLTYPE DestroyLock(CRITSEC_COOKIE lock);
- void STDMETHODCALLTYPE AcquireLock(CRITSEC_COOKIE lock);
- void STDMETHODCALLTYPE ReleaseLock(CRITSEC_COOKIE lock);
- EVENT_COOKIE STDMETHODCALLTYPE CreateAutoEvent(BOOL bInitialState);
- EVENT_COOKIE STDMETHODCALLTYPE CreateManualEvent(BOOL bInitialState);
- void STDMETHODCALLTYPE CloseEvent(EVENT_COOKIE event);
- BOOL STDMETHODCALLTYPE ClrSetEvent(EVENT_COOKIE event);
- BOOL STDMETHODCALLTYPE ClrResetEvent(EVENT_COOKIE event);
- DWORD STDMETHODCALLTYPE WaitForEvent(EVENT_COOKIE event, DWORD dwMilliseconds, BOOL bAlertable);
- DWORD STDMETHODCALLTYPE WaitForSingleObject(HANDLE handle, DWORD dwMilliseconds);
- SEMAPHORE_COOKIE STDMETHODCALLTYPE ClrCreateSemaphore(DWORD dwInitial, DWORD dwMax);
- void STDMETHODCALLTYPE ClrCloseSemaphore(SEMAPHORE_COOKIE semaphore);
- DWORD STDMETHODCALLTYPE ClrWaitForSemaphore(SEMAPHORE_COOKIE semaphore, DWORD dwMilliseconds, BOOL bAlertable);
- BOOL STDMETHODCALLTYPE ClrReleaseSemaphore(SEMAPHORE_COOKIE semaphore, LONG lReleaseCount, LONG* lpPreviousCount);
- MUTEX_COOKIE STDMETHODCALLTYPE ClrCreateMutex(LPSECURITY_ATTRIBUTES lpMutexAttributes,
- BOOL bInitialOwner,
- LPCTSTR lpName);
- void STDMETHODCALLTYPE ClrCloseMutex(MUTEX_COOKIE mutex);
- BOOL STDMETHODCALLTYPE ClrReleaseMutex(MUTEX_COOKIE mutex);
- DWORD STDMETHODCALLTYPE ClrWaitForMutex(MUTEX_COOKIE mutex, DWORD dwMilliseconds, BOOL bAlertable);
- DWORD STDMETHODCALLTYPE ClrSleepEx(DWORD dwMilliseconds, BOOL bAlertable);
- BOOL STDMETHODCALLTYPE ClrAllocationDisallowed();
- void STDMETHODCALLTYPE GetLastThrownObjectExceptionFromThread(void** ppvException);
-};
-
-MyIEE* InitIExecutionEngine();
-#endif
\ No newline at end of file
size_t keyLen = wcslen(key);
size_t keyBufferLen = keyLen + PrefixLen + 1;
WCHAR* keyBuffer =
- reinterpret_cast<WCHAR*>(jitInstance.allocateArray(static_cast<ULONG>(sizeof(WCHAR) * keyBufferLen)));
+ reinterpret_cast<WCHAR*>(jitInstance.allocateArray(sizeof(WCHAR) * keyBufferLen));
wcscpy_s(keyBuffer, keyBufferLen, Prefix);
wcscpy_s(&keyBuffer[PrefixLen], keyLen + 1, key);
void* JitHost::allocateMemory(size_t size)
{
- return InitIEEMemoryManager(&jitInstance)->ClrVirtualAlloc(nullptr, size, 0, 0);
+ return jitInstance.allocateLongLivedArray(size);
}
void JitHost::freeMemory(void* block)
{
- InitIEEMemoryManager(&jitInstance)->ClrVirtualFree(block, 0, 0);
+ jitInstance.freeLongLivedArray((void*)block);
}
bool JitHost::convertStringValueToInt(const WCHAR* key, const WCHAR* stringValue, int& result)
{
// Now we need to dup it, so you can call freeStringConfigValue() on what we return.
size_t resultLenInChars = wcslen(result) + 1;
- WCHAR* dupResult = (WCHAR*)jitInstance.allocateLongLivedArray((ULONG)(sizeof(WCHAR) * resultLenInChars));
+ WCHAR* dupResult = (WCHAR*)jitInstance.allocateLongLivedArray(sizeof(WCHAR) * resultLenInChars);
wcscpy_s(dupResult, resultLenInChars, result);
result = dupResult;
}
#include "standardpch.h"
#include "superpmi.h"
#include "jitinstance.h"
-#include "coreclrcallbacks.h"
#include "icorjitinfo.h"
#include "jithost.h"
#include "errorhandling.h"
LogError("GetProcAddress 'getJit' failed (0x%08x)", ::GetLastError());
return -1;
}
- pnsxsJitStartup = (PsxsJitStartup)::GetProcAddress(hLib, "sxsJitStartup");
pnjitStartup = (PjitStartup)::GetProcAddress(hLib, "jitStartup");
- if (pnsxsJitStartup != nullptr)
- {
- // Setup CoreClrCallbacks and call sxsJitStartup
- CoreClrCallbacks* cccallbacks = InitCoreClrCallbacks();
- pnsxsJitStartup(*cccallbacks);
- }
-
// Setup ICorJitHost and call jitStartup if necessary
if (pnjitStartup != nullptr)
{
LogError("GetProcAddress 'getJit' failed (0x%08x)", ::GetLastError());
return false;
}
- pnsxsJitStartup = (PsxsJitStartup)::GetProcAddress(hLib, "sxsJitStartup");
pnjitStartup = (PjitStartup)::GetProcAddress(hLib, "jitStartup");
- if (pnsxsJitStartup != nullptr)
- {
- // Setup CoreClrCallbacks and call sxsJitStartup
- CoreClrCallbacks* cccallbacks = InitCoreClrCallbacks();
- pnsxsJitStartup(*cccallbacks);
- }
-
// Setup ICorJitHost and call jitStartup if necessary
if (pnjitStartup != nullptr)
{
// Used to allocate memory that needs to handed to the EE.
// For eg, use this to allocated memory for reporting debug info,
// which will be handed to the EE by setVars() and setBoundaries()
-void* JitInstance::allocateArray(ULONG cBytes)
+void* JitInstance::allocateArray(size_t cBytes)
{
mc->cr->AddCall("allocateArray");
return HeapAlloc(mc->cr->getCodeHeap(), 0, cBytes);
// Used to allocate memory that needs to live as long as the jit
// instance does.
-void* JitInstance::allocateLongLivedArray(ULONG cBytes)
+void* JitInstance::allocateLongLivedArray(size_t cBytes)
{
return HeapAlloc(ourHeap, 0, cBytes);
}
HMODULE hLib;
PgetJit pngetJit;
PjitStartup pnjitStartup;
- PsxsJitStartup pnsxsJitStartup;
ICorJitHost* jitHost;
ICorJitInfo* icji;
SimpleTimer stj;
const MethodContext::Environment& getEnvironment();
- void* allocateArray(ULONG size);
- void* allocateLongLivedArray(ULONG size);
+ void* allocateArray(size_t size);
+ void* allocateLongLivedArray(size_t size);
void freeArray(void* array);
void freeLongLivedArray(void* array);
};
virtual BOOL HasCustomAttribute(CORINFO_METHOD_HANDLE method, LPCSTR customAttributeName) = 0;
};
-/*****************************************************************************/
-// This function determines the compile flags to use for a generic intatiation
-// since only the open instantiation can be verified.
-// See the comment associated with CORJIT_FLAG_SKIP_VERIFICATION for details.
-//
-// On return:
-// if *raiseVerificationException=TRUE, the caller should raise a VerificationException.
-// if *unverifiableGenericCode=TRUE, the method is a generic instantiation with
-// unverifiable code
-
-CORJIT_FLAGS GetCompileFlagsIfGenericInstantiation(
- CORINFO_METHOD_HANDLE method,
- CORJIT_FLAGS compileFlags,
- ICorJitInfo * pCorJitInfo,
- BOOL * raiseVerificationException,
- BOOL * unverifiableGenericCode);
-
// Returns the global instance of JIT->EE interface for NGen
extern "C" ICorDynamicInfo * __stdcall GetZapJitInfo();
#endif
#endif
-SELECTANY const GUID JITEEVersionIdentifier = { /* 96fc0c0a-9f77-450d-9663-ee33ae0fcae8 */
- 0x96fc0c0a,
- 0x9f77,
- 0x450d,
- {0x96, 0x63, 0xee, 0x33, 0xae, 0x0f, 0xca, 0xe8}
+SELECTANY const GUID JITEEVersionIdentifier = { /* 9C412381-94A6-4F35-B2B6-60AFB2495B72 */
+ 0x9c412381,
+ 0x94a6,
+ 0x4f35,
+ { 0xb2, 0xb6, 0x60, 0xaf, 0xb2, 0x49, 0x5b, 0x72 }
};
//////////////////////////////////////////////////////////////////////////////////////////////////////////
/* Allocating a new object. Always use ICorClassInfo::getNewHelper() to decide
which is the right helper to use to allocate an object of a given type. */
- CORINFO_HELP_NEW_CROSSCONTEXT, // cross context new object
CORINFO_HELP_NEWFAST,
CORINFO_HELP_NEWSFAST, // allocator for small, non-finalizer, non-array object
CORINFO_HELP_NEWSFAST_FINALIZE, // allocator for small, finalizable, non-array object
CORINFO_HELP_GETSYNCFROMCLASSHANDLE, // Given a generics class handle, returns the sync monitor
// in its ManagedClassObject
- /* Security callout support */
-
- CORINFO_HELP_SECURITY_PROLOG, // Required if CORINFO_FLG_SECURITYCHECK is set, or CORINFO_FLG_NOSECURITYWRAP is not set
- CORINFO_HELP_SECURITY_PROLOG_FRAMED, // Slow version of CORINFO_HELP_SECURITY_PROLOG. Used for instrumentation.
-
- CORINFO_HELP_METHOD_ACCESS_CHECK, // Callouts to runtime security access checks
- CORINFO_HELP_FIELD_ACCESS_CHECK,
- CORINFO_HELP_CLASS_ACCESS_CHECK,
-
- CORINFO_HELP_DELEGATE_SECURITY_CHECK, // Callout to delegate security transparency check
-
- /* Verification runtime callout support */
-
- CORINFO_HELP_VERIFICATION_RUNTIME_CHECK, // Do a Demand for UnmanagedCode permission at runtime
-
/* GC support */
CORINFO_HELP_STOP_FOR_GC, // Call GC (force a GC)
CORINFO_FLG_SHAREDINST = 0x00020000, // the code for this method is shared between different generic instantiations (also set on classes/types)
CORINFO_FLG_DELEGATE_INVOKE = 0x00040000, // "Delegate
CORINFO_FLG_PINVOKE = 0x00080000, // Is a P/Invoke call
- CORINFO_FLG_SECURITYCHECK = 0x00100000, // Is one of the security routines that does a stackwalk (e.g. Assert, Demand)
+// CORINFO_FLG_UNUSED = 0x00100000,
CORINFO_FLG_NOGCCHECK = 0x00200000, // This method is FCALL that has no GC check. Don't put alone in loops
CORINFO_FLG_INTRINSIC = 0x00400000, // This method MAY have an intrinsic ID
CORINFO_FLG_CONSTRUCTOR = 0x00800000, // This method is an instance or type initializer
CORINFO_FLG_AGGRESSIVE_OPT = 0x01000000, // The method may contain hot code and should be aggressively optimized if possible
CORINFO_FLG_DISABLE_TIER0_FOR_LOOPS = 0x02000000, // Indicates that tier 0 JIT should not be used for a method that contains a loop
- CORINFO_FLG_NOSECURITYWRAP = 0x04000000, // The method requires no security checks
+// CORINFO_FLG_UNUSED = 0x04000000,
// CORINFO_FLG_UNUSED = 0x08000000,
CORINFO_FLG_DONT_INLINE = 0x10000000, // The method should not be inlined
CORINFO_FLG_DONT_INLINE_CALLER = 0x20000000, // The method should not be inlined, nor should its callers. It cannot be tail called.
CORINFO_FLG_ARRAY = 0x00080000, // class is an array class (initialized differently)
CORINFO_FLG_OVERLAPPING_FIELDS = 0x00100000, // struct or class has fields that overlap (aka union)
CORINFO_FLG_INTERFACE = 0x00200000, // it is an interface
- CORINFO_FLG_CONTEXTFUL = 0x00400000, // is this a contextful class?
+ // unused = 0x00400000,
CORINFO_FLG_CUSTOMLAYOUT = 0x00800000, // does this struct have custom layout?
CORINFO_FLG_CONTAINS_GC_PTR = 0x01000000, // does the class contain a gc ptr ?
CORINFO_FLG_DELEGATE = 0x02000000, // is this a subclass of delegate or multicast delegate ?
- CORINFO_FLG_MARSHAL_BYREF = 0x04000000, // is this a subclass of MarshalByRef ?
+ // CORINFO_FLG_UNUSED = 0x04000000,
CORINFO_FLG_CONTAINS_STACK_PTR = 0x08000000, // This class has a stack pointer inside it
CORINFO_FLG_VARIANCE = 0x10000000, // MethodTable::HasVariance (sealed does *not* mean uncast-able)
CORINFO_FLG_BEFOREFIELDINIT = 0x20000000, // Additional flexibility for when to run .cctor (see code:#ClassConstructionFlags)
enum CorInfoMethodRuntimeFlags
{
CORINFO_FLG_BAD_INLINEE = 0x00000001, // The method is not suitable for inlining
- CORINFO_FLG_VERIFIABLE = 0x00000002, // The method has verifiable code
- CORINFO_FLG_UNVERIFIABLE = 0x00000004, // The method has unverifiable code
+ // unused = 0x00000002,
+ // unused = 0x00000004,
CORINFO_FLG_SWITCHED_TO_MIN_OPT = 0x00000008, // The JIT decided to switch to MinOpt for this method, when it was not requested
CORINFO_FLG_SWITCHED_TO_OPTIMIZED = 0x00000010, // The JIT decided to switch to tier 1 for this method, when a different tier was requested
};
{
CORINFO_ACCESS_ANY = 0x0000, // Normal access
CORINFO_ACCESS_THIS = 0x0001, // Accessed via the this reference
- CORINFO_ACCESS_UNWRAP = 0x0002, // Accessed via an unwrap reference
+ // UNUSED = 0x0002,
CORINFO_ACCESS_NONNULL = 0x0004, // Instance is guaranteed non-null
TAILCALL_FAIL = -1, // Couldn't do a tail call
};
-enum CorInfoCanSkipVerificationResult
-{
- CORINFO_VERIFICATION_CANNOT_SKIP = 0, // Cannot skip verification during jit time.
- CORINFO_VERIFICATION_CAN_SKIP = 1, // Can skip verification during jit time.
- CORINFO_VERIFICATION_RUNTIME_CHECK = 2, // Cannot skip verification during jit time,
- // but need to insert a callout to the VM to ask during runtime
- // whether to raise a verification or not (if the method is unverifiable).
- CORINFO_VERIFICATION_DONT_JIT = 3, // Cannot skip verification during jit time,
- // but do not jit the method if is is unverifiable.
-};
-
enum CorInfoInitClassResult
{
CORINFO_INITCLASS_NOT_REQUIRED = 0x00, // No class initialization required, but the class is not actually initialized yet
CORINFO_INDIRECT_CALL_COUNT
};
-// This is for use when the JIT is compiling an instantiation
-// of generic code. The JIT needs to know if the generic code itself
-// (which can be verified once and for all independently of the
-// instantiations) passed verification.
-enum CorInfoInstantiationVerification
-{
- // The method is NOT a concrete instantiation (eg. List<int>.Add()) of a method
- // in a generic class or a generic method. It is either the typical instantiation
- // (eg. List<T>.Add()) or entirely non-generic.
- INSTVER_NOT_INSTANTIATION = 0,
-
- // The method is an instantiation of a method in a generic class or a generic method,
- // and the generic class was successfully verified
- INSTVER_GENERIC_PASSED_VERIFICATION = 1,
-
- // The method is an instantiation of a method in a generic class or a generic method,
- // and the generic class failed verification
- INSTVER_GENERIC_FAILED_VERIFICATION = 2,
-};
-
// When using CORINFO_HELPER_TAILCALL, the JIT needs to pass certain special
// calling convention/argument passing/handling details to the helper
enum CorInfoHelperTailCallSpecialHandling
{
CORINFO_ACCESS_ALLOWED = 0, // Call allowed
CORINFO_ACCESS_ILLEGAL = 1, // Call not allowed
- CORINFO_ACCESS_RUNTIME_CHECK = 2, // Ask at runtime whether to allow the call or not
};
// JIT may either insert the callsiteCalloutHelper into the code (as per a verification error) or
// call throwExceptionFromHelper on the callsiteCalloutHelper. In this case callsiteCalloutHelper
// is guaranteed not to return.
- // - CORINFO_ACCESS_RUNTIME_CHECK - The jit must insert the callsiteCalloutHelper at the call site.
- // the helper may return
CorInfoIsAccessAllowedResult accessAllowed;
CORINFO_HELPER_DESC callsiteCalloutHelper;
// Wrapper delegate offsets
unsigned offsetOfWrapperDelegateIndirectCell;
- // Remoting offsets
- unsigned offsetOfTransparentProxyRP;
- unsigned offsetOfRealProxyServer;
-
- // Array offsets
- unsigned offsetOfObjArrayData;
-
// Reverse PInvoke offsets
unsigned sizeOfReversePInvokeFrame;
CORINFO_RUNTIME_ABI targetAbi;
CORINFO_OS osType;
- unsigned osMajor;
- unsigned osMinor;
- unsigned osBuild;
};
// This is used to indicate that a finally has been called
#define OFFSETOF__CORINFO_String__stringLen SIZEOF__CORINFO_Object
#define OFFSETOF__CORINFO_String__chars (OFFSETOF__CORINFO_String__stringLen + sizeof(unsigned __int32) /* stringLen */)
-enum CorInfoSecurityRuntimeChecks
-{
- CORINFO_ACCESS_SECURITY_NONE = 0,
- CORINFO_ACCESS_SECURITY_TRANSPARENCY = 0x0001 // check that transparency rules are enforced between the caller and callee
-};
-
/* data to optimize delegate construction */
struct DelegateCtorArgs
BOOL *pfIsOpenDelegate /* is the delegate open */
) = 0;
- // Indicates if the method is an instance of the generic
- // method that passes (or has passed) verification
- virtual CorInfoInstantiationVerification isInstantiationOfVerifiedGeneric (
- CORINFO_METHOD_HANDLE method /* IN */
- ) = 0;
-
- // Loads the constraints on a typical method definition, detecting cycles;
- // for use in verification.
- virtual void initConstraintsForVerification(
- CORINFO_METHOD_HANDLE method, /* IN */
- BOOL *pfHasCircularClassConstraints, /* OUT */
- BOOL *pfHasCircularMethodConstraint /* OUT */
- ) = 0;
-
- // Returns enum whether the method does not require verification
- // Also see ICorModuleInfo::canSkipVerification
- virtual CorInfoCanSkipVerificationResult canSkipMethodVerification (
- CORINFO_METHOD_HANDLE ftnHandle
- ) = 0;
-
// load and restore the method
virtual void methodMustBeLoadedBeforeCodeIsRun(
CORINFO_METHOD_HANDLE method
virtual CORINFO_CLASS_HANDLE getTokenTypeAsHandle (
CORINFO_RESOLVED_TOKEN * pResolvedToken /* IN */) = 0;
- // Returns true if the module does not require verification
- //
- // If fQuickCheckOnlyWithoutCommit=TRUE, the function only checks that the
- // module does not currently require verification in the current AppDomain.
- // This decision could change in the future, and so should not be cached.
- // If it is cached, it should only be used as a hint.
- // This is only used by ngen for calculating certain hints.
- //
-
- // Returns enum whether the module does not require verification
- // Also see ICorMethodInfo::canSkipMethodVerification();
- virtual CorInfoCanSkipVerificationResult canSkipVerification (
- CORINFO_MODULE_HANDLE module /* IN */
- ) = 0;
-
// Checks if the given metadata token is valid
virtual BOOL isValidToken (
CORINFO_MODULE_HANDLE module, /* IN */
int* length /* OUT */
) = 0;
- virtual BOOL shouldEnforceCallvirtRestriction(
- CORINFO_MODULE_HANDLE scope
- ) = 0;
-
/**********************************************************************************/
//
// ICorClassInfo
// GetTypeFromHandle(X) == GetTypeFromHandle(Y) (for CORINFO_INLINE_TYPECHECK_SOURCE_TOKEN)
virtual CorInfoInlineTypeCheck canInlineTypeCheck(CORINFO_CLASS_HANDLE cls, CorInfoInlineTypeCheckSource source) = 0;
- // If this method returns true, JIT will do optimization to inline the check for
- // GetTypeFromHandle(handle) == obj.GetType()
- virtual BOOL canInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE cls) = 0;
-
// return flags (a bitfield of CorInfoFlags values)
virtual DWORD getClassAttribs (
CORINFO_CLASS_HANDLE cls
CORINFO_CLASS_HANDLE clsHnd
) = 0;
- virtual CorInfoHelpFunc getSecurityPrologHelper(
- CORINFO_METHOD_HANDLE ftn
- ) = 0;
-
// This is not pretty. Boxing nullable<T> actually returns
// a boxed<T> not a boxed Nullable<T>. This call allows the verifier
// to call back to the EE on the 'box' instruction and get the transformed
CORINFO_FIELD_HANDLE field
) = 0;
- // TODO: jit64 should be switched to the same plan as the i386 jits - use
- // getClassGClayout to figure out the need for writebarrier helper, and inline the copying.
- // The interpretted value class copy is slow. Once this happens, USE_WRITE_BARRIER_HELPERS
- virtual bool isWriteBarrierHelperRequired(
- CORINFO_FIELD_HANDLE field) = 0;
-
virtual void getFieldInfo (CORINFO_RESOLVED_TOKEN * pResolvedToken,
CORINFO_METHOD_HANDLE callerHandle,
CORINFO_ACCESS_FLAGS flags,
// For eg, use this to allocated memory for reporting debug info,
// which will be handed to the EE by setVars() and setBoundaries()
virtual void * allocateArray(
- ULONG cBytes
+ size_t cBytes
) = 0;
// JitCompiler will free arrays passed by the EE using this
// CORINFO_LOOKUP_THISOBJ use vtable pointer of 'this' param
// CORINFO_LOOKUP_CLASSPARAM use vtable hidden param
// CORINFO_LOOKUP_METHODPARAM use enclosing type of method-desc hidden param
- virtual CORINFO_LOOKUP_KIND getLocationOfThisType(
- CORINFO_METHOD_HANDLE context
- ) = 0;
-
- // NOTE: the two methods below--getPInvokeUnmanagedTarget and getAddressOfPInvokeFixup--are
- // deprecated. New code should instead use getAddressOfPInvokeTarget, which subsumes the
- // functionality of these methods.
-
- // return the unmanaged target *if method has already been prelinked.*
- virtual void* getPInvokeUnmanagedTarget(
- CORINFO_METHOD_HANDLE method,
- void **ppIndirection = NULL
- ) = 0;
-
- // return address of fixup area for late-bound PInvoke calls.
- virtual void* getAddressOfPInvokeFixup(
- CORINFO_METHOD_HANDLE method,
- void **ppIndirection = NULL
+ virtual void getLocationOfThisType(
+ CORINFO_METHOD_HANDLE context,
+ CORINFO_LOOKUP_KIND* pLookupKind
) = 0;
// return the address of the PInvoke target. May be a fixup area in the
CORJIT_RECOVERABLEERROR = MAKE_HRESULT(SEVERITY_ERROR,FACILITY_NULL, 5),
};
-/*****************************************************************************
-Here is how CORJIT_FLAG_SKIP_VERIFICATION should be interepreted.
-Note that even if any method is inlined, it need not be verified.
-
-if (CORJIT_FLAG_SKIP_VERIFICATION is passed in to ICorJitCompiler::compileMethod())
-{
- No verification needs to be done.
- Just compile the method, generating unverifiable code if necessary
-}
-else
-{
- switch(ICorMethodInfo::isInstantiationOfVerifiedGeneric())
- {
- case INSTVER_NOT_INSTANTIATION:
-
- //
- // Non-generic case, or open generic instantiation
- //
-
- switch(canSkipMethodVerification())
- {
- case CORINFO_VERIFICATION_CANNOT_SKIP:
- {
- ICorMethodInfo::initConstraintsForVerification(&circularConstraints)
- if (circularConstraints)
- {
- Just emit code to call CORINFO_HELP_VERIFICATION
- The IL will not be compiled
- }
- else
- {
- Verify the method.
- if (unverifiable code is detected)
- {
- In place of branches with unverifiable code, emit code to call CORINFO_HELP_VERIFICATION
- Mark the method (and any of its instantiations) as unverifiable
- }
- Compile the rest of the verifiable code
- }
- }
-
- case CORINFO_VERIFICATION_CAN_SKIP:
- {
- No verification needs to be done.
- Just compile the method, generating unverifiable code if necessary
- }
-
- case CORINFO_VERIFICATION_RUNTIME_CHECK:
- {
- ICorMethodInfo::initConstraintsForVerification(&circularConstraints)
- if (circularConstraints)
- {
- Just emit code to call CORINFO_HELP_VERIFICATION
- The IL will not be compiled
-
- TODO: This could be changed to call CORINFO_HELP_VERIFICATION_RUNTIME_CHECK
- }
- else
- {
- Verify the method.
- if (unverifiable code is detected)
- {
- In the prolog, emit code to call CORINFO_HELP_VERIFICATION_RUNTIME_CHECK
- Mark the method (and any of its instantiations) as unverifiable
- }
- Compile the method, generating unverifiable code if necessary
- }
- }
- case CORINFO_VERIFICATION_DONT_JIT:
- {
- ICorMethodInfo::initConstraintsForVerification(&circularConstraints)
- if (circularConstraints)
- {
- Just emit code to call CORINFO_HELP_VERIFICATION
- The IL will not be compiled
- }
- else
- {
- Verify the method.
- if (unverifiable code is detected)
- {
- Fail the jit
- }
- }
- }
- }
-
- case INSTVER_GENERIC_PASSED_VERIFICATION:
- {
- This cannot ever happen because the VM would pass in CORJIT_FLAG_SKIP_VERIFICATION.
- }
-
- case INSTVER_GENERIC_FAILED_VERIFICATION:
-
- switch(canSkipMethodVerification())
- {
- case CORINFO_VERIFICATION_CANNOT_SKIP:
- {
- This cannot be supported because the compiler does not know which branches should call CORINFO_HELP_VERIFICATION.
- The CLR will throw a VerificationException instead of trying to compile this method
- }
-
- case CORINFO_VERIFICATION_CAN_SKIP:
- {
- This cannot ever happen because the CLR would pass in CORJIT_FLAG_SKIP_VERIFICATION.
- }
-
- case CORINFO_VERIFICATION_RUNTIME_CHECK:
- {
- No verification needs to be done.
- In the prolog, emit code to call CORINFO_HELP_VERIFICATION_RUNTIME_CHECK
- Compile the method, generating unverifiable code if necessary
- }
- case CORINFO_VERIFICATION_DONT_JIT:
- {
- Fail the jit
- }
- }
- }
-}
-
-*/
-
/*****************************************************************************/
// These are flags passed to ICorJitInfo::allocMem
// to guide the memory allocation for the code, readonly data, and read-write data
ULONG *nativeSizeOfCode /* OUT */
) = 0;
- // Some JIT compilers (most notably Phoenix), cache information about EE structures from one invocation
- // of the compiler to the next. This can be a problem when appdomains are unloaded, as some of this
- // cached information becomes stale. The code:ICorJitCompiler.isCacheCleanupRequired is called by the EE
- // early first to see if jit needs these notifications, and if so, the EE will call ClearCache is called
- // whenever the compiler should abandon its cache (eg on appdomain unload)
- virtual void clearCache() = 0;
- virtual BOOL isCacheCleanupRequired() = 0;
-
// Do any appropriate work at process shutdown. Default impl is to do nothing.
virtual void ProcessShutdownWork(ICorStaticInfo* info) {};
// 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).
virtual unsigned getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompileFlags) { return 0; }
-
- // 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,
- // and not to implement those methods itself. The JIT must not return this method when getJit()
- // is called. Instead, it must pass along all calls to this interface from within its own
- // ICorJitCompiler implementation. If 'realJitCompiler' is nullptr, then the JIT should resume
- // executing all the functions itself.
- virtual void setRealJit(ICorJitCompiler* realJitCompiler) { }
-
};
//------------------------------------------------------------------------------------------
class ICorJitInfo : public ICorDynamicInfo
{
public:
- // OBSOLETE: return memory manager that the JIT can use to allocate a regular memory
- virtual IEEMemoryManager* getMemoryManager() = 0;
-
// get a block of memory for the code, readonly data, and read-write data
virtual void allocMem (
ULONG hotCodeSize, /* IN */
size_t size /* IN */
) = 0;
- virtual void yieldExecution() = 0;
-
// Indicate how many exception handler blocks are to be returned.
// This is guaranteed to be called before any 'setEHinfo' call.
// Note that allocMem must be called before this method can be called.
virtual WORD getRelocTypeHint(void * target) = 0;
- // A callback to identify the range of address known to point to
- // compiler-generated native entry points that call back into
- // MSIL.
- virtual void getModuleNativeEntryPointRange(
- void ** pStart, /* OUT */
- void ** pEnd /* OUT */
- ) = 0;
-
// For what machine does the VM expect the JIT to generate code? The VM
// returns one of the IMAGE_FILE_MACHINE_* values. Note that if the VM
// is cross-compiling (such as the case for crossgen), it will return a
CORJIT_FLAG_SAMPLING_JIT_BACKGROUND = 35, // JIT is being invoked as a result of stack sampling for hot methods in the background
CORJIT_FLAG_USE_PINVOKE_HELPERS = 36, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions
CORJIT_FLAG_REVERSE_PINVOKE = 37, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog
- CORJIT_FLAG_DESKTOP_QUIRKS = 38, // The JIT should generate desktop-quirk-compatible code
+ // CORJIT_FLAG_UNUSED = 38,
CORJIT_FLAG_TIER0 = 39, // This is the initial tier for tiered compilation which should generate code as quickly as possible
CORJIT_FLAG_TIER1 = 40, // This is the final tier (for now) for tiered compilation which should generate high quality code
DWORD relOffsetOverride = NO_OVERRIDE_OFFSET) = 0;
#endif // !CROSSGEN_COMPILE
-#if !defined(DACCESS_COMPILE) && !defined(CROSSGEN_COMPILE)
-/*
- Return the address of the local security object reference
- (if available).
-*/
-virtual OBJECTREF* GetAddrOfSecurityObject(CrawlFrame *pCF) = 0;
-#endif // !DACCESS_COMPILE && !CROSSGEN_COMPILE
-
#ifndef CROSSGEN_COMPILE
/*
For a non-static method, "this" pointer is passed in as argument 0.
LPVOID hCallBack);
#endif // FEATURE_CONSERVATIVE_GC
-#ifdef TARGET_X86
-/*
- Return the address of the local security object reference
- using data that was previously cached before in UnwindStackFrame
- using StackwalkCacheUnwindInfo
-*/
-static OBJECTREF* GetAddrOfSecurityObjectFromCachedInfo(
- PREGDISPLAY pRD,
- StackwalkCacheUnwindInfo * stackwalkCacheUnwindInfo);
-#endif // TARGET_X86
-
-#if !defined(DACCESS_COMPILE) && !defined(CROSSGEN_COMPILE)
-virtual
-OBJECTREF* GetAddrOfSecurityObject(CrawlFrame *pCF) DAC_UNEXPECTED();
-#endif // !DACCESS_COMPILE && !CROSSGEN_COMPILE
-
#ifndef CROSSGEN_COMPILE
virtual
OBJECTREF GetInstance(
JITHELPER(CORINFO_HELP_DBLROUND, JIT_DoubleRound, CORINFO_HELP_SIG_16_STACK)
// Allocating a new object
- JITHELPER(CORINFO_HELP_NEW_CROSSCONTEXT, NULL, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)
JITHELPER(CORINFO_HELP_NEWFAST, JIT_New, CORINFO_HELP_SIG_REG_ONLY)
DYNAMICJITHELPER(CORINFO_HELP_NEWSFAST, JIT_New, CORINFO_HELP_SIG_REG_ONLY)
JITHELPER(CORINFO_HELP_NEWSFAST_FINALIZE, NULL, CORINFO_HELP_SIG_REG_ONLY)
JITHELPER(CORINFO_HELP_GETCLASSFROMMETHODPARAM, JIT_GetClassFromMethodParam, CORINFO_HELP_SIG_REG_ONLY)
JITHELPER(CORINFO_HELP_GETSYNCFROMCLASSHANDLE, JIT_GetSyncFromClassHandle, CORINFO_HELP_SIG_REG_ONLY)
- // Security callout support
- JITHELPER(CORINFO_HELP_SECURITY_PROLOG, NULL,CORINFO_HELP_SIG_REG_ONLY)
- JITHELPER(CORINFO_HELP_SECURITY_PROLOG_FRAMED, NULL,CORINFO_HELP_SIG_REG_ONLY)
-
- JITHELPER(CORINFO_HELP_METHOD_ACCESS_CHECK, NULL,CORINFO_HELP_SIG_8_STACK)
- JITHELPER(CORINFO_HELP_FIELD_ACCESS_CHECK, NULL,CORINFO_HELP_SIG_4_STACK)
- JITHELPER(CORINFO_HELP_CLASS_ACCESS_CHECK, NULL,CORINFO_HELP_SIG_4_STACK)
-
- JITHELPER(CORINFO_HELP_DELEGATE_SECURITY_CHECK, NULL,CORINFO_HELP_SIG_REG_ONLY)
-
- JITHELPER(CORINFO_HELP_VERIFICATION_RUNTIME_CHECK, NULL,CORINFO_HELP_SIG_REG_ONLY)
-
// GC support
DYNAMICJITHELPER(CORINFO_HELP_STOP_FOR_GC, JIT_RareDisableHelper, CORINFO_HELP_SIG_REG_ONLY)
#ifdef ENABLE_FAST_GCPOLL_HELPER
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
DEF_CLR_API(pInvokeMarshalingRequired)
DEF_CLR_API(satisfiesMethodConstraints)
DEF_CLR_API(isCompatibleDelegate)
-DEF_CLR_API(isInstantiationOfVerifiedGeneric)
-DEF_CLR_API(initConstraintsForVerification)
-DEF_CLR_API(canSkipMethodVerification)
DEF_CLR_API(methodMustBeLoadedBeforeCodeIsRun)
DEF_CLR_API(mapMethodDeclToMethodImpl)
DEF_CLR_API(getGSCookie)
DEF_CLR_API(findSig)
DEF_CLR_API(findCallSiteSig)
DEF_CLR_API(getTokenTypeAsHandle)
-DEF_CLR_API(canSkipVerification)
DEF_CLR_API(isValidToken)
DEF_CLR_API(isValidStringRef)
DEF_CLR_API(getStringLiteral)
-DEF_CLR_API(shouldEnforceCallvirtRestriction)
DEF_CLR_API(asCorInfoType)
DEF_CLR_API(getClassName)
DEF_CLR_API(getClassNameFromMetadata)
DEF_CLR_API(appendClassName)
DEF_CLR_API(isValueClass)
DEF_CLR_API(canInlineTypeCheck)
-DEF_CLR_API(canInlineTypeCheckWithObjectVTable)
DEF_CLR_API(getClassAttribs)
DEF_CLR_API(isStructRequiringStackAllocRetBuf)
DEF_CLR_API(getClassModule)
DEF_CLR_API(getNewArrHelper)
DEF_CLR_API(getCastingHelper)
DEF_CLR_API(getSharedCCtorHelper)
-DEF_CLR_API(getSecurityPrologHelper)
DEF_CLR_API(getTypeForBox)
DEF_CLR_API(getBoxHelper)
DEF_CLR_API(getUnBoxHelper)
DEF_CLR_API(getFieldClass)
DEF_CLR_API(getFieldType)
DEF_CLR_API(getFieldOffset)
-DEF_CLR_API(isWriteBarrierHelperRequired)
DEF_CLR_API(getFieldInfo)
DEF_CLR_API(isFieldStatic)
DEF_CLR_API(getBoundaries)
DEF_CLR_API(embedFieldHandle)
DEF_CLR_API(embedGenericHandle)
DEF_CLR_API(getLocationOfThisType)
-DEF_CLR_API(getPInvokeUnmanagedTarget)
-DEF_CLR_API(getAddressOfPInvokeFixup)
DEF_CLR_API(getAddressOfPInvokeTarget)
DEF_CLR_API(GetCookieForPInvokeCalliSig)
DEF_CLR_API(canGetCookieForPInvokeCalliSig)
DEF_CLR_API(recordCallSite)
DEF_CLR_API(recordRelocation)
DEF_CLR_API(getRelocTypeHint)
-DEF_CLR_API(getModuleNativeEntryPointRange)
DEF_CLR_API(getExpectedTargetArchitecture)
DEF_CLR_API(getJitFlags)
return temp;
}
-CorInfoInstantiationVerification WrapICorJitInfo::isInstantiationOfVerifiedGeneric(
- CORINFO_METHOD_HANDLE method /* IN */)
-{
- API_ENTER(isInstantiationOfVerifiedGeneric);
- CorInfoInstantiationVerification temp = wrapHnd->isInstantiationOfVerifiedGeneric(method);
- API_LEAVE(isInstantiationOfVerifiedGeneric);
- return temp;
-}
-
-void WrapICorJitInfo::initConstraintsForVerification(
- CORINFO_METHOD_HANDLE method, /* IN */
- BOOL *pfHasCircularClassConstraints, /* OUT */
- BOOL *pfHasCircularMethodConstraint /* OUT */)
-{
- API_ENTER(initConstraintsForVerification);
- wrapHnd->initConstraintsForVerification(method, pfHasCircularClassConstraints, pfHasCircularMethodConstraint);
- API_LEAVE(initConstraintsForVerification);
-}
-
-CorInfoCanSkipVerificationResult WrapICorJitInfo::canSkipMethodVerification(
- CORINFO_METHOD_HANDLE ftnHandle)
-{
- API_ENTER(canSkipMethodVerification);
- CorInfoCanSkipVerificationResult temp = wrapHnd->canSkipMethodVerification(ftnHandle);
- API_LEAVE(canSkipMethodVerification);
- return temp;
-}
-
void WrapICorJitInfo::methodMustBeLoadedBeforeCodeIsRun(
CORINFO_METHOD_HANDLE method)
{
return temp;
}
-CorInfoCanSkipVerificationResult WrapICorJitInfo::canSkipVerification(
- CORINFO_MODULE_HANDLE module /* IN */)
-{
- API_ENTER(canSkipVerification);
- CorInfoCanSkipVerificationResult temp = wrapHnd->canSkipVerification(module);
- API_LEAVE(canSkipVerification);
- return temp;
-}
-
BOOL WrapICorJitInfo::isValidToken(
CORINFO_MODULE_HANDLE module, /* IN */
unsigned metaTOK /* IN */)
return temp;
}
-BOOL WrapICorJitInfo::shouldEnforceCallvirtRestriction(
- CORINFO_MODULE_HANDLE scope)
-{
- API_ENTER(shouldEnforceCallvirtRestriction);
- BOOL temp = wrapHnd->shouldEnforceCallvirtRestriction(scope);
- API_LEAVE(shouldEnforceCallvirtRestriction);
- return temp;
-}
-
/**********************************************************************************/
//
// ICorClassInfo
return temp;
}
-BOOL WrapICorJitInfo::canInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE cls)
-{
- API_ENTER(canInlineTypeCheckWithObjectVTable);
- BOOL temp = wrapHnd->canInlineTypeCheckWithObjectVTable(cls);
- API_LEAVE(canInlineTypeCheckWithObjectVTable);
- return temp;
-}
-
DWORD WrapICorJitInfo::getClassAttribs(
CORINFO_CLASS_HANDLE cls)
{
return temp;
}
-CorInfoHelpFunc WrapICorJitInfo::getSecurityPrologHelper(
- CORINFO_METHOD_HANDLE ftn)
-{
- API_ENTER(getSecurityPrologHelper);
- CorInfoHelpFunc temp = wrapHnd->getSecurityPrologHelper(ftn);
- API_LEAVE(getSecurityPrologHelper);
- return temp;
-}
-
CORINFO_CLASS_HANDLE WrapICorJitInfo::getTypeForBox(
CORINFO_CLASS_HANDLE cls)
{
return temp;
}
-bool WrapICorJitInfo::isWriteBarrierHelperRequired(
- CORINFO_FIELD_HANDLE field)
-{
- API_ENTER(isWriteBarrierHelperRequired);
- bool result = wrapHnd->isWriteBarrierHelperRequired(field);
- API_LEAVE(isWriteBarrierHelperRequired);
- return result;
-}
-
void WrapICorJitInfo::getFieldInfo(CORINFO_RESOLVED_TOKEN * pResolvedToken,
CORINFO_METHOD_HANDLE callerHandle,
CORINFO_ACCESS_FLAGS flags,
}
void * WrapICorJitInfo::allocateArray(
- ULONG cBytes)
+ size_t cBytes)
{
API_ENTER(allocateArray);
void *temp = wrapHnd->allocateArray(cBytes);
API_LEAVE(embedGenericHandle);
}
-CORINFO_LOOKUP_KIND WrapICorJitInfo::getLocationOfThisType(
- CORINFO_METHOD_HANDLE context)
+void WrapICorJitInfo::getLocationOfThisType(
+ CORINFO_METHOD_HANDLE context,
+ CORINFO_LOOKUP_KIND * pLookupKind)
{
API_ENTER(getLocationOfThisType);
- CORINFO_LOOKUP_KIND temp = wrapHnd->getLocationOfThisType(context);
+ wrapHnd->getLocationOfThisType(context, pLookupKind);
API_LEAVE(getLocationOfThisType);
- return temp;
-}
-
-void* WrapICorJitInfo::getPInvokeUnmanagedTarget(
- CORINFO_METHOD_HANDLE method,
- void **ppIndirection)
-{
- API_ENTER(getPInvokeUnmanagedTarget);
- void *result = wrapHnd->getPInvokeUnmanagedTarget(method, ppIndirection);
- API_LEAVE(getPInvokeUnmanagedTarget);
- return result;
-}
-
-void* WrapICorJitInfo::getAddressOfPInvokeFixup(
- CORINFO_METHOD_HANDLE method,
- void **ppIndirection)
-{
- API_ENTER(getAddressOfPInvokeFixup);
- void *temp = wrapHnd->getAddressOfPInvokeFixup(method, ppIndirection);
- API_LEAVE(getAddressOfPInvokeFixup);
- return temp;
}
void WrapICorJitInfo::getAddressOfPInvokeTarget(
//
/*********************************************************************************/
-IEEMemoryManager* WrapICorJitInfo::getMemoryManager()
-{
- API_ENTER(getMemoryManager);
- IEEMemoryManager * temp = wrapHnd->getMemoryManager();
- API_LEAVE(getMemoryManager);
- return temp;
-}
-
void WrapICorJitInfo::allocMem(
ULONG hotCodeSize, /* IN */
ULONG coldCodeSize, /* IN */
return temp;
}
-void WrapICorJitInfo::yieldExecution()
-{
- API_ENTER(yieldExecution); //Nothing to record
- wrapHnd->yieldExecution();
- API_LEAVE(yieldExecution); //Nothing to recor)
-}
-
void WrapICorJitInfo::setEHcount(unsigned cEH /* IN */)
{
API_ENTER(setEHcount);
return result;
}
-void WrapICorJitInfo::getModuleNativeEntryPointRange(
- void **pStart, /* OUT */
- void **pEnd /* OUT */)
-{
- API_ENTER(getModuleNativeEntryPointRange);
- wrapHnd->getModuleNativeEntryPointRange(pStart, pEnd);
- API_LEAVE(getModuleNativeEntryPointRange);
-}
-
DWORD WrapICorJitInfo::getExpectedTargetArchitecture()
{
API_ENTER(getExpectedTargetArchitecture);
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
genReportGenericContextArg(initReg, &initRegZeroed);
- // The local variable representing the security object must be on the stack frame
- // and must be 0 initialized.
- noway_assert((compiler->lvaSecurityObject == BAD_VAR_NUM) ||
- (compiler->lvaTable[compiler->lvaSecurityObject].lvOnFrame &&
- compiler->lvaTable[compiler->lvaSecurityObject].lvMustInit));
-
#ifdef JIT32_GCENCODER
// Initialize the LocalAllocSP slot if there is localloc in the function.
if (compiler->lvaLocAllocSPvar != BAD_VAR_NUM)
#ifdef TARGET_XARCH
opts.compSupportsISA = 0;
-#ifdef FEATURE_CORECLR
if (JitConfig.EnableHWIntrinsic())
{
// Dummy ISAs for simplifying the JIT code
opts.setSupportedISA(InstructionSet_BMI2_X64);
#endif // TARGET_AMD64
}
-#else // !FEATURE_CORECLR
- if (!jitFlags.IsSet(JitFlags::JIT_FLAG_PREJIT))
- {
- // If this is not FEATURE_CORECLR, the only flags supported by the VM are AVX and AVX2.
- // Furthermore, the only two configurations supported by the desktop JIT are SSE2 and AVX2,
- // so if the latter is set, we also check all the in-between options.
- // Note that the EnableSSE2 and EnableSSE flags are only checked by HW Intrinsic code,
- // so the System.Numerics.Vector support doesn't depend on those flags.
- // However, if any of these are disabled, we will not enable AVX2.
- //
- if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_AVX) && jitFlags.IsSet(JitFlags::JIT_FLAG_USE_AVX2) &&
- (JitConfig.EnableAVX2() != 0) && (JitConfig.EnableAVX() != 0) && (JitConfig.EnableSSE42() != 0) &&
- (JitConfig.EnableSSE41() != 0) && (JitConfig.EnableSSSE3() != 0) && (JitConfig.EnableSSE3() != 0) &&
- (JitConfig.EnableSSE2() != 0) && (JitConfig.EnableSSE() != 0) && (JitConfig.EnableSSE3_4() != 0))
- {
- opts.setSupportedISA(InstructionSet_SSE);
- opts.setSupportedISA(InstructionSet_SSE2);
- opts.setSupportedISA(InstructionSet_SSE3);
- opts.setSupportedISA(InstructionSet_SSSE3);
- opts.setSupportedISA(InstructionSet_SSE41);
- opts.setSupportedISA(InstructionSet_SSE42);
- opts.setSupportedISA(InstructionSet_AVX);
- opts.setSupportedISA(InstructionSet_AVX2);
- }
- }
-#endif // !FEATURE_CORECLR
if (!compIsForInlining())
{
#endif // PROFILING_SUPPORTED
-bool Compiler::compIsFullTrust()
-{
- return (info.compCompHnd->canSkipMethodVerification(info.compMethodHnd) == CORINFO_VERIFICATION_CAN_SKIP);
-}
-
bool Compiler::compShouldThrowOnNoway(
#ifdef FEATURE_TRACELOGGING
const char* filename, unsigned line
// In min opts, we don't want the noway assert to go through the exception
// path. Instead we want it to just silently go through codegen for
// compat reasons.
- // If we are not in full trust, we should always fire for security.
- return !opts.MinOpts() || !compIsFullTrust();
+ return !opts.MinOpts();
}
// ConfigInteger does not offer an option for decimal flags. Any numbers are interpreted as hex.
assert(!jitFlags->IsSet(JitFlags::JIT_FLAG_PROF_ENTERLEAVE));
assert(!jitFlags->IsSet(JitFlags::JIT_FLAG_DEBUG_EnC));
assert(!jitFlags->IsSet(JitFlags::JIT_FLAG_DEBUG_INFO));
-
- assert(jitFlags->IsSet(JitFlags::JIT_FLAG_SKIP_VERIFICATION));
}
opts.jitFlags = jitFlags;
opts.dspDiffable = compIsForInlining() ? impInlineInfo->InlinerCompiler->opts.dspDiffable : false;
#endif
- opts.compNeedSecurityCheck = false;
- opts.altJit = false;
+ opts.altJit = false;
#if defined(LATE_DISASM) && !defined(DEBUG)
// For non-debug builds with the late disassembler built in, we currently always do late disassembly
}
}
- info.compUnwrapContextful = opts.OptimizationEnabled();
-
fgCanRelocateEHRegions = true;
}
{
codeGen->setFramePointerRequired(true);
- // Since we need a slots for security near ebp, its not possible
- // to do this after an Edit without shifting all the locals.
- // So we just always reserve space for these slots in case an Edit adds them
- opts.compNeedSecurityCheck = true;
-
// We don't care about localloc right now. If we do support it,
// EECodeManager::FixContextForEnC() needs to handle it smartly
// in case the localloc was actually executed.
// Set this before the first 'BADCODE'
// Skip verification where possible
- tiVerificationNeeded = !compileFlags->IsSet(JitFlags::JIT_FLAG_SKIP_VERIFICATION);
+ //.tiVerificationNeeded = !compileFlags->IsSet(JitFlags::JIT_FLAG_SKIP_VERIFICATION);
+ assert(compileFlags->IsSet(JitFlags::JIT_FLAG_SKIP_VERIFICATION));
assert(!compIsForInlining() || !tiVerificationNeeded); // Inlinees must have been verified.
- // assume the code is verifiable unless proven otherwise
- tiIsVerifiableCode = TRUE;
-
- tiRuntimeCalloutNeeded = false;
-
- CorInfoInstantiationVerification instVerInfo = INSTVER_GENERIC_PASSED_VERIFICATION;
-
- if (!compIsForInlining() && tiVerificationNeeded)
- {
- instVerInfo = compHnd->isInstantiationOfVerifiedGeneric(methodHnd);
-
- if (tiVerificationNeeded && (instVerInfo == INSTVER_GENERIC_FAILED_VERIFICATION))
- {
- CorInfoCanSkipVerificationResult canSkipVerificationResult =
- info.compCompHnd->canSkipMethodVerification(info.compMethodHnd);
-
- switch (canSkipVerificationResult)
- {
- case CORINFO_VERIFICATION_CANNOT_SKIP:
- // We cannot verify concrete instantiation.
- // We can only verify the typical/open instantiation
- // The VM should throw a VerificationException instead of allowing this.
- NO_WAY("Verification of closed instantiations is not supported");
- break;
-
- case CORINFO_VERIFICATION_CAN_SKIP:
- // The VM should first verify the open instantiation. If unverifiable code
- // is detected, it should pass in JitFlags::JIT_FLAG_SKIP_VERIFICATION.
- assert(!"The VM should have used JitFlags::JIT_FLAG_SKIP_VERIFICATION");
- tiVerificationNeeded = false;
- break;
-
- case CORINFO_VERIFICATION_RUNTIME_CHECK:
- // This is a concrete generic instantiation with unverifiable code, that also
- // needs a runtime callout.
- tiVerificationNeeded = false;
- tiRuntimeCalloutNeeded = true;
- break;
-
- case CORINFO_VERIFICATION_DONT_JIT:
- // We cannot verify concrete instantiation.
- // We can only verify the typical/open instantiation
- // The VM should throw a VerificationException instead of allowing this.
- BADCODE("NGEN of unverifiable transparent code is not supported");
- break;
- }
- }
-
- // load any constraints for verification, noting any cycles to be rejected by the verifying importer
- if (tiVerificationNeeded)
- {
- compHnd->initConstraintsForVerification(methodHnd, &info.hasCircularClassConstraints,
- &info.hasCircularMethodConstraints);
- }
- }
-
/* Setup an error trap */
struct Param
ULONG* methodCodeSize;
JitFlags* compileFlags;
- CorInfoInstantiationVerification instVerInfo;
- int result;
+ int result;
} param;
param.pThis = this;
param.classPtr = classPtr;
param.methodCodePtr = methodCodePtr;
param.methodCodeSize = methodCodeSize;
param.compileFlags = compileFlags;
- param.instVerInfo = instVerInfo;
param.result = CORJIT_INTERNALERROR;
setErrorTrap(compHnd, Param*, pParam, ¶m) // ERROR TRAP: Start normal block
{
- pParam->result = pParam->pThis->compCompileHelper(pParam->classPtr, pParam->compHnd, pParam->methodInfo,
- pParam->methodCodePtr, pParam->methodCodeSize,
- pParam->compileFlags, pParam->instVerInfo);
+ pParam->result =
+ pParam->pThis->compCompileHelper(pParam->classPtr, pParam->compHnd, pParam->methodInfo,
+ pParam->methodCodePtr, pParam->methodCodeSize, pParam->compileFlags);
}
finallyErrorTrap() // ERROR TRAP: The following block handles errors
{
#endif
}
-int Compiler::compCompileHelper(CORINFO_MODULE_HANDLE classPtr,
- COMP_HANDLE compHnd,
- CORINFO_METHOD_INFO* methodInfo,
- void** methodCodePtr,
- ULONG* methodCodeSize,
- JitFlags* compileFlags,
- CorInfoInstantiationVerification instVerInfo)
+int Compiler::compCompileHelper(CORINFO_MODULE_HANDLE classPtr,
+ COMP_HANDLE compHnd,
+ CORINFO_METHOD_INFO* methodInfo,
+ void** methodCodePtr,
+ ULONG* methodCodeSize,
+ JitFlags* compileFlags)
{
CORINFO_METHOD_HANDLE methodHnd = info.compMethodHnd;
eeGetMethodFullName(info.compMethodHnd), dspPtr(impTokenLookupContextHandle)));
}
- // Force verification if asked to do so
- if (JitConfig.JitForceVer())
- {
- tiVerificationNeeded = (instVerInfo == INSTVER_NOT_INSTANTIATION);
- }
-
if (tiVerificationNeeded)
{
JITLOG((LL_INFO10000, "tiVerificationNeeded initially set to true for %s\n", info.compFullName));
impCanReimport = (tiVerificationNeeded || compStressCompile(STRESS_CHK_REIMPORT, 15));
- // Need security prolog/epilog callouts when there is a declarative security in the method.
- tiSecurityCalloutNeeded = ((info.compFlags & CORINFO_FLG_NOSECURITYWRAP) == 0);
-
- if (tiSecurityCalloutNeeded || (info.compFlags & CORINFO_FLG_SECURITYCHECK))
- {
- // We need to allocate the security object on the stack
- // when the method being compiled has a declarative security
- // (i.e. when CORINFO_FLG_NOSECURITYWRAP is reset for the current method).
- // This is also the case when we inject a prolog and epilog in the method.
- opts.compNeedSecurityCheck = true;
- }
-
/* Initialize set a bunch of global values */
info.compScopeHnd = classPtr;
info.compIsStatic = (info.compFlags & CORINFO_FLG_STATIC) != 0;
- info.compIsContextful = (info.compClassAttr & CORINFO_FLG_CONTEXTFUL) != 0;
-
info.compPublishStubParam = opts.jitFlags->IsSet(JitFlags::JIT_FLAG_PUBLISH_SECRET_PARAM);
switch (methodInfo->args.getCallConv())
goto _Next;
}
-#ifdef FEATURE_CORECLR
if (compHasBackwardJump && (info.compFlags & CORINFO_FLG_DISABLE_TIER0_FOR_LOOPS) != 0 && fgCanSwitchToOptimized())
-#else // !FEATURE_CORECLR
- // We may want to use JitConfig value here to support DISABLE_TIER0_FOR_LOOPS
- if (compHasBackwardJump && fgCanSwitchToOptimized())
-#endif
{
// Method likely has a loop, switch to the OptimizedTier to avoid spending too much time running slower code
fgSwitchToOptimized();
};
// A JitTimer encapsulates a CompTimeInfo for a single compilation. It also tracks the start of compilation,
-// and when the current phase started. This is intended to be part of a Compilation object. This is
-// disabled (FEATURE_JIT_METHOD_PERF not defined) when FEATURE_CORECLR is set, or on non-windows platforms.
+// and when the current phase started. This is intended to be part of a Compilation object.
//
class JitTimer
{
return lvaTable[lclNum].lvInSsa;
}
- unsigned lvaSecurityObject; // variable representing the security object on the stack
unsigned lvaStubArgumentVar; // variable representing the secret stub argument coming in EAX
#if defined(FEATURE_EH_FUNCLETS)
var_types calleeRetType,
CORINFO_CLASS_HANDLE calleeRetTypeClass);
- bool impIsTailCallILPattern(bool tailPrefixed,
- OPCODE curOpcode,
- const BYTE* codeAddrOfNextOpcode,
- const BYTE* codeEnd,
- bool isRecursive,
- bool* IsCallPopRet = nullptr);
+ bool impIsTailCallILPattern(
+ bool tailPrefixed, OPCODE curOpcode, const BYTE* codeAddrOfNextOpcode, const BYTE* codeEnd, bool isRecursive);
bool impIsImplicitTailCallCandidate(
OPCODE curOpcode, const BYTE* codeAddrOfNextOpcode, const BYTE* codeEnd, int prefixFlags, bool isRecursive);
#endif // FEATURE_SIMD
GenTree* fgMorphArrayIndex(GenTree* tree);
GenTree* fgMorphCast(GenTree* tree);
- GenTree* fgUnwrapProxy(GenTree* objRef);
GenTreeFieldList* fgMorphLclArgToFieldlist(GenTreeLclVarCommon* lcl);
void fgInitArgInfo(GenTreeCall* call);
GenTreeCall* fgMorphArgs(GenTreeCall* call);
return jitFlags->IsSet(JitFlags::JIT_FLAG_REVERSE_PINVOKE);
}
- // true if we must generate code compatible with JIT32 quirks
- bool IsJit32Compat()
- {
-#if defined(TARGET_X86)
- return jitFlags->IsSet(JitFlags::JIT_FLAG_DESKTOP_QUIRKS);
-#else
- return false;
-#endif
- }
-
- // true if we must generate code compatible with Jit64 quirks
- bool IsJit64Compat()
- {
-#if defined(TARGET_AMD64)
- return jitFlags->IsSet(JitFlags::JIT_FLAG_DESKTOP_QUIRKS);
-#elif !defined(FEATURE_CORECLR)
- return true;
-#else
- return false;
-#endif
- }
-
bool compScopeInfo; // Generate the LocalVar info ?
bool compDbgCode; // Generate debugger-friendly code?
bool compDbgInfo; // Gather debugging info?
#endif // defined(DEBUG) && defined(TARGET_X86)
- bool compNeedSecurityCheck; // This flag really means where or not a security object needs
- // to be allocated on the stack.
- // It will be set to true in the following cases:
- // 1. When the method being compiled has a declarative security
- // (i.e. when CORINFO_FLG_NOSECURITYWRAP is reset for the current method).
- // This is also the case when we inject a prolog and epilog in the method.
- // (or)
- // 2. When the method being compiled has imperative security (i.e. the method
- // calls into another method that has CORINFO_FLG_SECURITYCHECK flag set).
- // (or)
- // 3. When opts.compDbgEnC is true. (See also Compiler::compCompile).
- //
- // When this flag is set, jit will allocate a gc-reference local variable (lvaSecurityObject),
- // which gets reported as a GC root to stackwalker.
- // (See also ICodeManager::GetAddrOfSecurityObject.)
-
bool compReloc; // Generate relocs for pointers in code, true for all ngen/prejit codegen
#ifdef DEBUG
bool compIsStatic : 1; // Is the method static (no 'this' pointer)?
bool compIsVarArgs : 1; // Does the method have varargs parameters?
- bool compIsContextful : 1; // contextful method
bool compInitMem : 1; // Is the CORINFO_OPT_INIT_LOCALS bit set in the method info options?
- bool compUnwrapContextful : 1; // JIT should unwrap proxies when possible
bool compProfilerCallback : 1; // JIT inserted a profiler Enter callback
bool compPublishStubParam : 1; // EAX captured in prolog will be available through an instrinsic
bool compRetBuffDefStack : 1; // The ret buff argument definitely points into the stack.
ULONG* methodCodeSize,
JitFlags* compileFlags);
void compCompileFinish();
- int compCompileHelper(CORINFO_MODULE_HANDLE classPtr,
- COMP_HANDLE compHnd,
- CORINFO_METHOD_INFO* methodInfo,
- void** methodCodePtr,
- ULONG* methodCodeSize,
- JitFlags* compileFlags,
- CorInfoInstantiationVerification instVerInfo);
+ int compCompileHelper(CORINFO_MODULE_HANDLE classPtr,
+ COMP_HANDLE compHnd,
+ CORINFO_METHOD_INFO* methodInfo,
+ void** methodCodePtr,
+ ULONG* methodCodeSize,
+ JitFlags* compileFlag);
ArenaAllocator* compGetArenaAllocator();
public:
// Set to TRUE if verification cannot be skipped for this method
- // If we detect unverifiable code, we will lazily check
- // canSkipMethodVerification() to see if verification is REALLY needed.
- BOOL tiVerificationNeeded;
-
- // It it initially TRUE, and it gets set to FALSE if we run into unverifiable code
- // Note that this is valid only if tiVerificationNeeded was ever TRUE.
- BOOL tiIsVerifiableCode;
-
- // Set to TRUE if runtime callout is needed for this method
- BOOL tiRuntimeCalloutNeeded;
-
- // Set to TRUE if security prolog/epilog callout is needed for this method
- // Note: This flag is different than compNeedSecurityCheck.
- // compNeedSecurityCheck means whether or not a security object needs
- // to be allocated on the stack, which is currently true for EnC as well.
- // tiSecurityCalloutNeeded means whether or not security callouts need
- // to be inserted in the jitted code.
- BOOL tiSecurityCalloutNeeded;
+ // CoreCLR does not ever run IL verification. Compile out the verifier from the JIT by making this a constant.
+ // TODO: Delete the verifier from the JIT? (https://github.com/dotnet/runtime/issues/32648)
+ // BOOL tiVerificationNeeded;
+ static const BOOL tiVerificationNeeded = FALSE;
// Returns TRUE if child is equal to or a subtype of parent for merge purposes
// This support is necessary to suport attributes that are not described in
typeInfo verGetArrayElemType(const typeInfo& ti);
typeInfo verParseArgSigToTypeInfo(CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_HANDLE args);
- BOOL verNeedsVerification();
BOOL verIsByRefLike(const typeInfo& ti);
BOOL verIsSafeToReturnByRef(const typeInfo& ti);
Compiler* prevCompiler; // Previous compiler on stack for TLS Compiler* linked list for reentrant compilers.
- // Is the compilation in a full trust context?
- bool compIsFullTrust();
-
#if MEASURE_NOWAY
void RecordNowayAssert(const char* filename, unsigned line, const char* condStr);
#endif // MEASURE_NOWAY
return JitConfig.JitStress();
}
-/*****************************************************************************
- * Should we do the strict check for non-virtual call to the virtual method?
- */
-
-inline DWORD StrictCheckForNonVirtualCallToVirtualMethod()
-{
- return JitConfig.JitStrictCheckForNonVirtualCallToVirtualMethod() == 1;
-}
-
#endif // DEBUG
/*****************************************************************************/
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
return (g_hInst);
}
-#ifndef FEATURE_CORECLR
-extern "C" DLLEXPORT void __stdcall sxsJitStartup(CoreClrCallbacks const& cccallbacks)
-{
-#ifndef SELF_NO_HOST
- InitUtilcode(cccallbacks);
-#endif
-}
-#endif // FEATURE_CORECLR
-
#endif // !FEATURE_MERGE_JIT_AND_ENGINE
/*****************************************************************************/
return CILJitBuff;
}
-ICorJitCompiler* g_realJitCompiler = nullptr;
-
DLLEXPORT ICorJitCompiler* __stdcall getJit()
{
if (!g_jitInitialized)
CorJitResult CILJit::compileMethod(
ICorJitInfo* compHnd, CORINFO_METHOD_INFO* methodInfo, unsigned flags, BYTE** entryAddress, ULONG* nativeSizeOfCode)
{
- if (g_realJitCompiler != nullptr)
- {
- return g_realJitCompiler->compileMethod(compHnd, methodInfo, flags, entryAddress, nativeSizeOfCode);
- }
-
JitFlags jitFlags;
assert(flags == CORJIT_FLAGS::CORJIT_FLAG_CALL_GETJITFLAGS);
return CorJitResult(result);
}
-/*****************************************************************************
- * Notification from VM to clear any caches
- */
-void CILJit::clearCache(void)
-{
- if (g_realJitCompiler != nullptr)
- {
- g_realJitCompiler->clearCache();
- // Continue...
- }
-
- return;
-}
-
-/*****************************************************************************
- * Notify vm that we have something to clean up
- */
-BOOL CILJit::isCacheCleanupRequired(void)
-{
- if (g_realJitCompiler != nullptr)
- {
- if (g_realJitCompiler->isCacheCleanupRequired())
- {
- return TRUE;
- }
- // Continue...
- }
-
- return FALSE;
-}
-
void CILJit::ProcessShutdownWork(ICorStaticInfo* statInfo)
{
- if (g_realJitCompiler != nullptr)
- {
- g_realJitCompiler->ProcessShutdownWork(statInfo);
- // Continue, by shutting down this JIT as well.
- }
-
jitShutdown(false);
Compiler::ProcessShutdownWork(statInfo);
*/
void CILJit::getVersionIdentifier(GUID* versionIdentifier)
{
- if (g_realJitCompiler != nullptr)
- {
- g_realJitCompiler->getVersionIdentifier(versionIdentifier);
- return;
- }
-
assert(versionIdentifier != nullptr);
memcpy(versionIdentifier, &JITEEVersionIdentifier, sizeof(GUID));
}
unsigned CILJit::getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompileFlags)
{
- if (g_realJitCompiler != nullptr)
- {
- return g_realJitCompiler->getMaxIntrinsicSIMDVectorLength(cpuCompileFlags);
- }
-
JitFlags jitFlags;
jitFlags.SetFromFlags(cpuCompileFlags);
#endif // !FEATURE_SIMD
}
-void CILJit::setRealJit(ICorJitCompiler* realJitCompiler)
-{
- g_realJitCompiler = realJitCompiler;
-}
-
/*****************************************************************************
* Returns the number of bytes required for the given type argument
*/
unsigned Compiler::eeGetArrayDataOffset(var_types type)
{
- return varTypeIsGC(type) ? eeGetEEInfo()->offsetOfObjArrayData : OFFSETOF__CORINFO_Array__data;
+ return OFFSETOF__CORINFO_Array__data;
}
//------------------------------------------------------------------------
ULONG* nativeSizeOfCode /* OUT */
);
- void clearCache(void);
- BOOL isCacheCleanupRequired(void);
-
void ProcessShutdownWork(ICorStaticInfo* statInfo);
void getVersionIdentifier(GUID* versionIdentifier /* OUT */
);
unsigned getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompileFlags);
-
- void setRealJit(ICorJitCompiler* realJitCompiler);
};
/*****************************************************************************
}
break;
-#if !defined(FEATURE_CORECLR)
- case CEE_CALLI:
-
- // CEE_CALLI should not be inlined if the call indirect target has a calling convention other than
- // CORINFO_CALLCONV_DEFAULT. In the case where we have a no-marshal CALLI P/Invoke we end up calling
- // the IL stub. We don't NGEN these stubs, so we'll have to JIT an IL stub for a trivial func.
- // It's almost certainly a better choice to leave out the inline candidate so we can generate an inlined
- // call frame.
-
- // Consider skipping this bail-out for force inlines.
- if (makeInlineObservations)
- {
- if (codeAddr > codeEndp - sizeof(DWORD))
- {
- goto TOO_FAR;
- }
-
- CORINFO_SIG_INFO calliSig;
- eeGetSig(getU4LittleEndian(codeAddr), info.compScopeHnd, impTokenLookupContextHandle, &calliSig);
-
- if (calliSig.getCallConv() != CORINFO_CALLCONV_DEFAULT)
- {
- compInlineResult->Note(InlineObservation::CALLEE_UNSUPPORTED_OPCODE);
-
- // Fail fast if we're inlining
- if (isInlining)
- {
- assert(compInlineResult->IsFailure());
- return;
- }
- }
- }
- break;
-#endif // FEATURE_CORECLR
-
case CEE_JMP:
retBlocks++;
if (tailCall)
{
- bool isCallPopAndRet = false;
-
// impIsTailCallILPattern uses isRecursive flag to determine whether ret in a fallthrough block is
// allowed. We don't know at this point whether the call is recursive so we conservatively pass
// false. This will only affect explicit tail calls when IL verification is not needed for the
// method.
bool isRecursive = false;
- if (!impIsTailCallILPattern(tailCall, opcode, codeAddr + sz, codeEndp, isRecursive,
- &isCallPopAndRet))
+ if (!impIsTailCallILPattern(tailCall, opcode, codeAddr + sz, codeEndp, isRecursive))
{
-#if !defined(FEATURE_CORECLR) && defined(TARGET_AMD64)
- BADCODE3("tail call not followed by ret or pop+ret", " at offset %04X",
- (IL_OFFSET)(codeAddr - codeBegp));
-#else
BADCODE3("tail call not followed by ret", " at offset %04X", (IL_OFFSET)(codeAddr - codeBegp));
-#endif // !FEATURE_CORECLR && TARGET_AMD64
}
if (fgCanSwitchToOptimized() && fgMayExplicitTailCall())
// to avoid stack overflow from recursion
fgSwitchToOptimized();
}
-
-#if !defined(FEATURE_CORECLR) && defined(TARGET_AMD64)
- if (isCallPopAndRet)
- {
- // By breaking here, we let pop and ret opcodes to be
- // imported after tail call. If tail prefix is honored,
- // stmts corresponding to pop and ret will be removed
- // in fgMorphCall().
- break;
- }
-#endif // !FEATURE_CORECLR && TARGET_AMD64
}
else
{
{
impImport(fgFirstBB);
- if (!opts.jitFlags->IsSet(JitFlags::JIT_FLAG_SKIP_VERIFICATION))
- {
- CorInfoMethodRuntimeFlags verFlag;
- verFlag = tiIsVerifiableCode ? CORINFO_FLG_VERIFIABLE : CORINFO_FLG_UNVERIFIABLE;
- info.compCompHnd->setMethodAttribs(info.compMethodHnd, verFlag);
- }
-
// Estimate how much of method IL was actually imported.
//
// Note this includes (to some extent) the impact of importer folded
GenTree* tree = nullptr;
- CORINFO_LOOKUP_KIND kind = info.compCompHnd->getLocationOfThisType(info.compMethodHnd);
+ CORINFO_LOOKUP_KIND kind;
+ info.compCompHnd->getLocationOfThisType(info.compMethodHnd, &kind);
if (!kind.needsRuntimeLookup)
{
}
}
- // Grab a temp for the security object.
- // (Note: opts.compDbgEnC currently also causes the security object to be generated. See Compiler::compCompile)
- if (opts.compNeedSecurityCheck)
- {
- noway_assert(lvaSecurityObject == BAD_VAR_NUM);
- lvaSecurityObject = lvaGrabTempWithImplicitUse(false DEBUGARG("security check"));
- lvaTable[lvaSecurityObject].lvType = TYP_REF;
- }
-
// Merge return points if required or beneficial
MergedReturns merger(this);
fgNewStmtAtEnd(fgFirstBB, gtNewQmarkNode(TYP_VOID, guardCheckCond, callback));
}
- /* Do we need to call out for security ? */
-
- if (tiSecurityCalloutNeeded)
- {
- // We must have grabbed this local.
- noway_assert(opts.compNeedSecurityCheck);
- noway_assert(lvaSecurityObject != BAD_VAR_NUM);
-
- GenTree* tree;
-
- /* Insert the expression "call JIT_Security_Prolog(MethodHnd, &SecurityObject)" */
-
- tree = gtNewIconEmbMethHndNode(info.compMethodHnd);
-
- tree = gtNewHelperCallNode(info.compCompHnd->getSecurityPrologHelper(info.compMethodHnd), TYP_VOID,
- gtNewCallArgs(tree, gtNewOperNode(GT_ADDR, TYP_BYREF,
- gtNewLclvNode(lvaSecurityObject, TYP_REF))));
-
- /* Create a new basic block and stick the call in it */
-
- fgEnsureFirstBBisScratch();
-
- fgNewStmtAtEnd(fgFirstBB, tree);
-
-#ifdef DEBUG
- if (verbose)
- {
- printf("\ntiSecurityCalloutNeeded - Add call JIT_Security_Prolog(%08p) statement ",
- dspPtr(info.compMethodHnd));
- printTreeID(tree);
- printf(" in first basic block %s\n", fgFirstBB->dspToString());
- gtDispTree(tree);
- printf("\n");
- }
-#endif
- }
-
#if !defined(FEATURE_EH_FUNCLETS)
/* Is this a 'synchronized' method? */
#endif // !FEATURE_EH_FUNCLETS
- /* Do we need to do runtime call out to check the security? */
-
- if (tiRuntimeCalloutNeeded)
- {
- GenTree* tree;
-
- /* Insert the expression "call verificationRuntimeCheck(MethodHnd)" */
-
- tree = gtNewIconEmbMethHndNode(info.compMethodHnd);
-
- tree = gtNewHelperCallNode(CORINFO_HELP_VERIFICATION_RUNTIME_CHECK, TYP_VOID, gtNewCallArgs(tree));
-
- /* Create a new basic block and stick the call in it */
-
- fgEnsureFirstBBisScratch();
-
- fgNewStmtAtEnd(fgFirstBB, tree);
-
-#ifdef DEBUG
- if (verbose)
- {
- printf("\ntiRuntimeCalloutNeeded - Call verificationRuntimeCheck(%08p) statement in first basic block %s\n",
- dspPtr(info.compMethodHnd), fgFirstBB->dspToString());
- gtDispTree(tree);
- printf("\n");
- }
-#endif
- }
-
if (opts.IsReversePInvoke())
{
fgAddReversePInvokeEnterExit();
// Assume we don't need to update the bbPreds lists.
assert(!fgComputePredsDone);
-#ifdef FEATURE_CORECLR
bool enableRemoveEmptyTry = true;
-#else
- // Code in a finally gets special treatment in the presence of
- // thread abort.
- bool enableRemoveEmptyTry = false;
-#endif // FEATURE_CORECLR
#ifdef DEBUG
// Allow override to enable/disable.
// Assume we don't need to update the bbPreds lists.
assert(!fgComputePredsDone);
-#ifdef FEATURE_CORECLR
bool enableCloning = true;
-#else
- // Finally cloning currently doesn't provide sufficient protection
- // for the cloned code in the presence of thread abort.
- bool enableCloning = false;
-#endif // FEATURE_CORECLR
#ifdef DEBUG
// Allow override to enable/disable.
header->doubleAlign = compiler->genDoubleAlign();
#endif
- header->security = compiler->opts.compNeedSecurityCheck;
+ header->security = false;
header->handlers = compiler->ehHasCallableHandlers();
header->localloc = compiler->compLocallocUsed;
compiler->lvaGSSecurityCookie),
prologSize, methodSize);
}
- else if (compiler->opts.compNeedSecurityCheck || compiler->lvaReportParamTypeArg() ||
- compiler->lvaKeepAliveAndReportThis())
+ else if (compiler->lvaReportParamTypeArg() || compiler->lvaKeepAliveAndReportThis())
{
gcInfoEncoderWithLog->SetPrologSize(prologSize);
}
- if (compiler->opts.compNeedSecurityCheck)
- {
- assert(compiler->lvaSecurityObject != BAD_VAR_NUM);
-
- // A VM requirement due to how the decoder works (it ignores partially interruptible frames when
- // an exception has escaped, but the VM requires the security object to live on).
- assert(compiler->codeGen->GetInterruptible());
-
- // The lv offset is FP-relative, and the using code expects caller-sp relative, so translate.
- // The normal GC lifetime reporting mechanisms will report a proper lifetime to the GC.
- // The security subsystem can safely assume that anywhere it might walk the stack, it will be
- // valid (null or a live GC ref).
- gcInfoEncoderWithLog->SetSecurityObjectStackSlot(
- compiler->lvaGetCallerSPRelativeOffset(compiler->lvaSecurityObject));
- }
-
#if defined(FEATURE_EH_FUNCLETS)
if (compiler->lvaPSPSym != BAD_VAR_NUM)
{
#define GTF_FLD_INITCLASS 0x20000000 // GT_FIELD/GT_CLS_VAR -- field access requires preceding class/static init helper
#define GTF_INX_RNGCHK 0x80000000 // GT_INDEX/GT_INDEX_ADDR -- the array reference should be range-checked.
-#define GTF_INX_REFARR_LAYOUT 0x20000000 // GT_INDEX
+#define GTF_INX_REFARR_LAYOUT 0x20000000 // GT_INDEX -- TODO: Delete, no longer necessary (https://github.com/dotnet/runtime/issues/32647)
#define GTF_INX_STRING_LAYOUT 0x40000000 // GT_INDEX -- this uses the special string array layout
#define GTF_IND_TGT_NOT_HEAP 0x80000000 // GT_IND -- the target is not on the heap
inline void Compiler::verRaiseVerifyExceptionIfNeeded(INDEBUG(const char* msg) DEBUGARG(const char* file)
DEBUGARG(unsigned line))
{
- // Remember that the code is not verifiable
- // Note that the method may yet pass canSkipMethodVerification(),
- // and so the presence of unverifiable code may not be an issue.
- tiIsVerifiableCode = FALSE;
-
#ifdef DEBUG
const char* tail = strrchr(file, '\\');
if (tail)
JITLOG((LL_INFO10000, "Detected unsafe code: %s:%d : %s, while compiling %s opcode %s, IL offset %x\n", file, line,
msg, info.compFullName, impCurOpcName, impCurOpcOffs));
- if (verNeedsVerification() || compIsForImportOnly())
+ if (compIsForImportOnly())
{
JITLOG((LL_ERROR, "Verification failure: %s:%d : %s, while compiling %s opcode %s, IL offset %x\n", file, line,
msg, info.compFullName, impCurOpcName, impCurOpcOffs));
{
// Ignore bad temp requests (they will happen with bad code and will be
// catched when importing the destblock)
- if ((tnum != BAD_VAR_NUM && tnum >= lvaCount) && verNeedsVerification())
+ if (tnum != BAD_VAR_NUM && tnum >= lvaCount)
{
return false;
}
#endif // !TARGET_64BIT
(varTypeIsFloating(dstTyp) && varTypeIsFloating(valTyp))))
{
- if (verNeedsVerification())
- {
- return false;
- }
+ return false;
}
}
if ((size.Value() == 0) || (varTypeIsGC(elementType)))
{
- assert(verNeedsVerification());
return nullptr;
}
*
*/
void Compiler::verHandleVerificationFailure(BasicBlock* block DEBUGARG(bool logMsg))
-
{
- // In AMD64, for historical reasons involving design limitations of JIT64, the VM has a
- // slightly different mechanism in which it calls the JIT to perform IL verification:
- // in the case of transparent methods the VM calls for a predicate IsVerifiable()
- // that consists of calling the JIT with the IMPORT_ONLY flag and with the IL verify flag on.
- // If the JIT determines the method is not verifiable, it should raise the exception to the VM and let
- // it bubble up until reported by the runtime. Currently in RyuJIT, this method doesn't bubble
- // up the exception, instead it embeds a throw inside the offending basic block and lets this
- // to fail upon runtime of the jitted method.
- //
- // For AMD64 we don't want this behavior when the JIT has been called only for verification (i.e.
- // with the IMPORT_ONLY and IL Verification flag set) because this won't actually generate code,
- // just try to find out whether to fail this method before even actually jitting it. So, in case
- // we detect these two conditions, instead of generating a throw statement inside the offending
- // basic block, we immediately fail to JIT and notify the VM to make the IsVerifiable() predicate
- // to return false and make RyuJIT behave the same way JIT64 does.
- //
- // The rationale behind this workaround is to avoid modifying the VM and maintain compatibility between JIT64 and
- // RyuJIT for the time being until we completely replace JIT64.
- // TODO-ARM64-Cleanup: We probably want to actually modify the VM in the future to avoid the unnecesary two passes.
-
- // In AMD64 we must make sure we're behaving the same way as JIT64, meaning we should only raise the verification
- // exception if we are only importing and verifying. The method verNeedsVerification() can also modify the
- // tiVerificationNeeded flag in the case it determines it can 'skip verification' during importation and defer it
- // to a runtime check. That's why we must assert one or the other (since the flag tiVerificationNeeded can
- // be turned off during importation).
- CLANG_FORMAT_COMMENT_ANCHOR;
-
-#ifdef TARGET_64BIT
-
-#ifdef DEBUG
- bool canSkipVerificationResult =
- info.compCompHnd->canSkipMethodVerification(info.compMethodHnd) != CORINFO_VERIFICATION_CANNOT_SKIP;
- assert(tiVerificationNeeded || canSkipVerificationResult);
-#endif // DEBUG
-
- // Add the non verifiable flag to the compiler
- if (opts.jitFlags->IsSet(JitFlags::JIT_FLAG_IMPORT_ONLY))
- {
- tiIsVerifiableCode = FALSE;
- }
-#endif // TARGET_64BIT
verResetCurrentState(block, &verCurrentState);
verConvertBBToThrowVerificationException(block DEBUGARG(logMsg));
return verMakeTypeInfo(ciType, classHandle);
}
-/*****************************************************************************/
-
-// This does the expensive check to figure out whether the method
-// needs to be verified. It is called only when we fail verification,
-// just before throwing the verification exception.
-
-BOOL Compiler::verNeedsVerification()
-{
- // If we have previously determined that verification is NOT needed
- // (for example in Compiler::compCompile), that means verification is really not needed.
- // Return the same decision we made before.
- // (Note: This literally means that tiVerificationNeeded can never go from 0 to 1.)
-
- if (!tiVerificationNeeded)
- {
- return tiVerificationNeeded;
- }
-
- assert(tiVerificationNeeded);
-
- // Ok, we haven't concluded that verification is NOT needed. Consult the EE now to
- // obtain the answer.
- CorInfoCanSkipVerificationResult canSkipVerificationResult =
- info.compCompHnd->canSkipMethodVerification(info.compMethodHnd);
-
- // canSkipVerification will return one of the following three values:
- // CORINFO_VERIFICATION_CANNOT_SKIP = 0, // Cannot skip verification during jit time.
- // CORINFO_VERIFICATION_CAN_SKIP = 1, // Can skip verification during jit time.
- // CORINFO_VERIFICATION_RUNTIME_CHECK = 2, // Skip verification during jit time,
- // but need to insert a callout to the VM to ask during runtime
- // whether to skip verification or not.
-
- // Set tiRuntimeCalloutNeeded if canSkipVerification() instructs us to insert a callout for runtime check
- if (canSkipVerificationResult == CORINFO_VERIFICATION_RUNTIME_CHECK)
- {
- tiRuntimeCalloutNeeded = true;
- }
-
- if (canSkipVerificationResult == CORINFO_VERIFICATION_DONT_JIT)
- {
- // Dev10 706080 - Testers don't like the assert, so just silence it
- // by not using the macros that invoke debugAssert.
- badCode();
- }
-
- // When tiVerificationNeeded is true, JIT will do the verification during JIT time.
- // The following line means we will NOT do jit time verification if canSkipVerification
- // returns CORINFO_VERIFICATION_CAN_SKIP or CORINFO_VERIFICATION_RUNTIME_CHECK.
- tiVerificationNeeded = (canSkipVerificationResult == CORINFO_VERIFICATION_CANNOT_SKIP);
- return tiVerificationNeeded;
-}
-
BOOL Compiler::verIsByRefLike(const typeInfo& ti)
{
if (ti.IsByRef())
if (impIsLDFTN_TOKEN(delegateCreateStart, codeAddr))
{
- if ((actualMethodAttribs & CORINFO_FLG_VIRTUAL) && ((actualMethodAttribs & CORINFO_FLG_FINAL) == 0)
-#ifdef DEBUG
- && StrictCheckForNonVirtualCallToVirtualMethod()
-#endif
- )
+ if ((actualMethodAttribs & CORINFO_FLG_VIRTUAL) && ((actualMethodAttribs & CORINFO_FLG_FINAL) == 0))
{
- if (info.compCompHnd->shouldEnforceCallvirtRestriction(info.compScopeHnd))
- {
- VerifyOrReturn(tiActualObj.IsThisPtr() && lvaIsOriginalThisReadOnly() ||
- verIsBoxedValueType(tiActualObj),
- "The 'this' parameter to the call must be either the calling method's "
- "'this' parameter or "
- "a boxed value type.");
- }
+ VerifyOrReturn(tiActualObj.IsThisPtr() && lvaIsOriginalThisReadOnly() ||
+ verIsBoxedValueType(tiActualObj),
+ "The 'this' parameter to the call must be either the calling method's "
+ "'this' parameter or "
+ "a boxed value type.");
}
}
// This is stronger that is strictly needed, but implementing a laxer rule is significantly
// hard and more error prone.
- if (opcode == CEE_CALL && (mflags & CORINFO_FLG_VIRTUAL) && ((mflags & CORINFO_FLG_FINAL) == 0)
-#ifdef DEBUG
- && StrictCheckForNonVirtualCallToVirtualMethod()
-#endif
- )
+ if (opcode == CEE_CALL && (mflags & CORINFO_FLG_VIRTUAL) && ((mflags & CORINFO_FLG_FINAL) == 0))
{
- if (info.compCompHnd->shouldEnforceCallvirtRestriction(info.compScopeHnd))
- {
- VerifyOrReturn(
- tiThis.IsThisPtr() && lvaIsOriginalThisReadOnly() || verIsBoxedValueType(tiThis),
- "The 'this' parameter to the call must be either the calling method's 'this' parameter or "
- "a boxed value type.");
- }
+ VerifyOrReturn(tiThis.IsThisPtr() && lvaIsOriginalThisReadOnly() || verIsBoxedValueType(tiThis),
+ "The 'this' parameter to the call must be either the calling method's 'this' parameter or "
+ "a boxed value type.");
}
}
if (methHnd)
{
- if ((mflags & CORINFO_FLG_PINVOKE) == 0 || (mflags & CORINFO_FLG_NOSECURITYWRAP) == 0)
+ if ((mflags & CORINFO_FLG_PINVOKE) == 0)
{
return;
}
{
#ifdef FEATURE_READYTORUN_COMPILER
noway_assert(opts.IsReadyToRun());
- CORINFO_LOOKUP_KIND kind = info.compCompHnd->getLocationOfThisType(info.compMethodHnd);
+ CORINFO_LOOKUP_KIND kind;
+ info.compCompHnd->getLocationOfThisType(info.compMethodHnd, &kind);
assert(kind.needsRuntimeLookup);
GenTree* ctxTree = getRuntimeContextTree(kind.runtimeLookupKind);
impInsertHelperCall(helperCall);
}
break;
- case CORINFO_ACCESS_RUNTIME_CHECK:
- impInsertHelperCall(helperCall);
- break;
}
}
* to a supported tail call IL pattern.
*
*/
-bool Compiler::impIsTailCallILPattern(bool tailPrefixed,
- OPCODE curOpcode,
- const BYTE* codeAddrOfNextOpcode,
- const BYTE* codeEnd,
- bool isRecursive,
- bool* isCallPopAndRet /* = nullptr */)
+bool Compiler::impIsTailCallILPattern(
+ bool tailPrefixed, OPCODE curOpcode, const BYTE* codeAddrOfNextOpcode, const BYTE* codeEnd, bool isRecursive)
{
// Bail out if the current opcode is not a call.
if (!impOpcodeIsCallOpcode(curOpcode))
return false;
}
- // Scan the opcodes to look for the following IL patterns if either
- // i) the call is not tail prefixed (i.e. implicit tail call) or
- // ii) if tail prefixed, IL verification is not needed for the method.
- //
- // Only in the above two cases we can allow the below tail call patterns
- // violating ECMA spec.
- //
- // Pattern1:
- // call
- // nop*
- // ret
- //
- // Pattern2:
- // call
- // nop*
- // pop
- // nop*
- // ret
- int cntPop = 0;
- OPCODE nextOpcode;
-
-#if !defined(FEATURE_CORECLR) && defined(TARGET_AMD64)
- do
- {
- nextOpcode = (OPCODE)getU1LittleEndian(codeAddrOfNextOpcode);
- codeAddrOfNextOpcode += sizeof(__int8);
- } while ((codeAddrOfNextOpcode < codeEnd) && // Haven't reached end of method
- (!tailPrefixed || !tiVerificationNeeded) && // Not ".tail" prefixed or method requires no IL verification
- ((nextOpcode == CEE_NOP) || ((nextOpcode == CEE_POP) && (++cntPop == 1)))); // Next opcode = nop or exactly
- // one pop seen so far.
-#else
- nextOpcode = (OPCODE)getU1LittleEndian(codeAddrOfNextOpcode);
-#endif // !FEATURE_CORECLR && TARGET_AMD64
+ OPCODE nextOpcode = (OPCODE)getU1LittleEndian(codeAddrOfNextOpcode);
- if (isCallPopAndRet)
- {
- // Allow call+pop+ret to be tail call optimized if caller ret type is void
- *isCallPopAndRet = (nextOpcode == CEE_RET) && (cntPop == 1);
- }
-
-#if !defined(FEATURE_CORECLR) && defined(TARGET_AMD64)
- // Jit64 Compat:
- // Tail call IL pattern could be either of the following
- // 1) call/callvirt/calli + ret
- // 2) call/callvirt/calli + pop + ret in a method returning void.
- return (nextOpcode == CEE_RET) && ((cntPop == 0) || ((cntPop == 1) && (info.compRetType == TYP_VOID)));
-#else
- return (nextOpcode == CEE_RET) && (cntPop == 0);
-#endif // !FEATURE_CORECLR && TARGET_AMD64
+ return (nextOpcode == CEE_RET);
}
/*****************************************************************************
szCanTailCallFailReason = "Caller is varargs";
}
#endif // FEATURE_FIXED_OUT_ARGS
- else if (opts.compNeedSecurityCheck)
- {
- canTailCall = false;
- szCanTailCallFailReason = "Caller requires a security check.";
- }
// We only need to cast the return value of pinvoke inlined calls that return small types
// ReadyToRun code sticks with default calling convention that does not widen small return types.
- bool checkForSmallType = opts.IsJit64Compat() || opts.IsReadyToRun();
+ bool checkForSmallType = opts.IsReadyToRun();
bool bIntrinsicImported = false;
CORINFO_SIG_INFO calliSig;
return TYP_UNDEF;
}
- /* Does the inlinee need a security check token on the frame */
-
- if (mflags & CORINFO_FLG_SECURITYCHECK)
- {
- compInlineResult->NoteFatal(InlineObservation::CALLEE_NEEDS_SECURITY_CHECK);
- return TYP_UNDEF;
- }
-
/* Does the inlinee use StackCrawlMark */
if (mflags & CORINFO_FLG_DONT_INLINE_CALLER)
* to the arg list next after we pop them */
}
- if (mflags & CORINFO_FLG_SECURITYCHECK)
- {
- assert(!compIsForInlining());
-
- // Need security prolog/epilog callouts when there is
- // imperative security in the method. This is to give security a
- // chance to do any setup in the prolog and cleanup in the epilog if needed.
-
- tiSecurityCalloutNeeded = true;
-
- // If the current method calls a method which needs a security check,
- // (i.e. the method being compiled has imperative security)
- // we need to reserve a slot for the security object in
- // the current method's stack frame
- opts.compNeedSecurityCheck = true;
- }
-
//--------------------------- Inline NDirect ------------------------------
// For inline cases we technically should look at both the current
if (impIsThis(obj))
{
aflags |= CORINFO_ACCESS_THIS;
-
- // An optimization for Contextful classes:
- // we unwrap the proxy when we have a 'this reference'
-
- if (info.compUnwrapContextful)
- {
- aflags |= CORINFO_ACCESS_UNWRAP;
- }
}
}
if (impIsThis(obj))
{
aflags |= CORINFO_ACCESS_THIS;
-
- // An optimization for Contextful classes:
- // we unwrap the proxy when we have a 'this reference'
-
- if (info.compUnwrapContextful)
- {
- aflags |= CORINFO_ACCESS_UNWRAP;
- }
}
}
// We must have imported a tailcall and jumped to RET
if (isTailCall)
{
-#if defined(FEATURE_CORECLR) || !defined(TARGET_AMD64)
- // Jit64 compat:
- // This cannot be asserted on Amd64 since we permit the following IL pattern:
- // tail.call
- // pop
- // ret
assert(verCurrentState.esStackDepth == 0 && impOpcodeIsCallOpcode(opcode));
-#endif // FEATURE_CORECLR || !TARGET_AMD64
opcode = CEE_RET; // To prevent trying to spill if CALL_SITE_BOUNDARIES
change the temp to TYP_BYREF and reimport the successors.
Note: We should only allow this in unverifiable code.
*/
- if (tree->gtType == TYP_BYREF && lvaTable[tempNum].lvType == TYP_I_IMPL && !verNeedsVerification())
+ if (tree->gtType == TYP_BYREF && lvaTable[tempNum].lvType == TYP_I_IMPL)
{
lvaTable[tempNum].lvType = TYP_BYREF;
impReimportMarkSuccessors(block);
}
}
- /* If the caller's stack frame is marked, then we can't do any inlining. Period. */
-
- if (opts.compNeedSecurityCheck)
- {
- inlineResult.NoteFatal(InlineObservation::CALLER_NEEDS_SECURITY_CHECK);
- return;
- }
-
/* Check if we tried to inline this method before */
if (methAttr & CORINFO_FLG_DONT_INLINE)
return;
}
- /* Do not inline if callee needs security checks (since they would then mark the wrong frame) */
-
- if (methAttr & CORINFO_FLG_SECURITYCHECK)
- {
- inlineResult.NoteFatal(InlineObservation::CALLEE_NEEDS_SECURITY_CHECK);
- return;
- }
-
/* Check legality of PInvoke callsite (for inlining of marshalling code) */
if (methAttr & CORINFO_FLG_PINVOKE)
CORINFO_CLASS_HANDLE baseClass = info.compCompHnd->getMethodClass(baseMethod);
const DWORD baseClassAttribs = info.compCompHnd->getClassAttribs(baseClass);
-#if !defined(FEATURE_CORECLR)
- // If base class is not beforefieldinit then devirtualizing may
- // cause us to miss a base class init trigger. Spec says we don't
- // need a trigger for ref class callvirts but desktop seems to
- // have one anyways. So defer.
- if ((baseClassAttribs & CORINFO_FLG_BEFOREFIELDINIT) == 0)
- {
- JITDUMP("\nimpDevirtualizeCall: base class has precise initialization, sorry\n");
- return;
- }
-#endif // FEATURE_CORECLR
-
// Is the call an interface call?
const bool isInterface = (baseClassAttribs & CORINFO_FLG_INTERFACE) != 0;
bool Compiler::impIsClassExact(CORINFO_CLASS_HANDLE classHnd)
{
DWORD flags = info.compCompHnd->getClassAttribs(classHnd);
- DWORD flagsMask = CORINFO_FLG_FINAL | CORINFO_FLG_MARSHAL_BYREF | CORINFO_FLG_CONTEXTFUL | CORINFO_FLG_VARIANCE |
- CORINFO_FLG_ARRAY;
+ DWORD flagsMask = CORINFO_FLG_FINAL | CORINFO_FLG_VARIANCE | CORINFO_FLG_ARRAY;
return ((flags & flagsMask) == CORINFO_FLG_FINAL);
}
INLINE_OBSERVATION(LOG_REPLAY_REJECT, bool, "rejected by log replay", FATAL, CALLEE)
INLINE_OBSERVATION(MARKED_AS_SKIPPED, bool, "skipped by complus request", FATAL, CALLEE)
INLINE_OBSERVATION(MAXSTACK_TOO_BIG, bool, "maxstack too big" , FATAL, CALLEE)
-INLINE_OBSERVATION(NEEDS_SECURITY_CHECK, bool, "needs security check", FATAL, CALLEE)
INLINE_OBSERVATION(NO_METHOD_INFO, bool, "cannot get method info", FATAL, CALLEE)
INLINE_OBSERVATION(NOT_PROFITABLE_INLINE, bool, "unprofitable inline", FATAL, CALLEE)
INLINE_OBSERVATION(RANDOM_REJECT, bool, "random reject", FATAL, CALLEE)
INLINE_OBSERVATION(DEBUG_CODEGEN, bool, "debug codegen", FATAL, CALLER)
INLINE_OBSERVATION(IS_JIT_NOINLINE, bool, "noinline per JitNoInlineRange", FATAL, CALLER)
-INLINE_OBSERVATION(NEEDS_SECURITY_CHECK, bool, "needs security check", FATAL, CALLER)
// ------ Caller Information -------
#include "target.h"
#if FEATURE_TAILCALL_OPT
-
-#ifdef FEATURE_CORECLR
-// CoreCLR - enable tail call opt for the following IL pattern
+// Enable tail call opt for the following IL pattern
//
// call someFunc
// jmp/jcc RetBlock
// RetBlock:
// ret
#define FEATURE_TAILCALL_OPT_SHARED_RETURN 1
-#else
-// Desktop: Keep this to zero as one of app-compat apps that is using GetCallingAssembly()
-// has an issue turning this ON.
-//
-// Refer to TF: Bug: 824625 and its associated regression TF Bug: 1113265
-#define FEATURE_TAILCALL_OPT_SHARED_RETURN 0
-#endif // FEATURE_CORECLR
-
#else // !FEATURE_TAILCALL_OPT
#define FEATURE_TAILCALL_OPT_SHARED_RETURN 0
#endif // !FEATURE_TAILCALL_OPT
CONFIG_INTEGER(JitStressModeNamesOnly, W("JitStressModeNamesOnly"), 0) // Internal Jit stress: if nonzero, only enable
// stress modes listed in JitStressModeNames
CONFIG_INTEGER(JitStressRegs, W("JitStressRegs"), 0)
-CONFIG_INTEGER(JitStrictCheckForNonVirtualCallToVirtualMethod, W("JitStrictCheckForNonVirtualCallToVirtualMethod"), 1)
CONFIG_INTEGER(JitVNMapSelLimit, W("JitVNMapSelLimit"), 0) // If non-zero, assert if # of VNF_MapSelect applications
// considered reaches this
CONFIG_INTEGER(NgenHashDump, W("NgenHashDump"), -1) // same as JitHashDump, but for ngen
CONFIG_INTEGER(JitEnableNoWayAssert, W("JitEnableNoWayAssert"), 1)
#endif // !defined(DEBUG) && !defined(_DEBUG)
-// It was originally intended that JitMinOptsTrackGCrefs only be enabled for amd64 on CoreCLR. A mistake was
-// made, and it was enabled for x86 as well. Whether it should continue to be enabled for x86 should be investigated.
-// This is tracked by issue https://github.com/dotnet/coreclr/issues/12415.
-#if (defined(TARGET_AMD64) && defined(FEATURE_CORECLR)) || defined(TARGET_X86)
+#if defined(TARGET_AMD64) || defined(TARGET_X86)
#define JitMinOptsTrackGCrefs_Default 0 // Not tracking GC refs in MinOpts is new behavior
#else
#define JitMinOptsTrackGCrefs_Default 1
CONFIG_INTEGER(JitEECallTimingInfo, W("JitEECallTimingInfo"), 0)
#if defined(DEBUG)
-#if defined(FEATURE_CORECLR)
CONFIG_INTEGER(JitEnableFinallyCloning, W("JitEnableFinallyCloning"), 1)
CONFIG_INTEGER(JitEnableRemoveEmptyTry, W("JitEnableRemoveEmptyTry"), 1)
-#else
-CONFIG_INTEGER(JitEnableFinallyCloning, W("JitEnableFinallyCloning"), 0)
-CONFIG_INTEGER(JitEnableRemoveEmptyTry, W("JitEnableRemoveEmptyTry"), 0)
-#endif // defined(FEATURE_CORECLR)
#endif // DEBUG
// Overall master enable for Guarded Devirtualization. Currently not enabled by default.
JIT_FLAG_SAMPLING_JIT_BACKGROUND = 35, // JIT is being invoked as a result of stack sampling for hot methods in the background
JIT_FLAG_USE_PINVOKE_HELPERS = 36, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions
JIT_FLAG_REVERSE_PINVOKE = 37, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog
- JIT_FLAG_DESKTOP_QUIRKS = 38, // The JIT should generate desktop-quirk-compatible code
+ // JIT_FLAG_UNUSED = 38,
JIT_FLAG_TIER0 = 39, // This is the initial tier for tiered compilation which should generate code as quickly as possible
JIT_FLAG_TIER1 = 40, // This is the final tier (for now) for tiered compilation which should generate high quality code
FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_SAMPLING_JIT_BACKGROUND, JIT_FLAG_SAMPLING_JIT_BACKGROUND);
FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_USE_PINVOKE_HELPERS, JIT_FLAG_USE_PINVOKE_HELPERS);
FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_REVERSE_PINVOKE, JIT_FLAG_REVERSE_PINVOKE);
- FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_DESKTOP_QUIRKS, JIT_FLAG_DESKTOP_QUIRKS);
FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_TIER0, JIT_FLAG_TIER0);
FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_TIER1, JIT_FLAG_TIER1);
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
lvaVarargsBaseOfStkArgs = BAD_VAR_NUM;
#endif // TARGET_X86
lvaVarargsHandleArg = BAD_VAR_NUM;
- lvaSecurityObject = BAD_VAR_NUM;
lvaStubArgumentVar = BAD_VAR_NUM;
lvaArg0Var = BAD_VAR_NUM;
lvaMonAcquired = BAD_VAR_NUM;
stkOffs = lvaAllocLocalAndSetVirtualOffset(lvaMonAcquired, lvaLclSize(lvaMonAcquired), stkOffs);
}
- if (opts.compNeedSecurityCheck)
- {
-#ifdef JIT32_GCENCODER
- /* This can't work without an explicit frame, so make sure */
- noway_assert(codeGen->isFramePointerUsed());
-#endif
- stkOffs = lvaAllocLocalAndSetVirtualOffset(lvaSecurityObject, TARGET_POINTER_SIZE, stkOffs);
- }
-
#ifdef JIT32_GCENCODER
if (lvaLocAllocSPvar != BAD_VAR_NUM)
{
#ifdef JIT32_GCENCODER
lclNum == lvaLocAllocSPvar ||
#endif // JIT32_GCENCODER
- lclNum == lvaSecurityObject)
+ false)
{
assert(varDsc->lvStkOffs != BAD_STK_OFFS);
continue;
LowerFastTailCall(call);
}
- if (comp->opts.IsJit64Compat())
- {
- CheckVSQuirkStackPaddingNeeded(call);
- }
-
ContainCheckCallOperands(call);
JITDUMP("lowering call (after):\n");
DISPTREERANGE(BlockRange(), call);
JITDUMP("\n");
}
-// Though the below described issue gets fixed in intellitrace dll of VS2015 (a.k.a Dev14),
-// we still need this quirk for desktop so that older version of VS (e.g. VS2010/2012)
-// continues to work.
-// This quirk is excluded from other targets that have no back compat burden.
-//
-// Quirk for VS debug-launch scenario to work:
-// See if this is a PInvoke call with exactly one param that is the address of a struct local.
-// In such a case indicate to frame-layout logic to add 16-bytes of padding
-// between save-reg area and locals. This is to protect against the buffer
-// overrun bug in microsoft.intellitrace.11.0.0.dll!ProfilerInterop.InitInterop().
-//
-// A work-around to this bug is to disable IntelliTrace debugging
-// (VS->Tools->Options->IntelliTrace->Enable IntelliTrace - uncheck this option).
-// The reason why this works on Jit64 is that at the point of AV the call stack is
-//
-// GetSystemInfo() Native call
-// IL_Stub generated for PInvoke declaration.
-// ProfilerInterface::InitInterop()
-// ProfilerInterface.Cctor()
-// VM asm worker
-//
-// The cctor body has just the call to InitInterop(). VM asm worker is holding
-// something in rbx that is used immediately after the Cctor call. Jit64 generated
-// InitInterop() method is pushing the registers in the following order
-//
-// rbx
-// rbp
-// rsi
-// rdi
-// r12
-// r13
-// Struct local
-//
-// Due to buffer overrun, rbx doesn't get impacted. Whereas RyuJIT jitted code of
-// the same method is pushing regs in the following order
-//
-// rbp
-// rdi
-// rsi
-// rbx
-// struct local
-//
-// Therefore as a fix, we add padding between save-reg area and locals to
-// make this scenario work against JB.
-//
-// Note: If this quirk gets broken due to other JIT optimizations, we should consider
-// more tolerant fix. One such fix is to padd the struct.
-void Lowering::CheckVSQuirkStackPaddingNeeded(GenTreeCall* call)
-{
- assert(comp->opts.IsJit64Compat());
-
-#ifdef TARGET_AMD64
- // Confine this to IL stub calls which aren't marked as unmanaged.
- if (call->IsPInvoke() && !call->IsUnmanaged())
- {
- bool paddingNeeded = false;
- GenTree* firstPutArgReg = nullptr;
- for (GenTreeCall::Use& use : call->LateArgs())
- {
- if (use.GetNode()->OperIs(GT_PUTARG_REG))
- {
- if (firstPutArgReg == nullptr)
- {
- firstPutArgReg = use.GetNode();
- GenTree* op1 = firstPutArgReg->AsOp()->gtOp1;
-
- if (op1->OperGet() == GT_LCL_VAR_ADDR)
- {
- unsigned lclNum = op1->AsLclVarCommon()->GetLclNum();
- if (comp->lvaGetDesc(lclNum)->TypeGet() == TYP_STRUCT)
- {
- // First arg is addr of a struct local.
- paddingNeeded = true;
- }
- else
- {
- // Not a struct local.
- assert(paddingNeeded == false);
- break;
- }
- }
- else
- {
- // First arg is not a local var addr.
- assert(paddingNeeded == false);
- break;
- }
- }
- else
- {
- // Has more than one arg.
- paddingNeeded = false;
- break;
- }
- }
- }
-
- if (paddingNeeded)
- {
- comp->compVSQuirkStackPaddingNeeded = VSQUIRK_STACK_PAD;
- }
- }
-#endif // TARGET_AMD64
-}
-
// Inserts profiler hook, GT_PROF_HOOK for a tail call node.
//
// AMD64:
// Most of these checks are already done by importer or fgMorphTailCall().
// This serves as a double sanity check.
assert((comp->info.compFlags & CORINFO_FLG_SYNCH) == 0); // tail calls from synchronized methods
- assert(!comp->opts.compNeedSecurityCheck); // tail call from methods that need security check
assert(!call->IsUnmanaged()); // tail calls to unamanaged methods
assert(!comp->compLocallocUsed); // tail call from methods that also do localloc
// Most of these checks are already done by importer or fgMorphTailCall().
// This serves as a double sanity check.
assert((comp->info.compFlags & CORINFO_FLG_SYNCH) == 0); // tail calls from synchronized methods
- assert(!comp->opts.compNeedSecurityCheck); // tail call from methods that need security check
assert(!call->IsUnmanaged()); // tail calls to unamanaged methods
assert(!comp->compLocallocUsed); // tail call from methods that also do localloc
void LowerBlock(BasicBlock* block);
GenTree* LowerNode(GenTree* node);
- void CheckVSQuirkStackPaddingNeeded(GenTreeCall* call);
-
// ------------------------------
// Call Lowering
// ------------------------------
#pragma warning(pop)
#endif
-/*****************************************************************************
- *
- * Perform an unwrap operation on a Proxy object
- */
-
-GenTree* Compiler::fgUnwrapProxy(GenTree* objRef)
-{
- assert(info.compIsContextful && info.compUnwrapContextful && impIsThis(objRef));
-
- CORINFO_EE_INFO* pInfo = eeGetEEInfo();
- GenTree* addTree;
-
- // Perform the unwrap:
- //
- // This requires two extra indirections.
- // We mark these indirections as 'invariant' and
- // the CSE logic will hoist them when appropriate.
- //
- // Note that each dereference is a GC pointer
-
- addTree = gtNewOperNode(GT_ADD, TYP_I_IMPL, objRef, gtNewIconNode(pInfo->offsetOfTransparentProxyRP, TYP_I_IMPL));
-
- objRef = gtNewOperNode(GT_IND, TYP_REF, addTree);
- objRef->gtFlags |= GTF_IND_INVARIANT;
-
- addTree = gtNewOperNode(GT_ADD, TYP_I_IMPL, objRef, gtNewIconNode(pInfo->offsetOfRealProxyServer, TYP_I_IMPL));
-
- objRef = gtNewOperNode(GT_IND, TYP_REF, addTree);
- objRef->gtFlags |= GTF_IND_INVARIANT;
-
- // objRef now hold the 'real this' reference (i.e. the unwrapped proxy)
- return objRef;
-}
-
#ifdef DEBUG
void fgArgTabEntry::Dump()
{
assert(arg2 != nullptr);
nonStandardArgs.Add(arg2, REG_LNGARG_HI);
}
-#else // !TARGET_X86
+#else // !TARGET_X86
// TODO-X86-CQ: Currently RyuJIT/x86 passes args on the stack, so this is not needed.
// If/when we change that, the following code needs to be changed to correctly support the (TBD) managed calling
// convention for x86/SSE.
//
CLANG_FORMAT_COMMENT_ANCHOR;
-#if !defined(FEATURE_CORECLR)
- if (call->IsUnmanaged() && !opts.ShouldUsePInvokeHelpers())
- {
- assert(!call->gtCallCookie);
- // Add a conservative estimate of the stack size in a special parameter (r11) at the call site.
- // It will be used only on the intercepted-for-host code path to copy the arguments.
-
- GenTree* cns = new (this, GT_CNS_INT) GenTreeIntCon(TYP_I_IMPL, fgEstimateCallStackSize(call));
- call->gtCallArgs = gtPrependNewCallArg(cns, call->gtCallArgs);
- numArgs++;
-
- nonStandardArgs.Add(cns, REG_PINVOKE_COOKIE_PARAM);
- }
- else
-#endif // !defined(FEATURE_CORECLR)
- if (call->IsVirtualStub())
+ if (call->IsVirtualStub())
{
if (!call->IsTailCallViaHelper())
{
elemOffs = OFFSETOF__CORINFO_String__chars;
tree->gtFlags &= ~GTF_INX_STRING_LAYOUT; // Clear this flag as it is used for GTF_IND_VOLATILE
}
- else if (tree->gtFlags & GTF_INX_REFARR_LAYOUT)
- {
- lenOffs = OFFSETOF__CORINFO_Array__length;
- elemOffs = eeGetEEInfo()->offsetOfObjArrayData;
- }
- else // We have a standard array
+ else
{
+ // We have a standard array
lenOffs = OFFSETOF__CORINFO_Array__length;
elemOffs = OFFSETOF__CORINFO_Array__data;
}
noway_assert(varTypeIsGC(objRef->TypeGet()) || objRef->TypeGet() == TYP_I_IMPL);
- // An optimization for Contextful classes:
- // we unwrap the proxy when we have a 'this reference'
- if (info.compIsContextful && info.compUnwrapContextful && impIsThis(objRef))
- {
- objRef = fgUnwrapProxy(objRef);
- }
-
/*
Now we have a tree like this:
noway_assert(!call->IsTailPrefixedCall());
noway_assert(!call->IsImplicitTailCall() || !gtIsRecursiveCall(call));
- /* If the caller's stack frame is marked, then we can't do any inlining. Period.
- Although we have checked this in impCanInline, it is possible that later IL instructions
- might cause compNeedSecurityCheck to be set. Therefore we need to check it here again.
- */
-
- if (opts.compNeedSecurityCheck)
- {
- result->NoteFatal(InlineObservation::CALLER_NEEDS_SECURITY_CHECK);
- return;
- }
-
//
// Calling inlinee's compiler to inline the method.
//
return nullptr;
}
- if (opts.compNeedSecurityCheck)
- {
- failTailCall("Needs security check");
- return nullptr;
- }
-
if (compLocallocUsed || compLocallocOptimized)
{
failTailCall("Localloc used");
// a recursive call into a loop. Another option is to modify gtIsRecursiveCall() to check that the
// generic type parameters of both caller and callee generic method are the same.
if (opts.compTailCallLoopOpt && canFastTailCall && gtIsRecursiveCall(call) && !lvaReportParamTypeArg() &&
- !lvaKeepAliveAndReportThis() && !call->IsVirtual() && !hasStructParam && !varTypeIsStruct(call->TypeGet()) &&
- ((info.compClassAttr & CORINFO_FLG_MARSHAL_BYREF) == 0))
+ !lvaKeepAliveAndReportThis() && !call->IsVirtual() && !hasStructParam && !varTypeIsStruct(call->TypeGet()))
{
fastTailCallToLoop = true;
}
codeGen->setFramePointerRequiredGCInfo(true);
}
- if (opts.compNeedSecurityCheck)
- {
- codeGen->setFramePointerRequiredGCInfo(true);
-
-#ifndef JIT32_GCENCODER
-
- // The decoder only reports objects in frames with exceptions if the frame
- // is fully interruptible.
- // Even if there is no catch or other way to resume execution in this frame
- // the VM requires the security object to remain alive until later, so
- // Frames with security objects must be fully interruptible.
- SetInterruptible(true);
-
-#endif // JIT32_GCENCODER
- }
-
if (compIsProfilerHookNeeded())
{
codeGen->setFramePointerRequired(true);
{
noway_assert(!compIsForInlining());
- CORINFO_LOOKUP_KIND kind = info.compCompHnd->getLocationOfThisType(info.compMethodHnd);
+ CORINFO_LOOKUP_KIND kind;
+ info.compCompHnd->getLocationOfThisType(info.compMethodHnd, &kind);
if (!kind.needsRuntimeLookup)
{
#endif // FEATURE_SIMD
-#if !defined(FEATURE_CORECLR) && defined(TARGET_AMD64)
-Statement* SkipNopStmts(Statement* stmt)
-{
- while ((stmt != nullptr) && !stmt->IsNothingNode())
- {
- stmt = stmt->GetNextStmt();
- }
- return stmt;
-}
-
-#endif // !FEATURE_CORECLR && TARGET_AMD64
-
//------------------------------------------------------------------------
// fgCheckStmtAfterTailCall: check that statements after the tail call stmt
// candidate are in one of expected forms, that are desctibed below.
Statement* nextMorphStmt = callStmt->GetNextStmt();
-#if !defined(FEATURE_CORECLR) && defined(TARGET_AMD64)
- // Legacy Jit64 Compat:
- // There could be any number of GT_NOPs between tail call and GT_RETURN.
- // That is tail call pattern could be one of the following:
- // 1) tail.call, nop*, ret
- // 2) tail.call, nop*, pop, nop*, ret
- // 3) var=tail.call, nop*, ret(var)
- // 4) var=tail.call, nop*, pop, ret
- // 5) comma(tail.call, nop), nop*, ret
- //
- // See impIsTailCallILPattern() for details on tail call IL patterns
- // that are supported.
- GenTree* callExpr = callStmt->GetRootNode();
-
- if (callExpr->gtOper != GT_RETURN)
- {
- // First skip all GT_NOPs after the call
- nextMorphStmt = SkipNopStmts(nextMorphStmt);
-
- // Check to see if there is a pop.
- // Since tail call is honored, we can get rid of the stmt corresponding to pop.
- if (nextMorphStmt != nullptr && nextMorphStmt->GetRootNode()->gtOper != GT_RETURN)
- {
- // Note that pop opcode may or may not result in a new stmt (for details see
- // impImportBlockCode()). Hence, it is not possible to assert about the IR
- // form generated by pop but pop tree must be side-effect free so that we can
- // delete it safely.
- Statement* popStmt = nextMorphStmt;
-
- // Side effect flags on a GT_COMMA may be overly pessimistic, so examine
- // the constituent nodes.
- GenTree* popExpr = popStmt->GetRootNode();
- bool isSideEffectFree = (popExpr->gtFlags & GTF_ALL_EFFECT) == 0;
- if (!isSideEffectFree && (popExpr->OperGet() == GT_COMMA))
- {
- isSideEffectFree = ((popExpr->gtGetOp1()->gtFlags & GTF_ALL_EFFECT) == 0) &&
- ((popExpr->gtGetOp2()->gtFlags & GTF_ALL_EFFECT) == 0);
- }
- noway_assert(isSideEffectFree);
-
- nextMorphStmt = popStmt->GetNextStmt();
- }
-
- // Next skip any GT_NOP nodes after the pop
- nextMorphStmt = SkipNopStmts(nextMorphStmt);
- }
-#endif // !FEATURE_CORECLR && TARGET_AMD64
-
// Check that the rest stmts in the block are in one of the following pattern:
// 1) ret(void)
// 2) ret(cast*(callResultLclVar))
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
return nullptr;
}
-#ifdef FEATURE_CORECLR
- // For coreclr, we also exit early if the method is not a JIT Intrinsic (which requires the [Intrinsic] attribute).
+ // Exit early if the method is not a JIT Intrinsic (which requires the [Intrinsic] attribute).
if ((methodFlags & CORINFO_FLG_JIT_INTRINSIC) == 0)
{
return nullptr;
}
-#endif // FEATURE_CORECLR
// Get base type and intrinsic Id
var_types baseType = TYP_UNKNOWN;
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
#ifndef TARGET_H_
#define TARGET_H_
-#if defined(FEATURE_CORECLR) && defined(TARGET_UNIX)
+#if defined(TARGET_UNIX)
#define FEATURE_VARARG 0
-#else // !(defined(FEATURE_CORECLR) && defined(TARGET_UNIX))
+#else
#define FEATURE_VARARG 1
-#endif // !(defined(FEATURE_CORECLR) && defined(TARGET_UNIX))
+#endif
/*****************************************************************************/
// The following are human readable names for the target architectures
/*****************************************************************************/
-// The pseudorandom nop insertion is not necessary for current CoreCLR scenarios
-// #if defined(FEATURE_CORECLR) && !defined(TARGET_ARM)
+// The pseudorandom nop insertion is not necessary for current scenarios
// #define PSEUDORANDOM_NOP_INSERTION
-// #endif
/*****************************************************************************/
case CORINFO_HELP_NEWSFAST:
case CORINFO_HELP_NEWSFAST_ALIGN8:
case CORINFO_HELP_NEWSFAST_ALIGN8_VC:
- case CORINFO_HELP_NEW_CROSSCONTEXT:
case CORINFO_HELP_NEWFAST:
case CORINFO_HELP_NEWSFAST_FINALIZE:
case CORINFO_HELP_NEWSFAST_ALIGN8_FINALIZE:
break;
// These helper calls may throw an exception
- case CORINFO_HELP_METHOD_ACCESS_CHECK:
- case CORINFO_HELP_FIELD_ACCESS_CHECK:
- case CORINFO_HELP_CLASS_ACCESS_CHECK:
- case CORINFO_HELP_DELEGATE_SECURITY_CHECK:
case CORINFO_HELP_MON_EXIT_STATIC:
break;
case CORINFO_HELP_MON_ENTER_STATIC:
case CORINFO_HELP_JIT_REVERSE_PINVOKE_ENTER:
case CORINFO_HELP_JIT_REVERSE_PINVOKE_EXIT:
- case CORINFO_HELP_SECURITY_PROLOG:
- case CORINFO_HELP_SECURITY_PROLOG_FRAMED:
- case CORINFO_HELP_VERIFICATION_RUNTIME_CHECK:
case CORINFO_HELP_GETFIELDADDR:
case CORINFO_HELP_INIT_PINVOKE_FRAME:
case CORINFO_HELP_JIT_PINVOKE_BEGIN:
return (b) ? "true" : "false";
}
-#ifdef FEATURE_CORECLR
-#ifdef _CRT_ABS_DEFINED
-// we don't have the full standard library
-inline int64_t abs(int64_t t)
-{
- return t > 0 ? t : -t;
-}
-#endif
-#endif // FEATURE_CORECLR
-
template <typename T>
int signum(T val)
{
// These allocation operations probably require some augmentation -- perhaps allocSiteId,
// something about array length...
- case CORINFO_HELP_NEW_CROSSCONTEXT:
case CORINFO_HELP_NEWFAST:
case CORINFO_HELP_NEWSFAST:
case CORINFO_HELP_NEWSFAST_FINALIZE:
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
[return: MarshalAs(UnmanagedType.Bool)]delegate bool __isCompatibleDelegate(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* objCls, CORINFO_CLASS_STRUCT_* methodParentCls, CORINFO_METHOD_STRUCT_* method, CORINFO_CLASS_STRUCT_* delegateCls, [MarshalAs(UnmanagedType.Bool)] ref bool pfIsOpenDelegate);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
- delegate CorInfoInstantiationVerification __isInstantiationOfVerifiedGeneric(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method);
- [UnmanagedFunctionPointerAttribute(default(CallingConvention))]
- delegate void __initConstraintsForVerification(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, [MarshalAs(UnmanagedType.Bool)] ref bool pfHasCircularClassConstraints, [MarshalAs(UnmanagedType.Bool)] ref bool pfHasCircularMethodConstraint);
- [UnmanagedFunctionPointerAttribute(default(CallingConvention))]
- delegate CorInfoCanSkipVerificationResult __canSkipMethodVerification(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftnHandle);
- [UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate void __methodMustBeLoadedBeforeCodeIsRun(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate CORINFO_METHOD_STRUCT_* __mapMethodDeclToMethodImpl(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate CORINFO_CLASS_STRUCT_* __getTokenTypeAsHandle(IntPtr _this, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
- delegate CorInfoCanSkipVerificationResult __canSkipVerification(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module);
- [UnmanagedFunctionPointerAttribute(default(CallingConvention))]
[return: MarshalAs(UnmanagedType.Bool)]delegate bool __isValidToken(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
[return: MarshalAs(UnmanagedType.Bool)]delegate bool __isValidStringRef(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate char* __getStringLiteral(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK, ref int length);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
- [return: MarshalAs(UnmanagedType.Bool)]delegate bool __shouldEnforceCallvirtRestriction(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* scope);
- [UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate CorInfoType __asCorInfoType(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate byte* __getClassName(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate CorInfoInlineTypeCheck __canInlineTypeCheck(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, CorInfoInlineTypeCheckSource source);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
- [return: MarshalAs(UnmanagedType.Bool)]delegate bool __canInlineTypeCheckWithObjectVTable(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls);
- [UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate uint __getClassAttribs(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
[return: MarshalAs(UnmanagedType.Bool)]delegate bool __isStructRequiringStackAllocRetBuf(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate CorInfoHelpFunc __getSharedCCtorHelper(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* clsHnd);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
- delegate CorInfoHelpFunc __getSecurityPrologHelper(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn);
- [UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate CORINFO_CLASS_STRUCT_* __getTypeForBox(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate CorInfoHelpFunc __getBoxHelper(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate uint __getFieldOffset(IntPtr _this, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
- [return: MarshalAs(UnmanagedType.I1)]delegate bool __isWriteBarrierHelperRequired(IntPtr _this, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field);
- [UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate void __getFieldInfo(IntPtr _this, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, CORINFO_ACCESS_FLAGS flags, CORINFO_FIELD_INFO* pResult);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
[return: MarshalAs(UnmanagedType.I1)]delegate bool __isFieldStatic(IntPtr _this, IntPtr* ppException, CORINFO_FIELD_STRUCT_* fldHnd);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate void __setVars(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, uint cVars, NativeVarInfo* vars);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
- delegate void* __allocateArray(IntPtr _this, IntPtr* ppException, uint cBytes);
+ delegate void* __allocateArray(IntPtr _this, IntPtr* ppException, UIntPtr cBytes);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate void __freeArray(IntPtr _this, IntPtr* ppException, void* array);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate void __embedGenericHandle(IntPtr _this, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, [MarshalAs(UnmanagedType.Bool)]bool fEmbedParent, ref CORINFO_GENERICHANDLE_RESULT pResult);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
- delegate void __getLocationOfThisType(IntPtr _this, IntPtr* ppException, out CORINFO_LOOKUP_KIND _return, CORINFO_METHOD_STRUCT_* context);
- [UnmanagedFunctionPointerAttribute(default(CallingConvention))]
- delegate void* __getPInvokeUnmanagedTarget(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, ref void* ppIndirection);
- [UnmanagedFunctionPointerAttribute(default(CallingConvention))]
- delegate void* __getAddressOfPInvokeFixup(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, ref void* ppIndirection);
+ delegate void __getLocationOfThisType(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* context, ref CORINFO_LOOKUP_KIND pLookupKind);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate void __getAddressOfPInvokeTarget(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, ref CORINFO_CONST_LOOKUP pLookup);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
[return: MarshalAs(UnmanagedType.I1)]delegate bool __convertPInvokeCalliToCall(IntPtr _this, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, [MarshalAs(UnmanagedType.I1)]bool mustConvert);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
- delegate void* __getMemoryManager(IntPtr _this, IntPtr* ppException);
- [UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate void __allocMem(IntPtr _this, IntPtr* ppException, uint hotCodeSize, uint coldCodeSize, uint roDataSize, uint xcptnsCount, CorJitAllocMemFlag flag, ref void* hotCodeBlock, ref void* coldCodeBlock, ref void* roDataBlock);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate void __reserveUnwindInfo(IntPtr _this, IntPtr* ppException, [MarshalAs(UnmanagedType.Bool)]bool isFunclet, [MarshalAs(UnmanagedType.Bool)]bool isColdCode, uint unwindSize);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate void* __allocGCInfo(IntPtr _this, IntPtr* ppException, UIntPtr size);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
- delegate void __yieldExecution(IntPtr _this, IntPtr* ppException);
- [UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate void __setEHcount(IntPtr _this, IntPtr* ppException, uint cEH);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate void __setEHinfo(IntPtr _this, IntPtr* ppException, uint EHnumber, ref CORINFO_EH_CLAUSE clause);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate ushort __getRelocTypeHint(IntPtr _this, IntPtr* ppException, void* target);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
- delegate void __getModuleNativeEntryPointRange(IntPtr _this, IntPtr* ppException, ref void* pStart, ref void* pEnd);
- [UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate uint __getExpectedTargetArchitecture(IntPtr _this, IntPtr* ppException);
[UnmanagedFunctionPointerAttribute(default(CallingConvention))]
delegate uint __getJitFlags(IntPtr _this, IntPtr* ppException, ref CORJIT_FLAGS flags, uint sizeInBytes);
}
}
- static CorInfoInstantiationVerification _isInstantiationOfVerifiedGeneric(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method)
- {
- var _this = GetThis(thisHandle);
- try
- {
- return _this.isInstantiationOfVerifiedGeneric(method);
- }
- catch (Exception ex)
- {
- *ppException = _this.AllocException(ex);
- return default(CorInfoInstantiationVerification);
- }
- }
-
- static void _initConstraintsForVerification(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, [MarshalAs(UnmanagedType.Bool)] ref bool pfHasCircularClassConstraints, [MarshalAs(UnmanagedType.Bool)] ref bool pfHasCircularMethodConstraint)
- {
- var _this = GetThis(thisHandle);
- try
- {
- _this.initConstraintsForVerification(method, ref pfHasCircularClassConstraints, ref pfHasCircularMethodConstraint);
- }
- catch (Exception ex)
- {
- *ppException = _this.AllocException(ex);
- }
- }
-
- static CorInfoCanSkipVerificationResult _canSkipMethodVerification(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftnHandle)
- {
- var _this = GetThis(thisHandle);
- try
- {
- return _this.canSkipMethodVerification(ftnHandle);
- }
- catch (Exception ex)
- {
- *ppException = _this.AllocException(ex);
- return default(CorInfoCanSkipVerificationResult);
- }
- }
-
static void _methodMustBeLoadedBeforeCodeIsRun(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method)
{
var _this = GetThis(thisHandle);
}
}
- static CorInfoCanSkipVerificationResult _canSkipVerification(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module)
- {
- var _this = GetThis(thisHandle);
- try
- {
- return _this.canSkipVerification(module);
- }
- catch (Exception ex)
- {
- *ppException = _this.AllocException(ex);
- return default(CorInfoCanSkipVerificationResult);
- }
- }
-
[return: MarshalAs(UnmanagedType.Bool)]static bool _isValidToken(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK)
{
var _this = GetThis(thisHandle);
}
}
- [return: MarshalAs(UnmanagedType.Bool)]static bool _shouldEnforceCallvirtRestriction(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* scope)
- {
- var _this = GetThis(thisHandle);
- try
- {
- return _this.shouldEnforceCallvirtRestriction(scope);
- }
- catch (Exception ex)
- {
- *ppException = _this.AllocException(ex);
- return default(bool);
- }
- }
-
static CorInfoType _asCorInfoType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
}
}
- [return: MarshalAs(UnmanagedType.Bool)]static bool _canInlineTypeCheckWithObjectVTable(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
- {
- var _this = GetThis(thisHandle);
- try
- {
- return _this.canInlineTypeCheckWithObjectVTable(cls);
- }
- catch (Exception ex)
- {
- *ppException = _this.AllocException(ex);
- return default(bool);
- }
- }
-
static uint _getClassAttribs(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
}
}
- static CorInfoHelpFunc _getSecurityPrologHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn)
- {
- var _this = GetThis(thisHandle);
- try
- {
- return _this.getSecurityPrologHelper(ftn);
- }
- catch (Exception ex)
- {
- *ppException = _this.AllocException(ex);
- return default(CorInfoHelpFunc);
- }
- }
-
static CORINFO_CLASS_STRUCT_* _getTypeForBox(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls)
{
var _this = GetThis(thisHandle);
}
}
- [return: MarshalAs(UnmanagedType.I1)]static bool _isWriteBarrierHelperRequired(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field)
- {
- var _this = GetThis(thisHandle);
- try
- {
- return _this.isWriteBarrierHelperRequired(field);
- }
- catch (Exception ex)
- {
- *ppException = _this.AllocException(ex);
- return default(bool);
- }
- }
-
static void _getFieldInfo(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, CORINFO_ACCESS_FLAGS flags, CORINFO_FIELD_INFO* pResult)
{
var _this = GetThis(thisHandle);
}
}
- static void* _allocateArray(IntPtr thisHandle, IntPtr* ppException, uint cBytes)
+ static void* _allocateArray(IntPtr thisHandle, IntPtr* ppException, UIntPtr cBytes)
{
var _this = GetThis(thisHandle);
try
}
}
- static void _getLocationOfThisType(IntPtr thisHandle, IntPtr* ppException, out CORINFO_LOOKUP_KIND _return, CORINFO_METHOD_STRUCT_* context)
- {
- var _this = GetThis(thisHandle);
- try
- {
- _this.getLocationOfThisType(out _return, context);
- }
- catch (Exception ex)
- {
- *ppException = _this.AllocException(ex);
- _return = default(CORINFO_LOOKUP_KIND);
- }
- }
-
- static void* _getPInvokeUnmanagedTarget(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, ref void* ppIndirection)
+ static void _getLocationOfThisType(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* context, ref CORINFO_LOOKUP_KIND pLookupKind)
{
var _this = GetThis(thisHandle);
try
{
- return _this.getPInvokeUnmanagedTarget(method, ref ppIndirection);
+ _this.getLocationOfThisType(context, ref pLookupKind);
}
catch (Exception ex)
{
*ppException = _this.AllocException(ex);
- return default(void*);
- }
- }
-
- static void* _getAddressOfPInvokeFixup(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, ref void* ppIndirection)
- {
- var _this = GetThis(thisHandle);
- try
- {
- return _this.getAddressOfPInvokeFixup(method, ref ppIndirection);
- }
- catch (Exception ex)
- {
- *ppException = _this.AllocException(ex);
- return default(void*);
}
}
}
}
- static void* _getMemoryManager(IntPtr thisHandle, IntPtr* ppException)
- {
- var _this = GetThis(thisHandle);
- try
- {
- return _this.getMemoryManager();
- }
- catch (Exception ex)
- {
- *ppException = _this.AllocException(ex);
- return default(void*);
- }
- }
-
static void _allocMem(IntPtr thisHandle, IntPtr* ppException, uint hotCodeSize, uint coldCodeSize, uint roDataSize, uint xcptnsCount, CorJitAllocMemFlag flag, ref void* hotCodeBlock, ref void* coldCodeBlock, ref void* roDataBlock)
{
var _this = GetThis(thisHandle);
}
}
- static void _yieldExecution(IntPtr thisHandle, IntPtr* ppException)
- {
- var _this = GetThis(thisHandle);
- try
- {
- _this.yieldExecution();
- }
- catch (Exception ex)
- {
- *ppException = _this.AllocException(ex);
- }
- }
-
static void _setEHcount(IntPtr thisHandle, IntPtr* ppException, uint cEH)
{
var _this = GetThis(thisHandle);
}
}
- static void _getModuleNativeEntryPointRange(IntPtr thisHandle, IntPtr* ppException, ref void* pStart, ref void* pEnd)
- {
- var _this = GetThis(thisHandle);
- try
- {
- _this.getModuleNativeEntryPointRange(ref pStart, ref pEnd);
- }
- catch (Exception ex)
- {
- *ppException = _this.AllocException(ex);
- }
- }
-
static uint _getExpectedTargetArchitecture(IntPtr thisHandle, IntPtr* ppException)
{
var _this = GetThis(thisHandle);
static IntPtr GetUnmanagedCallbacks(out Object keepAlive)
{
- IntPtr * callbacks = (IntPtr *)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 180);
- Object[] delegates = new Object[180];
+ IntPtr * callbacks = (IntPtr *)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 167);
+ Object[] delegates = new Object[167];
var d0 = new __getMethodAttribs(_getMethodAttribs);
callbacks[0] = Marshal.GetFunctionPointerForDelegate(d0);
var d21 = new __isCompatibleDelegate(_isCompatibleDelegate);
callbacks[21] = Marshal.GetFunctionPointerForDelegate(d21);
delegates[21] = d21;
- var d22 = new __isInstantiationOfVerifiedGeneric(_isInstantiationOfVerifiedGeneric);
+ var d22 = new __methodMustBeLoadedBeforeCodeIsRun(_methodMustBeLoadedBeforeCodeIsRun);
callbacks[22] = Marshal.GetFunctionPointerForDelegate(d22);
delegates[22] = d22;
- var d23 = new __initConstraintsForVerification(_initConstraintsForVerification);
+ var d23 = new __mapMethodDeclToMethodImpl(_mapMethodDeclToMethodImpl);
callbacks[23] = Marshal.GetFunctionPointerForDelegate(d23);
delegates[23] = d23;
- var d24 = new __canSkipMethodVerification(_canSkipMethodVerification);
+ var d24 = new __getGSCookie(_getGSCookie);
callbacks[24] = Marshal.GetFunctionPointerForDelegate(d24);
delegates[24] = d24;
- var d25 = new __methodMustBeLoadedBeforeCodeIsRun(_methodMustBeLoadedBeforeCodeIsRun);
+ var d25 = new __resolveToken(_resolveToken);
callbacks[25] = Marshal.GetFunctionPointerForDelegate(d25);
delegates[25] = d25;
- var d26 = new __mapMethodDeclToMethodImpl(_mapMethodDeclToMethodImpl);
+ var d26 = new __tryResolveToken(_tryResolveToken);
callbacks[26] = Marshal.GetFunctionPointerForDelegate(d26);
delegates[26] = d26;
- var d27 = new __getGSCookie(_getGSCookie);
+ var d27 = new __findSig(_findSig);
callbacks[27] = Marshal.GetFunctionPointerForDelegate(d27);
delegates[27] = d27;
- var d28 = new __resolveToken(_resolveToken);
+ var d28 = new __findCallSiteSig(_findCallSiteSig);
callbacks[28] = Marshal.GetFunctionPointerForDelegate(d28);
delegates[28] = d28;
- var d29 = new __tryResolveToken(_tryResolveToken);
+ var d29 = new __getTokenTypeAsHandle(_getTokenTypeAsHandle);
callbacks[29] = Marshal.GetFunctionPointerForDelegate(d29);
delegates[29] = d29;
- var d30 = new __findSig(_findSig);
+ var d30 = new __isValidToken(_isValidToken);
callbacks[30] = Marshal.GetFunctionPointerForDelegate(d30);
delegates[30] = d30;
- var d31 = new __findCallSiteSig(_findCallSiteSig);
+ var d31 = new __isValidStringRef(_isValidStringRef);
callbacks[31] = Marshal.GetFunctionPointerForDelegate(d31);
delegates[31] = d31;
- var d32 = new __getTokenTypeAsHandle(_getTokenTypeAsHandle);
+ var d32 = new __getStringLiteral(_getStringLiteral);
callbacks[32] = Marshal.GetFunctionPointerForDelegate(d32);
delegates[32] = d32;
- var d33 = new __canSkipVerification(_canSkipVerification);
+ var d33 = new __asCorInfoType(_asCorInfoType);
callbacks[33] = Marshal.GetFunctionPointerForDelegate(d33);
delegates[33] = d33;
- var d34 = new __isValidToken(_isValidToken);
+ var d34 = new __getClassName(_getClassName);
callbacks[34] = Marshal.GetFunctionPointerForDelegate(d34);
delegates[34] = d34;
- var d35 = new __isValidStringRef(_isValidStringRef);
+ var d35 = new __getClassNameFromMetadata(_getClassNameFromMetadata);
callbacks[35] = Marshal.GetFunctionPointerForDelegate(d35);
delegates[35] = d35;
- var d36 = new __getStringLiteral(_getStringLiteral);
+ var d36 = new __getTypeInstantiationArgument(_getTypeInstantiationArgument);
callbacks[36] = Marshal.GetFunctionPointerForDelegate(d36);
delegates[36] = d36;
- var d37 = new __shouldEnforceCallvirtRestriction(_shouldEnforceCallvirtRestriction);
+ var d37 = new __appendClassName(_appendClassName);
callbacks[37] = Marshal.GetFunctionPointerForDelegate(d37);
delegates[37] = d37;
- var d38 = new __asCorInfoType(_asCorInfoType);
+ var d38 = new __isValueClass(_isValueClass);
callbacks[38] = Marshal.GetFunctionPointerForDelegate(d38);
delegates[38] = d38;
- var d39 = new __getClassName(_getClassName);
+ var d39 = new __canInlineTypeCheck(_canInlineTypeCheck);
callbacks[39] = Marshal.GetFunctionPointerForDelegate(d39);
delegates[39] = d39;
- var d40 = new __getClassNameFromMetadata(_getClassNameFromMetadata);
+ var d40 = new __getClassAttribs(_getClassAttribs);
callbacks[40] = Marshal.GetFunctionPointerForDelegate(d40);
delegates[40] = d40;
- var d41 = new __getTypeInstantiationArgument(_getTypeInstantiationArgument);
+ var d41 = new __isStructRequiringStackAllocRetBuf(_isStructRequiringStackAllocRetBuf);
callbacks[41] = Marshal.GetFunctionPointerForDelegate(d41);
delegates[41] = d41;
- var d42 = new __appendClassName(_appendClassName);
+ var d42 = new __getClassModule(_getClassModule);
callbacks[42] = Marshal.GetFunctionPointerForDelegate(d42);
delegates[42] = d42;
- var d43 = new __isValueClass(_isValueClass);
+ var d43 = new __getModuleAssembly(_getModuleAssembly);
callbacks[43] = Marshal.GetFunctionPointerForDelegate(d43);
delegates[43] = d43;
- var d44 = new __canInlineTypeCheck(_canInlineTypeCheck);
+ var d44 = new __getAssemblyName(_getAssemblyName);
callbacks[44] = Marshal.GetFunctionPointerForDelegate(d44);
delegates[44] = d44;
- var d45 = new __canInlineTypeCheckWithObjectVTable(_canInlineTypeCheckWithObjectVTable);
+ var d45 = new __LongLifetimeMalloc(_LongLifetimeMalloc);
callbacks[45] = Marshal.GetFunctionPointerForDelegate(d45);
delegates[45] = d45;
- var d46 = new __getClassAttribs(_getClassAttribs);
+ var d46 = new __LongLifetimeFree(_LongLifetimeFree);
callbacks[46] = Marshal.GetFunctionPointerForDelegate(d46);
delegates[46] = d46;
- var d47 = new __isStructRequiringStackAllocRetBuf(_isStructRequiringStackAllocRetBuf);
+ var d47 = new __getClassModuleIdForStatics(_getClassModuleIdForStatics);
callbacks[47] = Marshal.GetFunctionPointerForDelegate(d47);
delegates[47] = d47;
- var d48 = new __getClassModule(_getClassModule);
+ var d48 = new __getClassSize(_getClassSize);
callbacks[48] = Marshal.GetFunctionPointerForDelegate(d48);
delegates[48] = d48;
- var d49 = new __getModuleAssembly(_getModuleAssembly);
+ var d49 = new __getHeapClassSize(_getHeapClassSize);
callbacks[49] = Marshal.GetFunctionPointerForDelegate(d49);
delegates[49] = d49;
- var d50 = new __getAssemblyName(_getAssemblyName);
+ var d50 = new __canAllocateOnStack(_canAllocateOnStack);
callbacks[50] = Marshal.GetFunctionPointerForDelegate(d50);
delegates[50] = d50;
- var d51 = new __LongLifetimeMalloc(_LongLifetimeMalloc);
+ var d51 = new __getClassAlignmentRequirement(_getClassAlignmentRequirement);
callbacks[51] = Marshal.GetFunctionPointerForDelegate(d51);
delegates[51] = d51;
- var d52 = new __LongLifetimeFree(_LongLifetimeFree);
+ var d52 = new __getClassGClayout(_getClassGClayout);
callbacks[52] = Marshal.GetFunctionPointerForDelegate(d52);
delegates[52] = d52;
- var d53 = new __getClassModuleIdForStatics(_getClassModuleIdForStatics);
+ var d53 = new __getClassNumInstanceFields(_getClassNumInstanceFields);
callbacks[53] = Marshal.GetFunctionPointerForDelegate(d53);
delegates[53] = d53;
- var d54 = new __getClassSize(_getClassSize);
+ var d54 = new __getFieldInClass(_getFieldInClass);
callbacks[54] = Marshal.GetFunctionPointerForDelegate(d54);
delegates[54] = d54;
- var d55 = new __getHeapClassSize(_getHeapClassSize);
+ var d55 = new __checkMethodModifier(_checkMethodModifier);
callbacks[55] = Marshal.GetFunctionPointerForDelegate(d55);
delegates[55] = d55;
- var d56 = new __canAllocateOnStack(_canAllocateOnStack);
+ var d56 = new __getNewHelper(_getNewHelper);
callbacks[56] = Marshal.GetFunctionPointerForDelegate(d56);
delegates[56] = d56;
- var d57 = new __getClassAlignmentRequirement(_getClassAlignmentRequirement);
+ var d57 = new __getNewArrHelper(_getNewArrHelper);
callbacks[57] = Marshal.GetFunctionPointerForDelegate(d57);
delegates[57] = d57;
- var d58 = new __getClassGClayout(_getClassGClayout);
+ var d58 = new __getCastingHelper(_getCastingHelper);
callbacks[58] = Marshal.GetFunctionPointerForDelegate(d58);
delegates[58] = d58;
- var d59 = new __getClassNumInstanceFields(_getClassNumInstanceFields);
+ var d59 = new __getSharedCCtorHelper(_getSharedCCtorHelper);
callbacks[59] = Marshal.GetFunctionPointerForDelegate(d59);
delegates[59] = d59;
- var d60 = new __getFieldInClass(_getFieldInClass);
+ var d60 = new __getTypeForBox(_getTypeForBox);
callbacks[60] = Marshal.GetFunctionPointerForDelegate(d60);
delegates[60] = d60;
- var d61 = new __checkMethodModifier(_checkMethodModifier);
+ var d61 = new __getBoxHelper(_getBoxHelper);
callbacks[61] = Marshal.GetFunctionPointerForDelegate(d61);
delegates[61] = d61;
- var d62 = new __getNewHelper(_getNewHelper);
+ var d62 = new __getUnBoxHelper(_getUnBoxHelper);
callbacks[62] = Marshal.GetFunctionPointerForDelegate(d62);
delegates[62] = d62;
- var d63 = new __getNewArrHelper(_getNewArrHelper);
+ var d63 = new __getReadyToRunHelper(_getReadyToRunHelper);
callbacks[63] = Marshal.GetFunctionPointerForDelegate(d63);
delegates[63] = d63;
- var d64 = new __getCastingHelper(_getCastingHelper);
+ var d64 = new __getReadyToRunDelegateCtorHelper(_getReadyToRunDelegateCtorHelper);
callbacks[64] = Marshal.GetFunctionPointerForDelegate(d64);
delegates[64] = d64;
- var d65 = new __getSharedCCtorHelper(_getSharedCCtorHelper);
+ var d65 = new __getHelperName(_getHelperName);
callbacks[65] = Marshal.GetFunctionPointerForDelegate(d65);
delegates[65] = d65;
- var d66 = new __getSecurityPrologHelper(_getSecurityPrologHelper);
+ var d66 = new __initClass(_initClass);
callbacks[66] = Marshal.GetFunctionPointerForDelegate(d66);
delegates[66] = d66;
- var d67 = new __getTypeForBox(_getTypeForBox);
+ var d67 = new __classMustBeLoadedBeforeCodeIsRun(_classMustBeLoadedBeforeCodeIsRun);
callbacks[67] = Marshal.GetFunctionPointerForDelegate(d67);
delegates[67] = d67;
- var d68 = new __getBoxHelper(_getBoxHelper);
+ var d68 = new __getBuiltinClass(_getBuiltinClass);
callbacks[68] = Marshal.GetFunctionPointerForDelegate(d68);
delegates[68] = d68;
- var d69 = new __getUnBoxHelper(_getUnBoxHelper);
+ var d69 = new __getTypeForPrimitiveValueClass(_getTypeForPrimitiveValueClass);
callbacks[69] = Marshal.GetFunctionPointerForDelegate(d69);
delegates[69] = d69;
- var d70 = new __getReadyToRunHelper(_getReadyToRunHelper);
+ var d70 = new __getTypeForPrimitiveNumericClass(_getTypeForPrimitiveNumericClass);
callbacks[70] = Marshal.GetFunctionPointerForDelegate(d70);
delegates[70] = d70;
- var d71 = new __getReadyToRunDelegateCtorHelper(_getReadyToRunDelegateCtorHelper);
+ var d71 = new __canCast(_canCast);
callbacks[71] = Marshal.GetFunctionPointerForDelegate(d71);
delegates[71] = d71;
- var d72 = new __getHelperName(_getHelperName);
+ var d72 = new __areTypesEquivalent(_areTypesEquivalent);
callbacks[72] = Marshal.GetFunctionPointerForDelegate(d72);
delegates[72] = d72;
- var d73 = new __initClass(_initClass);
+ var d73 = new __compareTypesForCast(_compareTypesForCast);
callbacks[73] = Marshal.GetFunctionPointerForDelegate(d73);
delegates[73] = d73;
- var d74 = new __classMustBeLoadedBeforeCodeIsRun(_classMustBeLoadedBeforeCodeIsRun);
+ var d74 = new __compareTypesForEquality(_compareTypesForEquality);
callbacks[74] = Marshal.GetFunctionPointerForDelegate(d74);
delegates[74] = d74;
- var d75 = new __getBuiltinClass(_getBuiltinClass);
+ var d75 = new __mergeClasses(_mergeClasses);
callbacks[75] = Marshal.GetFunctionPointerForDelegate(d75);
delegates[75] = d75;
- var d76 = new __getTypeForPrimitiveValueClass(_getTypeForPrimitiveValueClass);
+ var d76 = new __isMoreSpecificType(_isMoreSpecificType);
callbacks[76] = Marshal.GetFunctionPointerForDelegate(d76);
delegates[76] = d76;
- var d77 = new __getTypeForPrimitiveNumericClass(_getTypeForPrimitiveNumericClass);
+ var d77 = new __getParentType(_getParentType);
callbacks[77] = Marshal.GetFunctionPointerForDelegate(d77);
delegates[77] = d77;
- var d78 = new __canCast(_canCast);
+ var d78 = new __getChildType(_getChildType);
callbacks[78] = Marshal.GetFunctionPointerForDelegate(d78);
delegates[78] = d78;
- var d79 = new __areTypesEquivalent(_areTypesEquivalent);
+ var d79 = new __satisfiesClassConstraints(_satisfiesClassConstraints);
callbacks[79] = Marshal.GetFunctionPointerForDelegate(d79);
delegates[79] = d79;
- var d80 = new __compareTypesForCast(_compareTypesForCast);
+ var d80 = new __isSDArray(_isSDArray);
callbacks[80] = Marshal.GetFunctionPointerForDelegate(d80);
delegates[80] = d80;
- var d81 = new __compareTypesForEquality(_compareTypesForEquality);
+ var d81 = new __getArrayRank(_getArrayRank);
callbacks[81] = Marshal.GetFunctionPointerForDelegate(d81);
delegates[81] = d81;
- var d82 = new __mergeClasses(_mergeClasses);
+ var d82 = new __getArrayInitializationData(_getArrayInitializationData);
callbacks[82] = Marshal.GetFunctionPointerForDelegate(d82);
delegates[82] = d82;
- var d83 = new __isMoreSpecificType(_isMoreSpecificType);
+ var d83 = new __canAccessClass(_canAccessClass);
callbacks[83] = Marshal.GetFunctionPointerForDelegate(d83);
delegates[83] = d83;
- var d84 = new __getParentType(_getParentType);
+ var d84 = new __getFieldName(_getFieldName);
callbacks[84] = Marshal.GetFunctionPointerForDelegate(d84);
delegates[84] = d84;
- var d85 = new __getChildType(_getChildType);
+ var d85 = new __getFieldClass(_getFieldClass);
callbacks[85] = Marshal.GetFunctionPointerForDelegate(d85);
delegates[85] = d85;
- var d86 = new __satisfiesClassConstraints(_satisfiesClassConstraints);
+ var d86 = new __getFieldType(_getFieldType);
callbacks[86] = Marshal.GetFunctionPointerForDelegate(d86);
delegates[86] = d86;
- var d87 = new __isSDArray(_isSDArray);
+ var d87 = new __getFieldOffset(_getFieldOffset);
callbacks[87] = Marshal.GetFunctionPointerForDelegate(d87);
delegates[87] = d87;
- var d88 = new __getArrayRank(_getArrayRank);
+ var d88 = new __getFieldInfo(_getFieldInfo);
callbacks[88] = Marshal.GetFunctionPointerForDelegate(d88);
delegates[88] = d88;
- var d89 = new __getArrayInitializationData(_getArrayInitializationData);
+ var d89 = new __isFieldStatic(_isFieldStatic);
callbacks[89] = Marshal.GetFunctionPointerForDelegate(d89);
delegates[89] = d89;
- var d90 = new __canAccessClass(_canAccessClass);
+ var d90 = new __getBoundaries(_getBoundaries);
callbacks[90] = Marshal.GetFunctionPointerForDelegate(d90);
delegates[90] = d90;
- var d91 = new __getFieldName(_getFieldName);
+ var d91 = new __setBoundaries(_setBoundaries);
callbacks[91] = Marshal.GetFunctionPointerForDelegate(d91);
delegates[91] = d91;
- var d92 = new __getFieldClass(_getFieldClass);
+ var d92 = new __getVars(_getVars);
callbacks[92] = Marshal.GetFunctionPointerForDelegate(d92);
delegates[92] = d92;
- var d93 = new __getFieldType(_getFieldType);
+ var d93 = new __setVars(_setVars);
callbacks[93] = Marshal.GetFunctionPointerForDelegate(d93);
delegates[93] = d93;
- var d94 = new __getFieldOffset(_getFieldOffset);
+ var d94 = new __allocateArray(_allocateArray);
callbacks[94] = Marshal.GetFunctionPointerForDelegate(d94);
delegates[94] = d94;
- var d95 = new __isWriteBarrierHelperRequired(_isWriteBarrierHelperRequired);
+ var d95 = new __freeArray(_freeArray);
callbacks[95] = Marshal.GetFunctionPointerForDelegate(d95);
delegates[95] = d95;
- var d96 = new __getFieldInfo(_getFieldInfo);
+ var d96 = new __getArgNext(_getArgNext);
callbacks[96] = Marshal.GetFunctionPointerForDelegate(d96);
delegates[96] = d96;
- var d97 = new __isFieldStatic(_isFieldStatic);
+ var d97 = new __getArgType(_getArgType);
callbacks[97] = Marshal.GetFunctionPointerForDelegate(d97);
delegates[97] = d97;
- var d98 = new __getBoundaries(_getBoundaries);
+ var d98 = new __getArgClass(_getArgClass);
callbacks[98] = Marshal.GetFunctionPointerForDelegate(d98);
delegates[98] = d98;
- var d99 = new __setBoundaries(_setBoundaries);
+ var d99 = new __getHFAType(_getHFAType);
callbacks[99] = Marshal.GetFunctionPointerForDelegate(d99);
delegates[99] = d99;
- var d100 = new __getVars(_getVars);
+ var d100 = new __GetErrorHRESULT(_GetErrorHRESULT);
callbacks[100] = Marshal.GetFunctionPointerForDelegate(d100);
delegates[100] = d100;
- var d101 = new __setVars(_setVars);
+ var d101 = new __GetErrorMessage(_GetErrorMessage);
callbacks[101] = Marshal.GetFunctionPointerForDelegate(d101);
delegates[101] = d101;
- var d102 = new __allocateArray(_allocateArray);
+ var d102 = new __FilterException(_FilterException);
callbacks[102] = Marshal.GetFunctionPointerForDelegate(d102);
delegates[102] = d102;
- var d103 = new __freeArray(_freeArray);
+ var d103 = new __HandleException(_HandleException);
callbacks[103] = Marshal.GetFunctionPointerForDelegate(d103);
delegates[103] = d103;
- var d104 = new __getArgNext(_getArgNext);
+ var d104 = new __ThrowExceptionForJitResult(_ThrowExceptionForJitResult);
callbacks[104] = Marshal.GetFunctionPointerForDelegate(d104);
delegates[104] = d104;
- var d105 = new __getArgType(_getArgType);
+ var d105 = new __ThrowExceptionForHelper(_ThrowExceptionForHelper);
callbacks[105] = Marshal.GetFunctionPointerForDelegate(d105);
delegates[105] = d105;
- var d106 = new __getArgClass(_getArgClass);
+ var d106 = new __runWithErrorTrap(_runWithErrorTrap);
callbacks[106] = Marshal.GetFunctionPointerForDelegate(d106);
delegates[106] = d106;
- var d107 = new __getHFAType(_getHFAType);
+ var d107 = new __getEEInfo(_getEEInfo);
callbacks[107] = Marshal.GetFunctionPointerForDelegate(d107);
delegates[107] = d107;
- var d108 = new __GetErrorHRESULT(_GetErrorHRESULT);
+ var d108 = new __getJitTimeLogFilename(_getJitTimeLogFilename);
callbacks[108] = Marshal.GetFunctionPointerForDelegate(d108);
delegates[108] = d108;
- var d109 = new __GetErrorMessage(_GetErrorMessage);
+ var d109 = new __getMethodDefFromMethod(_getMethodDefFromMethod);
callbacks[109] = Marshal.GetFunctionPointerForDelegate(d109);
delegates[109] = d109;
- var d110 = new __FilterException(_FilterException);
+ var d110 = new __getMethodName(_getMethodName);
callbacks[110] = Marshal.GetFunctionPointerForDelegate(d110);
delegates[110] = d110;
- var d111 = new __HandleException(_HandleException);
+ var d111 = new __getMethodNameFromMetadata(_getMethodNameFromMetadata);
callbacks[111] = Marshal.GetFunctionPointerForDelegate(d111);
delegates[111] = d111;
- var d112 = new __ThrowExceptionForJitResult(_ThrowExceptionForJitResult);
+ var d112 = new __getMethodHash(_getMethodHash);
callbacks[112] = Marshal.GetFunctionPointerForDelegate(d112);
delegates[112] = d112;
- var d113 = new __ThrowExceptionForHelper(_ThrowExceptionForHelper);
+ var d113 = new __findNameOfToken(_findNameOfToken);
callbacks[113] = Marshal.GetFunctionPointerForDelegate(d113);
delegates[113] = d113;
- var d114 = new __runWithErrorTrap(_runWithErrorTrap);
+ var d114 = new __getSystemVAmd64PassStructInRegisterDescriptor(_getSystemVAmd64PassStructInRegisterDescriptor);
callbacks[114] = Marshal.GetFunctionPointerForDelegate(d114);
delegates[114] = d114;
- var d115 = new __getEEInfo(_getEEInfo);
+ var d115 = new __getThreadTLSIndex(_getThreadTLSIndex);
callbacks[115] = Marshal.GetFunctionPointerForDelegate(d115);
delegates[115] = d115;
- var d116 = new __getJitTimeLogFilename(_getJitTimeLogFilename);
+ var d116 = new __getInlinedCallFrameVptr(_getInlinedCallFrameVptr);
callbacks[116] = Marshal.GetFunctionPointerForDelegate(d116);
delegates[116] = d116;
- var d117 = new __getMethodDefFromMethod(_getMethodDefFromMethod);
+ var d117 = new __getAddrOfCaptureThreadGlobal(_getAddrOfCaptureThreadGlobal);
callbacks[117] = Marshal.GetFunctionPointerForDelegate(d117);
delegates[117] = d117;
- var d118 = new __getMethodName(_getMethodName);
+ var d118 = new __getHelperFtn(_getHelperFtn);
callbacks[118] = Marshal.GetFunctionPointerForDelegate(d118);
delegates[118] = d118;
- var d119 = new __getMethodNameFromMetadata(_getMethodNameFromMetadata);
+ var d119 = new __getFunctionEntryPoint(_getFunctionEntryPoint);
callbacks[119] = Marshal.GetFunctionPointerForDelegate(d119);
delegates[119] = d119;
- var d120 = new __getMethodHash(_getMethodHash);
+ var d120 = new __getFunctionFixedEntryPoint(_getFunctionFixedEntryPoint);
callbacks[120] = Marshal.GetFunctionPointerForDelegate(d120);
delegates[120] = d120;
- var d121 = new __findNameOfToken(_findNameOfToken);
+ var d121 = new __getMethodSync(_getMethodSync);
callbacks[121] = Marshal.GetFunctionPointerForDelegate(d121);
delegates[121] = d121;
- var d122 = new __getSystemVAmd64PassStructInRegisterDescriptor(_getSystemVAmd64PassStructInRegisterDescriptor);
+ var d122 = new __getLazyStringLiteralHelper(_getLazyStringLiteralHelper);
callbacks[122] = Marshal.GetFunctionPointerForDelegate(d122);
delegates[122] = d122;
- var d123 = new __getThreadTLSIndex(_getThreadTLSIndex);
+ var d123 = new __embedModuleHandle(_embedModuleHandle);
callbacks[123] = Marshal.GetFunctionPointerForDelegate(d123);
delegates[123] = d123;
- var d124 = new __getInlinedCallFrameVptr(_getInlinedCallFrameVptr);
+ var d124 = new __embedClassHandle(_embedClassHandle);
callbacks[124] = Marshal.GetFunctionPointerForDelegate(d124);
delegates[124] = d124;
- var d125 = new __getAddrOfCaptureThreadGlobal(_getAddrOfCaptureThreadGlobal);
+ var d125 = new __embedMethodHandle(_embedMethodHandle);
callbacks[125] = Marshal.GetFunctionPointerForDelegate(d125);
delegates[125] = d125;
- var d126 = new __getHelperFtn(_getHelperFtn);
+ var d126 = new __embedFieldHandle(_embedFieldHandle);
callbacks[126] = Marshal.GetFunctionPointerForDelegate(d126);
delegates[126] = d126;
- var d127 = new __getFunctionEntryPoint(_getFunctionEntryPoint);
+ var d127 = new __embedGenericHandle(_embedGenericHandle);
callbacks[127] = Marshal.GetFunctionPointerForDelegate(d127);
delegates[127] = d127;
- var d128 = new __getFunctionFixedEntryPoint(_getFunctionFixedEntryPoint);
+ var d128 = new __getLocationOfThisType(_getLocationOfThisType);
callbacks[128] = Marshal.GetFunctionPointerForDelegate(d128);
delegates[128] = d128;
- var d129 = new __getMethodSync(_getMethodSync);
+ var d129 = new __getAddressOfPInvokeTarget(_getAddressOfPInvokeTarget);
callbacks[129] = Marshal.GetFunctionPointerForDelegate(d129);
delegates[129] = d129;
- var d130 = new __getLazyStringLiteralHelper(_getLazyStringLiteralHelper);
+ var d130 = new __GetCookieForPInvokeCalliSig(_GetCookieForPInvokeCalliSig);
callbacks[130] = Marshal.GetFunctionPointerForDelegate(d130);
delegates[130] = d130;
- var d131 = new __embedModuleHandle(_embedModuleHandle);
+ var d131 = new __canGetCookieForPInvokeCalliSig(_canGetCookieForPInvokeCalliSig);
callbacks[131] = Marshal.GetFunctionPointerForDelegate(d131);
delegates[131] = d131;
- var d132 = new __embedClassHandle(_embedClassHandle);
+ var d132 = new __getJustMyCodeHandle(_getJustMyCodeHandle);
callbacks[132] = Marshal.GetFunctionPointerForDelegate(d132);
delegates[132] = d132;
- var d133 = new __embedMethodHandle(_embedMethodHandle);
+ var d133 = new __GetProfilingHandle(_GetProfilingHandle);
callbacks[133] = Marshal.GetFunctionPointerForDelegate(d133);
delegates[133] = d133;
- var d134 = new __embedFieldHandle(_embedFieldHandle);
+ var d134 = new __getCallInfo(_getCallInfo);
callbacks[134] = Marshal.GetFunctionPointerForDelegate(d134);
delegates[134] = d134;
- var d135 = new __embedGenericHandle(_embedGenericHandle);
+ var d135 = new __canAccessFamily(_canAccessFamily);
callbacks[135] = Marshal.GetFunctionPointerForDelegate(d135);
delegates[135] = d135;
- var d136 = new __getLocationOfThisType(_getLocationOfThisType);
+ var d136 = new __isRIDClassDomainID(_isRIDClassDomainID);
callbacks[136] = Marshal.GetFunctionPointerForDelegate(d136);
delegates[136] = d136;
- var d137 = new __getPInvokeUnmanagedTarget(_getPInvokeUnmanagedTarget);
+ var d137 = new __getClassDomainID(_getClassDomainID);
callbacks[137] = Marshal.GetFunctionPointerForDelegate(d137);
delegates[137] = d137;
- var d138 = new __getAddressOfPInvokeFixup(_getAddressOfPInvokeFixup);
+ var d138 = new __getFieldAddress(_getFieldAddress);
callbacks[138] = Marshal.GetFunctionPointerForDelegate(d138);
delegates[138] = d138;
- var d139 = new __getAddressOfPInvokeTarget(_getAddressOfPInvokeTarget);
+ var d139 = new __getStaticFieldCurrentClass(_getStaticFieldCurrentClass);
callbacks[139] = Marshal.GetFunctionPointerForDelegate(d139);
delegates[139] = d139;
- var d140 = new __GetCookieForPInvokeCalliSig(_GetCookieForPInvokeCalliSig);
+ var d140 = new __getVarArgsHandle(_getVarArgsHandle);
callbacks[140] = Marshal.GetFunctionPointerForDelegate(d140);
delegates[140] = d140;
- var d141 = new __canGetCookieForPInvokeCalliSig(_canGetCookieForPInvokeCalliSig);
+ var d141 = new __canGetVarArgsHandle(_canGetVarArgsHandle);
callbacks[141] = Marshal.GetFunctionPointerForDelegate(d141);
delegates[141] = d141;
- var d142 = new __getJustMyCodeHandle(_getJustMyCodeHandle);
+ var d142 = new __constructStringLiteral(_constructStringLiteral);
callbacks[142] = Marshal.GetFunctionPointerForDelegate(d142);
delegates[142] = d142;
- var d143 = new __GetProfilingHandle(_GetProfilingHandle);
+ var d143 = new __emptyStringLiteral(_emptyStringLiteral);
callbacks[143] = Marshal.GetFunctionPointerForDelegate(d143);
delegates[143] = d143;
- var d144 = new __getCallInfo(_getCallInfo);
+ var d144 = new __getFieldThreadLocalStoreID(_getFieldThreadLocalStoreID);
callbacks[144] = Marshal.GetFunctionPointerForDelegate(d144);
delegates[144] = d144;
- var d145 = new __canAccessFamily(_canAccessFamily);
+ var d145 = new __setOverride(_setOverride);
callbacks[145] = Marshal.GetFunctionPointerForDelegate(d145);
delegates[145] = d145;
- var d146 = new __isRIDClassDomainID(_isRIDClassDomainID);
+ var d146 = new __addActiveDependency(_addActiveDependency);
callbacks[146] = Marshal.GetFunctionPointerForDelegate(d146);
delegates[146] = d146;
- var d147 = new __getClassDomainID(_getClassDomainID);
+ var d147 = new __GetDelegateCtor(_GetDelegateCtor);
callbacks[147] = Marshal.GetFunctionPointerForDelegate(d147);
delegates[147] = d147;
- var d148 = new __getFieldAddress(_getFieldAddress);
+ var d148 = new __MethodCompileComplete(_MethodCompileComplete);
callbacks[148] = Marshal.GetFunctionPointerForDelegate(d148);
delegates[148] = d148;
- var d149 = new __getStaticFieldCurrentClass(_getStaticFieldCurrentClass);
+ var d149 = new __getTailCallCopyArgsThunk(_getTailCallCopyArgsThunk);
callbacks[149] = Marshal.GetFunctionPointerForDelegate(d149);
delegates[149] = d149;
- var d150 = new __getVarArgsHandle(_getVarArgsHandle);
+ var d150 = new __convertPInvokeCalliToCall(_convertPInvokeCalliToCall);
callbacks[150] = Marshal.GetFunctionPointerForDelegate(d150);
delegates[150] = d150;
- var d151 = new __canGetVarArgsHandle(_canGetVarArgsHandle);
+ var d151 = new __allocMem(_allocMem);
callbacks[151] = Marshal.GetFunctionPointerForDelegate(d151);
delegates[151] = d151;
- var d152 = new __constructStringLiteral(_constructStringLiteral);
+ var d152 = new __reserveUnwindInfo(_reserveUnwindInfo);
callbacks[152] = Marshal.GetFunctionPointerForDelegate(d152);
delegates[152] = d152;
- var d153 = new __emptyStringLiteral(_emptyStringLiteral);
+ var d153 = new __allocUnwindInfo(_allocUnwindInfo);
callbacks[153] = Marshal.GetFunctionPointerForDelegate(d153);
delegates[153] = d153;
- var d154 = new __getFieldThreadLocalStoreID(_getFieldThreadLocalStoreID);
+ var d154 = new __allocGCInfo(_allocGCInfo);
callbacks[154] = Marshal.GetFunctionPointerForDelegate(d154);
delegates[154] = d154;
- var d155 = new __setOverride(_setOverride);
+ var d155 = new __setEHcount(_setEHcount);
callbacks[155] = Marshal.GetFunctionPointerForDelegate(d155);
delegates[155] = d155;
- var d156 = new __addActiveDependency(_addActiveDependency);
+ var d156 = new __setEHinfo(_setEHinfo);
callbacks[156] = Marshal.GetFunctionPointerForDelegate(d156);
delegates[156] = d156;
- var d157 = new __GetDelegateCtor(_GetDelegateCtor);
+ var d157 = new __logMsg(_logMsg);
callbacks[157] = Marshal.GetFunctionPointerForDelegate(d157);
delegates[157] = d157;
- var d158 = new __MethodCompileComplete(_MethodCompileComplete);
+ var d158 = new __doAssert(_doAssert);
callbacks[158] = Marshal.GetFunctionPointerForDelegate(d158);
delegates[158] = d158;
- var d159 = new __getTailCallCopyArgsThunk(_getTailCallCopyArgsThunk);
+ var d159 = new __reportFatalError(_reportFatalError);
callbacks[159] = Marshal.GetFunctionPointerForDelegate(d159);
delegates[159] = d159;
- var d160 = new __convertPInvokeCalliToCall(_convertPInvokeCalliToCall);
+ var d160 = new __allocMethodBlockCounts(_allocMethodBlockCounts);
callbacks[160] = Marshal.GetFunctionPointerForDelegate(d160);
delegates[160] = d160;
- var d161 = new __getMemoryManager(_getMemoryManager);
+ var d161 = new __getMethodBlockCounts(_getMethodBlockCounts);
callbacks[161] = Marshal.GetFunctionPointerForDelegate(d161);
delegates[161] = d161;
- var d162 = new __allocMem(_allocMem);
+ var d162 = new __recordCallSite(_recordCallSite);
callbacks[162] = Marshal.GetFunctionPointerForDelegate(d162);
delegates[162] = d162;
- var d163 = new __reserveUnwindInfo(_reserveUnwindInfo);
+ var d163 = new __recordRelocation(_recordRelocation);
callbacks[163] = Marshal.GetFunctionPointerForDelegate(d163);
delegates[163] = d163;
- var d164 = new __allocUnwindInfo(_allocUnwindInfo);
+ var d164 = new __getRelocTypeHint(_getRelocTypeHint);
callbacks[164] = Marshal.GetFunctionPointerForDelegate(d164);
delegates[164] = d164;
- var d165 = new __allocGCInfo(_allocGCInfo);
+ var d165 = new __getExpectedTargetArchitecture(_getExpectedTargetArchitecture);
callbacks[165] = Marshal.GetFunctionPointerForDelegate(d165);
delegates[165] = d165;
- var d166 = new __yieldExecution(_yieldExecution);
+ var d166 = new __getJitFlags(_getJitFlags);
callbacks[166] = Marshal.GetFunctionPointerForDelegate(d166);
delegates[166] = d166;
- var d167 = new __setEHcount(_setEHcount);
- callbacks[167] = Marshal.GetFunctionPointerForDelegate(d167);
- delegates[167] = d167;
- var d168 = new __setEHinfo(_setEHinfo);
- callbacks[168] = Marshal.GetFunctionPointerForDelegate(d168);
- delegates[168] = d168;
- var d169 = new __logMsg(_logMsg);
- callbacks[169] = Marshal.GetFunctionPointerForDelegate(d169);
- delegates[169] = d169;
- var d170 = new __doAssert(_doAssert);
- callbacks[170] = Marshal.GetFunctionPointerForDelegate(d170);
- delegates[170] = d170;
- var d171 = new __reportFatalError(_reportFatalError);
- callbacks[171] = Marshal.GetFunctionPointerForDelegate(d171);
- delegates[171] = d171;
- var d172 = new __allocMethodBlockCounts(_allocMethodBlockCounts);
- callbacks[172] = Marshal.GetFunctionPointerForDelegate(d172);
- delegates[172] = d172;
- var d173 = new __getMethodBlockCounts(_getMethodBlockCounts);
- callbacks[173] = Marshal.GetFunctionPointerForDelegate(d173);
- delegates[173] = d173;
- var d174 = new __recordCallSite(_recordCallSite);
- callbacks[174] = Marshal.GetFunctionPointerForDelegate(d174);
- delegates[174] = d174;
- var d175 = new __recordRelocation(_recordRelocation);
- callbacks[175] = Marshal.GetFunctionPointerForDelegate(d175);
- delegates[175] = d175;
- var d176 = new __getRelocTypeHint(_getRelocTypeHint);
- callbacks[176] = Marshal.GetFunctionPointerForDelegate(d176);
- delegates[176] = d176;
- var d177 = new __getModuleNativeEntryPointRange(_getModuleNativeEntryPointRange);
- callbacks[177] = Marshal.GetFunctionPointerForDelegate(d177);
- delegates[177] = d177;
- var d178 = new __getExpectedTargetArchitecture(_getExpectedTargetArchitecture);
- callbacks[178] = Marshal.GetFunctionPointerForDelegate(d178);
- delegates[178] = d178;
- var d179 = new __getJitFlags(_getJitFlags);
- callbacks[179] = Marshal.GetFunctionPointerForDelegate(d179);
- delegates[179] = d179;
keepAlive = delegates;
return (IntPtr)callbacks;
/* Allocating a new object. Always use ICorClassInfo::getNewHelper() to decide
which is the right helper to use to allocate an object of a given type. */
- CORINFO_HELP_NEW_CROSSCONTEXT, // cross context new object
CORINFO_HELP_NEWFAST,
CORINFO_HELP_NEWSFAST, // allocator for small, non-finalizer, non-array object
CORINFO_HELP_NEWSFAST_FINALIZE, // allocator for small, finalizable, non-array object
CORINFO_HELP_GETSYNCFROMCLASSHANDLE, // Given a generics class handle, returns the sync monitor
// in its ManagedClassObject
- /* Security callout support */
-
- CORINFO_HELP_SECURITY_PROLOG, // Required if CORINFO_FLG_SECURITYCHECK is set, or CORINFO_FLG_NOSECURITYWRAP is not set
- CORINFO_HELP_SECURITY_PROLOG_FRAMED, // Slow version of CORINFO_HELP_SECURITY_PROLOG. Used for instrumentation.
-
- CORINFO_HELP_METHOD_ACCESS_CHECK, // Callouts to runtime security access checks
- CORINFO_HELP_FIELD_ACCESS_CHECK,
- CORINFO_HELP_CLASS_ACCESS_CHECK,
-
- CORINFO_HELP_DELEGATE_SECURITY_CHECK, // Callout to delegate security transparency check
-
- /* Verification runtime callout support */
-
- CORINFO_HELP_VERIFICATION_RUNTIME_CHECK, // Do a Demand for UnmanagedCode permission at runtime
-
/* GC support */
CORINFO_HELP_STOP_FOR_GC, // Call GC (force a GC)
}
}
- result |= CorInfoFlag.CORINFO_FLG_NOSECURITYWRAP;
-
return (uint)result;
}
{ throw new NotImplementedException("satisfiesMethodConstraints"); }
private bool isCompatibleDelegate(CORINFO_CLASS_STRUCT_* objCls, CORINFO_CLASS_STRUCT_* methodParentCls, CORINFO_METHOD_STRUCT_* method, CORINFO_CLASS_STRUCT_* delegateCls, ref bool pfIsOpenDelegate)
{ throw new NotImplementedException("isCompatibleDelegate"); }
- private CorInfoInstantiationVerification isInstantiationOfVerifiedGeneric(CORINFO_METHOD_STRUCT_* method)
- { throw new NotImplementedException("isInstantiationOfVerifiedGeneric"); }
- private void initConstraintsForVerification(CORINFO_METHOD_STRUCT_* method, ref bool pfHasCircularClassConstraints, ref bool pfHasCircularMethodConstraint)
- { throw new NotImplementedException("isInstantiationOfVerifiedGeneric"); }
-
- private CorInfoCanSkipVerificationResult canSkipMethodVerification(CORINFO_METHOD_STRUCT_* ftnHandle)
- {
- return CorInfoCanSkipVerificationResult.CORINFO_VERIFICATION_CAN_SKIP;
- }
private void methodMustBeLoadedBeforeCodeIsRun(CORINFO_METHOD_STRUCT_* method)
{
{ throw new NotImplementedException("isValidToken"); }
private bool isValidStringRef(CORINFO_MODULE_STRUCT_* module, uint metaTOK)
{ throw new NotImplementedException("isValidStringRef"); }
- private bool shouldEnforceCallvirtRestriction(CORINFO_MODULE_STRUCT_* scope)
- { throw new NotImplementedException("shouldEnforceCallvirtRestriction"); }
private char* getStringLiteral(CORINFO_MODULE_STRUCT_* module, uint metaTOK, ref int length)
{
return CorInfoInlineTypeCheck.CORINFO_INLINE_TYPECHECK_PASS;
}
- private bool canInlineTypeCheckWithObjectVTable(CORINFO_CLASS_STRUCT_* cls) { throw new NotImplementedException(); }
-
private uint getClassAttribs(CORINFO_CLASS_STRUCT_* cls)
{
TypeDesc type = HandleToObject(cls);
private CorInfoHelpFunc getSharedCCtorHelper(CORINFO_CLASS_STRUCT_* clsHnd)
{ throw new NotImplementedException("getSharedCCtorHelper"); }
- private CorInfoHelpFunc getSecurityPrologHelper(CORINFO_METHOD_STRUCT_* ftn)
- { throw new NotImplementedException("getSecurityPrologHelper"); }
private CORINFO_CLASS_STRUCT_* getTypeForBox(CORINFO_CLASS_STRUCT_* cls)
{
return (uint)fieldDesc.Offset.AsInt;
}
- private bool isWriteBarrierHelperRequired(CORINFO_FIELD_STRUCT_* field)
- { throw new NotImplementedException("isWriteBarrierHelperRequired"); }
-
private CORINFO_FIELD_ACCESSOR getFieldIntrinsic(FieldDesc field)
{
Debug.Assert(field.IsIntrinsic);
extendOthers = true;
}
- private void* allocateArray(uint cBytes)
+ private void* allocateArray(UIntPtr cBytes)
{
- return (void*)Marshal.AllocCoTaskMem((int)cBytes);
+ return (void*)Marshal.AllocHGlobal((IntPtr)(void*)cBytes);
}
private void freeArray(void* array)
{
- Marshal.FreeCoTaskMem((IntPtr)array);
+ Marshal.FreeHGlobal((IntPtr)array);
}
private CORINFO_ARG_LIST_STRUCT_* getArgNext(CORINFO_ARG_LIST_STRUCT_* args)
pEEInfoOut.offsetOfDelegateInstance = (uint)pointerSize; // Delegate::m_firstParameter
pEEInfoOut.offsetOfDelegateFirstTarget = OffsetOfDelegateFirstTarget;
- pEEInfoOut.offsetOfObjArrayData = (uint)(2 * pointerSize);
-
pEEInfoOut.sizeOfReversePInvokeFrame = (uint)(2 * pointerSize);
pEEInfoOut.osPageSize = new UIntPtr(0x1000);
}
}
- private void getLocationOfThisType(out CORINFO_LOOKUP_KIND result, CORINFO_METHOD_STRUCT_* context)
+ private void getLocationOfThisType(CORINFO_METHOD_STRUCT_* context, ref CORINFO_LOOKUP_KIND result)
{
- result = new CORINFO_LOOKUP_KIND();
-
MethodDesc method = HandleToObject(context);
if (method.IsSharedByGenericInstantiations)
}
}
- private void* getPInvokeUnmanagedTarget(CORINFO_METHOD_STRUCT_* method, ref void* ppIndirection)
- { throw new NotImplementedException("getPInvokeUnmanagedTarget"); }
- private void* getAddressOfPInvokeFixup(CORINFO_METHOD_STRUCT_* method, ref void* ppIndirection)
- { throw new NotImplementedException("getAddressOfPInvokeFixup"); }
private void* GetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, ref void* ppIndirection)
{ throw new NotImplementedException("GetCookieForPInvokeCalliSig"); }
private CORINFO_JUST_MY_CODE_HANDLE_* getJustMyCodeHandle(CORINFO_METHOD_STRUCT_* method, ref CORINFO_JUST_MY_CODE_HANDLE_* ppIndirection)
return null;
}
- private void* getMemoryManager()
- {
- // This method is completely handled by the C++ wrapper to the JIT-EE interface,
- // and should never reach the managed implementation.
- Debug.Fail("CorInfoImpl.getMemoryManager should not be called");
- throw new NotSupportedException("getMemoryManager");
- }
-
private byte[] _code;
private byte[] _coldCode;
return (void*)GetPin(_gcInfo);
}
- private void yieldExecution()
- {
- // Nothing to do
- }
-
private bool logMsg(uint level, byte* fmt, IntPtr args)
{
// Console.WriteLine(Marshal.PtrToStringAnsi((IntPtr)fmt));
}
}
- private void getModuleNativeEntryPointRange(ref void* pStart, ref void* pEnd)
- { throw new NotImplementedException("getModuleNativeEntryPointRange"); }
-
private uint getExpectedTargetArchitecture()
{
TargetArchitecture arch = _compilation.TypeSystemContext.Target.Architecture;
public enum CorInfoMethodRuntimeFlags
{
CORINFO_FLG_BAD_INLINEE = 0x00000001, // The method is not suitable for inlining
- CORINFO_FLG_VERIFIABLE = 0x00000002, // The method has verifiable code
- CORINFO_FLG_UNVERIFIABLE = 0x00000004, // The method has unverifiable code
+ // unused = 0x00000002,
+ // unused = 0x00000004,
CORINFO_FLG_SWITCHED_TO_MIN_OPT = 0x00000008, // The JIT decided to switch to MinOpt for this method, when it was not requested
CORINFO_FLG_SWITCHED_TO_OPTIMIZED = 0x00000010, // The JIT decided to switch to tier 1 for this method, when a different tier was requested
};
{
CORINFO_ACCESS_ANY = 0x0000, // Normal access
CORINFO_ACCESS_THIS = 0x0001, // Accessed via the this reference
- CORINFO_ACCESS_UNWRAP = 0x0002, // Accessed via an unwrap reference
+ // CORINFO_ACCESS_UNUSED = 0x0002,
CORINFO_ACCESS_NONNULL = 0x0004, // Instance is guaranteed non-null
CORINFO_FLG_SHAREDINST = 0x00020000, // the code for this method is shared between different generic instantiations (also set on classes/types)
CORINFO_FLG_DELEGATE_INVOKE = 0x00040000, // "Delegate
CORINFO_FLG_PINVOKE = 0x00080000, // Is a P/Invoke call
- CORINFO_FLG_SECURITYCHECK = 0x00100000, // Is one of the security routines that does a stackwalk (e.g. Assert, Demand)
+ // CORINFO_FLG_UNUSED = 0x00100000,
CORINFO_FLG_NOGCCHECK = 0x00200000, // This method is FCALL that has no GC check. Don't put alone in loops
CORINFO_FLG_INTRINSIC = 0x00400000, // This method MAY have an intrinsic ID
CORINFO_FLG_CONSTRUCTOR = 0x00800000, // This method is an instance or type initializer
CORINFO_FLG_AGGRESSIVE_OPT = 0x01000000, // The method may contain hot code and should be aggressively optimized if possible
CORINFO_FLG_DISABLE_TIER0_FOR_LOOPS = 0x02000000, // Indicates that tier 0 JIT should not be used for a method that contains a loop
- CORINFO_FLG_NOSECURITYWRAP = 0x04000000, // The method requires no security checks
+ // CORINFO_FLG_UNUSED = 0x04000000,
CORINFO_FLG_DONT_INLINE = 0x10000000, // The method should not be inlined
CORINFO_FLG_DONT_INLINE_CALLER = 0x20000000, // The method should not be inlined, nor should its callers. It cannot be tail called.
CORINFO_FLG_JIT_INTRINSIC = 0x40000000, // Method is a potential jit intrinsic; verify identity by name check
CORINFO_FLG_ARRAY = 0x00080000, // class is an array class (initialized differently)
CORINFO_FLG_OVERLAPPING_FIELDS = 0x00100000, // struct or class has fields that overlap (aka union)
CORINFO_FLG_INTERFACE = 0x00200000, // it is an interface
- CORINFO_FLG_CONTEXTFUL = 0x00400000, // is this a contextful class?
+ // CORINFO_FLG_UNUSED = 0x00400000,
CORINFO_FLG_CUSTOMLAYOUT = 0x00800000, // does this struct have custom layout?
CORINFO_FLG_CONTAINS_GC_PTR = 0x01000000, // does the class contain a gc ptr ?
CORINFO_FLG_DELEGATE = 0x02000000, // is this a subclass of delegate or multicast delegate ?
- CORINFO_FLG_MARSHAL_BYREF = 0x04000000, // is this a subclass of MarshalByRef ?
+ // CORINFO_FLG_UNUSED = 0x04000000,
CORINFO_FLG_CONTAINS_STACK_PTR = 0x08000000, // This class has a stack pointer inside it
CORINFO_FLG_VARIANCE = 0x10000000, // MethodTable::HasVariance (sealed does *not* mean uncast-able)
CORINFO_FLG_BEFOREFIELDINIT = 0x20000000, // Additional flexibility for when to run .cctor (see code:#ClassConstructionFlags)
{
CORINFO_ACCESS_ALLOWED = 0, // Call allowed
CORINFO_ACCESS_ILLEGAL = 1, // Call not allowed
- CORINFO_ACCESS_RUNTIME_CHECK = 2, // Ask at runtime whether to allow the call or not
}
//----------------------------------------------------------------------------
CORINFO_REGION_JIT,
}
- // This is for use when the JIT is compiling an instantiation
- // of generic code. The JIT needs to know if the generic code itself
- // (which can be verified once and for all independently of the
- // instantiations) passed verification.
- public enum CorInfoInstantiationVerification
- {
- // The method is NOT a concrete instantiation (eg. List<int>.Add()) of a method
- // in a generic class or a generic method. It is either the typical instantiation
- // (eg. List<T>.Add()) or entirely non-generic.
- INSTVER_NOT_INSTANTIATION = 0,
-
- // The method is an instantiation of a method in a generic class or a generic method,
- // and the generic class was successfully verified
- INSTVER_GENERIC_PASSED_VERIFICATION = 1,
-
- // The method is an instantiation of a method in a generic class or a generic method,
- // and the generic class failed verification
- INSTVER_GENERIC_FAILED_VERIFICATION = 2,
- };
-
public enum CorInfoTypeWithMod
{
CORINFO_TYPE_MASK = 0x3F, // lower 6 bits are type mask
// Wrapper delegate offsets
public uint offsetOfWrapperDelegateIndirectCell;
- // Remoting offsets
- public uint offsetOfTransparentProxyRP;
- public uint offsetOfRealProxyServer;
-
- // Array offsets
- public uint offsetOfObjArrayData;
-
// Reverse PInvoke offsets
public uint sizeOfReversePInvokeFrame;
public CORINFO_RUNTIME_ABI targetAbi;
public CORINFO_OS osType;
- public uint osMajor;
- public uint osMinor;
- public uint osBuild;
}
public enum CORINFO_THIS_TRANSFORM
// JIT may either insert the callsiteCalloutHelper into the code (as per a verification error) or
// call throwExceptionFromHelper on the callsiteCalloutHelper. In this case callsiteCalloutHelper
// is guaranteed not to return.
- // - CORINFO_ACCESS_RUNTIME_CHECK - The jit must insert the callsiteCalloutHelper at the call site.
- // the helper may return
public CorInfoIsAccessAllowedResult accessAllowed;
public CORINFO_HELPER_DESC callsiteCalloutHelper;
CORJIT_FLAG_SAMPLING_JIT_BACKGROUND = 35, // JIT is being invoked as a result of stack sampling for hot methods in the background
CORJIT_FLAG_USE_PINVOKE_HELPERS = 36, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions
CORJIT_FLAG_REVERSE_PINVOKE = 37, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog
- CORJIT_FLAG_DESKTOP_QUIRKS = 38, // The JIT should generate desktop-quirk-compatible code
+ // CORJIT_FLAG_UNUSED = 38,
CORJIT_FLAG_TIER0 = 39, // This is the initial tier for tiered compilation which should generate code as quickly as possible
CORJIT_FLAG_TIER1 = 40, // This is the final tier (for now) for tiered compilation which should generate high quality code
CORJIT_FLAG_RELATIVE_CODE_RELOCS = 41, // JIT should generate PC-relative address computations instead of EE relocation records
;
NORMALTYPES
void
-IEEMemoryManager*,void*,void*
LPVOID,void*,void*
void*
const void *,void*
ICorJitInfo::BlockCounts**,ref BlockCounts*,void**
; Enums
-CorInfoCanSkipVerificationResult,,int
CorInfoClassId,,int
CorInfoHelperTailCallSpecialHandling,,int
CorInfoHelpFunc,,int
CorInfoInlineTypeCheck,,int
CorInfoInlineTypeCheckSource,,int
CorInfoInline,,int
-CorInfoInstantiationVerification,,int
CorInfoIntrinsics,,int
CorInfoIsAccessAllowedResult,,int
CorInfoMethodRuntimeFlags,,int
BOOL pInvokeMarshalingRequired( CORINFO_METHOD_HANDLE method, CORINFO_SIG_INFO* callSiteSig );
BOOL satisfiesMethodConstraints( CORINFO_CLASS_HANDLE parent, CORINFO_METHOD_HANDLE method );
BOOL isCompatibleDelegate( CORINFO_CLASS_HANDLE objCls, CORINFO_CLASS_HANDLE methodParentCls, CORINFO_METHOD_HANDLE method, CORINFO_CLASS_HANDLE delegateCls, BOOL *pfIsOpenDelegate );
- CorInfoInstantiationVerification isInstantiationOfVerifiedGeneric( CORINFO_METHOD_HANDLE method );
- void initConstraintsForVerification( CORINFO_METHOD_HANDLE method, BOOL *pfHasCircularClassConstraints, BOOL *pfHasCircularMethodConstraint );
- CorInfoCanSkipVerificationResult canSkipMethodVerification( CORINFO_METHOD_HANDLE ftnHandle );
void methodMustBeLoadedBeforeCodeIsRun( CORINFO_METHOD_HANDLE method );
CORINFO_METHOD_HANDLE mapMethodDeclToMethodImpl( CORINFO_METHOD_HANDLE method );
void getGSCookie( GSCookie * pCookieVal, GSCookie ** ppCookieVal );
void findSig( CORINFO_MODULE_HANDLE module, unsigned sigTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO *sig );
void findCallSiteSig( CORINFO_MODULE_HANDLE module,unsigned methTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO *sig)
CORINFO_CLASS_HANDLE getTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken)
- CorInfoCanSkipVerificationResult canSkipVerification(CORINFO_MODULE_HANDLE module)
BOOL isValidToken(CORINFO_MODULE_HANDLE module, unsigned metaTOK)
BOOL isValidStringRef(CORINFO_MODULE_HANDLE module, unsigned metaTOK)
LPCWSTR getStringLiteral(CORINFO_MODULE_HANDLE module, unsigned metaTOK, int* length)
- BOOL shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope)
CorInfoType asCorInfoType(CORINFO_CLASS_HANDLE cls)
const char* getClassName(CORINFO_CLASS_HANDLE cls)
const char* getClassNameFromMetadata(CORINFO_CLASS_HANDLE cls, const char **namespaceName)
int appendClassName(WCHAR** ppBuf, int* pnBufLen, CORINFO_CLASS_HANDLE cls, BOOL fNamespace, BOOL fFullInst, BOOL fAssembly)
BOOL isValueClass(CORINFO_CLASS_HANDLE cls)
CorInfoInlineTypeCheck canInlineTypeCheck(CORINFO_CLASS_HANDLE cls, CorInfoInlineTypeCheckSource source)
- BOOL canInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE cls)
DWORD getClassAttribs(CORINFO_CLASS_HANDLE cls)
BOOL isStructRequiringStackAllocRetBuf(CORINFO_CLASS_HANDLE cls)
CORINFO_MODULE_HANDLE getClassModule(CORINFO_CLASS_HANDLE cls)
CorInfoHelpFunc getNewArrHelper(CORINFO_CLASS_HANDLE arrayCls)
CorInfoHelpFunc getCastingHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool fThrowing)
CorInfoHelpFunc getSharedCCtorHelper(CORINFO_CLASS_HANDLE clsHnd)
- CorInfoHelpFunc getSecurityPrologHelper(CORINFO_METHOD_HANDLE ftn)
CORINFO_CLASS_HANDLE getTypeForBox(CORINFO_CLASS_HANDLE cls)
CorInfoHelpFunc getBoxHelper(CORINFO_CLASS_HANDLE cls)
CorInfoHelpFunc getUnBoxHelper(CORINFO_CLASS_HANDLE cls)
CORINFO_CLASS_HANDLE getFieldClass(CORINFO_FIELD_HANDLE field)
CorInfoType getFieldType(CORINFO_FIELD_HANDLE field, CORINFO_CLASS_HANDLE* structType, CORINFO_CLASS_HANDLE memberParent)
unsigned getFieldOffset(CORINFO_FIELD_HANDLE field)
- bool isWriteBarrierHelperRequired(CORINFO_FIELD_HANDLE field)
void getFieldInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_METHOD_HANDLE callerHandle, CORINFO_ACCESS_FLAGS flags, CORINFO_FIELD_INFO* pResult)
bool isFieldStatic(CORINFO_FIELD_HANDLE fldHnd)
void getBoundaries(CORINFO_METHOD_HANDLE ftn, unsigned int* cILOffsets, DWORD** pILOffsets, ICorDebugInfo::BoundaryTypes* implictBoundaries)
void setBoundaries(CORINFO_METHOD_HANDLE ftn, ULONG32 cMap, ICorDebugInfo::OffsetMapping* pMap)
void getVars(CORINFO_METHOD_HANDLE ftn, ULONG32* cVars, ICorDebugInfo::ILVarInfo** vars, bool* extendOthers)
void setVars(CORINFO_METHOD_HANDLE ftn, ULONG32 cVars, ICorDebugInfo::NativeVarInfo* vars)
- void*allocateArray(ULONG cBytes);
+ void*allocateArray(size_t cBytes);
void freeArray(void*array);
CORINFO_ARG_LIST_HANDLE getArgNext(CORINFO_ARG_LIST_HANDLE args);
CorInfoTypeWithMod getArgType(CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_HANDLE args, CORINFO_CLASS_HANDLE* vcTypeRet);
CORINFO_METHOD_HANDLE embedMethodHandle(CORINFO_METHOD_HANDLE handle, void **ppIndirection);
CORINFO_FIELD_HANDLE embedFieldHandle(CORINFO_FIELD_HANDLE handle, void **ppIndirection);
void embedGenericHandle(CORINFO_RESOLVED_TOKEN * pResolvedToken, BOOL fEmbedParent, CORINFO_GENERICHANDLE_RESULT * pResult);
- [ManualNativeWrapper] [ReturnAsParm] CORINFO_LOOKUP_KIND getLocationOfThisType(CORINFO_METHOD_HANDLE context);
- void* getPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void **ppIndirection);
- void* getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void **ppIndirection);
+ void getLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND* pLookupKind);
void getAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP *pLookup);
LPVOID GetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, void ** ppIndirection);
bool canGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig);
void MethodCompileComplete(CORINFO_METHOD_HANDLE methHnd);
void* getTailCallCopyArgsThunk (CORINFO_SIG_INFO *pSig, CorInfoHelperTailCallSpecialHandling flags);
bool convertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN * pResolvedToken, bool mustConvert);
- [ManualNativeWrapper] IEEMemoryManager* getMemoryManager();
void allocMem( ULONG hotCodeSize, ULONG coldCodeSize, ULONG roDataSize, ULONG xcptnsCount, CorJitAllocMemFlag flag, void** hotCodeBlock, void** coldCodeBlock, void** roDataBlock );
void reserveUnwindInfo(BOOL isFunclet, BOOL isColdCode, ULONG unwindSize)
void allocUnwindInfo(BYTE* pHotCode, BYTE* pColdCode, ULONG startOffset, ULONG endOffset, ULONG unwindSize, BYTE* pUnwindBlock, CorJitFuncKind funcKind)
void* allocGCInfo(size_t size)
- void yieldExecution()
void setEHcount(unsigned cEH)
void setEHinfo(unsigned EHnumber, const CORINFO_EH_CLAUSE* clause)
BOOL logMsg(unsigned level, const char* fmt, va_list args)
void recordCallSite(ULONG instrOffset, CORINFO_SIG_INFO* callSig, CORINFO_METHOD_HANDLE methodHandle)
void recordRelocation(void* location, void* target, WORD fRelocType, WORD slotNum, INT32 addlDelta)
WORD getRelocTypeHint(void* target)
- void getModuleNativeEntryPointRange(void** pStart, void** pEnd)
DWORD getExpectedTargetArchitecture()
DWORD getJitFlags(CORJIT_FLAGS* flags, DWORD sizeInBytes)
abort();
}
-enum CORINFO_RUNTIME_LOOKUP_KIND { };
-struct CORINFO_LOOKUP_KIND
-{
- bool needsRuntimeLookup;
- CORINFO_RUNTIME_LOOKUP_KIND runtimeLookupKind;
- unsigned short runtimeLookupFlags;
- void* runtimeLookupArgs;
-};
-
int JitInterfaceWrapper::FilterException(void* pExceptionPointers)
{
NotImplemented();
}
return true;
}
-
-CORINFO_LOOKUP_KIND JitInterfaceWrapper::getLocationOfThisType(void* context)
-{
- CorInfoException* pException = nullptr;
- CORINFO_LOOKUP_KIND _ret;
- _callbacks->getLocationOfThisType(_thisHandle, &pException, &_ret, context);
- if (pException != nullptr)
- {
- throw pException;
- }
- return _ret;
-}
-
-void* JitInterfaceWrapper::getMemoryManager()
-{
- NotImplemented();
- return nullptr;
-}
int (* pInvokeMarshalingRequired)(void * thisHandle, CorInfoException** ppException, void* method, void* callSiteSig);
int (* satisfiesMethodConstraints)(void * thisHandle, CorInfoException** ppException, void* parent, void* method);
int (* isCompatibleDelegate)(void * thisHandle, CorInfoException** ppException, void* objCls, void* methodParentCls, void* method, void* delegateCls, int* pfIsOpenDelegate);
- int (* isInstantiationOfVerifiedGeneric)(void * thisHandle, CorInfoException** ppException, void* method);
- void (* initConstraintsForVerification)(void * thisHandle, CorInfoException** ppException, void* method, int* pfHasCircularClassConstraints, int* pfHasCircularMethodConstraint);
- int (* canSkipMethodVerification)(void * thisHandle, CorInfoException** ppException, void* ftnHandle);
void (* methodMustBeLoadedBeforeCodeIsRun)(void * thisHandle, CorInfoException** ppException, void* method);
void* (* mapMethodDeclToMethodImpl)(void * thisHandle, CorInfoException** ppException, void* method);
void (* getGSCookie)(void * thisHandle, CorInfoException** ppException, void* pCookieVal, void** ppCookieVal);
void (* findSig)(void * thisHandle, CorInfoException** ppException, void* module, unsigned sigTOK, void* context, void* sig);
void (* findCallSiteSig)(void * thisHandle, CorInfoException** ppException, void* module, unsigned methTOK, void* context, void* sig);
void* (* getTokenTypeAsHandle)(void * thisHandle, CorInfoException** ppException, void* pResolvedToken);
- int (* canSkipVerification)(void * thisHandle, CorInfoException** ppException, void* module);
int (* isValidToken)(void * thisHandle, CorInfoException** ppException, void* module, unsigned metaTOK);
int (* isValidStringRef)(void * thisHandle, CorInfoException** ppException, void* module, unsigned metaTOK);
const wchar_t* (* getStringLiteral)(void * thisHandle, CorInfoException** ppException, void* module, unsigned metaTOK, int* length);
- int (* shouldEnforceCallvirtRestriction)(void * thisHandle, CorInfoException** ppException, void* scope);
int (* asCorInfoType)(void * thisHandle, CorInfoException** ppException, void* cls);
const char* (* getClassName)(void * thisHandle, CorInfoException** ppException, void* cls);
const char* (* getClassNameFromMetadata)(void * thisHandle, CorInfoException** ppException, void* cls, const char** namespaceName);
int (* appendClassName)(void * thisHandle, CorInfoException** ppException, wchar_t** ppBuf, int* pnBufLen, void* cls, int fNamespace, int fFullInst, int fAssembly);
int (* isValueClass)(void * thisHandle, CorInfoException** ppException, void* cls);
int (* canInlineTypeCheck)(void * thisHandle, CorInfoException** ppException, void* cls, int source);
- int (* canInlineTypeCheckWithObjectVTable)(void * thisHandle, CorInfoException** ppException, void* cls);
unsigned int (* getClassAttribs)(void * thisHandle, CorInfoException** ppException, void* cls);
int (* isStructRequiringStackAllocRetBuf)(void * thisHandle, CorInfoException** ppException, void* cls);
void* (* getClassModule)(void * thisHandle, CorInfoException** ppException, void* cls);
int (* getNewArrHelper)(void * thisHandle, CorInfoException** ppException, void* arrayCls);
int (* getCastingHelper)(void * thisHandle, CorInfoException** ppException, void* pResolvedToken, bool fThrowing);
int (* getSharedCCtorHelper)(void * thisHandle, CorInfoException** ppException, void* clsHnd);
- int (* getSecurityPrologHelper)(void * thisHandle, CorInfoException** ppException, void* ftn);
void* (* getTypeForBox)(void * thisHandle, CorInfoException** ppException, void* cls);
int (* getBoxHelper)(void * thisHandle, CorInfoException** ppException, void* cls);
int (* getUnBoxHelper)(void * thisHandle, CorInfoException** ppException, void* cls);
void* (* getFieldClass)(void * thisHandle, CorInfoException** ppException, void* field);
int (* getFieldType)(void * thisHandle, CorInfoException** ppException, void* field, void* structType, void* memberParent);
unsigned (* getFieldOffset)(void * thisHandle, CorInfoException** ppException, void* field);
- bool (* isWriteBarrierHelperRequired)(void * thisHandle, CorInfoException** ppException, void* field);
void (* getFieldInfo)(void * thisHandle, CorInfoException** ppException, void* pResolvedToken, void* callerHandle, int flags, void* pResult);
bool (* isFieldStatic)(void * thisHandle, CorInfoException** ppException, void* fldHnd);
void (* getBoundaries)(void * thisHandle, CorInfoException** ppException, void* ftn, unsigned int* cILOffsets, unsigned int** pILOffsets, void* implictBoundaries);
void (* setBoundaries)(void * thisHandle, CorInfoException** ppException, void* ftn, unsigned int cMap, void* pMap);
void (* getVars)(void * thisHandle, CorInfoException** ppException, void* ftn, unsigned int* cVars, void* vars, bool* extendOthers);
void (* setVars)(void * thisHandle, CorInfoException** ppException, void* ftn, unsigned int cVars, void* vars);
- void* (* allocateArray)(void * thisHandle, CorInfoException** ppException, unsigned int cBytes);
+ void* (* allocateArray)(void * thisHandle, CorInfoException** ppException, size_t cBytes);
void (* freeArray)(void * thisHandle, CorInfoException** ppException, void* array);
void* (* getArgNext)(void * thisHandle, CorInfoException** ppException, void* args);
int (* getArgType)(void * thisHandle, CorInfoException** ppException, void* sig, void* args, void* vcTypeRet);
void* (* embedMethodHandle)(void * thisHandle, CorInfoException** ppException, void* handle, void** ppIndirection);
void* (* embedFieldHandle)(void * thisHandle, CorInfoException** ppException, void* handle, void** ppIndirection);
void (* embedGenericHandle)(void * thisHandle, CorInfoException** ppException, void* pResolvedToken, int fEmbedParent, void* pResult);
- void (* getLocationOfThisType)(void * thisHandle, CorInfoException** ppException, CORINFO_LOOKUP_KIND* _return, void* context);
- void* (* getPInvokeUnmanagedTarget)(void * thisHandle, CorInfoException** ppException, void* method, void** ppIndirection);
- void* (* getAddressOfPInvokeFixup)(void * thisHandle, CorInfoException** ppException, void* method, void** ppIndirection);
+ void (* getLocationOfThisType)(void * thisHandle, CorInfoException** ppException, void* context, void* pLookupKind);
void (* getAddressOfPInvokeTarget)(void * thisHandle, CorInfoException** ppException, void* method, void* pLookup);
void* (* GetCookieForPInvokeCalliSig)(void * thisHandle, CorInfoException** ppException, void* szMetaSig, void** ppIndirection);
bool (* canGetCookieForPInvokeCalliSig)(void * thisHandle, CorInfoException** ppException, void* szMetaSig);
void (* MethodCompileComplete)(void * thisHandle, CorInfoException** ppException, void* methHnd);
void* (* getTailCallCopyArgsThunk)(void * thisHandle, CorInfoException** ppException, void* pSig, int flags);
bool (* convertPInvokeCalliToCall)(void * thisHandle, CorInfoException** ppException, void* pResolvedToken, bool mustConvert);
- void* (* getMemoryManager)(void * thisHandle, CorInfoException** ppException);
void (* allocMem)(void * thisHandle, CorInfoException** ppException, unsigned int hotCodeSize, unsigned int coldCodeSize, unsigned int roDataSize, unsigned int xcptnsCount, int flag, void** hotCodeBlock, void** coldCodeBlock, void** roDataBlock);
void (* reserveUnwindInfo)(void * thisHandle, CorInfoException** ppException, int isFunclet, int isColdCode, unsigned int unwindSize);
void (* allocUnwindInfo)(void * thisHandle, CorInfoException** ppException, unsigned char* pHotCode, unsigned char* pColdCode, unsigned int startOffset, unsigned int endOffset, unsigned int unwindSize, unsigned char* pUnwindBlock, int funcKind);
void* (* allocGCInfo)(void * thisHandle, CorInfoException** ppException, size_t size);
- void (* yieldExecution)(void * thisHandle, CorInfoException** ppException);
void (* setEHcount)(void * thisHandle, CorInfoException** ppException, unsigned cEH);
void (* setEHinfo)(void * thisHandle, CorInfoException** ppException, unsigned EHnumber, void* clause);
int (* logMsg)(void * thisHandle, CorInfoException** ppException, unsigned level, const char* fmt, va_list args);
void (* recordCallSite)(void * thisHandle, CorInfoException** ppException, unsigned int instrOffset, void* callSig, void* methodHandle);
void (* recordRelocation)(void * thisHandle, CorInfoException** ppException, void* location, void* target, unsigned short fRelocType, unsigned short slotNum, int addlDelta);
unsigned short (* getRelocTypeHint)(void * thisHandle, CorInfoException** ppException, void* target);
- void (* getModuleNativeEntryPointRange)(void * thisHandle, CorInfoException** ppException, void** pStart, void** pEnd);
unsigned int (* getExpectedTargetArchitecture)(void * thisHandle, CorInfoException** ppException);
unsigned int (* getJitFlags)(void * thisHandle, CorInfoException** ppException, void* flags, unsigned int sizeInBytes);
return _ret;
}
- virtual int isInstantiationOfVerifiedGeneric(void* method)
- {
- CorInfoException* pException = nullptr;
- int _ret = _callbacks->isInstantiationOfVerifiedGeneric(_thisHandle, &pException, method);
- if (pException != nullptr)
- throw pException;
- return _ret;
- }
-
- virtual void initConstraintsForVerification(void* method, int* pfHasCircularClassConstraints, int* pfHasCircularMethodConstraint)
- {
- CorInfoException* pException = nullptr;
- _callbacks->initConstraintsForVerification(_thisHandle, &pException, method, pfHasCircularClassConstraints, pfHasCircularMethodConstraint);
- if (pException != nullptr)
- throw pException;
- }
-
- virtual int canSkipMethodVerification(void* ftnHandle)
- {
- CorInfoException* pException = nullptr;
- int _ret = _callbacks->canSkipMethodVerification(_thisHandle, &pException, ftnHandle);
- if (pException != nullptr)
- throw pException;
- return _ret;
- }
-
virtual void methodMustBeLoadedBeforeCodeIsRun(void* method)
{
CorInfoException* pException = nullptr;
return _ret;
}
- virtual int canSkipVerification(void* module)
- {
- CorInfoException* pException = nullptr;
- int _ret = _callbacks->canSkipVerification(_thisHandle, &pException, module);
- if (pException != nullptr)
- throw pException;
- return _ret;
- }
-
virtual int isValidToken(void* module, unsigned metaTOK)
{
CorInfoException* pException = nullptr;
return _ret;
}
- virtual int shouldEnforceCallvirtRestriction(void* scope)
- {
- CorInfoException* pException = nullptr;
- int _ret = _callbacks->shouldEnforceCallvirtRestriction(_thisHandle, &pException, scope);
- if (pException != nullptr)
- throw pException;
- return _ret;
- }
-
virtual int asCorInfoType(void* cls)
{
CorInfoException* pException = nullptr;
return _ret;
}
- virtual int canInlineTypeCheckWithObjectVTable(void* cls)
- {
- CorInfoException* pException = nullptr;
- int _ret = _callbacks->canInlineTypeCheckWithObjectVTable(_thisHandle, &pException, cls);
- if (pException != nullptr)
- throw pException;
- return _ret;
- }
-
virtual unsigned int getClassAttribs(void* cls)
{
CorInfoException* pException = nullptr;
return _ret;
}
- virtual int getSecurityPrologHelper(void* ftn)
- {
- CorInfoException* pException = nullptr;
- int _ret = _callbacks->getSecurityPrologHelper(_thisHandle, &pException, ftn);
- if (pException != nullptr)
- throw pException;
- return _ret;
- }
-
virtual void* getTypeForBox(void* cls)
{
CorInfoException* pException = nullptr;
return _ret;
}
- virtual bool isWriteBarrierHelperRequired(void* field)
- {
- CorInfoException* pException = nullptr;
- bool _ret = _callbacks->isWriteBarrierHelperRequired(_thisHandle, &pException, field);
- if (pException != nullptr)
- throw pException;
- return _ret;
- }
-
virtual void getFieldInfo(void* pResolvedToken, void* callerHandle, int flags, void* pResult)
{
CorInfoException* pException = nullptr;
throw pException;
}
- virtual void* allocateArray(unsigned int cBytes)
+ virtual void* allocateArray(size_t cBytes)
{
CorInfoException* pException = nullptr;
void* _ret = _callbacks->allocateArray(_thisHandle, &pException, cBytes);
throw pException;
}
- virtual CORINFO_LOOKUP_KIND getLocationOfThisType(void* context);
- virtual void* getPInvokeUnmanagedTarget(void* method, void** ppIndirection)
+ virtual void getLocationOfThisType(void* context, void* pLookupKind)
{
CorInfoException* pException = nullptr;
- void* _ret = _callbacks->getPInvokeUnmanagedTarget(_thisHandle, &pException, method, ppIndirection);
+ _callbacks->getLocationOfThisType(_thisHandle, &pException, context, pLookupKind);
if (pException != nullptr)
throw pException;
- return _ret;
- }
-
- virtual void* getAddressOfPInvokeFixup(void* method, void** ppIndirection)
- {
- CorInfoException* pException = nullptr;
- void* _ret = _callbacks->getAddressOfPInvokeFixup(_thisHandle, &pException, method, ppIndirection);
- if (pException != nullptr)
- throw pException;
- return _ret;
}
virtual void getAddressOfPInvokeTarget(void* method, void* pLookup)
return _ret;
}
- virtual void* getMemoryManager();
virtual void allocMem(unsigned int hotCodeSize, unsigned int coldCodeSize, unsigned int roDataSize, unsigned int xcptnsCount, int flag, void** hotCodeBlock, void** coldCodeBlock, void** roDataBlock)
{
CorInfoException* pException = nullptr;
return _ret;
}
- virtual void yieldExecution()
- {
- CorInfoException* pException = nullptr;
- _callbacks->yieldExecution(_thisHandle, &pException);
- if (pException != nullptr)
- throw pException;
- }
-
virtual void setEHcount(unsigned cEH)
{
CorInfoException* pException = nullptr;
return _ret;
}
- virtual void getModuleNativeEntryPointRange(void** pStart, void** pEnd)
- {
- CorInfoException* pException = nullptr;
- _callbacks->getModuleNativeEntryPointRange(_thisHandle, &pException, pStart, pEnd);
- if (pException != nullptr)
- throw pException;
- }
-
virtual unsigned int getExpectedTargetArchitecture()
{
CorInfoException* pException = nullptr;
uint64_t corJitFlags;
};
-static const GUID JITEEVersionIdentifier = { /* 96fc0c0a-9f77-450d-9663-ee33ae0fcae8 */
- 0x96fc0c0a,
- 0x9f77,
- 0x450d,
- {0x96, 0x63, 0xee, 0x33, 0xae, 0x0f, 0xca, 0xe8}
+static const GUID JITEEVersionIdentifier = { /* 9C412381-94A6-4F35-B2B6-60AFB2495B72 */
+ 0x9c412381,
+ 0x94a6,
+ 0x4f35,
+ { 0xb2, 0xb6, 0x60, 0xaf, 0xb2, 0x49, 0x5b, 0x72 }
};
class Jit
void* entryAddress,
void* nativeSizeOfCode) = 0;
- virtual void clearCache() = 0;
- virtual unsigned isCacheCleanupRequired() = 0;
virtual void ProcessShutdownWork(void* info) = 0;
// The EE asks the JIT for a "version identifier". This represents the version of the JIT/EE interface.
#ifndef DACCESS_COMPILE
-//**************************************************************************
-// Clear the caches for all JITs loaded.
-//
-void ExecutionManager::ClearCaches( void )
-{
- CONTRACTL {
- NOTHROW;
- GC_NOTRIGGER;
- } CONTRACTL_END;
-
- GetEEJitManager()->ClearCache();
-}
-
-//**************************************************************************
-// Check if caches for any JITs loaded need to be cleaned
-//
-BOOL ExecutionManager::IsCacheCleanupRequired( void )
-{
- CONTRACTL {
- NOTHROW;
- GC_NOTRIGGER;
- } CONTRACTL_END;
-
- return GetEEJitManager()->IsCacheCleanupRequired();
-}
-
#ifndef FEATURE_MERGE_JIT_AND_ENGINE
/*********************************************************************/
// This static method returns the name of the jit dll
}
#endif // ALLOW_SXS_JIT
- VOID ClearCache()
- {
- CONTRACTL {
- NOTHROW;
- GC_NOTRIGGER;
- } CONTRACTL_END;
-
- if( m_jit != NULL )
- {
- m_jit->clearCache();
- }
-#ifdef ALLOW_SXS_JIT
- if( m_alternateJit != NULL )
- {
- m_alternateJit->clearCache();
- }
-#endif // ALLOW_SXS_JIT
- }
-
- BOOL IsCacheCleanupRequired()
- {
- CONTRACTL {
- NOTHROW;
- GC_NOTRIGGER;
- } CONTRACTL_END;
-
- BOOL ret = FALSE;
-
- if( m_jit != NULL )
- {
- if (m_jit->isCacheCleanupRequired())
- ret = TRUE;
- }
-
-#ifdef ALLOW_SXS_JIT
- if( !ret && m_alternateJit != NULL )
- {
- if (m_alternateJit->isCacheCleanupRequired())
- ret = TRUE;
- }
-#endif // ALLOW_SXS_JIT
-
- return ret;
- }
-
#if !defined CROSSGEN_COMPILE && !defined DACCESS_COMPILE
EEJitManager();
}
#endif
- static void ClearCaches( void );
- static BOOL IsCacheCleanupRequired();
-
static LPCWSTR GetJitName();
static void Unload(LoaderAllocator *pLoaderAllocator);
#endif // USE_GC_INFO_DECODER
#endif // !CROSSGEN_COMPILE
-#ifdef TARGET_X86
-/*****************************************************************************
- *
- * Return the address of the local security object reference
- * using data that was previously cached before in UnwindStackFrame
- * using StackwalkCacheUnwindInfo
- */
-
-OBJECTREF* EECodeManager::GetAddrOfSecurityObjectFromCachedInfo(PREGDISPLAY pRD, StackwalkCacheUnwindInfo * stackwalkCacheUnwindInfo)
-{
- LIMITED_METHOD_CONTRACT;
- size_t securityObjectOffset = stackwalkCacheUnwindInfo->securityObjectOffset;
-
- _ASSERTE(securityObjectOffset != 0);
- // We pretend that filters are ESP-based methods in UnwindEbpDoubleAlignFrame().
- // Hence we cannot enforce this assert.
- // _ASSERTE(stackwalkCacheUnwindInfo->fUseEbpAsFrameReg);
- return (OBJECTREF *) (size_t) (GetRegdisplayFP(pRD) - (securityObjectOffset * sizeof(void*)));
-}
-#endif // TARGET_X86
-
-#if !defined(DACCESS_COMPILE) && !defined(CROSSGEN_COMPILE)
-OBJECTREF* EECodeManager::GetAddrOfSecurityObject(CrawlFrame *pCF)
-{
- CONTRACTL {
- NOTHROW;
- GC_NOTRIGGER;
- } CONTRACTL_END;
-
- REGDISPLAY* pRD = pCF->GetRegisterSet();
- IJitManager* pJitMan = pCF->GetJitManager();
- METHODTOKEN methodToken = pCF->GetMethodToken();
- unsigned relOffset = pCF->GetRelOffset();
- CodeManState* pState = pCF->GetCodeManState();
-
- GCInfoToken gcInfoToken = pJitMan->GetGCInfoToken(methodToken);
-
- _ASSERTE(sizeof(CodeManStateBuf) <= sizeof(pState->stateBuf));
-
-#ifndef USE_GC_INFO_DECODER
- CodeManStateBuf * stateBuf = (CodeManStateBuf*)pState->stateBuf;
-
- /* Extract the necessary information from the info block header */
- stateBuf->hdrInfoSize = (DWORD)DecodeGCHdrInfo(gcInfoToken, // <TODO>truncation</TODO>
- relOffset,
- &stateBuf->hdrInfoBody);
-
- pState->dwIsSet = 1;
- if (stateBuf->hdrInfoBody.securityCheck)
- {
- _ASSERTE(stateBuf->hdrInfoBody.ebpFrame);
- if(stateBuf->hdrInfoBody.prologOffs == hdrInfo::NOT_IN_PROLOG &&
- stateBuf->hdrInfoBody.epilogOffs == hdrInfo::NOT_IN_EPILOG)
- {
- return (OBJECTREF *)(size_t)(GetRegdisplayFP(pRD) - GetSecurityObjectOffset(&stateBuf->hdrInfoBody));
- }
- }
-#else // !USE_GC_INFO_DECODER
-
- GcInfoDecoder gcInfoDecoder(
- gcInfoToken,
- DECODE_SECURITY_OBJECT
- );
-
- INT32 spOffset = gcInfoDecoder.GetSecurityObjectStackSlot();
- if( spOffset != NO_SECURITY_OBJECT )
- {
- UINT_PTR uCallerSP = GetCallerSp(pRD);
-
- if (pCF->IsFunclet())
- {
- if (!pCF->IsFilterFunclet())
- {
- // Cannot retrieve the security object for a non-filter funclet.
- return NULL;
- }
-
- DWORD dwParentOffset = 0;
- UINT_PTR uParentCallerSP = 0;
-
- // If this is a filter funclet, retrieve the information of the parent method
- // and use that to find the security object.
- ExceptionTracker::FindParentStackFrameEx(pCF, &dwParentOffset, &uParentCallerSP);
-
- relOffset = dwParentOffset;
- uCallerSP = uParentCallerSP;
- }
-
- // Security object is always live anyplace we can throw or take a GC
- OBJECTREF* pSlot = (OBJECTREF*) (spOffset + uCallerSP);
- return pSlot;
- }
-#endif // USE_GC_INFO_DECODER
-
- return NULL;
-}
-#endif // !DACCESS_COMPILE && !CROSSGEN_COMPILE
-
#ifndef CROSSGEN_COMPILE
/*****************************************************************************
*
return NameLen;
}
-CorInfoCanSkipVerificationResult CEEInfo::canSkipMethodVerification(CORINFO_METHOD_HANDLE ftnHnd)
-{
- CONTRACTL {
- THROWS;
- GC_TRIGGERS;
- MODE_PREEMPTIVE;
- } CONTRACTL_END;
-
- return CORINFO_VERIFICATION_CAN_SKIP;
-}
-
-/*********************************************************************/
-BOOL CEEInfo::shouldEnforceCallvirtRestriction(
- CORINFO_MODULE_HANDLE scopeHnd)
-{
- LIMITED_METHOD_CONTRACT;
- return TRUE;
-}
-
#ifdef FEATURE_READYTORUN_COMPILER
// Returns true if assemblies are in the same version bubble
return false;
}
-
-/*********************************************************************/
-CorInfoCanSkipVerificationResult CEEInfo::canSkipVerification(
- CORINFO_MODULE_HANDLE moduleHnd)
-{
- CONTRACTL {
- THROWS;
- GC_TRIGGERS;
- MODE_PREEMPTIVE;
- } CONTRACTL_END;
-
- return CORINFO_VERIFICATION_CAN_SKIP;
-}
-
/*********************************************************************/
// Checks if the given metadata token is valid
BOOL CEEInfo::isValidToken (
}
-CORINFO_LOOKUP_KIND CEEInfo::getLocationOfThisType(CORINFO_METHOD_HANDLE context)
+void CEEInfo::getLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND* pLookupKind)
{
CONTRACTL {
THROWS;
MODE_PREEMPTIVE;
} CONTRACTL_END;
- CORINFO_LOOKUP_KIND result;
-
/* Initialize fields of result for debug build warning */
- result.needsRuntimeLookup = false;
- result.runtimeLookupKind = CORINFO_LOOKUP_THISOBJ;
+ pLookupKind->needsRuntimeLookup = false;
+ pLookupKind->runtimeLookupKind = CORINFO_LOOKUP_THISOBJ;
JIT_TO_EE_TRANSITION();
// If the method table is not shared, then return CONST
if (!pContextMD->GetMethodTable()->IsSharedByGenericInstantiations())
{
- result.needsRuntimeLookup = false;
+ pLookupKind->needsRuntimeLookup = false;
}
else
{
- result.needsRuntimeLookup = true;
+ pLookupKind->needsRuntimeLookup = true;
// If we've got a vtable extra argument, go through that
if (pContextMD->RequiresInstMethodTableArg())
{
- result.runtimeLookupKind = CORINFO_LOOKUP_CLASSPARAM;
+ pLookupKind->runtimeLookupKind = CORINFO_LOOKUP_CLASSPARAM;
}
// If we've got an object, go through its vtable
else if (pContextMD->AcquiresInstMethodTableFromThis())
{
- result.runtimeLookupKind = CORINFO_LOOKUP_THISOBJ;
+ pLookupKind->runtimeLookupKind = CORINFO_LOOKUP_THISOBJ;
}
// Otherwise go through the method-desc argument
else
{
_ASSERTE(pContextMD->RequiresInstMethodDescArg());
- result.runtimeLookupKind = CORINFO_LOOKUP_METHODPARAM;
+ pLookupKind->runtimeLookupKind = CORINFO_LOOKUP_METHODPARAM;
}
}
EE_TO_JIT_TRANSITION();
-
- return result;
}
CORINFO_METHOD_HANDLE CEEInfo::GetDelegateCtor(
}
/*********************************************************************/
-// If this method returns true, JIT will do optimization to inline the check for
-// GetTypeFromHandle(handle) == obj.GetType()
-//
-// This will enable to use directly the typehandle instead of going through getClassByHandle
-BOOL CEEInfo::canInlineTypeCheckWithObjectVTable (CORINFO_CLASS_HANDLE clsHnd)
-{
- LIMITED_METHOD_CONTRACT;
- return TRUE;
-}
-
-/*********************************************************************/
DWORD CEEInfo::getClassAttribs (CORINFO_CLASS_HANDLE clsHnd)
{
CONTRACTL {
}
/***********************************************************************/
-CorInfoHelpFunc CEEInfo::getSecurityPrologHelper(CORINFO_METHOD_HANDLE ftn)
-{
- CONTRACTL {
- THROWS;
- GC_TRIGGERS;
- MODE_PREEMPTIVE;
- } CONTRACTL_END;
-
- CorInfoHelpFunc result = CORINFO_HELP_UNDEF;
-
- JIT_TO_EE_TRANSITION();
-
-#ifdef FEATURE_NATIVE_IMAGE_GENERATION
- // This will make sure that when IBC logging is on, we call the slow helper with IBC probe
- if (IsCompilingForNGen() &&
- GetAppDomain()->ToCompilationDomain()->m_fForceInstrument)
- {
- result = CORINFO_HELP_SECURITY_PROLOG_FRAMED;
- }
-#endif // FEATURE_NATIVE_IMAGE_GENERATION
-
- if (result == CORINFO_HELP_UNDEF)
- {
- result = CORINFO_HELP_SECURITY_PROLOG;
- }
-
- EE_TO_JIT_TRANSITION();
-
- return result;
-}
-
-/***********************************************************************/
// registers a vararg sig & returns a class-specific cookie for it.
CORINFO_VARARGS_HANDLE CEEInfo::getVarArgsHandle(CORINFO_SIG_INFO *sig,
if (pMD->IsLCGMethod())
{
- return CORINFO_FLG_STATIC | CORINFO_FLG_DONT_INLINE | CORINFO_FLG_NOSECURITYWRAP;
+ return CORINFO_FLG_STATIC | CORINFO_FLG_DONT_INLINE;
}
- DWORD result = CORINFO_FLG_NOSECURITYWRAP;
+ DWORD result = 0;
DWORD attribs = pMD->GetAttrs();
/*************************************************************
-This loads the (formal) declared constraints on the class and method type parameters,
-and detects (but does not itself reject) circularities among the class type parameters
-and (separately) method type parameters.
-
-It must be called whenever we verify a typical method, ie any method (generic or
-nongeneric) in a typical class. It must be called for non-generic methods too,
-because their bodies may still mention class type parameters which will need to
-have their formal constraints loaded in order to perform type compatibility tests.
-
-We have to rule out cycles like "C<U,T> where T:U, U:T" only to avoid looping
-in the verifier (ie the T.CanCast(A) would loop calling U.CanCast(A) then
-T.CanCastTo(A) etc.). Since the JIT only tries to walk the hierarchy from a type
-a parameter when verifying, it should be safe to JIT unverified, but trusted,
-instantiations even in the presence of cycle constraints.
-@TODO: It should be possible (and easy) to detect cycles much earlier on by
-directly inspecting the metadata. All you have to do is check that, for each
-of the n type parameters to a class or method there is no path of length n
-obtained by following naked type parameter constraints of the same kind.
-This can be detected by looking directly at metadata, without actually loading
-the typehandles for the naked type parameters.
- *************************************************************/
-
-void CEEInfo::initConstraintsForVerification(CORINFO_METHOD_HANDLE hMethod,
- BOOL *pfHasCircularClassConstraints,
- BOOL *pfHasCircularMethodConstraints)
-{
- CONTRACTL {
- THROWS;
- GC_TRIGGERS;
- MODE_PREEMPTIVE;
- PRECONDITION(CheckPointer(pfHasCircularClassConstraints));
- PRECONDITION(CheckPointer(pfHasCircularMethodConstraints));
- } CONTRACTL_END;
-
- *pfHasCircularClassConstraints = FALSE;
- *pfHasCircularMethodConstraints = FALSE;
-
- JIT_TO_EE_TRANSITION();
-
- MethodDesc* pMethod = GetMethod(hMethod);
- if (pMethod->IsTypicalMethodDefinition())
- {
- // Force a load of the constraints on the type parameters, detecting cyclic bounds
- pMethod->LoadConstraintsForTypicalMethodDefinition(pfHasCircularClassConstraints,pfHasCircularMethodConstraints);
- }
-
- EE_TO_JIT_TRANSITION();
-}
-
-/*************************************************************
- * Check if a method to be compiled is an instantiation
- * of generic code that has already been verified.
- * Three possible return values (see corinfo.h)
- *************************************************************/
-
-CorInfoInstantiationVerification
- CEEInfo::isInstantiationOfVerifiedGeneric(CORINFO_METHOD_HANDLE hMethod)
-{
- CONTRACTL {
- THROWS;
- GC_TRIGGERS;
- MODE_PREEMPTIVE;
- } CONTRACTL_END;
-
- CorInfoInstantiationVerification result = INSTVER_NOT_INSTANTIATION;
-
- JIT_TO_EE_TRANSITION();
-
- MethodDesc * pMethod = GetMethod(hMethod);
-
- if (!(pMethod->HasClassOrMethodInstantiation()))
- {
- result = INSTVER_NOT_INSTANTIATION;
- goto exit;
- }
-
- if (pMethod->IsTypicalMethodDefinition())
- {
- result = INSTVER_NOT_INSTANTIATION;
- goto exit;
- }
-
- result = INSTVER_GENERIC_PASSED_VERIFICATION;
-
- exit: ;
-
- EE_TO_JIT_TRANSITION();
-
- return result;
-}
-
-/*************************************************************
* Similar to above, but perform check for tail call
* eligibility. The callee can be passed as NULL if not known
* (calli and callvirt).
}
/*********************************************************************/
-bool CEEInfo::isWriteBarrierHelperRequired(CORINFO_FIELD_HANDLE field)
-{
- CONTRACTL {
- THROWS;
- GC_TRIGGERS;
- MODE_PREEMPTIVE;
- } CONTRACTL_END;
-
- bool fHelperRequired = false;
-
- JIT_TO_EE_TRANSITION();
-
- FieldDesc * pField = (FieldDesc *)field;
-
- // TODO: jit64 should be switched to the same plan as the i386 jits - use
- // getClassGClayout to figure out the need for writebarrier helper, and inline the copying.
- // Once this happens, USE_WRITE_BARRIER_HELPERS and CORINFO_FLG_WRITE_BARRIER_HELPER can be removed.
- CorElementType type = pField->GetFieldType();
-
- if(CorTypeInfo::IsObjRef(type))
- fHelperRequired = true;
- else if (type == ELEMENT_TYPE_VALUETYPE)
- {
- TypeHandle th = pField->GetFieldTypeHandleThrowing();
- _ASSERTE(!th.IsNull());
- if(th.GetMethodTable()->ContainsPointers())
- fHelperRequired = true;
- }
-
- EE_TO_JIT_TRANSITION();
-
- return fHelperRequired;
-}
-
-/*********************************************************************/
DWORD CEEInfo::getFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE fieldHnd, void **ppIndirection)
{
CONTRACTL {
return result;
}
-void *CEEInfo::allocateArray(ULONG cBytes)
+void *CEEInfo::allocateArray(size_t cBytes)
{
CONTRACTL {
THROWS;
}
/*********************************************************************/
- // return the unmanaged target *if method has already been prelinked.*
-void* CEEInfo::getPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method,
- void **ppIndirection)
-{
- CONTRACTL {
- THROWS;
- GC_TRIGGERS;
- MODE_PREEMPTIVE;
- } CONTRACTL_END;
-
- // Not expected to work due to multicore and tiered JIT potentially needing
- // to call managed cctors
- _ASSERTE(FALSE);
-
- if (ppIndirection != NULL)
- {
- *ppIndirection = NULL;
- }
-
- return NULL;
-}
-
-/*********************************************************************/
// return address of fixup area for late-bound N/Direct calls.
void* CEEInfo::getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method,
void **ppIndirection)
// Wrapper delegate offsets
pEEInfoOut->offsetOfWrapperDelegateIndirectCell = OFFSETOF__DelegateObject__methodPtrAux;
- // Remoting offsets
- pEEInfoOut->offsetOfTransparentProxyRP = (DWORD)-1;
- pEEInfoOut->offsetOfRealProxyServer = (DWORD)-1;
-
- pEEInfoOut->offsetOfObjArrayData = OFFSETOF__PtrArray__m_Array_;
-
pEEInfoOut->sizeOfReversePInvokeFrame = (DWORD)-1;
pEEInfoOut->osPageSize = GetOsPageSize();
pEEInfoOut->osType = CORINFO_WINNT;
#endif
- // hardcode OS version to 0.0.0. These fields can be removed from JITEE interface
- pEEInfoOut->osMajor = 0;
- pEEInfoOut->osMinor = 0;
- pEEInfoOut->osBuild = 0;
-
EE_TO_JIT_TRANSITION();
}
}
/*********************************************************************/
-IEEMemoryManager* CEEInfo::getMemoryManager()
-{
- UNREACHABLE(); // OBSOLETE
- return NULL;
-}
-
-/*********************************************************************/
int CEEInfo::doAssert(const char* szFile, int iLine, const char* szExpr)
{
STATIC_CONTRACT_THROWS;
return result;
}
-void CEEInfo::yieldExecution()
-{
- WRAPPER_NO_CONTRACT;
-}
-
-
#ifndef CROSSGEN_COMPILE
/*********************************************************************/
return (WORD)-1;
}
-void CEEJitInfo::getModuleNativeEntryPointRange(void** pStart, void** pEnd)
-{
- CONTRACTL {
- NOTHROW;
- GC_NOTRIGGER;
- MODE_PREEMPTIVE;
- }
- CONTRACTL_END;
-
- JIT_TO_EE_TRANSITION_LEAF();
-
- *pStart = *pEnd = 0;
-
- EE_TO_JIT_TRANSITION_LEAF();
-}
-
DWORD CEEJitInfo::getExpectedTargetArchitecture()
{
LIMITED_METHOD_CONTRACT;
UNREACHABLE_RET(); // only called on derived class.
}
-void CEEInfo::getModuleNativeEntryPointRange(
- void ** pStart, /* OUT */
- void ** pEnd /* OUT */
- )
-{
- LIMITED_METHOD_CONTRACT;
- UNREACHABLE(); // only called on derived class.
-}
-
DWORD CEEInfo::getExpectedTargetArchitecture()
{
LIMITED_METHOD_CONTRACT;
BOOL fAssembly);
BOOL isValueClass (CORINFO_CLASS_HANDLE cls);
CorInfoInlineTypeCheck canInlineTypeCheck (CORINFO_CLASS_HANDLE cls, CorInfoInlineTypeCheckSource source);
- BOOL canInlineTypeCheckWithObjectVTable (CORINFO_CLASS_HANDLE cls);
DWORD getClassAttribs (CORINFO_CLASS_HANDLE cls);
static CorInfoHelpFunc getCastingHelperStatic(TypeHandle clsHnd, bool fThrowing, bool * pfClassMustBeRestored);
CorInfoHelpFunc getSharedCCtorHelper(CORINFO_CLASS_HANDLE clsHnd);
- CorInfoHelpFunc getSecurityPrologHelper(CORINFO_METHOD_HANDLE ftn);
CORINFO_CLASS_HANDLE getTypeForBox(CORINFO_CLASS_HANDLE cls);
CorInfoHelpFunc getBoxHelper(CORINFO_CLASS_HANDLE cls);
CorInfoHelpFunc getUnBoxHelper(CORINFO_CLASS_HANDLE cls);
size_t findNameOfToken (CORINFO_MODULE_HANDLE module, mdToken metaTOK,
__out_ecount (FQNameCapacity) char * szFQName, size_t FQNameCapacity);
- CorInfoCanSkipVerificationResult canSkipVerification(CORINFO_MODULE_HANDLE moduleHnd);
-
// Checks if the given metadata token is valid
BOOL isValidToken (
CORINFO_MODULE_HANDLE module,
CorInfoInline inlineResult,
const char * reason);
- // Used by ngen
- CORINFO_METHOD_HANDLE instantiateMethodAtObject(CORINFO_METHOD_HANDLE method);
-
- // Loads the constraints on a typical method definition, detecting cycles;
- // used by verifiers.
- void initConstraintsForVerification(
- CORINFO_METHOD_HANDLE method,
- BOOL *pfHasCircularClassConstraints,
- BOOL *pfHasCircularMethodConstraints
- );
-
- CorInfoInstantiationVerification isInstantiationOfVerifiedGeneric (
- CORINFO_METHOD_HANDLE methodHnd);
-
-
bool canTailCall (
CORINFO_METHOD_HANDLE callerHnd,
CORINFO_METHOD_HANDLE declaredCalleeHnd,
CorInfoTailCall tailCallResult,
const char * reason);
- CorInfoCanSkipVerificationResult canSkipMethodVerification(
- CORINFO_METHOD_HANDLE ftnHnd);
-
// Given a method descriptor ftnHnd, extract signature information into sigInfo
// Obtain (representative) instantiation information from ftnHnd's owner class
//@GENERICSVER: added explicit owner parameter
LPVOID GetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, void ** ppIndirection);
bool canGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig);
- // Check Visibility rules.
-
- // should we enforce the new (for whidbey) restrictions on calling virtual methods?
- BOOL shouldEnforceCallvirtRestriction(
- CORINFO_MODULE_HANDLE scope);
-
// Check constraints on method type arguments (only).
// The parent class should be checked separately using satisfiesClassConstraints(parent).
BOOL satisfiesMethodConstraints(
unsigned getFieldOffset (CORINFO_FIELD_HANDLE field);
- bool isWriteBarrierHelperRequired(CORINFO_FIELD_HANDLE field);
-
void* getFieldAddress(CORINFO_FIELD_HANDLE field, void **ppIndirection);
CORINFO_CLASS_HANDLE getStaticFieldCurrentClass(CORINFO_FIELD_HANDLE field, bool* pIsSpeculative);
// ICorDebugInfo stuff
- void * allocateArray(ULONG cBytes);
+ void * allocateArray(size_t cBytes);
void freeArray(void *array);
void getBoundaries(CORINFO_METHOD_HANDLE ftn,
unsigned int *cILOffsets, DWORD **pILOffsets,
unsigned getClassDomainID (CORINFO_CLASS_HANDLE cls, void **ppIndirection);
CORINFO_VARARGS_HANDLE getVarArgsHandle(CORINFO_SIG_INFO *sig, void **ppIndirection);
bool canGetVarArgsHandle(CORINFO_SIG_INFO *sig);
- void* getPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void **ppIndirection);
void* getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void **ppIndirection);
void getAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP *pLookup);
CORINFO_JUST_MY_CODE_HANDLE getJustMyCodeHandle(CORINFO_METHOD_HANDLE method, CORINFO_JUST_MY_CODE_HANDLE **ppIndirection);
CORINFO_METHOD_HANDLE embedMethodHandle(CORINFO_METHOD_HANDLE handle,
void **ppIndirection);
- void embedGenericHandle(CORINFO_RESOLVED_TOKEN * pResolvedToken,
- BOOL fEmbedParent,
- CORINFO_GENERICHANDLE_RESULT *pResult);
+ void embedGenericHandle(CORINFO_RESOLVED_TOKEN * pResolvedToken,
+ BOOL fEmbedParent,
+ CORINFO_GENERICHANDLE_RESULT *pResult);
- CORINFO_LOOKUP_KIND getLocationOfThisType(CORINFO_METHOD_HANDLE context);
+ void getLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND* pLookupKind);
void setOverride(ICorDynamicInfo *pOverride, CORINFO_METHOD_HANDLE currentMethod)
// ICorJitInfo stuff - none of this should be called on this class
//
- IEEMemoryManager* getMemoryManager();
-
void allocMem (
ULONG hotCodeSize, /* IN */
ULONG coldCodeSize, /* IN */
size_t size /* IN */
);
- void yieldExecution();
-
void setEHcount (
unsigned cEH /* IN */
);
WORD getRelocTypeHint(void * target);
- void getModuleNativeEntryPointRange(
- void ** pStart, /* OUT */
- void ** pEnd /* OUT */
- );
-
DWORD getExpectedTargetArchitecture();
CEEInfo(MethodDesc * fd = NULL, bool fVerifyOnly = false, bool fAllowInlining = true) :
WORD getRelocTypeHint(void * target);
- void getModuleNativeEntryPointRange(
- void** pStart,
- void** pEnd);
-
DWORD getExpectedTargetArchitecture();
CodeHeader* GetCodeHeader()
return pAssembly;
}
-#ifndef DACCESS_COMPILE
-OBJECTREF* CrawlFrame::GetAddrOfSecurityObject()
-{
- CONTRACTL {
- NOTHROW;
- GC_NOTRIGGER;
- } CONTRACTL_END;
-
- if (isFrameless)
- {
- _ASSERTE(pFunc);
-
-#if defined(TARGET_X86)
- if (isCachedMethod)
- {
- return pSecurityObject;
- }
- else
-#endif // TARGET_X86
- {
- return (static_cast <OBJECTREF*>(GetCodeManager()->GetAddrOfSecurityObject(this)));
- }
- }
- else
- {
-#ifdef FEATURE_INTERPRETER
- // Check for an InterpreterFrame.
- Frame* pFrm = GetFrame();
- if (pFrm != NULL && pFrm->GetVTablePtr() == InterpreterFrame::GetMethodFrameVPtr())
- {
-#ifdef DACCESS_COMPILE
- // TBD: DACize the interpreter.
- return NULL;
-#else
- return dac_cast<PTR_InterpreterFrame>(pFrm)->GetInterpreter()->GetAddressOfSecurityObject();
-#endif
- }
- // Otherwise...
-#endif // FEATURE_INTERPRETER
-
- /*ISSUE: Are there any other functions holding a security desc? */
- if (pFunc && (pFunc->IsIL() || pFunc->IsNoMetadata()))
- return dac_cast<PTR_FramedMethodFrame>
- (pFrame)->GetAddrOfSecurityDesc();
- }
- return NULL;
-}
-#endif
-
BOOL CrawlFrame::IsInCalleesFrames(LPVOID stackPointer)
{
LIMITED_METHOD_CONTRACT;
m_crawl.pThread = this->m_pThread;
- m_crawl.pSecurityObject = NULL;
m_crawl.isCachedMethod = false;
m_crawl.stackWalkCache.ClearEntry();
{
m_crawl.isCachedMethod = m_crawl.stackWalkCache.Lookup((UINT_PTR)GetControlPC(m_crawl.pRD));
_ASSERTE (m_crawl.isCachedMethod != m_crawl.stackWalkCache.IsEmpty());
-
- m_crawl.pSecurityObject = NULL;
-#if defined(TARGET_X86)
- if (m_crawl.isCachedMethod && m_crawl.stackWalkCache.m_CacheEntry.HasSecurityObject())
- {
- // pCallback will use this to save time on GetAddrOfSecurityObject
- StackwalkCacheUnwindInfo stackwalkCacheUnwindInfo(&m_crawl.stackWalkCache.m_CacheEntry);
- m_crawl.pSecurityObject = EECodeManager::GetAddrOfSecurityObjectFromCachedInfo(
- m_crawl.pRD,
- &stackwalkCacheUnwindInfo);
- }
-#endif // TARGET_X86
}
#endif // DACCESS_COMPILE
BOOL IsInCalleesFrames(LPVOID stackPointer);
-#ifndef DACCESS_COMPILE
- /* Returns address of the securityobject stored in the current function (method?)
- Returns NULL if
- - not a function OR
- - function (method?) hasn't reserved any room for it
- (which is an error)
- */
- OBJECTREF * GetAddrOfSecurityObject();
-#endif // DACCESS_COMPILE
-
// Fetch the extra type argument passed in some cases
PTR_VOID GetParamTypeArg();
Thread* pThread;
// fields used for stackwalk cache
- OBJECTREF *pSecurityObject;
BOOL isCachedMethod;
StackwalkCache stackWalkCache;
return m_ThreadTasks
|| ThreadpoolMgr::HaveTimerInfosToFlush()
- || ExecutionManager::IsCacheCleanupRequired()
|| Thread::CleanupNeededForFinalizedThread()
|| (m_DetachCount > 0)
|| SystemDomain::System()->RequireAppDomainCleanup()
Thread::CleanupDetachedThreads();
}
- if(ExecutionManager::IsCacheCleanupRequired() && GCHeapUtilities::GetGCHeap()->GetCondemnedGeneration()>=1)
- {
- ExecutionManager::ClearCaches();
- }
-
// If there were any TimerInfos waiting to be released, they'll get flushed now
ThreadpoolMgr::FlushQueueOfTimerInfos();
#endif
//
- // Don't use IBC data from untrusted assemblies--this allows us to assume that
- // the IBC data is not malicious
- //
- if (m_zapper->m_pEEJitInfo->canSkipVerification(m_hModule) != CORINFO_VERIFICATION_CAN_SKIP)
- {
- return S_FALSE;
- }
-
- //
// See if there's profile data in the resource section of the PE
//
m_pRawProfileData = (BYTE*)m_ModuleDecoder.GetWin32Resource(W("PROFILE_DATA"), W("IBC"), &m_cRawProfileData);
jitFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_FRAMED);
}
- if (canSkipMethodVerification(m_currentMethodHandle) == CORINFO_VERIFICATION_CAN_SKIP)
- {
- jitFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_SKIP_VERIFICATION);
- }
+ jitFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_SKIP_VERIFICATION);
if (m_pImage->m_profileDataSections[MethodBlockCounts].pData &&
!m_zapper->m_pOpt->m_ignoreProfileData)
{
// READYTORUN: FUTURE: Producedure spliting
m_jitFlags.Clear(CORJIT_FLAGS::CORJIT_FLAG_PROCSPLIT);
-
- if (!(methodAttribs & CORINFO_FLG_NOSECURITYWRAP) || (methodAttribs & CORINFO_FLG_SECURITYCHECK))
- {
- if (m_zapper->m_pOpt->m_verbose)
- m_zapper->Warning(W("ReadyToRun: Methods with security checks not supported\n"));
- ThrowHR(E_NOTIMPL);
- }
}
#endif
return sizeof(m_jitFlags);
}
-IEEMemoryManager* ZapInfo::getMemoryManager()
-{
- return GetEEMemoryManager();
-}
-
bool ZapInfo::runWithErrorTrap(void (*function)(void*), void* param)
{
return m_pEEJitInfo->runWithErrorTrap(function, param);
return m_pGCInfo;
}
-void ZapInfo::yieldExecution()
-{
- // nothing necessary here
-}
-
-
void ZapInfo::setEHcount(unsigned cEH)
{
//
return m_pEEJitInfo->getTokenTypeAsHandle(pResolvedToken);
}
-CORINFO_LOOKUP_KIND
-ZapInfo::getLocationOfThisType(CORINFO_METHOD_HANDLE context)
+void ZapInfo::getLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND * pLookupKind)
{
- return m_pEEJitInfo->getLocationOfThisType(context);
+ m_pEEJitInfo->getLocationOfThisType(context, pLookupKind);
}
void
return NULL;
}
-void * ZapInfo::getPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void **ppIndirection)
-{
- // We will never be able to return this directly in prejit mode.
- _ASSERTE(ppIndirection != NULL);
-
- *ppIndirection = NULL;
- return NULL;
-}
-
void * ZapInfo::getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method,void **ppIndirection)
{
_ASSERTE(ppIndirection != NULL);
ThrowHR(E_NOTIMPL);
}
- if (pResult->methodFlags & CORINFO_FLG_SECURITYCHECK)
- {
- if (m_zapper->m_pOpt->m_verbose)
- m_zapper->Warning(W("ReadyToRun: Methods with security checks not supported\n"));
- ThrowHR(E_NOTIMPL);
- }
-
if (GetCompileInfo()->IsNativeCallableMethod(pResult->hMethod))
{
if (m_zapper->m_pOpt->m_verbose)
#endif
}
-void ZapInfo::getModuleNativeEntryPointRange(void** pStart, void** pEnd)
-{
- // Initialize outparams to default range of (0,0).
- *pStart = 0;
- *pEnd = 0;
-}
-
DWORD ZapInfo::getExpectedTargetArchitecture()
{
return IMAGE_FILE_MACHINE_NATIVE;
return;
}
-void * ZapInfo::allocateArray(ULONG cBytes)
+void * ZapInfo::allocateArray(size_t cBytes)
{
return new BYTE[cBytes];
}
return m_pEEJitInfo->getFieldOffset(field);
}
-bool ZapInfo::isWriteBarrierHelperRequired(
- CORINFO_FIELD_HANDLE field)
-{
- return m_pEEJitInfo->isWriteBarrierHelperRequired(field);
-}
-
void ZapInfo::getFieldInfo (CORINFO_RESOLVED_TOKEN * pResolvedToken,
CORINFO_METHOD_HANDLE callerHandle,
CORINFO_ACCESS_FLAGS flags,
return m_pEEJitInfo->canInlineTypeCheck(cls, source);
}
-BOOL ZapInfo::canInlineTypeCheckWithObjectVTable (CORINFO_CLASS_HANDLE cls)
-{
- return m_pEEJitInfo->canInlineTypeCheckWithObjectVTable(cls);
-}
-
DWORD ZapInfo::getClassAttribs(CORINFO_CLASS_HANDLE cls)
{
return m_pEEJitInfo->getClassAttribs(cls);
return m_pEEJitInfo->isMoreSpecificType(cls1, cls2);
}
-BOOL ZapInfo::shouldEnforceCallvirtRestriction(
- CORINFO_MODULE_HANDLE scopeHnd)
-{
- return m_zapper->m_pEEJitInfo->shouldEnforceCallvirtRestriction(scopeHnd);
-}
-
CORINFO_CLASS_HANDLE ZapInfo::getParentType (
CORINFO_CLASS_HANDLE cls)
{
return m_pEEJitInfo->getSharedCCtorHelper(clsHnd);
}
-CorInfoHelpFunc ZapInfo::getSecurityPrologHelper(CORINFO_METHOD_HANDLE ftn)
-{
- return m_pEEJitInfo->getSecurityPrologHelper(ftn);
-}
-
CORINFO_CLASS_HANDLE ZapInfo::getTypeForBox(CORINFO_CLASS_HANDLE cls)
{
return m_pEEJitInfo->getTypeForBox(cls);
return m_pEEJitInfo->findNameOfToken(tokenScope, token, szFQName, FQNameCapacity);
}
-CorInfoCanSkipVerificationResult ZapInfo::canSkipVerification (
- CORINFO_MODULE_HANDLE tokenScope)
-{
- return m_pEEJitInfo->canSkipVerification(tokenScope);
-}
-
BOOL ZapInfo::isValidToken (
CORINFO_MODULE_HANDLE tokenScope,
unsigned token)
return m_pEEJitInfo->reportInliningDecision(inlinerHnd, inlineeHnd, inlineResult, reason);
}
-
-CorInfoInstantiationVerification ZapInfo::isInstantiationOfVerifiedGeneric(
- CORINFO_METHOD_HANDLE method)
-{
- return m_pEEJitInfo->isInstantiationOfVerifiedGeneric(method);
-}
-
-
-void ZapInfo::initConstraintsForVerification(CORINFO_METHOD_HANDLE method,
- BOOL *pfHasCircularClassConstraints,
- BOOL *pfHasCircularMethodConstraints)
-{
- m_pEEJitInfo->
- initConstraintsForVerification(method,pfHasCircularClassConstraints,pfHasCircularMethodConstraints);
-}
-
bool ZapInfo::canTailCall(CORINFO_METHOD_HANDLE caller,
CORINFO_METHOD_HANDLE declaredCallee,
CORINFO_METHOD_HANDLE exactCallee,
return m_pEEJitInfo->reportTailCallDecision(callerHnd, calleeHnd, fIsTailPrefix, tailCallResult, reason);
}
-
-CorInfoCanSkipVerificationResult ZapInfo::canSkipMethodVerification (
- CORINFO_METHOD_HANDLE ftnHandle)
-{
- // ILStubs are generated internally by the CLR. There is no need to
- // verify it, or any of its callees.
- if (m_zapper->m_pOpt->m_compilerFlags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_IL_STUB))
- return CORINFO_VERIFICATION_CAN_SKIP;
-
- CorInfoCanSkipVerificationResult canSkipVer =
- m_pEEJitInfo->canSkipMethodVerification(ftnHandle);
-
- if (canSkipVer == CORINFO_VERIFICATION_RUNTIME_CHECK)
- {
- // Transparent code could be partial trust, but we don't know at NGEN time.
- // Since the JIT is not hardened against unverifiable/illegal code, tell it
- // to just not jit the method if it hits unverifiable code, rathern than
- // injecting a runtime callout and continuing trying to JIT the method.
- canSkipVer = CORINFO_VERIFICATION_DONT_JIT;
- }
-
- return canSkipVer;
-}
-
void ZapInfo::getEHinfo(CORINFO_METHOD_HANDLE ftn,
unsigned EHnumber, CORINFO_EH_CLAUSE* clause)
{
// ICorJitInfo
- IEEMemoryManager* getMemoryManager();
-
virtual void allocMem (
ULONG hotCodeSize, /* IN */
ULONG coldCodeSize, /* IN */
);
void * allocGCInfo(size_t size);
- void yieldExecution();
void setEHcount(unsigned cEH);
void setEHinfo(unsigned EHnumber, const CORINFO_EH_CLAUSE *clause);
BOOL fEmbedParent,
CORINFO_GENERICHANDLE_RESULT *pResult);
- CORINFO_LOOKUP_KIND
- getLocationOfThisType(CORINFO_METHOD_HANDLE context);
-
+ void getLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND* pLookupKind);
void * getHelperFtn (CorInfoHelpFunc ftnNum,
void * getMethodSync(CORINFO_METHOD_HANDLE ftn,
void **ppIndirection);
- void * getPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method,
- void **ppIndirection);
void * getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method,
void **ppIndirection);
void getAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method,
WORD getRelocTypeHint(void * target);
- void getModuleNativeEntryPointRange(void** pStart, void** pEnd);
-
DWORD getExpectedTargetArchitecture();
// ICorJitInfo delegate ctor optimization
ICorDebugInfo::ILVarInfo **vars, bool *extendOthers);
void setVars(CORINFO_METHOD_HANDLE ftn, ULONG32 cVars,
ICorDebugInfo::NativeVarInfo*vars);
- void * allocateArray(ULONG cBytes);
+ void * allocateArray(size_t cBytes);
void freeArray(void *array);
// ICorFieldInfo
unsigned getFieldOffset(CORINFO_FIELD_HANDLE field);
- bool isWriteBarrierHelperRequired(
- CORINFO_FIELD_HANDLE field);
-
void getFieldInfo (CORINFO_RESOLVED_TOKEN * pResolvedToken,
CORINFO_METHOD_HANDLE callerHandle,
CORINFO_ACCESS_FLAGS flags,
BOOL fAssembly);
BOOL isValueClass(CORINFO_CLASS_HANDLE clsHnd);
CorInfoInlineTypeCheck canInlineTypeCheck(CORINFO_CLASS_HANDLE cls, CorInfoInlineTypeCheckSource source);
- BOOL canInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE clsHnd);
DWORD getClassAttribs(CORINFO_CLASS_HANDLE cls);
BOOL isStructRequiringStackAllocRetBuf(CORINFO_CLASS_HANDLE cls);
CORINFO_MODULE_HANDLE getClassModule(CORINFO_CLASS_HANDLE cls);
CorInfoHelpFunc getCastingHelper(CORINFO_RESOLVED_TOKEN * pResolvedToken, bool fThrowing);
CorInfoHelpFunc getNewArrHelper(CORINFO_CLASS_HANDLE arrayCls);
CorInfoHelpFunc getSharedCCtorHelper(CORINFO_CLASS_HANDLE clsHnd);
- CorInfoHelpFunc getSecurityPrologHelper(CORINFO_METHOD_HANDLE ftn);
CORINFO_CLASS_HANDLE getTypeForBox(CORINFO_CLASS_HANDLE cls);
CorInfoHelpFunc getBoxHelper(CORINFO_CLASS_HANDLE cls);
CorInfoHelpFunc getUnBoxHelper(CORINFO_CLASS_HANDLE cls);
BOOL isMoreSpecificType(CORINFO_CLASS_HANDLE cls1,
CORINFO_CLASS_HANDLE cls2);
- BOOL shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope);
CORINFO_CLASS_HANDLE getParentType(CORINFO_CLASS_HANDLE cls);
CorInfoType getChildType (CORINFO_CLASS_HANDLE clsHnd,
CORINFO_CLASS_HANDLE *clsRet);
unsigned metaTOK,
__out_ecount (FQNameCapacity) char * szFQName,
size_t FQNameCapacity);
- CorInfoCanSkipVerificationResult canSkipVerification (CORINFO_MODULE_HANDLE module);
BOOL isValidToken(CORINFO_MODULE_HANDLE module,
unsigned metaTOK);
BOOL isValidStringRef(CORINFO_MODULE_HANDLE module,
CorInfoInline inlineResult,
const char * reason);
- CorInfoInstantiationVerification isInstantiationOfVerifiedGeneric(
- CORINFO_METHOD_HANDLE method);
-
- void initConstraintsForVerification(CORINFO_METHOD_HANDLE method,
- BOOL *pfHasCircularClassConstraints,
- BOOL *pfHasCircularMethodConstraints);
-
bool canTailCall(CORINFO_METHOD_HANDLE caller,
CORINFO_METHOD_HANDLE declaredCallee,
CORINFO_METHOD_HANDLE exactCallee,
CorInfoTailCall tailCallResult,
const char * reason);
- CorInfoCanSkipVerificationResult canSkipMethodVerification (
- CORINFO_METHOD_HANDLE callerHnd);
-
void getEHinfo(CORINFO_METHOD_HANDLE ftn,
unsigned EHnumber, CORINFO_EH_CLAUSE* clause);
CORINFO_CLASS_HANDLE getMethodClass(CORINFO_METHOD_HANDLE method);
_ASSERTE(m_hJitLib != NULL);
_ASSERTE(m_pJitCompiler != NULL);
- // We're unloading the fallback JIT dll, so clear the fallback shim. We do this even though
- // we'll unload the main JIT below, in case there are other places that have loaded the main JIT
- // but not the fallback JIT (note that LoadLibrary reference counts the number of loads that have been done).
- m_pJitCompiler->setRealJit(nullptr);
-
FreeLibrary(m_hJitLegacy);
}
#endif