diff --git a/src/coreclr/src/ToolBox/superpmi/.gitmirror b/src/coreclr/src/ToolBox/superpmi/.gitmirror deleted file mode 100644 index f507630f949df6..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/.gitmirror +++ /dev/null @@ -1 +0,0 @@ -Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror. \ No newline at end of file diff --git a/src/coreclr/src/ToolBox/superpmi/mcs/.gitmirror b/src/coreclr/src/ToolBox/superpmi/mcs/.gitmirror deleted file mode 100644 index f507630f949df6..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/mcs/.gitmirror +++ /dev/null @@ -1 +0,0 @@ -Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror. \ No newline at end of file diff --git a/src/coreclr/src/ToolBox/superpmi/mcs/verbildump.cpp b/src/coreclr/src/ToolBox/superpmi/mcs/verbildump.cpp index d46ad2b20b8560..8b552af3bdf73a 100644 --- a/src/coreclr/src/ToolBox/superpmi/mcs/verbildump.cpp +++ b/src/coreclr/src/ToolBox/superpmi/mcs/verbildump.cpp @@ -905,7 +905,6 @@ char* DumpAttributeToConsoleBare(DWORD attribute) 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) \ @@ -917,7 +916,7 @@ char* DumpAttributeToConsoleBare(DWORD attribute) 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(); diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/.gitmirror b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/.gitmirror deleted file mode 100644 index f507630f949df6..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/.gitmirror +++ /dev/null @@ -1 +0,0 @@ -Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror. \ No newline at end of file diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/coreclrcommoncallbacks.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/coreclrcommoncallbacks.h deleted file mode 100644 index 3d5a4dc0b65200..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/coreclrcommoncallbacks.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitcompilerimpl.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitcompilerimpl.h index 28d67c20d17f59..4dfee625b97a07 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitcompilerimpl.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitcompilerimpl.h @@ -34,14 +34,6 @@ CorJitResult __stdcall compileMethod(ICorJitInfo* comp, /* IN 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); /* {}; */ @@ -57,12 +49,4 @@ void getVersionIdentifier(GUID* versionIdentifier /* OUT */ // 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h index 482bc998e63ea7..349cec9752999d 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h @@ -169,22 +169,6 @@ BOOL isCompatibleDelegate(CORINFO_CLASS_HANDLE objCls, /* type of the 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); @@ -231,20 +215,6 @@ void findCallSiteSig(CORINFO_MODULE_HANDLE module, /* IN */ 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 */ @@ -260,8 +230,6 @@ LPCWSTR getStringLiteral(CORINFO_MODULE_HANDLE module, /* IN */ int* length /* OUT */ ); -BOOL shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope); - /**********************************************************************************/ // // ICorClassInfo @@ -300,10 +268,6 @@ BOOL isValueClass(CORINFO_CLASS_HANDLE cls); // 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); @@ -375,8 +339,6 @@ CorInfoHelpFunc getCastingHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool fT // returns helper to trigger static constructor CorInfoHelpFunc getSharedCCtorHelper(CORINFO_CLASS_HANDLE clsHnd); -CorInfoHelpFunc getSecurityPrologHelper(CORINFO_METHOD_HANDLE ftn); - // This is not pretty. Boxing nullable actually returns // a boxed not a boxed Nullable. This call allows the verifier // to call back to the EE on the 'box' instruction and get the transformed @@ -532,11 +494,6 @@ CorInfoType getFieldType(CORINFO_FIELD_HANDLE field, // 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, @@ -609,7 +566,7 @@ void setVars(CORINFO_METHOD_HANDLE ftn, // [IN] method of interest // 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() @@ -827,17 +784,7 @@ void embedGenericHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken, // 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. @@ -929,9 +876,6 @@ void* getTailCallCopyArgsThunk(CORINFO_SIG_INFO* pSig, CorInfoHelperTailCallSpec 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 */ @@ -992,8 +936,6 @@ void allocUnwindInfo(BYTE* pHotCode, /* 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. @@ -1060,13 +1002,6 @@ void recordRelocation(void* location, /* IN */ 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/lwmlist.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/lwmlist.h index 59ebf7f35e7bad..c24e0e0b3c7bdd 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/lwmlist.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/lwmlist.h @@ -28,8 +28,6 @@ LWM(CanGetCookieForPInvokeCalliSig, CanGetCookieForPInvokeCalliSigValue, DWORD) 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) @@ -48,7 +46,6 @@ LWM(FilterException, DWORD, 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) @@ -116,12 +113,10 @@ LWM(GetMethodVTableOffset, DWORDLONG, DDD) 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) @@ -138,19 +133,16 @@ LWM(GetVarArgsHandle, GetVarArgsHandleValue, DLDL) 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) @@ -159,7 +151,6 @@ LWM(ResolveVirtualMethod, Agnostic_ResolveVirtualMethod, DWORDLONG) LWM(TryResolveToken, Agnostic_CORINFO_RESOLVED_TOKENin, TryResolveTokenValue) LWM(SatisfiesClassConstraints, DWORDLONG, DWORD) LWM(SatisfiesMethodConstraints, DLDL, DWORD) -LWM(ShouldEnforceCallvirtRestriction, DWORDLONG, DWORD) #undef LWM #undef DENSELWM diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp index 2a5da1050b1d01..5185e349eb9839 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp @@ -1637,27 +1637,6 @@ CorInfoUnmanagedCallConv MethodContext::repGetUnmanagedCallConv(CORINFO_METHOD_H return result; } -void MethodContext::recIsInstantiationOfVerifiedGeneric(CORINFO_METHOD_HANDLE method, - CorInfoInstantiationVerification result) -{ - if (IsInstantiationOfVerifiedGeneric == nullptr) - IsInstantiationOfVerifiedGeneric = new LightWeightMap(); - - 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) @@ -1853,25 +1832,6 @@ CorInfoHelpFunc MethodContext::repGetSharedCCtorHelper(CORINFO_CLASS_HANDLE clsH return result; } -void MethodContext::recGetSecurityPrologHelper(CORINFO_METHOD_HANDLE ftn, CorInfoHelpFunc result) -{ - if (GetSecurityPrologHelper == nullptr) - GetSecurityPrologHelper = new LightWeightMap(); - - 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) @@ -3325,30 +3285,22 @@ void MethodContext::repGetFieldInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken, 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 @@ -3898,17 +3850,11 @@ void MethodContext::recGetEEInfo(CORINFO_EE_INFO* pEEInfoOut) 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)); @@ -3916,17 +3862,15 @@ void MethodContext::recGetEEInfo(CORINFO_EE_INFO* pEEInfoOut) 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) { @@ -3953,17 +3897,11 @@ 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 @@ -3981,9 +3919,6 @@ void MethodContext::repGetEEInfo(CORINFO_EE_INFO* pEEInfoOut) 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); @@ -3993,10 +3928,6 @@ void MethodContext::repGetEEInfo(CORINFO_EE_INFO* pEEInfoOut) #else pEEInfoOut->osType = CORINFO_WINNT; #endif - - pEEInfoOut->osMajor = (unsigned)0; - pEEInfoOut->osMinor = (unsigned)0; - pEEInfoOut->osBuild = (unsigned)0; } } @@ -4224,10 +4155,10 @@ void MethodContext::dmpGetLocationOfThisType(DWORDLONG key, const Agnostic_CORIN 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, @@ -4494,24 +4425,6 @@ CorInfoInlineTypeCheck MethodContext::repCanInlineTypeCheck(CORINFO_CLASS_HANDLE return (CorInfoInlineTypeCheck)CanInlineTypeCheck->Get(key); } -void MethodContext::recCanInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE cls, BOOL result) -{ - if (CanInlineTypeCheckWithObjectVTable == nullptr) - CanInlineTypeCheckWithObjectVTable = new LightWeightMap(); - - 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) @@ -4545,36 +4458,6 @@ BOOL MethodContext::repSatisfiesMethodConstraints(CORINFO_CLASS_HANDLE parent, C return value; } -void MethodContext::recInitConstraintsForVerification(CORINFO_METHOD_HANDLE method, - BOOL* pfHasCircularClassConstraints, - BOOL* pfHasCircularMethodConstraint) -{ - if (InitConstraintsForVerification == nullptr) - InitConstraintsForVerification = new LightWeightMap(); - - 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) @@ -4836,35 +4719,6 @@ void MethodContext::dmpHandleException(DWORD key, DWORD value) 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(); - - 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) @@ -5063,46 +4917,6 @@ BOOL MethodContext::repIsDelegateCreationAllowed(CORINFO_CLASS_HANDLE delegateHn return (BOOL)value; } -void MethodContext::recCanSkipMethodVerification(CORINFO_METHOD_HANDLE ftnHandle, - BOOL skip, - CorInfoCanSkipVerificationResult result) -{ - if (CanSkipMethodVerification == nullptr) - CanSkipMethodVerification = new LightWeightMap(); - - 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, @@ -5157,28 +4971,6 @@ void MethodContext::repFindCallSiteSig(CORINFO_MODULE_HANDLE module, DEBUG_REP(dmpFindCallSiteSig(key, value)); } -void MethodContext::recShouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope, BOOL result) -{ - if (ShouldEnforceCallvirtRestriction == nullptr) - ShouldEnforceCallvirtRestriction = new LightWeightMap(); - 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) @@ -5904,25 +5696,6 @@ WORD MethodContext::repGetRelocTypeHint(void* target) return retVal; } -void MethodContext::recIsWriteBarrierHelperRequired(CORINFO_FIELD_HANDLE field, bool result) -{ - if (IsWriteBarrierHelperRequired == nullptr) - IsWriteBarrierHelperRequired = new LightWeightMap(); - - 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) @@ -6251,30 +6024,6 @@ BOOL MethodContext::repCheckMethodModifier(CORINFO_METHOD_HANDLE hMethod, LPCSTR return value; } -void MethodContext::recGetPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void** ppIndirection, void* result) -{ - if (GetPInvokeUnmanagedTarget == nullptr) - GetPInvokeUnmanagedTarget = new LightWeightMap(); - 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) diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h index 3c1c4792d96a4c..d0de0fd177331b 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h @@ -170,17 +170,11 @@ class MethodContext 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 { @@ -697,10 +691,6 @@ class MethodContext 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); @@ -737,10 +727,6 @@ class MethodContext 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); @@ -1027,7 +1013,7 @@ class MethodContext 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, @@ -1066,22 +1052,11 @@ class MethodContext 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); @@ -1113,10 +1088,6 @@ class MethodContext 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); @@ -1157,12 +1128,6 @@ class MethodContext 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, @@ -1173,10 +1138,6 @@ class MethodContext 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); @@ -1265,10 +1226,6 @@ class MethodContext 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); @@ -1302,10 +1259,6 @@ class MethodContext 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); @@ -1373,7 +1326,7 @@ enum mcPackets 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 @@ -1398,7 +1351,7 @@ enum mcPackets 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, @@ -1468,10 +1421,10 @@ enum mcPackets 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, @@ -1488,12 +1441,12 @@ enum mcPackets 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, @@ -1501,7 +1454,7 @@ enum mcPackets 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, @@ -1510,7 +1463,7 @@ enum mcPackets 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, diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/runtimedetails.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/runtimedetails.h index cacd2c4e1fd1fa..3d6c7e23512d5b 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/runtimedetails.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/runtimedetails.h @@ -35,6 +35,5 @@ // Jit Exports typedef ICorJitCompiler*(__stdcall* PgetJit)(); typedef void(__stdcall* PjitStartup)(ICorJitHost* host); -typedef void(__stdcall* PsxsJitStartup)(CoreClrCallbacks const& cccallbacks); #endif diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/spmidumphelper.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/spmidumphelper.cpp index f54b9b4236ff73..fdebace71a446a 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/spmidumphelper.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/spmidumphelper.cpp @@ -115,13 +115,11 @@ std::string SpmiDumpHelper::DumpCorInfoFlag(CorInfoFlag flags) 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); @@ -130,11 +128,9 @@ std::string SpmiDumpHelper::DumpCorInfoFlag(CorInfoFlag flags) 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); diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/.gitmirror b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/.gitmirror deleted file mode 100644 index f507630f949df6..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/.gitmirror +++ /dev/null @@ -1 +0,0 @@ -Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror. \ No newline at end of file diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/CMakeLists.txt b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/CMakeLists.txt index d435f3b2907540..938a0cabed7d54 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/CMakeLists.txt +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/CMakeLists.txt @@ -15,12 +15,9 @@ include_directories(.) 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/coreclrcallbacks.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/coreclrcallbacks.cpp deleted file mode 100644 index 0d79ce7b261e17..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/coreclrcallbacks.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// -// 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; -} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/coreclrcallbacks.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/coreclrcallbacks.h deleted file mode 100644 index a5257422cdc57a..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/coreclrcallbacks.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitcompiler.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitcompiler.cpp index ace9d8bac5cca5..e55e7093e52cc4 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitcompiler.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitcompiler.cpp @@ -11,7 +11,6 @@ #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 */ @@ -23,9 +22,6 @@ CorJitResult __stdcall interceptor_ICJC::compileMethod(ICorJitInfo* 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) { @@ -89,16 +85,6 @@ CorJitResult __stdcall interceptor_ICJC::compileMethod(ICorJitInfo* 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); @@ -113,8 +99,3 @@ unsigned interceptor_ICJC::getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompi { return original_ICorJitCompiler->getMaxIntrinsicSIMDVectorLength(cpuCompileFlags); } - -void interceptor_ICJC::setRealJit(ICorJitCompiler* realJitCompiler) -{ - original_ICorJitCompiler->setRealJit(realJitCompiler); -} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitcompiler.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitcompiler.h index c1f35adc87efab..14499dd28d8ceb 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitcompiler.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitcompiler.h @@ -7,7 +7,6 @@ #define _ICorJitCompiler #include "runtimedetails.h" -#include "ieememorymanager.h" class interceptor_ICJC : public ICorJitCompiler { @@ -20,6 +19,4 @@ 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp index 9f42b42925344a..2768739712afbd 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp @@ -6,7 +6,6 @@ #include "standardpch.h" #include "icorjitinfo.h" #include "superpmi-shim-collector.h" -#include "ieememorymanager.h" #include "icorjitcompiler.h" #include "methodcontext.h" #include "errorhandling.h" @@ -341,41 +340,6 @@ BOOL interceptor_ICJI::isCompatibleDelegate( 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) { @@ -478,23 +442,6 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getTokenTypeAsHandle(CORINFO_RESOLVED_TOK 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 */ @@ -528,14 +475,6 @@ LPCWSTR interceptor_ICJI::getStringLiteral(CORINFO_MODULE_HANDLE module, /* 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 @@ -618,16 +557,6 @@ CorInfoInlineTypeCheck interceptor_ICJI::canInlineTypeCheck(CORINFO_CLASS_HANDLE 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) { @@ -815,14 +744,6 @@ CorInfoHelpFunc interceptor_ICJI::getSharedCCtorHelper(CORINFO_CLASS_HANDLE clsH 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 actually returns // a boxed not a boxed Nullable. This call allows the verifier // to call back to the EE on the 'box' instruction and get the transformed @@ -1143,17 +1064,6 @@ unsigned interceptor_ICJI::getFieldOffset(CORINFO_FIELD_HANDLE field) 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, @@ -1259,7 +1169,7 @@ void interceptor_ICJI::setVars(CORINFO_METHOD_HANDLE ftn, // [IN] meth // 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); @@ -1685,30 +1595,11 @@ void interceptor_ICJI::embedGenericHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken // 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. @@ -1980,15 +1871,6 @@ bool interceptor_ICJI::runWithErrorTrap(void (*function)(void*), void* param) 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 */ @@ -2072,13 +1954,6 @@ void* interceptor_ICJI::allocGCInfo(size_t size /* 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. @@ -2186,17 +2061,6 @@ WORD interceptor_ICJI::getRelocTypeHint(void* target) 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.h index af2c866fd652bc..8dfeaa44335dd0 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.h @@ -7,7 +7,6 @@ #define _ICorJitInfo #include "runtimedetails.h" -#include "ieememorymanager.h" #include "methodcontext.h" class interceptor_ICJI : public ICorJitInfo diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/ieememorymanager.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/ieememorymanager.cpp deleted file mode 100644 index 3bd9e7e5d4b897..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/ieememorymanager.cpp +++ /dev/null @@ -1,80 +0,0 @@ -// -// 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(); -} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/ieememorymanager.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/ieememorymanager.h deleted file mode 100644 index 55fb3733a40069..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/ieememorymanager.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/iexecutionengine.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/iexecutionengine.cpp deleted file mode 100644 index 6409e4f24fd20a..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/iexecutionengine.cpp +++ /dev/null @@ -1,160 +0,0 @@ -// -// 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); -} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/iexecutionengine.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/iexecutionengine.h deleted file mode 100644 index 69f9679af44392..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/iexecutionengine.h +++ /dev/null @@ -1,73 +0,0 @@ -// -// 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/superpmi-shim-collector.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/superpmi-shim-collector.cpp index 1a94cdb1509ab6..bb39b86d6d1a0a 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/superpmi-shim-collector.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/superpmi-shim-collector.cpp @@ -8,7 +8,6 @@ //---------------------------------------------------------- #include "standardpch.h" -#include "coreclrcallbacks.h" #include "icorjitcompiler.h" #include "runtimedetails.h" #include "errorhandling.h" @@ -188,36 +187,3 @@ extern "C" DLLEXPORT ICorJitCompiler* __stdcall getJit() 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); - } -} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/superpmi-shim-collector.def b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/superpmi-shim-collector.def index 436434c3de6fca..f00334b07ef670 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/superpmi-shim-collector.def +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/superpmi-shim-collector.def @@ -2,4 +2,3 @@ LIBRARY EXPORTS getJit jitStartup - sxsJitStartup diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/.gitmirror b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/.gitmirror deleted file mode 100644 index f507630f949df6..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/.gitmirror +++ /dev/null @@ -1 +0,0 @@ -Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror. \ No newline at end of file diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/CMakeLists.txt b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/CMakeLists.txt index 8bf68a910f2e1e..bd0dee2ff121a8 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/CMakeLists.txt +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/CMakeLists.txt @@ -15,12 +15,9 @@ include_directories(.) 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/coreclrcallbacks.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/coreclrcallbacks.cpp deleted file mode 100644 index 0d79ce7b261e17..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/coreclrcallbacks.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// -// 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; -} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/coreclrcallbacks.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/coreclrcallbacks.h deleted file mode 100644 index a5257422cdc57a..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/coreclrcallbacks.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitcompiler.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitcompiler.cpp index 37a0559f396556..b9c54a0ca2bcbd 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitcompiler.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitcompiler.cpp @@ -7,8 +7,6 @@ #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 */ @@ -19,8 +17,6 @@ CorJitResult __stdcall interceptor_ICJC::compileMethod(ICorJitInfo* 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"); @@ -30,18 +26,6 @@ CorJitResult __stdcall interceptor_ICJC::compileMethod(ICorJitInfo* 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"); @@ -59,9 +43,3 @@ unsigned interceptor_ICJC::getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompi mcs->AddCall("getMaxIntrinsicSIMDVectorLength"); return original_ICorJitCompiler->getMaxIntrinsicSIMDVectorLength(cpuCompileFlags); } - -void interceptor_ICJC::setRealJit(ICorJitCompiler* realJitCompiler) -{ - mcs->AddCall("setRealJit"); - original_ICorJitCompiler->setRealJit(realJitCompiler); -} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitcompiler.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitcompiler.h index 5ce4e6324f4ffa..ef6207a5b28979 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitcompiler.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitcompiler.h @@ -8,7 +8,6 @@ #include "runtimedetails.h" #include "methodcallsummarizer.h" -#include "ieememorymanager.h" class interceptor_ICJC : public ICorJitCompiler { @@ -21,6 +20,4 @@ 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp index aa7d8a383cc3a9..93d71b71bd6610 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp @@ -6,7 +6,6 @@ #include "standardpch.h" #include "icorjitinfo.h" #include "superpmi-shim-counter.h" -#include "ieememorymanager.h" #include "icorjitcompiler.h" #include "spmiutil.h" @@ -240,36 +239,6 @@ BOOL interceptor_ICJI::isCompatibleDelegate( 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) { @@ -351,15 +320,6 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getTokenTypeAsHandle(CORINFO_RESOLVED_TOK // 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 */ @@ -387,12 +347,6 @@ LPCWSTR interceptor_ICJI::getStringLiteral(CORINFO_MODULE_HANDLE module, /* 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 @@ -460,14 +414,6 @@ CorInfoInlineTypeCheck interceptor_ICJI::canInlineTypeCheck(CORINFO_CLASS_HANDLE 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) { @@ -624,12 +570,6 @@ CorInfoHelpFunc interceptor_ICJI::getSharedCCtorHelper(CORINFO_CLASS_HANDLE clsH 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 actually returns // a boxed not a boxed Nullable. This call allows the verifier // to call back to the EE on the 'box' instruction and get the transformed @@ -897,15 +837,6 @@ unsigned interceptor_ICJI::getFieldOffset(CORINFO_FIELD_HANDLE field) 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, @@ -1005,7 +936,7 @@ void interceptor_ICJI::setVars(CORINFO_METHOD_HANDLE ftn, // [IN] meth // 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); @@ -1321,24 +1252,10 @@ void interceptor_ICJI::embedGenericHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken // 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. @@ -1538,16 +1455,6 @@ bool interceptor_ICJI::runWithErrorTrap(void (*function)(void*), void* param) 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 */ @@ -1626,13 +1533,6 @@ void* interceptor_ICJI::allocGCInfo(size_t size /* 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. @@ -1739,17 +1639,6 @@ WORD interceptor_ICJI::getRelocTypeHint(void* target) 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.h index f4c13ee2c9ed68..97475257edb1b2 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.h @@ -7,7 +7,6 @@ #define _ICorJitInfo #include "runtimedetails.h" -#include "ieememorymanager.h" #include "methodcallsummarizer.h" class interceptor_ICJI : public ICorJitInfo diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/ieememorymanager.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/ieememorymanager.cpp deleted file mode 100644 index 24efbce4f4b59b..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/ieememorymanager.cpp +++ /dev/null @@ -1,80 +0,0 @@ -// -// 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(); -} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/ieememorymanager.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/ieememorymanager.h deleted file mode 100644 index 28e85395915a49..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/ieememorymanager.h +++ /dev/null @@ -1,109 +0,0 @@ -// -// 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/iexecutionengine.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/iexecutionengine.cpp deleted file mode 100644 index 7e882bb3960284..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/iexecutionengine.cpp +++ /dev/null @@ -1,159 +0,0 @@ -// -// 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); -} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/iexecutionengine.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/iexecutionengine.h deleted file mode 100644 index e3706b41964325..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/iexecutionengine.h +++ /dev/null @@ -1,146 +0,0 @@ -// -// 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/superpmi-shim-counter.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/superpmi-shim-counter.cpp index 6bc7d3f4b7f1f8..3d4e6306ab72a6 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/superpmi-shim-counter.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/superpmi-shim-counter.cpp @@ -10,7 +10,6 @@ #include "standardpch.h" #include "superpmi-shim-counter.h" #include "runtimedetails.h" -#include "coreclrcallbacks.h" #include "icorjitcompiler.h" #include "errorhandling.h" #include "logging.h" @@ -184,36 +183,3 @@ extern "C" DLLEXPORT ICorJitCompiler* __stdcall getJit() 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); - } -} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/superpmi-shim-counter.def b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/superpmi-shim-counter.def index 436434c3de6fca..f00334b07ef670 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/superpmi-shim-counter.def +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/superpmi-shim-counter.def @@ -2,4 +2,3 @@ LIBRARY EXPORTS getJit jitStartup - sxsJitStartup diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/.gitmirror b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/.gitmirror deleted file mode 100644 index f507630f949df6..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/.gitmirror +++ /dev/null @@ -1 +0,0 @@ -Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror. \ No newline at end of file diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/CMakeLists.txt b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/CMakeLists.txt index c27dd035fb12db..e003c0372183a0 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/CMakeLists.txt +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/CMakeLists.txt @@ -15,12 +15,9 @@ include_directories(.) 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/coreclrcallbacks.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/coreclrcallbacks.cpp deleted file mode 100644 index 0d79ce7b261e17..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/coreclrcallbacks.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// -// 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; -} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/coreclrcallbacks.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/coreclrcallbacks.h deleted file mode 100644 index 6c4a054df4afa9..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/coreclrcallbacks.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitcompiler.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitcompiler.cpp index b45a3fe437525a..c9bfb9fffda050 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitcompiler.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitcompiler.cpp @@ -7,8 +7,6 @@ #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 */ @@ -19,25 +17,12 @@ CorJitResult __stdcall interceptor_ICJC::compileMethod(ICorJitInfo* 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); @@ -52,8 +37,3 @@ unsigned interceptor_ICJC::getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompi { return original_ICorJitCompiler->getMaxIntrinsicSIMDVectorLength(cpuCompileFlags); } - -void interceptor_ICJC::setRealJit(ICorJitCompiler* realJitCompiler) -{ - original_ICorJitCompiler->setRealJit(realJitCompiler); -} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitcompiler.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitcompiler.h index e045da2926b488..158c54d8d7b85b 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitcompiler.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitcompiler.h @@ -7,7 +7,6 @@ #define _ICorJitCompiler #include "runtimedetails.h" -#include "ieememorymanager.h" class interceptor_ICJC : public ICorJitCompiler { @@ -19,7 +18,4 @@ 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp index 4a9a71464c8365..5fee245bce605a 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp @@ -6,7 +6,6 @@ #include "standardpch.h" #include "icorjitinfo.h" #include "superpmi-shim-simple.h" -#include "ieememorymanager.h" #include "icorjitcompiler.h" #include "spmiutil.h" @@ -218,31 +217,6 @@ BOOL interceptor_ICJI::isCompatibleDelegate( 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) { @@ -307,23 +281,6 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getTokenTypeAsHandle(CORINFO_RESOLVED_TOK 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 */ @@ -348,11 +305,6 @@ LPCWSTR interceptor_ICJI::getStringLiteral(CORINFO_MODULE_HANDLE module, /* IN return original_ICorJitInfo->getStringLiteral(module, metaTOK, length); } -BOOL interceptor_ICJI::shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope) -{ - return original_ICorJitInfo->shouldEnforceCallvirtRestriction(scope); -} - /**********************************************************************************/ // // ICorClassInfo @@ -413,13 +365,6 @@ CorInfoInlineTypeCheck interceptor_ICJI::canInlineTypeCheck(CORINFO_CLASS_HANDLE 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) { @@ -556,11 +501,6 @@ CorInfoHelpFunc interceptor_ICJI::getSharedCCtorHelper(CORINFO_CLASS_HANDLE clsH return original_ICorJitInfo->getSharedCCtorHelper(clsHnd); } -CorInfoHelpFunc interceptor_ICJI::getSecurityPrologHelper(CORINFO_METHOD_HANDLE ftn) -{ - return original_ICorJitInfo->getSecurityPrologHelper(ftn); -} - // This is not pretty. Boxing nullable actually returns // a boxed not a boxed Nullable. This call allows the verifier // to call back to the EE on the 'box' instruction and get the transformed @@ -800,14 +740,6 @@ unsigned interceptor_ICJI::getFieldOffset(CORINFO_FIELD_HANDLE field) 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, @@ -903,7 +835,7 @@ void interceptor_ICJI::setVars(CORINFO_METHOD_HANDLE ftn, // [IN] meth // 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); } @@ -1186,21 +1118,9 @@ void interceptor_ICJI::embedGenericHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken // 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. @@ -1373,15 +1293,6 @@ bool interceptor_ICJI::runWithErrorTrap(void (*function)(void*), void* param) 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 */ @@ -1456,12 +1367,6 @@ void* interceptor_ICJI::allocGCInfo(size_t size /* 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. @@ -1550,16 +1455,6 @@ WORD interceptor_ICJI::getRelocTypeHint(void* target) 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.h index 4d01de9b77dd52..191ce4da201ff9 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.h @@ -7,7 +7,6 @@ #define _ICorJitInfo #include "runtimedetails.h" -#include "ieememorymanager.h" class interceptor_ICJI : public ICorJitInfo { diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/ieememorymanager.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/ieememorymanager.cpp deleted file mode 100644 index aecd68e9d9dc55..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/ieememorymanager.cpp +++ /dev/null @@ -1,80 +0,0 @@ -// -// 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(); -} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/ieememorymanager.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/ieememorymanager.h deleted file mode 100644 index b70c1fd758f76b..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/ieememorymanager.h +++ /dev/null @@ -1,110 +0,0 @@ -// -// 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/iexecutionengine.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/iexecutionengine.cpp deleted file mode 100644 index 4e8cbb4359e690..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/iexecutionengine.cpp +++ /dev/null @@ -1,160 +0,0 @@ -// -// 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); -} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/iexecutionengine.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/iexecutionengine.h deleted file mode 100644 index 33216496f18978..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/iexecutionengine.h +++ /dev/null @@ -1,147 +0,0 @@ -// -// 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/superpmi-shim-simple.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/superpmi-shim-simple.cpp index a2fbaf0ef97730..a9a8bdd9f40355 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/superpmi-shim-simple.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/superpmi-shim-simple.cpp @@ -10,7 +10,6 @@ #include "standardpch.h" #include "superpmi-shim-simple.h" #include "runtimedetails.h" -#include "coreclrcallbacks.h" #include "icorjitcompiler.h" #include "errorhandling.h" #include "logging.h" @@ -153,42 +152,3 @@ extern "C" DLLEXPORT ICorJitCompiler* __stdcall getJit() 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); - } -} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/superpmi-shim-simple.def b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/superpmi-shim-simple.def index 436434c3de6fca..f00334b07ef670 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/superpmi-shim-simple.def +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/superpmi-shim-simple.def @@ -2,4 +2,3 @@ LIBRARY EXPORTS getJit jitStartup - sxsJitStartup diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi/.gitmirror b/src/coreclr/src/ToolBox/superpmi/superpmi/.gitmirror deleted file mode 100644 index f507630f949df6..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi/.gitmirror +++ /dev/null @@ -1 +0,0 @@ -Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror. \ No newline at end of file diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi/CMakeLists.txt b/src/coreclr/src/ToolBox/superpmi/superpmi/CMakeLists.txt index 1c8b10ba0c552c..bd56911faace2c 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi/CMakeLists.txt +++ b/src/coreclr/src/ToolBox/superpmi/superpmi/CMakeLists.txt @@ -17,11 +17,8 @@ include_directories(../superpmi-shared) set(SUPERPMI_SOURCES commandline.cpp - coreclrcallbacks.cpp cycletimer.cpp icorjitinfo.cpp - ieememorymanager.cpp - iexecutionengine.cpp jitdebugger.cpp jitinstance.cpp methodstatsemitter.cpp diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi/coreclrcallbacks.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi/coreclrcallbacks.cpp deleted file mode 100644 index 8727bd7fb75505..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi/coreclrcallbacks.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// -// 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; -} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi/coreclrcallbacks.h b/src/coreclr/src/ToolBox/superpmi/superpmi/coreclrcallbacks.h deleted file mode 100644 index 33057795352360..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi/coreclrcallbacks.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp index f3bf12be739a7d..084bf2703ffc92 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp @@ -263,35 +263,6 @@ BOOL MyICJI::isCompatibleDelegate(CORINFO_CLASS_HANDLE objCls, /* type 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) { @@ -370,26 +341,6 @@ CORINFO_CLASS_HANDLE MyICJI::getTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN* pResol 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 */ @@ -417,12 +368,6 @@ LPCWSTR MyICJI::getStringLiteral(CORINFO_MODULE_HANDLE module, /* 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 @@ -504,14 +449,6 @@ CorInfoInlineTypeCheck MyICJI::canInlineTypeCheck(CORINFO_CLASS_HANDLE cls, CorI 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) { @@ -680,12 +617,6 @@ CorInfoHelpFunc MyICJI::getSharedCCtorHelper(CORINFO_CLASS_HANDLE clsHnd) 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 actually returns // a boxed not a boxed Nullable. This call allows the verifier // to call back to the EE on the 'box' instruction and get the transformed @@ -955,16 +886,6 @@ unsigned MyICJI::getFieldOffset(CORINFO_FIELD_HANDLE field) 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, @@ -1087,7 +1008,7 @@ void MyICJI::setVars(CORINFO_METHOD_HANDLE ftn, // [IN] method of inte // 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); } @@ -1425,25 +1346,10 @@ void MyICJI::embedGenericHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken, // 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. @@ -1649,12 +1555,6 @@ bool MyICJI::runWithErrorTrap(void (*function)(void*), void* param) 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 */ @@ -1743,12 +1643,6 @@ void* MyICJI::allocGCInfo(size_t size /* 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. @@ -1870,18 +1764,6 @@ WORD MyICJI::getRelocTypeHint(void* target) 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.h b/src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.h index 333d69dbbed4a9..3c9e51873fabb0 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.h @@ -7,7 +7,7 @@ #define _ICorJitInfo #include "runtimedetails.h" -#include "ieememorymanager.h" +#include "jitinstance.h" extern ICorJitInfo* pICJI; diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi/ieememorymanager.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi/ieememorymanager.cpp deleted file mode 100644 index b12735019e354b..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi/ieememorymanager.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// -// 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; -} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi/ieememorymanager.h b/src/coreclr/src/ToolBox/superpmi/superpmi/ieememorymanager.h deleted file mode 100644 index 5793f2b90ae98e..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi/ieememorymanager.h +++ /dev/null @@ -1,115 +0,0 @@ -// -// 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi/iexecutionengine.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi/iexecutionengine.cpp deleted file mode 100644 index 0c0d147c978109..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi/iexecutionengine.cpp +++ /dev/null @@ -1,208 +0,0 @@ -// -// 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; -} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi/iexecutionengine.h b/src/coreclr/src/ToolBox/superpmi/superpmi/iexecutionengine.h deleted file mode 100644 index fb3a413cb4956e..00000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi/iexecutionengine.h +++ /dev/null @@ -1,148 +0,0 @@ -// -// 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 diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi/jithost.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi/jithost.cpp index b35ebb00fbf173..909f87b577fb8d 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi/jithost.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi/jithost.cpp @@ -21,7 +21,7 @@ WCHAR* GetCOMPlusVariable(const WCHAR* key, JitInstance& jitInstance) size_t keyLen = wcslen(key); size_t keyBufferLen = keyLen + PrefixLen + 1; WCHAR* keyBuffer = - reinterpret_cast(jitInstance.allocateArray(static_cast(sizeof(WCHAR) * keyBufferLen))); + reinterpret_cast(jitInstance.allocateArray(sizeof(WCHAR) * keyBufferLen)); wcscpy_s(keyBuffer, keyBufferLen, Prefix); wcscpy_s(&keyBuffer[PrefixLen], keyLen + 1, key); @@ -53,12 +53,12 @@ JitHost::JitHost(JitInstance& jitInstance) : jitInstance(jitInstance) 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) @@ -171,7 +171,7 @@ const WCHAR* JitHost::getStringConfigValue(const WCHAR* key) { // 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; } diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi/jitinstance.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi/jitinstance.cpp index 36bfda31d20e51..3f6c8434d54c1b 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi/jitinstance.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi/jitinstance.cpp @@ -6,7 +6,6 @@ #include "standardpch.h" #include "superpmi.h" #include "jitinstance.h" -#include "coreclrcallbacks.h" #include "icorjitinfo.h" #include "jithost.h" #include "errorhandling.h" @@ -173,16 +172,8 @@ HRESULT JitInstance::StartUp(char* PathToJit, bool copyJit, bool breakOnDebugBre 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) { @@ -241,16 +232,8 @@ bool JitInstance::reLoad(MethodContext* firstContext) 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) { @@ -450,7 +433,7 @@ const WCHAR* JitInstance::getOption(const WCHAR* key, LightWeightMapcr->AddCall("allocateArray"); return HeapAlloc(mc->cr->getCodeHeap(), 0, cBytes); @@ -458,7 +441,7 @@ void* JitInstance::allocateArray(ULONG 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); } diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi/jitinstance.h b/src/coreclr/src/ToolBox/superpmi/superpmi/jitinstance.h index 119a925c92f355..b7b241dc8eaec5 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi/jitinstance.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi/jitinstance.h @@ -20,7 +20,6 @@ class JitInstance HMODULE hLib; PgetJit pngetJit; PjitStartup pnjitStartup; - PsxsJitStartup pnsxsJitStartup; ICorJitHost* jitHost; ICorJitInfo* icji; SimpleTimer stj; @@ -68,8 +67,8 @@ class JitInstance 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); }; diff --git a/src/coreclr/src/inc/corcompile.h b/src/coreclr/src/inc/corcompile.h index fd5096c502fc8b..9f41fd19a3654e 100644 --- a/src/coreclr/src/inc/corcompile.h +++ b/src/coreclr/src/inc/corcompile.h @@ -1757,23 +1757,6 @@ class ICorCompileInfo 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(); diff --git a/src/coreclr/src/inc/corinfo.h b/src/coreclr/src/inc/corinfo.h index ca7cdabf45d4fd..73e560ec37286b 100644 --- a/src/coreclr/src/inc/corinfo.h +++ b/src/coreclr/src/inc/corinfo.h @@ -217,11 +217,11 @@ TODO: Talk about initializing strutures before use #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 } }; ////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -383,7 +383,6 @@ enum CorInfoHelpFunc /* 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 @@ -461,21 +460,6 @@ enum CorInfoHelpFunc 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) @@ -814,13 +798,13 @@ enum CorInfoFlag 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. @@ -834,11 +818,11 @@ enum CorInfoFlag 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) @@ -850,8 +834,8 @@ enum CorInfoFlag 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 }; @@ -861,7 +845,7 @@ enum CORINFO_ACCESS_FLAGS { 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 @@ -1043,17 +1027,6 @@ enum CorInfoTailCall 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 @@ -1097,26 +1070,6 @@ enum CorInfoIndirectCallReason 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.Add()) of a method - // in a generic class or a generic method. It is either the typical instantiation - // (eg. List.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 @@ -1575,7 +1528,6 @@ enum CorInfoIsAccessAllowedResult { 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 }; @@ -1662,8 +1614,6 @@ struct CORINFO_CALL_INFO // 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; @@ -1818,13 +1768,6 @@ struct CORINFO_EE_INFO // Wrapper delegate offsets unsigned offsetOfWrapperDelegateIndirectCell; - // Remoting offsets - unsigned offsetOfTransparentProxyRP; - unsigned offsetOfRealProxyServer; - - // Array offsets - unsigned offsetOfObjArrayData; - // Reverse PInvoke offsets unsigned sizeOfReversePInvokeFrame; @@ -1839,9 +1782,6 @@ struct CORINFO_EE_INFO CORINFO_RUNTIME_ABI targetAbi; CORINFO_OS osType; - unsigned osMajor; - unsigned osMinor; - unsigned osBuild; }; // This is used to indicate that a finally has been called @@ -1957,12 +1897,6 @@ struct CORINFO_VarArgInfo #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 @@ -2192,26 +2126,6 @@ class ICorStaticInfo 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 @@ -2266,21 +2180,6 @@ class ICorStaticInfo 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 */ @@ -2301,10 +2200,6 @@ class ICorStaticInfo int* length /* OUT */ ) = 0; - virtual BOOL shouldEnforceCallvirtRestriction( - CORINFO_MODULE_HANDLE scope - ) = 0; - /**********************************************************************************/ // // ICorClassInfo @@ -2359,10 +2254,6 @@ class ICorStaticInfo // 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 @@ -2475,10 +2366,6 @@ class ICorStaticInfo CORINFO_CLASS_HANDLE clsHnd ) = 0; - virtual CorInfoHelpFunc getSecurityPrologHelper( - CORINFO_METHOD_HANDLE ftn - ) = 0; - // This is not pretty. Boxing nullable actually returns // a boxed not a boxed Nullable. This call allows the verifier // to call back to the EE on the 'box' instruction and get the transformed @@ -2694,12 +2581,6 @@ class ICorStaticInfo 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, @@ -2778,7 +2659,7 @@ class ICorStaticInfo // 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 @@ -3062,24 +2943,9 @@ class ICorDynamicInfo : public ICorStaticInfo // 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 diff --git a/src/coreclr/src/inc/corjit.h b/src/coreclr/src/inc/corjit.h index 190d911f4d54fb..47b6858238415d 100644 --- a/src/coreclr/src/inc/corjit.h +++ b/src/coreclr/src/inc/corjit.h @@ -48,129 +48,6 @@ enum CorJitResult 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 @@ -245,14 +122,6 @@ class ICorJitCompiler 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) {}; @@ -268,15 +137,6 @@ class ICorJitCompiler // 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) { } - }; //------------------------------------------------------------------------------------------ @@ -294,9 +154,6 @@ class ICorJitCompiler 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 */ @@ -361,8 +218,6 @@ class ICorJitInfo : public ICorDynamicInfo 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. @@ -435,14 +290,6 @@ class ICorJitInfo : public ICorDynamicInfo 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 diff --git a/src/coreclr/src/inc/corjitflags.h b/src/coreclr/src/inc/corjitflags.h index ab89219a55a8f9..1982e0c7b93f64 100644 --- a/src/coreclr/src/inc/corjitflags.h +++ b/src/coreclr/src/inc/corjitflags.h @@ -94,7 +94,7 @@ class CORJIT_FLAGS 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 diff --git a/src/coreclr/src/inc/eetwain.h b/src/coreclr/src/inc/eetwain.h index f0083fb9079f56..6f61b51a286754 100644 --- a/src/coreclr/src/inc/eetwain.h +++ b/src/coreclr/src/inc/eetwain.h @@ -245,14 +245,6 @@ virtual bool EnumGcRefs(PREGDISPLAY pContext, 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. @@ -518,22 +510,6 @@ bool EnumGcRefsConservative(PREGDISPLAY pRD, 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( diff --git a/src/coreclr/src/inc/jithelpers.h b/src/coreclr/src/inc/jithelpers.h index feeb880ac8a048..b1ce9b13c8c031 100644 --- a/src/coreclr/src/inc/jithelpers.h +++ b/src/coreclr/src/inc/jithelpers.h @@ -70,7 +70,6 @@ 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) @@ -145,18 +144,6 @@ 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 diff --git a/src/coreclr/src/jit/.gitmirror b/src/coreclr/src/jit/.gitmirror deleted file mode 100644 index f507630f949df6..00000000000000 --- a/src/coreclr/src/jit/.gitmirror +++ /dev/null @@ -1 +0,0 @@ -Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror. \ No newline at end of file diff --git a/src/coreclr/src/jit/ICorJitInfo_API_names.h b/src/coreclr/src/jit/ICorJitInfo_API_names.h index a17127ed6d29a8..541d572426592b 100644 --- a/src/coreclr/src/jit/ICorJitInfo_API_names.h +++ b/src/coreclr/src/jit/ICorJitInfo_API_names.h @@ -24,9 +24,6 @@ DEF_CLR_API(getUnmanagedCallConv) 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) @@ -35,11 +32,9 @@ DEF_CLR_API(tryResolveToken) 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) @@ -47,7 +42,6 @@ DEF_CLR_API(getTypeInstantiationArgument) 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) @@ -68,7 +62,6 @@ DEF_CLR_API(getNewHelper) 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) @@ -97,7 +90,6 @@ DEF_CLR_API(getFieldName) 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) @@ -139,8 +131,6 @@ DEF_CLR_API(embedMethodHandle) 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) @@ -179,7 +169,6 @@ DEF_CLR_API(getMethodBlockCounts) DEF_CLR_API(recordCallSite) DEF_CLR_API(recordRelocation) DEF_CLR_API(getRelocTypeHint) -DEF_CLR_API(getModuleNativeEntryPointRange) DEF_CLR_API(getExpectedTargetArchitecture) DEF_CLR_API(getJitFlags) diff --git a/src/coreclr/src/jit/ICorJitInfo_API_wrapper.hpp b/src/coreclr/src/jit/ICorJitInfo_API_wrapper.hpp index 824f86b8dd9955..785d2bcef86413 100644 --- a/src/coreclr/src/jit/ICorJitInfo_API_wrapper.hpp +++ b/src/coreclr/src/jit/ICorJitInfo_API_wrapper.hpp @@ -232,34 +232,6 @@ BOOL WrapICorJitInfo::isCompatibleDelegate( 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) { @@ -338,15 +310,6 @@ CORINFO_CLASS_HANDLE WrapICorJitInfo::getTokenTypeAsHandle( 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 */) @@ -378,15 +341,6 @@ LPCWSTR WrapICorJitInfo::getStringLiteral( return temp; } -BOOL WrapICorJitInfo::shouldEnforceCallvirtRestriction( - CORINFO_MODULE_HANDLE scope) -{ - API_ENTER(shouldEnforceCallvirtRestriction); - BOOL temp = wrapHnd->shouldEnforceCallvirtRestriction(scope); - API_LEAVE(shouldEnforceCallvirtRestriction); - return temp; -} - /**********************************************************************************/ // // ICorClassInfo @@ -456,14 +410,6 @@ CorInfoInlineTypeCheck WrapICorJitInfo::canInlineTypeCheck(CORINFO_CLASS_HANDLE 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) { @@ -647,15 +593,6 @@ CorInfoHelpFunc WrapICorJitInfo::getSharedCCtorHelper( 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) { @@ -938,15 +875,6 @@ unsigned WrapICorJitInfo::getFieldOffset( 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, @@ -1017,7 +945,7 @@ void WrapICorJitInfo::setVars( } void * WrapICorJitInfo::allocateArray( - ULONG cBytes) + size_t cBytes) { API_ENTER(allocateArray); void *temp = wrapHnd->allocateArray(cBytes); @@ -1345,33 +1273,13 @@ void WrapICorJitInfo::embedGenericHandle( 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( @@ -1595,14 +1503,6 @@ bool WrapICorJitInfo::convertPInvokeCalliToCall( // /*********************************************************************************/ -IEEMemoryManager* WrapICorJitInfo::getMemoryManager() -{ - API_ENTER(getMemoryManager); - IEEMemoryManager * temp = wrapHnd->getMemoryManager(); - API_LEAVE(getMemoryManager); - return temp; -} - void WrapICorJitInfo::allocMem( ULONG hotCodeSize, /* IN */ ULONG coldCodeSize, /* IN */ @@ -1650,13 +1550,6 @@ void *WrapICorJitInfo::allocGCInfo(size_t size /* 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); @@ -1748,15 +1641,6 @@ WORD WrapICorJitInfo::getRelocTypeHint(void *target) 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); diff --git a/src/coreclr/src/jit/armelnonjit/.gitmirror b/src/coreclr/src/jit/armelnonjit/.gitmirror deleted file mode 100644 index f507630f949df6..00000000000000 --- a/src/coreclr/src/jit/armelnonjit/.gitmirror +++ /dev/null @@ -1 +0,0 @@ -Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror. \ No newline at end of file diff --git a/src/coreclr/src/jit/codegencommon.cpp b/src/coreclr/src/jit/codegencommon.cpp index 1af9bc029c5be8..20e17efe95523b 100644 --- a/src/coreclr/src/jit/codegencommon.cpp +++ b/src/coreclr/src/jit/codegencommon.cpp @@ -7635,12 +7635,6 @@ void CodeGen::genFnProlog() 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) diff --git a/src/coreclr/src/jit/compiler.cpp b/src/coreclr/src/jit/compiler.cpp index 7eaf9f5cf32589..fa319cd94c4ad8 100644 --- a/src/coreclr/src/jit/compiler.cpp +++ b/src/coreclr/src/jit/compiler.cpp @@ -2196,7 +2196,6 @@ void Compiler::compSetProcessor() #ifdef TARGET_XARCH opts.compSupportsISA = 0; -#ifdef FEATURE_CORECLR if (JitConfig.EnableHWIntrinsic()) { // Dummy ISAs for simplifying the JIT code @@ -2308,32 +2307,6 @@ void Compiler::compSetProcessor() 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()) { @@ -2482,11 +2455,6 @@ void DummyProfilerELTStub(UINT_PTR ProfilerHandle) #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 @@ -2500,8 +2468,7 @@ bool Compiler::compShouldThrowOnNoway( // 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. @@ -2546,8 +2513,6 @@ void Compiler::compInitOptions(JitFlags* jitFlags) 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; @@ -2618,8 +2583,7 @@ void Compiler::compInitOptions(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 @@ -3884,8 +3848,6 @@ void Compiler::compSetOptimizationLevel() } } - info.compUnwrapContextful = opts.OptimizationEnabled(); - fgCanRelocateEHRegions = true; } @@ -4383,11 +4345,6 @@ void Compiler::compCompile(void** methodCodePtr, ULONG* methodCodeSize, JitFlags { 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. @@ -5384,66 +5341,11 @@ int Compiler::compCompile(CORINFO_METHOD_HANDLE methodHnd, // 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 @@ -5457,8 +5359,7 @@ int Compiler::compCompile(CORINFO_METHOD_HANDLE methodHnd, ULONG* methodCodeSize; JitFlags* compileFlags; - CorInfoInstantiationVerification instVerInfo; - int result; + int result; } param; param.pThis = this; param.classPtr = classPtr; @@ -5467,14 +5368,13 @@ int Compiler::compCompile(CORINFO_METHOD_HANDLE methodHnd, 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 { @@ -5824,13 +5724,12 @@ unsigned getMethodBodyChecksum(__in_z char* code, int size) #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; @@ -5913,12 +5812,6 @@ int Compiler::compCompileHelper(CORINFO_MODULE_HANDLE classPtr, 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)); @@ -5931,18 +5824,6 @@ int Compiler::compCompileHelper(CORINFO_MODULE_HANDLE classPtr, 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; @@ -5977,8 +5858,6 @@ int Compiler::compCompileHelper(CORINFO_MODULE_HANDLE 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()) @@ -6091,12 +5970,7 @@ int Compiler::compCompileHelper(CORINFO_MODULE_HANDLE classPtr, 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(); diff --git a/src/coreclr/src/jit/compiler.h b/src/coreclr/src/jit/compiler.h index be3690ec18a8cb..3b120cd84dcd52 100644 --- a/src/coreclr/src/jit/compiler.h +++ b/src/coreclr/src/jit/compiler.h @@ -1211,8 +1211,7 @@ class CompTimeSummaryInfo }; // 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 { @@ -3432,7 +3431,6 @@ class Compiler 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) @@ -4119,12 +4117,8 @@ class Compiler 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); @@ -5396,7 +5390,6 @@ class Compiler #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); @@ -8444,28 +8437,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 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? @@ -8493,22 +8464,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #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 @@ -8815,9 +8770,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 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. @@ -9078,13 +9031,12 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 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(); @@ -9291,24 +9243,10 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 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 @@ -9382,7 +9320,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 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); @@ -9567,9 +9504,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 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 diff --git a/src/coreclr/src/jit/compiler.hpp b/src/coreclr/src/jit/compiler.hpp index 889d5017b0d769..2274ba47fec191 100644 --- a/src/coreclr/src/jit/compiler.hpp +++ b/src/coreclr/src/jit/compiler.hpp @@ -2897,15 +2897,6 @@ inline int getJitStressLevel() 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 /*****************************************************************************/ diff --git a/src/coreclr/src/jit/crossgen/.gitmirror b/src/coreclr/src/jit/crossgen/.gitmirror deleted file mode 100644 index f507630f949df6..00000000000000 --- a/src/coreclr/src/jit/crossgen/.gitmirror +++ /dev/null @@ -1 +0,0 @@ -Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror. \ No newline at end of file diff --git a/src/coreclr/src/jit/dll/.gitmirror b/src/coreclr/src/jit/dll/.gitmirror deleted file mode 100644 index f507630f949df6..00000000000000 --- a/src/coreclr/src/jit/dll/.gitmirror +++ /dev/null @@ -1 +0,0 @@ -Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror. \ No newline at end of file diff --git a/src/coreclr/src/jit/ee_il_dll.cpp b/src/coreclr/src/jit/ee_il_dll.cpp index cbf8d59135338d..4ac4c24dfde058 100644 --- a/src/coreclr/src/jit/ee_il_dll.cpp +++ b/src/coreclr/src/jit/ee_il_dll.cpp @@ -179,15 +179,6 @@ HINSTANCE GetModuleInst() 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 /*****************************************************************************/ @@ -204,8 +195,6 @@ void* __cdecl operator new(size_t, const CILJitSingletonAllocator&) return CILJitBuff; } -ICorJitCompiler* g_realJitCompiler = nullptr; - DLLEXPORT ICorJitCompiler* __stdcall getJit() { if (!g_jitInitialized) @@ -296,11 +285,6 @@ void JitTls::SetCompiler(Compiler* compiler) 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); @@ -328,45 +312,8 @@ CorJitResult CILJit::compileMethod( 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); @@ -377,12 +324,6 @@ void CILJit::ProcessShutdownWork(ICorStaticInfo* statInfo) */ void CILJit::getVersionIdentifier(GUID* versionIdentifier) { - if (g_realJitCompiler != nullptr) - { - g_realJitCompiler->getVersionIdentifier(versionIdentifier); - return; - } - assert(versionIdentifier != nullptr); memcpy(versionIdentifier, &JITEEVersionIdentifier, sizeof(GUID)); } @@ -393,11 +334,6 @@ void CILJit::getVersionIdentifier(GUID* versionIdentifier) unsigned CILJit::getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompileFlags) { - if (g_realJitCompiler != nullptr) - { - return g_realJitCompiler->getMaxIntrinsicSIMDVectorLength(cpuCompileFlags); - } - JitFlags jitFlags; jitFlags.SetFromFlags(cpuCompileFlags); @@ -435,11 +371,6 @@ unsigned CILJit::getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompileFlags) #endif // !FEATURE_SIMD } -void CILJit::setRealJit(ICorJitCompiler* realJitCompiler) -{ - g_realJitCompiler = realJitCompiler; -} - /***************************************************************************** * Returns the number of bytes required for the given type argument */ @@ -554,7 +485,7 @@ GenTree* Compiler::eeGetPInvokeCookie(CORINFO_SIG_INFO* szMetaSig) unsigned Compiler::eeGetArrayDataOffset(var_types type) { - return varTypeIsGC(type) ? eeGetEEInfo()->offsetOfObjArrayData : OFFSETOF__CORINFO_Array__data; + return OFFSETOF__CORINFO_Array__data; } //------------------------------------------------------------------------ diff --git a/src/coreclr/src/jit/ee_il_dll.hpp b/src/coreclr/src/jit/ee_il_dll.hpp index 4a937d19a4aa65..7cdc23e819811e 100644 --- a/src/coreclr/src/jit/ee_il_dll.hpp +++ b/src/coreclr/src/jit/ee_il_dll.hpp @@ -13,17 +13,12 @@ class CILJit : public ICorJitCompiler 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); }; /***************************************************************************** diff --git a/src/coreclr/src/jit/flowgraph.cpp b/src/coreclr/src/jit/flowgraph.cpp index 6cbab31aceef16..8b58a819146048 100644 --- a/src/coreclr/src/jit/flowgraph.cpp +++ b/src/coreclr/src/jit/flowgraph.cpp @@ -4817,41 +4817,6 @@ void Compiler::fgFindJumpTargets(const BYTE* codeAddr, IL_OFFSET codeSize, Fixed } 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++; @@ -5588,22 +5553,14 @@ unsigned Compiler::fgMakeBasicBlocks(const BYTE* codeAddr, IL_OFFSET codeSize, F 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()) @@ -5613,17 +5570,6 @@ unsigned Compiler::fgMakeBasicBlocks(const BYTE* codeAddr, IL_OFFSET codeSize, F // 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 { @@ -6915,13 +6861,6 @@ void Compiler::fgImport() { 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 @@ -7849,7 +7788,8 @@ GenTree* Compiler::fgGetCritSectOfStaticMethod() 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) { @@ -8955,15 +8895,6 @@ void Compiler::fgAddInternal() } } - // 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); @@ -9100,43 +9031,6 @@ void Compiler::fgAddInternal() 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? */ @@ -9215,35 +9109,6 @@ void Compiler::fgAddInternal() #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(); @@ -24157,13 +24022,7 @@ void Compiler::fgRemoveEmptyTry() // 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. @@ -24503,13 +24362,7 @@ void Compiler::fgCloneFinally() // 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. diff --git a/src/coreclr/src/jit/gcencode.cpp b/src/coreclr/src/jit/gcencode.cpp index f948d95f42175b..1f4d4be185603e 100644 --- a/src/coreclr/src/jit/gcencode.cpp +++ b/src/coreclr/src/jit/gcencode.cpp @@ -1575,7 +1575,7 @@ size_t GCInfo::gcInfoBlockHdrSave( header->doubleAlign = compiler->genDoubleAlign(); #endif - header->security = compiler->opts.compNeedSecurityCheck; + header->security = false; header->handlers = compiler->ehHasCallableHandlers(); header->localloc = compiler->compLocallocUsed; @@ -3919,28 +3919,11 @@ void GCInfo::gcInfoBlockHdrSave(GcInfoEncoder* gcInfoEncoder, unsigned methodSiz 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) { diff --git a/src/coreclr/src/jit/gentree.h b/src/coreclr/src/jit/gentree.h index 755b5ee4c5d0f1..e53624ff9d81ae 100644 --- a/src/coreclr/src/jit/gentree.h +++ b/src/coreclr/src/jit/gentree.h @@ -806,7 +806,7 @@ struct GenTree #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 diff --git a/src/coreclr/src/jit/importer.cpp b/src/coreclr/src/jit/importer.cpp index c38d0cd85318d1..7d940d6e762a20 100644 --- a/src/coreclr/src/jit/importer.cpp +++ b/src/coreclr/src/jit/importer.cpp @@ -154,11 +154,6 @@ inline void Compiler::impPushNullObjRefOnStack() 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) @@ -175,7 +170,7 @@ inline void Compiler::verRaiseVerifyExceptionIfNeeded(INDEBUG(const char* msg) D 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)); @@ -2265,7 +2260,7 @@ bool Compiler::impSpillStackEntry(unsigned level, { // 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; } @@ -2303,10 +2298,7 @@ bool Compiler::impSpillStackEntry(unsigned level, #endif // !TARGET_64BIT (varTypeIsFloating(dstTyp) && varTypeIsFloating(valTyp)))) { - if (verNeedsVerification()) - { - return false; - } + return false; } } @@ -3362,7 +3354,6 @@ GenTree* Compiler::impInitializeArrayIntrinsic(CORINFO_SIG_INFO* sig) if ((size.Value() == 0) || (varTypeIsGC(elementType))) { - assert(verNeedsVerification()); return nullptr; } @@ -4773,49 +4764,7 @@ void Compiler::verConvertBBToThrowVerificationException(BasicBlock* block DEBUGA * */ 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)); @@ -5019,58 +4968,6 @@ typeInfo Compiler::verParseArgSigToTypeInfo(CORINFO_SIG_INFO* sig, CORINFO_ARG_L 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()) @@ -5397,20 +5294,13 @@ void Compiler::verVerifyCall(OPCODE opcode, 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."); } } @@ -5560,19 +5450,11 @@ void Compiler::verVerifyCall(OPCODE opcode, // 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."); } } @@ -6643,7 +6525,7 @@ void Compiler::impCheckForPInvokeCall( if (methHnd) { - if ((mflags & CORINFO_FLG_PINVOKE) == 0 || (mflags & CORINFO_FLG_NOSECURITYWRAP) == 0) + if ((mflags & CORINFO_FLG_PINVOKE) == 0) { return; } @@ -7049,7 +6931,8 @@ GenTree* Compiler::impImportStaticFieldAccess(CORINFO_RESOLVED_TOKEN* pResolvedT { #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); @@ -7199,9 +7082,6 @@ void Compiler::impHandleAccessAllowedInternal(CorInfoIsAccessAllowedResult resul impInsertHelperCall(helperCall); } break; - case CORINFO_ACCESS_RUNTIME_CHECK: - impInsertHelperCall(helperCall); - break; } } @@ -7326,12 +7206,8 @@ enum * 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)) @@ -7356,55 +7232,9 @@ bool Compiler::impIsTailCallILPattern(bool tailPrefixed, 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); } /***************************************************************************** @@ -7530,11 +7360,6 @@ var_types Compiler::impImportCall(OPCODE opcode, 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 @@ -7546,7 +7371,7 @@ var_types Compiler::impImportCall(OPCODE opcode, // 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; @@ -7649,14 +7474,6 @@ var_types Compiler::impImportCall(OPCODE opcode, 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) @@ -8155,23 +7972,6 @@ var_types Compiler::impImportCall(OPCODE opcode, * 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 @@ -14157,14 +13957,6 @@ void Compiler::impImportBlockCode(BasicBlock* block) 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; - } } } @@ -14536,14 +14328,6 @@ void Compiler::impImportBlockCode(BasicBlock* block) 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; - } } } @@ -16866,14 +16650,7 @@ bool Compiler::impReturnInstruction(int prefixFlags, OPCODE& opcode) // 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 @@ -17324,7 +17101,7 @@ void Compiler::impImportBlock(BasicBlock* block) 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); @@ -19885,14 +19662,6 @@ void Compiler::impMarkInlineCandidateHelper(GenTreeCall* call, } } - /* 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) @@ -19909,14 +19678,6 @@ void Compiler::impMarkInlineCandidateHelper(GenTreeCall* call, 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) @@ -20237,18 +19998,6 @@ void Compiler::impDevirtualizeCall(GenTreeCall* call, 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; @@ -20924,8 +20673,7 @@ void Compiler::addExpRuntimeLookupCandidate(GenTreeCall* call) 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); } diff --git a/src/coreclr/src/jit/inline.def b/src/coreclr/src/jit/inline.def index c9c613093bd56e..b35464e3a2a4cc 100644 --- a/src/coreclr/src/jit/inline.def +++ b/src/coreclr/src/jit/inline.def @@ -52,7 +52,6 @@ INLINE_OBSERVATION(LOCALLOC_TOO_LARGE, bool, "localloc size too large", 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) @@ -105,7 +104,6 @@ INLINE_OBSERVATION(UNSUPPORTED_OPCODE, bool, "unsupported opcode", 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 ------- diff --git a/src/coreclr/src/jit/jit.h b/src/coreclr/src/jit/jit.h index f43860c6934fbd..324437eaf32cf8 100644 --- a/src/coreclr/src/jit/jit.h +++ b/src/coreclr/src/jit/jit.h @@ -707,9 +707,7 @@ class Histogram #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 @@ -717,14 +715,6 @@ class Histogram // 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 diff --git a/src/coreclr/src/jit/jitconfigvalues.h b/src/coreclr/src/jit/jitconfigvalues.h index d3a888d79ad7f8..f852fe2d3d53b2 100644 --- a/src/coreclr/src/jit/jitconfigvalues.h +++ b/src/coreclr/src/jit/jitconfigvalues.h @@ -123,7 +123,6 @@ CONFIG_INTEGER(JitStressFP, W("JitStressFP"), 0) // Intern 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 @@ -285,10 +284,7 @@ CONFIG_INTEGER(JitEnableNoWayAssert, W("JitEnableNoWayAssert"), 0) 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 @@ -376,13 +372,8 @@ CONFIG_INTEGER(JitObjectStackAllocation, W("JitObjectStackAllocation"), 0) 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. diff --git a/src/coreclr/src/jit/jitee.h b/src/coreclr/src/jit/jitee.h index 751489e946a45f..4f9df37e92de8c 100644 --- a/src/coreclr/src/jit/jitee.h +++ b/src/coreclr/src/jit/jitee.h @@ -81,7 +81,7 @@ class JitFlags 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 @@ -280,7 +280,6 @@ class JitFlags 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); diff --git a/src/coreclr/src/jit/jitstd/.gitmirror b/src/coreclr/src/jit/jitstd/.gitmirror deleted file mode 100644 index f507630f949df6..00000000000000 --- a/src/coreclr/src/jit/jitstd/.gitmirror +++ /dev/null @@ -1 +0,0 @@ -Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror. \ No newline at end of file diff --git a/src/coreclr/src/jit/lclvars.cpp b/src/coreclr/src/jit/lclvars.cpp index f38437012ff2bd..9c83a269543c5c 100644 --- a/src/coreclr/src/jit/lclvars.cpp +++ b/src/coreclr/src/jit/lclvars.cpp @@ -68,7 +68,6 @@ void Compiler::lvaInit() 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; @@ -5756,15 +5755,6 @@ void Compiler::lvaAssignVirtualFrameOffsetsToLocals() 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) { @@ -5966,7 +5956,7 @@ void Compiler::lvaAssignVirtualFrameOffsetsToLocals() #ifdef JIT32_GCENCODER lclNum == lvaLocAllocSPvar || #endif // JIT32_GCENCODER - lclNum == lvaSecurityObject) + false) { assert(varDsc->lvStkOffs != BAD_STK_OFFS); continue; diff --git a/src/coreclr/src/jit/lower.cpp b/src/coreclr/src/jit/lower.cpp index ab2820d72c2848..21dcb09d796ea2 100644 --- a/src/coreclr/src/jit/lower.cpp +++ b/src/coreclr/src/jit/lower.cpp @@ -1659,122 +1659,12 @@ void Lowering::LowerCall(GenTree* node) 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: @@ -1896,7 +1786,6 @@ void Lowering::LowerFastTailCall(GenTreeCall* call) // 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 @@ -2200,7 +2089,6 @@ GenTree* Lowering::LowerTailCallViaHelper(GenTreeCall* call, GenTree* callTarget // 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 diff --git a/src/coreclr/src/jit/lower.h b/src/coreclr/src/jit/lower.h index f3db1dfd747340..9cc09e5d377eae 100644 --- a/src/coreclr/src/jit/lower.h +++ b/src/coreclr/src/jit/lower.h @@ -119,8 +119,6 @@ class Lowering final : public Phase void LowerBlock(BasicBlock* block); GenTree* LowerNode(GenTree* node); - void CheckVSQuirkStackPaddingNeeded(GenTreeCall* call); - // ------------------------------ // Call Lowering // ------------------------------ diff --git a/src/coreclr/src/jit/morph.cpp b/src/coreclr/src/jit/morph.cpp index 08c593784bec5f..f3c02f92fdb785 100644 --- a/src/coreclr/src/jit/morph.cpp +++ b/src/coreclr/src/jit/morph.cpp @@ -764,40 +764,6 @@ GenTree* Compiler::fgMorphCast(GenTree* tree) #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() { @@ -2648,7 +2614,7 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) 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. @@ -2672,22 +2638,7 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) // 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()) { @@ -5373,13 +5324,9 @@ GenTree* Compiler::fgMorphArrayIndex(GenTree* tree) 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; } @@ -5949,13 +5896,6 @@ GenTree* Compiler::fgMorphField(GenTree* tree, MorphAddrContext* mac) 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: @@ -6542,17 +6482,6 @@ void Compiler::fgMorphCallInlineHelper(GenTreeCall* call, InlineResult* result) 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. // @@ -6943,12 +6872,6 @@ GenTree* Compiler::fgMorphPotentialTailCall(GenTreeCall* call) return nullptr; } - if (opts.compNeedSecurityCheck) - { - failTailCall("Needs security check"); - return nullptr; - } - if (compLocallocUsed || compLocallocOptimized) { failTailCall("Localloc used"); @@ -7162,8 +7085,7 @@ GenTree* Compiler::fgMorphPotentialTailCall(GenTreeCall* call) // 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; } @@ -15788,22 +15710,6 @@ void Compiler::fgSetOptions() 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); @@ -15829,7 +15735,8 @@ GenTree* Compiler::fgInitThisClass() { 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) { @@ -17574,18 +17481,6 @@ bool Compiler::fgMorphCombineSIMDFieldAssignments(BasicBlock* block, Statement* #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. @@ -17606,54 +17501,6 @@ bool Compiler::fgCheckStmtAfterTailCall() 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)) diff --git a/src/coreclr/src/jit/protojit/.gitmirror b/src/coreclr/src/jit/protojit/.gitmirror deleted file mode 100644 index f507630f949df6..00000000000000 --- a/src/coreclr/src/jit/protojit/.gitmirror +++ /dev/null @@ -1 +0,0 @@ -Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror. \ No newline at end of file diff --git a/src/coreclr/src/jit/protononjit/.gitmirror b/src/coreclr/src/jit/protononjit/.gitmirror deleted file mode 100644 index f507630f949df6..00000000000000 --- a/src/coreclr/src/jit/protononjit/.gitmirror +++ /dev/null @@ -1 +0,0 @@ -Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror. \ No newline at end of file diff --git a/src/coreclr/src/jit/simd.cpp b/src/coreclr/src/jit/simd.cpp index 1d7b9bf7443a92..f436f3468451a0 100644 --- a/src/coreclr/src/jit/simd.cpp +++ b/src/coreclr/src/jit/simd.cpp @@ -2432,13 +2432,11 @@ GenTree* Compiler::impSIMDIntrinsic(OPCODE opcode, 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; diff --git a/src/coreclr/src/jit/standalone/.gitmirror b/src/coreclr/src/jit/standalone/.gitmirror deleted file mode 100644 index f507630f949df6..00000000000000 --- a/src/coreclr/src/jit/standalone/.gitmirror +++ /dev/null @@ -1 +0,0 @@ -Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror. \ No newline at end of file diff --git a/src/coreclr/src/jit/target.h b/src/coreclr/src/jit/target.h index 00aea16f09e59e..ddfc9b67f80497 100644 --- a/src/coreclr/src/jit/target.h +++ b/src/coreclr/src/jit/target.h @@ -6,11 +6,11 @@ #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 @@ -196,10 +196,8 @@ typedef unsigned char regNumberSmall; /*****************************************************************************/ -// 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 /*****************************************************************************/ diff --git a/src/coreclr/src/jit/utils.cpp b/src/coreclr/src/jit/utils.cpp index d493c991e3a995..e60ea169ef0d50 100644 --- a/src/coreclr/src/jit/utils.cpp +++ b/src/coreclr/src/jit/utils.cpp @@ -1264,7 +1264,6 @@ void HelperCallProperties::init() 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: @@ -1448,10 +1447,6 @@ void HelperCallProperties::init() 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; @@ -1470,9 +1465,6 @@ void HelperCallProperties::init() 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: diff --git a/src/coreclr/src/jit/utils.h b/src/coreclr/src/jit/utils.h index 7201022baffd64..7a7b96c96077c9 100644 --- a/src/coreclr/src/jit/utils.h +++ b/src/coreclr/src/jit/utils.h @@ -106,16 +106,6 @@ inline const char* dspBool(bool b) 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 int signum(T val) { diff --git a/src/coreclr/src/jit/valuenum.cpp b/src/coreclr/src/jit/valuenum.cpp index 2509bb1912ec79..c1d799f603bc63 100644 --- a/src/coreclr/src/jit/valuenum.cpp +++ b/src/coreclr/src/jit/valuenum.cpp @@ -8740,7 +8740,6 @@ VNFunc Compiler::fgValueNumberJitHelperMethodVNFunc(CorInfoHelpFunc helpFunc) // 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: diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs index 5e64833b92487a..850cb2450f3a5c 100644 --- a/src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs +++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs @@ -56,12 +56,6 @@ unsafe partial class CorInfoImpl [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); @@ -78,16 +72,12 @@ unsafe partial class CorInfoImpl [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); @@ -102,8 +92,6 @@ unsafe partial class CorInfoImpl [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); @@ -144,8 +132,6 @@ unsafe partial class CorInfoImpl [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); @@ -202,8 +188,6 @@ unsafe partial class CorInfoImpl [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); @@ -216,7 +200,7 @@ unsafe partial class CorInfoImpl [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))] @@ -284,11 +268,7 @@ unsafe partial class CorInfoImpl [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))] @@ -334,8 +314,6 @@ unsafe partial class CorInfoImpl [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); @@ -344,8 +322,6 @@ unsafe partial class CorInfoImpl [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); @@ -366,8 +342,6 @@ unsafe partial class CorInfoImpl [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); @@ -673,47 +647,6 @@ static CorInfoUnmanagedCallConv _getUnmanagedCallConv(IntPtr thisHandle, IntPtr* } } - 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); @@ -820,20 +753,6 @@ static void _findCallSiteSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_MOD } } - 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); @@ -876,20 +795,6 @@ static CorInfoCanSkipVerificationResult _canSkipVerification(IntPtr 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); @@ -988,20 +893,6 @@ static CorInfoInlineTypeCheck _canInlineTypeCheck(IntPtr thisHandle, IntPtr* ppE } } - [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); @@ -1281,20 +1172,6 @@ static CorInfoHelpFunc _getSharedCCtorHelper(IntPtr thisHandle, IntPtr* ppExcept } } - 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); @@ -1685,20 +1562,6 @@ static uint _getFieldOffset(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIEL } } - [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); @@ -1778,7 +1641,7 @@ static void _setVars(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRU } } - static void* _allocateArray(IntPtr thisHandle, IntPtr* ppException, uint cBytes) + static void* _allocateArray(IntPtr thisHandle, IntPtr* ppException, UIntPtr cBytes) { var _this = GetThis(thisHandle); try @@ -2246,45 +2109,16 @@ static void _embedGenericHandle(IntPtr thisHandle, IntPtr* ppException, ref CORI } } - 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*); } } @@ -2590,20 +2424,6 @@ static void _MethodCompileComplete(IntPtr thisHandle, IntPtr* ppException, CORIN } } - 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); @@ -2657,19 +2477,6 @@ static void _allocUnwindInfo(IntPtr thisHandle, IntPtr* ppException, byte* pHotC } } - 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); @@ -2805,19 +2612,6 @@ static ushort _getRelocTypeHint(IntPtr thisHandle, IntPtr* ppException, void* ta } } - 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); @@ -2849,8 +2643,8 @@ static uint _getJitFlags(IntPtr thisHandle, IntPtr* ppException, ref CORJIT_FLAG 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); @@ -2918,480 +2712,441 @@ static IntPtr GetUnmanagedCallbacks(out Object keepAlive) 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; diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoHelpFunc.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoHelpFunc.cs index 08850f8d940a00..94530e1f46d467 100644 --- a/src/coreclr/src/tools/Common/JitInterface/CorInfoHelpFunc.cs +++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoHelpFunc.cs @@ -51,7 +51,6 @@ public enum CorInfoHelpFunc /* 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 @@ -128,21 +127,6 @@ which is the right helper to use to allocate an object of a given type. */ 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) diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs index 4903aec134730a..545e48ac3ce23d 100644 --- a/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs @@ -698,8 +698,6 @@ private uint getMethodAttribsInternal(MethodDesc method) } } - result |= CorInfoFlag.CORINFO_FLG_NOSECURITYWRAP; - return (uint)result; } @@ -884,15 +882,6 @@ private bool satisfiesMethodConstraints(CORINFO_CLASS_STRUCT_* parent, CORINFO_M { 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) { @@ -1150,8 +1139,6 @@ private bool isValidToken(CORINFO_MODULE_STRUCT_* module, uint metaTOK) { 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) { @@ -1235,8 +1222,6 @@ private CorInfoInlineTypeCheck canInlineTypeCheck(CORINFO_CLASS_STRUCT_* cls, Co 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); @@ -1519,8 +1504,6 @@ private bool checkMethodModifier(CORINFO_METHOD_STRUCT_* hMethod, byte* modifier 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) { @@ -2042,9 +2025,6 @@ private uint getFieldOffset(CORINFO_FIELD_STRUCT_* field) 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); @@ -2093,14 +2073,14 @@ private void getVars(CORINFO_METHOD_STRUCT_* ftn, ref uint cVars, ILVarInfo** va 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) @@ -2210,8 +2190,6 @@ private void getEEInfo(ref CORINFO_EE_INFO pEEInfoOut) 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); @@ -2401,10 +2379,8 @@ private CORINFO_RUNTIME_LOOKUP_KIND GetGenericRuntimeLookupKind(MethodDesc metho } } - 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) @@ -2419,10 +2395,6 @@ private void getLocationOfThisType(out CORINFO_LOOKUP_KIND result, CORINFO_METHO } } - 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) @@ -2506,14 +2478,6 @@ private void MethodCompileComplete(CORINFO_METHOD_STRUCT_* methHnd) 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; @@ -2597,11 +2561,6 @@ private void allocUnwindInfo(byte* pHotCode, byte* pColdCode, uint startOffset, 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)); @@ -2791,9 +2750,6 @@ private ushort getRelocTypeHint(void* target) } } - private void getModuleNativeEntryPointRange(ref void* pStart, ref void* pEnd) - { throw new NotImplementedException("getModuleNativeEntryPointRange"); } - private uint getExpectedTargetArchitecture() { TargetArchitecture arch = _compilation.TypeSystemContext.Target.Architecture; diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.cs index e249197fd3480a..1617872651259c 100644 --- a/src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.cs +++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.cs @@ -322,8 +322,8 @@ public unsafe struct CORINFO_RESOLVED_TOKEN 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 }; @@ -566,7 +566,7 @@ public enum CORINFO_ACCESS_FLAGS { 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 @@ -605,13 +605,13 @@ public enum CorInfoFlag : uint 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 @@ -624,11 +624,11 @@ public enum CorInfoFlag : uint 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) @@ -712,7 +712,6 @@ public enum CorInfoIsAccessAllowedResult { 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 } //---------------------------------------------------------------------------- @@ -800,26 +799,6 @@ public enum CorInfoRegionKind 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.Add()) of a method - // in a generic class or a generic method. It is either the typical instantiation - // (eg. List.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 @@ -899,13 +878,6 @@ public struct InlinedCallFrameInfo // 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; @@ -920,9 +892,6 @@ public struct InlinedCallFrameInfo public CORINFO_RUNTIME_ABI targetAbi; public CORINFO_OS osType; - public uint osMajor; - public uint osMinor; - public uint osBuild; } public enum CORINFO_THIS_TRANSFORM @@ -1048,8 +1017,6 @@ public unsafe struct CORINFO_CALL_INFO // 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; @@ -1340,7 +1307,7 @@ public enum CorJitFlag : uint 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 diff --git a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt index a124f01f0e85b2..b6083523bfee25 100644 --- a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt +++ b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt @@ -34,7 +34,6 @@ ; NORMALTYPES void -IEEMemoryManager*,void*,void* LPVOID,void*,void* void* const void *,void* @@ -109,7 +108,6 @@ CORINFO_JUST_MY_CODE_HANDLE**,ref CORINFO_JUST_MY_CODE_HANDLE_*,void** ICorJitInfo::BlockCounts**,ref BlockCounts*,void** ; Enums -CorInfoCanSkipVerificationResult,,int CorInfoClassId,,int CorInfoHelperTailCallSpecialHandling,,int CorInfoHelpFunc,,int @@ -117,7 +115,6 @@ CorInfoInitClassResult,,int CorInfoInlineTypeCheck,,int CorInfoInlineTypeCheckSource,,int CorInfoInline,,int -CorInfoInstantiationVerification,,int CorInfoIntrinsics,,int CorInfoIsAccessAllowedResult,,int CorInfoMethodRuntimeFlags,,int @@ -184,9 +181,6 @@ FUNCTIONS 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 ); @@ -195,11 +189,9 @@ FUNCTIONS 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) @@ -207,7 +199,6 @@ FUNCTIONS 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) @@ -228,7 +219,6 @@ FUNCTIONS 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) @@ -257,14 +247,13 @@ FUNCTIONS 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); @@ -298,9 +287,7 @@ FUNCTIONS 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); @@ -323,12 +310,10 @@ FUNCTIONS 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) @@ -339,6 +324,5 @@ FUNCTIONS 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) diff --git a/src/coreclr/src/tools/crossgen2/jitinterface/jitinterface.cpp b/src/coreclr/src/tools/crossgen2/jitinterface/jitinterface.cpp index 806a0e80dde22e..4d4bf90905183d 100644 --- a/src/coreclr/src/tools/crossgen2/jitinterface/jitinterface.cpp +++ b/src/coreclr/src/tools/crossgen2/jitinterface/jitinterface.cpp @@ -14,15 +14,6 @@ static void NotImplemented() 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(); @@ -47,21 +38,3 @@ bool JitInterfaceWrapper::runWithErrorTrap(void* function, void* parameter) } 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; -} diff --git a/src/coreclr/src/tools/crossgen2/jitinterface/jitinterface.h b/src/coreclr/src/tools/crossgen2/jitinterface/jitinterface.h index 64ce8fcf69a227..d7622f054b9f95 100644 --- a/src/coreclr/src/tools/crossgen2/jitinterface/jitinterface.h +++ b/src/coreclr/src/tools/crossgen2/jitinterface/jitinterface.h @@ -32,9 +32,6 @@ struct JitInterfaceCallbacks 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); @@ -43,11 +40,9 @@ struct JitInterfaceCallbacks 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); @@ -55,7 +50,6 @@ struct JitInterfaceCallbacks 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); @@ -76,7 +70,6 @@ struct JitInterfaceCallbacks 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); @@ -105,14 +98,13 @@ struct JitInterfaceCallbacks 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); @@ -146,9 +138,7 @@ struct JitInterfaceCallbacks 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); @@ -171,12 +161,10 @@ struct JitInterfaceCallbacks 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); @@ -187,7 +175,6 @@ struct JitInterfaceCallbacks 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); @@ -395,32 +382,6 @@ class JitInterfaceWrapper 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; @@ -487,15 +448,6 @@ class JitInterfaceWrapper 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; @@ -523,15 +475,6 @@ class JitInterfaceWrapper 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; @@ -595,15 +538,6 @@ class JitInterfaceWrapper 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; @@ -783,15 +717,6 @@ class JitInterfaceWrapper 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; @@ -1042,15 +967,6 @@ class JitInterfaceWrapper 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; @@ -1100,7 +1016,7 @@ class JitInterfaceWrapper throw pException; } - virtual void* allocateArray(unsigned int cBytes) + virtual void* allocateArray(size_t cBytes) { CorInfoException* pException = nullptr; void* _ret = _callbacks->allocateArray(_thisHandle, &pException, cBytes); @@ -1375,23 +1291,12 @@ class JitInterfaceWrapper 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) @@ -1586,7 +1491,6 @@ class JitInterfaceWrapper 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; @@ -1620,14 +1524,6 @@ class JitInterfaceWrapper 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; @@ -1713,14 +1609,6 @@ class JitInterfaceWrapper 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; diff --git a/src/coreclr/src/tools/crossgen2/jitinterface/jitwrapper.cpp b/src/coreclr/src/tools/crossgen2/jitinterface/jitwrapper.cpp index 44ef2b69d49c09..26731de7f6aa20 100644 --- a/src/coreclr/src/tools/crossgen2/jitinterface/jitwrapper.cpp +++ b/src/coreclr/src/tools/crossgen2/jitinterface/jitwrapper.cpp @@ -27,11 +27,11 @@ class CORJIT_FLAGS 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 @@ -44,8 +44,6 @@ 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. diff --git a/src/coreclr/src/vm/codeman.cpp b/src/coreclr/src/vm/codeman.cpp index e7c08e0255adc5..b8250aa664d80c 100644 --- a/src/coreclr/src/vm/codeman.cpp +++ b/src/coreclr/src/vm/codeman.cpp @@ -4377,32 +4377,6 @@ BOOL ExecutionManager::IsReadyToRunCode(PCODE currentPC) #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 diff --git a/src/coreclr/src/vm/codeman.h b/src/coreclr/src/vm/codeman.h index 1fef7fcd195cc2..433ae895bc63ce 100644 --- a/src/coreclr/src/vm/codeman.h +++ b/src/coreclr/src/vm/codeman.h @@ -913,51 +913,6 @@ class EEJitManager : public IJitManager } #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(); @@ -1313,9 +1268,6 @@ class ExecutionManager } #endif - static void ClearCaches( void ); - static BOOL IsCacheCleanupRequired(); - static LPCWSTR GetJitName(); static void Unload(LoaderAllocator *pLoaderAllocator); diff --git a/src/coreclr/src/vm/eetwain.cpp b/src/coreclr/src/vm/eetwain.cpp index d55d22bdf8370f..9915cfc54649fa 100644 --- a/src/coreclr/src/vm/eetwain.cpp +++ b/src/coreclr/src/vm/eetwain.cpp @@ -5236,104 +5236,6 @@ bool EECodeManager::EnumGcRefs( PREGDISPLAY pRD, #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, // truncation - 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 /***************************************************************************** * diff --git a/src/coreclr/src/vm/jitinterface.cpp b/src/coreclr/src/vm/jitinterface.cpp index 8fd7319af20449..d67f6fb49650a3 100644 --- a/src/coreclr/src/vm/jitinterface.cpp +++ b/src/coreclr/src/vm/jitinterface.cpp @@ -623,25 +623,6 @@ size_t CEEInfo::findNameOfToken ( 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 @@ -716,20 +697,6 @@ static bool CallerAndCalleeInSystemVersionBubble(MethodDesc* pCaller, MethodDesc 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 ( @@ -2461,7 +2428,7 @@ CorInfoType CEEInfo::asCorInfoType (CORINFO_CLASS_HANDLE clsHnd) } -CORINFO_LOOKUP_KIND CEEInfo::getLocationOfThisType(CORINFO_METHOD_HANDLE context) +void CEEInfo::getLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND* pLookupKind) { CONTRACTL { THROWS; @@ -2469,11 +2436,9 @@ CORINFO_LOOKUP_KIND CEEInfo::getLocationOfThisType(CORINFO_METHOD_HANDLE context 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(); @@ -2482,33 +2447,31 @@ CORINFO_LOOKUP_KIND CEEInfo::getLocationOfThisType(CORINFO_METHOD_HANDLE context // 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( @@ -3795,17 +3758,6 @@ CorInfoInlineTypeCheck CEEInfo::canInlineTypeCheck(CORINFO_CLASS_HANDLE clsHnd, return CORINFO_INLINE_TYPECHECK_PASS; } -/*********************************************************************/ -// 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) { @@ -6378,38 +6330,6 @@ CorInfoHelpFunc CEEInfo::getBoxHelper(CORINFO_CLASS_HANDLE clsHnd) return result; } -/***********************************************************************/ -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. @@ -6687,10 +6607,10 @@ DWORD CEEInfo::getMethodAttribsInternal (CORINFO_METHOD_HANDLE ftn) 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(); @@ -8309,98 +8229,6 @@ void CEEInfo::reportInliningDecision (CORINFO_METHOD_HANDLE inlinerHnd, } -/************************************************************* -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 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 @@ -9557,41 +9385,6 @@ unsigned CEEInfo::getFieldOffset (CORINFO_FIELD_HANDLE fieldHnd) return result; } -/*********************************************************************/ -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) { @@ -9621,7 +9414,7 @@ DWORD CEEInfo::getFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE fieldHnd, void ** return result; } -void *CEEInfo::allocateArray(ULONG cBytes) +void *CEEInfo::allocateArray(size_t cBytes) { CONTRACTL { THROWS; @@ -10110,29 +9903,6 @@ BOOL CEEInfo::isCompatibleDelegate( return result; } -/*********************************************************************/ - // 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, @@ -10304,12 +10074,6 @@ void CEEInfo::getEEInfo(CORINFO_EE_INFO *pEEInfoOut) // 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(); @@ -10322,11 +10086,6 @@ void CEEInfo::getEEInfo(CORINFO_EE_INFO *pEEInfoOut) 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(); } @@ -10858,13 +10617,6 @@ bool CEEInfo::runWithErrorTrap(void (*function)(void*), void* param) return success; } -/*********************************************************************/ -IEEMemoryManager* CEEInfo::getMemoryManager() -{ - UNREACHABLE(); // OBSOLETE - return NULL; -} - /*********************************************************************/ int CEEInfo::doAssert(const char* szFile, int iLine, const char* szExpr) { @@ -10934,12 +10686,6 @@ BOOL CEEInfo::logMsg(unsigned level, const char* fmt, va_list args) return result; } -void CEEInfo::yieldExecution() -{ - WRAPPER_NO_CONTRACT; -} - - #ifndef CROSSGEN_COMPILE /*********************************************************************/ @@ -11699,22 +11445,6 @@ WORD CEEJitInfo::getRelocTypeHint(void * target) 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; @@ -14115,15 +13845,6 @@ WORD CEEInfo::getRelocTypeHint(void * target) 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; diff --git a/src/coreclr/src/vm/jitinterface.h b/src/coreclr/src/vm/jitinterface.h index dd5d4fc734d7e7..c1e0bb8e49d48f 100644 --- a/src/coreclr/src/vm/jitinterface.h +++ b/src/coreclr/src/vm/jitinterface.h @@ -454,7 +454,6 @@ class CEEInfo : public ICorJitInfo 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); @@ -498,7 +497,6 @@ class CEEInfo : public ICorJitInfo 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); @@ -651,8 +649,6 @@ class CEEInfo : public ICorJitInfo 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, @@ -697,21 +693,6 @@ class CEEInfo : public ICorJitInfo 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, @@ -724,9 +705,6 @@ class CEEInfo : public ICorJitInfo 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 @@ -799,12 +777,6 @@ class CEEInfo : public ICorJitInfo 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( @@ -835,14 +807,12 @@ class CEEInfo : public ICorJitInfo 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, @@ -922,7 +892,6 @@ class CEEInfo : public ICorJitInfo 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); @@ -970,11 +939,11 @@ class CEEInfo : public ICorJitInfo 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) @@ -1009,8 +978,6 @@ class CEEInfo : public ICorJitInfo // ICorJitInfo stuff - none of this should be called on this class // - IEEMemoryManager* getMemoryManager(); - void allocMem ( ULONG hotCodeSize, /* IN */ ULONG coldCodeSize, /* IN */ @@ -1042,8 +1009,6 @@ class CEEInfo : public ICorJitInfo size_t size /* IN */ ); - void yieldExecution(); - void setEHcount ( unsigned cEH /* IN */ ); @@ -1090,11 +1055,6 @@ class CEEInfo : public ICorJitInfo WORD getRelocTypeHint(void * target); - void getModuleNativeEntryPointRange( - void ** pStart, /* OUT */ - void ** pEnd /* OUT */ - ); - DWORD getExpectedTargetArchitecture(); CEEInfo(MethodDesc * fd = NULL, bool fVerifyOnly = false, bool fAllowInlining = true) : @@ -1296,10 +1256,6 @@ class CEEJitInfo : public CEEInfo WORD getRelocTypeHint(void * target); - void getModuleNativeEntryPointRange( - void** pStart, - void** pEnd); - DWORD getExpectedTargetArchitecture(); CodeHeader* GetCodeHeader() diff --git a/src/coreclr/src/vm/stackwalk.cpp b/src/coreclr/src/vm/stackwalk.cpp index 66890ec1002a6c..d12211ec8f11a1 100644 --- a/src/coreclr/src/vm/stackwalk.cpp +++ b/src/coreclr/src/vm/stackwalk.cpp @@ -47,55 +47,6 @@ Assembly* CrawlFrame::GetAssembly() 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 (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(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 - (pFrame)->GetAddrOfSecurityDesc(); - } - return NULL; -} -#endif - BOOL CrawlFrame::IsInCalleesFrames(LPVOID stackPointer) { LIMITED_METHOD_CONTRACT; @@ -1509,7 +1460,6 @@ void StackFrameIterator::ResetCrawlFrame() m_crawl.pThread = this->m_pThread; - m_crawl.pSecurityObject = NULL; m_crawl.isCachedMethod = false; m_crawl.stackWalkCache.ClearEntry(); @@ -2945,18 +2895,6 @@ void StackFrameIterator::ProcessCurrentFrame(void) { 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 diff --git a/src/coreclr/src/vm/stackwalk.h b/src/coreclr/src/vm/stackwalk.h index 44752ba7a777f3..fcfd0edee3e3d7 100644 --- a/src/coreclr/src/vm/stackwalk.h +++ b/src/coreclr/src/vm/stackwalk.h @@ -112,16 +112,6 @@ class CrawlFrame 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(); @@ -501,7 +491,6 @@ class CrawlFrame Thread* pThread; // fields used for stackwalk cache - OBJECTREF *pSecurityObject; BOOL isCachedMethod; StackwalkCache stackWalkCache; diff --git a/src/coreclr/src/vm/threads.cpp b/src/coreclr/src/vm/threads.cpp index f9586156b7b555..1f9c3ce234a0fa 100644 --- a/src/coreclr/src/vm/threads.cpp +++ b/src/coreclr/src/vm/threads.cpp @@ -7240,7 +7240,6 @@ BOOL Thread::HaveExtraWorkForFinalizer() return m_ThreadTasks || ThreadpoolMgr::HaveTimerInfosToFlush() - || ExecutionManager::IsCacheCleanupRequired() || Thread::CleanupNeededForFinalizedThread() || (m_DetachCount > 0) || SystemDomain::System()->RequireAppDomainCleanup() @@ -7287,11 +7286,6 @@ void Thread::DoExtraWorkForFinalizer() 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(); diff --git a/src/coreclr/src/zap/zapimage.cpp b/src/coreclr/src/zap/zapimage.cpp index 5ca0fa9c6ed350..2a2f158f8610f9 100644 --- a/src/coreclr/src/zap/zapimage.cpp +++ b/src/coreclr/src/zap/zapimage.cpp @@ -2433,15 +2433,6 @@ HRESULT ZapImage::LocateProfileData() return S_FALSE; #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 // diff --git a/src/coreclr/src/zap/zapinfo.cpp b/src/coreclr/src/zap/zapinfo.cpp index e5ffb56d1d1650..f0bf42024051a6 100644 --- a/src/coreclr/src/zap/zapinfo.cpp +++ b/src/coreclr/src/zap/zapinfo.cpp @@ -164,10 +164,7 @@ CORJIT_FLAGS ZapInfo::ComputeJitFlags(CORINFO_METHOD_HANDLE handle) 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) @@ -482,13 +479,6 @@ void ZapInfo::CompileMethod() { // 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 @@ -891,11 +881,6 @@ DWORD ZapInfo::getJitFlags(CORJIT_FLAGS* jitFlags, DWORD sizeInBytes) return sizeof(m_jitFlags); } -IEEMemoryManager* ZapInfo::getMemoryManager() -{ - return GetEEMemoryManager(); -} - bool ZapInfo::runWithErrorTrap(void (*function)(void*), void* param) { return m_pEEJitInfo->runWithErrorTrap(function, param); @@ -1171,12 +1156,6 @@ void * ZapInfo::allocGCInfo(size_t size) return m_pGCInfo; } -void ZapInfo::yieldExecution() -{ - // nothing necessary here -} - - void ZapInfo::setEHcount(unsigned cEH) { // @@ -1613,10 +1592,9 @@ CORINFO_CLASS_HANDLE ZapInfo::getTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN * pRes 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 @@ -2009,15 +1987,6 @@ void * ZapInfo::getMethodSync(CORINFO_METHOD_HANDLE ftn, 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); @@ -2266,13 +2235,6 @@ void ZapInfo::getCallInfo(CORINFO_RESOLVED_TOKEN * pResolvedToken, 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) @@ -2855,13 +2817,6 @@ WORD ZapInfo::getRelocTypeHint(void * target) #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; @@ -2988,7 +2943,7 @@ void ZapInfo::setVars(CORINFO_METHOD_HANDLE ftn, return; } -void * ZapInfo::allocateArray(ULONG cBytes) +void * ZapInfo::allocateArray(size_t cBytes) { return new BYTE[cBytes]; } @@ -3025,12 +2980,6 @@ unsigned ZapInfo::getFieldOffset(CORINFO_FIELD_HANDLE field) 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, @@ -3281,11 +3230,6 @@ CorInfoInlineTypeCheck ZapInfo::canInlineTypeCheck (CORINFO_CLASS_HANDLE cls, Co 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); @@ -3374,12 +3318,6 @@ BOOL ZapInfo::isMoreSpecificType( 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) { @@ -3601,11 +3539,6 @@ CorInfoHelpFunc ZapInfo::getSharedCCtorHelper(CORINFO_CLASS_HANDLE clsHnd) 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); @@ -3789,12 +3722,6 @@ size_t ZapInfo::findNameOfToken(CORINFO_MODULE_HANDLE tokenScope, 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) @@ -3882,22 +3809,6 @@ void ZapInfo::reportInliningDecision (CORINFO_METHOD_HANDLE inlinerHnd, 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, @@ -3930,30 +3841,6 @@ void ZapInfo::reportTailCallDecision(CORINFO_METHOD_HANDLE callerHnd, 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) { diff --git a/src/coreclr/src/zap/zapinfo.h b/src/coreclr/src/zap/zapinfo.h index 08869b69c405e1..22fb7182627105 100644 --- a/src/coreclr/src/zap/zapinfo.h +++ b/src/coreclr/src/zap/zapinfo.h @@ -268,8 +268,6 @@ class ZapInfo // ICorJitInfo - IEEMemoryManager* getMemoryManager(); - virtual void allocMem ( ULONG hotCodeSize, /* IN */ ULONG coldCodeSize, /* IN */ @@ -298,7 +296,6 @@ class ZapInfo ); void * allocGCInfo(size_t size); - void yieldExecution(); void setEHcount(unsigned cEH); void setEHinfo(unsigned EHnumber, const CORINFO_EH_CLAUSE *clause); @@ -348,9 +345,7 @@ class ZapInfo 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, @@ -376,8 +371,6 @@ class ZapInfo 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, @@ -444,8 +437,6 @@ class ZapInfo WORD getRelocTypeHint(void * target); - void getModuleNativeEntryPointRange(void** pStart, void** pEnd); - DWORD getExpectedTargetArchitecture(); // ICorJitInfo delegate ctor optimization @@ -484,7 +475,7 @@ class ZapInfo 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 @@ -498,9 +489,6 @@ class ZapInfo 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, @@ -522,7 +510,6 @@ class ZapInfo 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); @@ -554,7 +541,6 @@ class ZapInfo 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); @@ -594,7 +580,6 @@ class ZapInfo 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); @@ -624,7 +609,6 @@ class ZapInfo 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, @@ -661,13 +645,6 @@ class ZapInfo 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, @@ -679,9 +656,6 @@ class ZapInfo 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); diff --git a/src/coreclr/src/zap/zapper.cpp b/src/coreclr/src/zap/zapper.cpp index fc5ba32d952609..a11f605aa83801 100644 --- a/src/coreclr/src/zap/zapper.cpp +++ b/src/coreclr/src/zap/zapper.cpp @@ -668,11 +668,6 @@ Zapper::~Zapper() _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