if(CLR_CMAKE_PLATFORM_LINUX OR CLR_CMAKE_PLATFORM_FREEBSD)
add_definitions(-DFEATURE_PERFMAP)
endif(CLR_CMAKE_PLATFORM_LINUX OR CLR_CMAKE_PLATFORM_FREEBSD)
-add_definitions(-DFEATURE_PREJIT)
if(NOT CLR_CMAKE_PLATFORM_UNIX)
add_definitions(-DFEATURE_PROFAPI_ATTACH_DETACH)
# Contains the crossgen build specific definitions. Included by the leaf crossgen cmake files.
add_definitions(
+ -DFEATURE_PREJIT
-DCROSSGEN_COMPILE
-DCROSS_COMPILE
-DFEATURE_NATIVE_IMAGE_GENERATION
DEFINE_DACVAR(ULONG, PTR_AppDomain, AppDomain__m_pTheAppDomain, AppDomain::m_pTheAppDomain)
DEFINE_DACVAR(ULONG, PTR_SystemDomain, SystemDomain__m_pSystemDomain, SystemDomain::m_pSystemDomain)
+#ifdef FEATURE_PREJIT
DEFINE_DACVAR(ULONG, BOOL, SystemDomain__s_fForceDebug, SystemDomain::s_fForceDebug)
DEFINE_DACVAR(ULONG, BOOL, SystemDomain__s_fForceProfiling, SystemDomain::s_fForceProfiling)
DEFINE_DACVAR(ULONG, BOOL, SystemDomain__s_fForceInstrument, SystemDomain::s_fForceInstrument)
+#endif
#ifdef FEATURE_INTEROP_DEBUGGING
DEFINE_DACVAR(ULONG, DWORD, dac__g_debuggerWordTLSIndex, g_debuggerWordTLSIndex)
JITHELPER(CORINFO_HELP_EE_VSD_FIXUP, NULL, CORINFO_HELP_SIG_NO_ALIGN_STUB)
#endif
JITHELPER(CORINFO_HELP_EE_EXTERNAL_FIXUP, ExternalMethodFixupStub, CORINFO_HELP_SIG_NO_ALIGN_STUB)
+#ifdef FEATURE_PREJIT
JITHELPER(CORINFO_HELP_EE_VTABLE_FIXUP, VirtualMethodFixupStub, CORINFO_HELP_SIG_NO_ALIGN_STUB)
+#else
+ JITHELPER(CORINFO_HELP_EE_VTABLE_FIXUP, NULL, CORINFO_HELP_SIG_NO_ALIGN_STUB)
+#endif
JITHELPER(CORINFO_HELP_EE_REMOTING_THUNK, NULL, CORINFO_HELP_SIG_UNDEF)
{
CHECK(CheckCorHeader());
-#if !defined(FEATURE_PREJIT)
- CHECK(IsILOnly());
-#endif
-
if (IsILOnly() && !HasReadyToRunHeader())
CHECK(CheckILOnly());
extern ExternalMethodFixupWorker:proc
extern ProcessCLRException:proc
+
+ifdef FEATURE_PREJIT
extern VirtualMethodFixupWorker:proc
+endif
ifdef FEATURE_READYTORUN
extern DynamicHelperWorker:proc
endif ; FEATURE_READYTORUN
+ifdef FEATURE_PREJIT
;============================================================================================
;; EXTERN_C VOID __stdcall VirtualMethodFixupStub()
TAILJMP_RAX
NESTED_END VirtualMethodFixupStub, _TEXT
+endif ; FEATURE_PREJIT
end
return offsetInFunc;
}
+#ifdef FEATURE_PREJIT
//==========================================================================================
// In NGen image, virtual slots inherited from cross-module dependencies point to jump thunks.
// These jump thunk initially point to VirtualMethodFixupStub which transfers control here.
// Ready to return
return pCode;
}
+#endif // FEATURE_PREJIT
#ifdef FEATURE_READYTORUN
#endif // FEATURE_READYTORUN
+#ifdef FEATURE_PREJIT
//============================================================================================
// EXTERN_C VOID __stdcall VirtualMethodFixupStub()
TAILJMP_RAX
NESTED_END VirtualMethodFixupStub, _TEXT
+#endif // FEATURE_PREJIT
SPTR_IMPL(AppDomain, AppDomain, m_pTheAppDomain);
SPTR_IMPL(SystemDomain, SystemDomain, m_pSystemDomain);
+#ifdef FEATURE_PREJIT
SVAL_IMPL(BOOL, SystemDomain, s_fForceDebug);
SVAL_IMPL(BOOL, SystemDomain, s_fForceProfiling);
SVAL_IMPL(BOOL, SystemDomain, s_fForceInstrument);
+#endif
#ifndef DACCESS_COMPILE
// Do nothing - new() was in-place
}
-
+#ifdef FEATURE_PREJIT
void SystemDomain::SetCompilationOverrides(BOOL fForceDebug,
BOOL fForceProfiling,
BOOL fForceInstrument)
s_fForceProfiling = fForceProfiling;
s_fForceInstrument = fForceInstrument;
}
+#endif
#endif //!DACCESS_COMPILE
+#ifdef FEATURE_PREJIT
void SystemDomain::GetCompilationOverrides(BOOL * fForceDebug,
BOOL * fForceProfiling,
BOOL * fForceInstrument)
*fForceProfiling = s_fForceProfiling;
*fForceInstrument = s_fForceInstrument;
}
+#endif
#ifndef DACCESS_COMPILE
static DWORD m_dwLowestFreeIndex;
#endif // DACCESS_COMPILE
+#ifdef FEATURE_PREJIT
protected:
// These flags let the correct native image of mscorlib to be loaded.
SVAL_DECL(BOOL, s_fForceDebug);
SVAL_DECL(BOOL, s_fForceProfiling);
SVAL_DECL(BOOL, s_fForceInstrument);
+#endif
public:
static void SetCompilationOverrides(BOOL fForceDebug,
bx lr
NESTED_END stackProbe, _TEXT
+#ifdef FEATURE_PREJIT
//------------------------------------------------
// VirtualMethodFixupStub
//
bx r12
NESTED_END VirtualMethodFixupStub, _TEXT
+#endif // FEATURE_PREJIT
//------------------------------------------------
// ExternalMethodFixupStub
NESTED_END ExternalMethodFixupStub, _TEXT
+#ifdef FEATURE_PREJIT
//------------------------------------------------
// StubDispatchFixupStub
//
bx r12
NESTED_END StubDispatchFixupStub, _TEXT
+#endif // FEATURE_PREJIT
//------------------------------------------------
// JIT_RareDisableHelper
IMPORT GetCurrentSavedRedirectContext
- ;; Imports to support virtual import fixup for ngen images
- IMPORT VirtualMethodFixupWorker
;; Import to support cross-moodule external method invocation in ngen images
IMPORT ExternalMethodFixupWorker
+
+#ifdef FEATURE_PREJIT
+ ;; Imports to support virtual import fixup for ngen images
+ IMPORT VirtualMethodFixupWorker
IMPORT StubDispatchFixupWorker
+#endif
#ifdef FEATURE_READYTORUN
IMPORT DynamicHelperWorker
EPILOG_RETURN
NESTED_END
+#ifdef FEATURE_PREJIT
;------------------------------------------------
; VirtualMethodFixupStub
;
EPILOG_BRANCH_REG r12
NESTED_END
+#endif // FEATURE_PREJIT
;------------------------------------------------
; ExternalMethodFixupStub
NESTED_END
+#ifdef FEATURE_PREJIT
;------------------------------------------------
; StubDispatchFixupStub
;
EPILOG_BRANCH_REG r12
NESTED_END
+#endif // FEATURE_PREJIT
;------------------------------------------------
; JIT_RareDisableHelper
CONTRACTL
{
THROWS;
- GC_TRIGGERS;
+ GC_NOTRIGGER;
}
CONTRACTL_END;
CONTRACTL
{
THROWS;
- GC_TRIGGERS;
+ GC_NOTRIGGER;
}
CONTRACTL_END;
ret lr
WRITE_BARRIER_END JIT_WriteBarrier
+#ifdef FEATURE_PREJIT
//------------------------------------------------
// VirtualMethodFixupStub
//
// and tailcall to the actual method
EPILOG_BRANCH_REG x12
-NESTED_END VirtualMEthodFixupStub, _TEXT
+NESTED_END VirtualMethodFixupStub, _TEXT
+#endif // FEATURE_PREJIT
//------------------------------------------------
// ExternalMethodFixupStub
#include "asmconstants.h"
#include "asmmacros.h"
+#ifdef FEATURE_PREJIT
IMPORT VirtualMethodFixupWorker
+ IMPORT StubDispatchFixupWorker
+#endif
IMPORT ExternalMethodFixupWorker
IMPORT PreStubWorker
IMPORT NDirectImportWorker
IMPORT VSD_ResolveWorker
- IMPORT StubDispatchFixupWorker
IMPORT JIT_InternalThrow
IMPORT ComPreStubWorker
IMPORT COMToCLRWorker
ret lr
WRITE_BARRIER_END JIT_WriteBarrier
+#ifdef FEATURE_PREJIT
;------------------------------------------------
; VirtualMethodFixupStub
;
EPILOG_BRANCH_REG x12
NESTED_END
+#endif // FEATURE_PREJIT
+
;------------------------------------------------
; ExternalMethodFixupStub
;
#endif // 0
+#endif
+#endif
+
+#ifndef DACCESS_COMPILE
//-----------------------------------------------------------------------------
void Module::RunEagerFixups()
}
}
}
+#endif // !DACCESS_COMPILE
+#ifdef FEATURE_PREJIT
+
+#ifndef DACCESS_COMPILE
void Module::LoadTokenTables()
{
CONTRACTL
return TRUE;
}
-#ifdef FEATURE_PREJIT
//
// Profile data management
//
return static_cast<const ExternalMethodBlobEntry *>(pEntry);
}
-
static bool GetBasename(LPCWSTR _src, __out_ecount(dstlen) __out_z LPWSTR _dst, int dstlen)
{
LIMITED_METHOD_CONTRACT;
// the metadataProfileData is free'ed in destructor of the corresponding MetaDataTracker
}
-#endif //FEATURE_PREJIT
void Module::SetIsIJWFixedUp()
{
FastInterlockOr(&m_dwTransientFlags, IS_IJW_FIXED_UP);
}
-#ifdef FEATURE_PREJIT
/* static */
Module::TokenProfileData *Module::TokenProfileData::CreateNoThrow(void)
{
return tpd;
}
-#endif // FEATURE_PREJIT
-
#endif // !DACCESS_COMPILE
#ifndef DACCESS_COMPILE
}
#endif
-#ifdef FEATURE_PREJIT
void Module::LogTokenAccess(mdToken token, SectionFormat format, ULONG flagnum)
{
CONTRACTL
LogTokenAccess(token, format, flagNum);
}
}
-#endif // FEATURE_PREJIT
#ifndef DACCESS_COMPILE
-#ifdef FEATURE_PREJIT
//
// Encoding callbacks
RETURN result;
}
#endif // DACCESS_COMPILE
-#endif //FEATURE_PREJIT
#ifndef DACCESS_COMPILE
class CodeVersionManager;
class TieredCompilationManager;
class ProfileEmitter;
+class JITInlineTrackingMap;
#ifdef FEATURE_PREJIT
class TypeHandleList;
class TrackingMap;
struct MethodInModule;
class PersistentInlineTrackingMapNGen;
-class JITInlineTrackingMap;
extern VerboseLevel g_CorCompileVerboseLevel;
#endif
WRAPPER_NO_CONTRACT;
_ASSERTE((flag & supportedFlags) == flag);
+#ifdef FEATURE_PREJIT
_ASSERTE(!MapIsCompressed());
_ASSERTE(dwNumHotItems == 0);
+#endif // FEATURE_PREJIT
PTR_TADDR pElement = GetElementPtr(rid);
_ASSERTE(pElement);
};
-
-#ifdef FEATURE_PREJIT
-
// For IBC Profiling we collect signature blobs for instantiated types.
// For such instantiated types and methods we create our own ibc token
//
typedef SHash<ProfilingBlobTraits> ProfilingBlobTable;
typedef DPTR(ProfilingBlobTable) PTR_ProfilingBlobTable;
-
+#ifdef FEATURE_PREJIT
#define METHODTABLE_RESTORE_REASON() \
RESTORE_REASON_FUNC(CanNotPreRestoreHardBindToParentMethodTable) \
RESTORE_REASON_FUNC(CanNotPreRestoreHardBindToCanonicalMethodTable) \
#ifndef _DATAIMAGE_H_
#define _DATAIMAGE_H_
-#if defined(FEATURE_PREJIT) && !defined(DACCESS_COMPILE)
-
-// All we really need is to pre-declare the PrecodeType enum, but g++ doesn't
-// support enum pre-declaration, so we need to include the declaration itself.
-/*#include "cgensys.h" // needed to include precode.h*/
-#include "precode.h"
-
-typedef BYTE ZapRelocationType; // IMAGE_REL_XXX enum
-
// IMAGE_REL_BASED_PTR is architecture specific reloc of virtual address
#ifdef _TARGET_64BIT_
#define IMAGE_REL_BASED_PTR IMAGE_REL_BASED_DIR64
// Special NGEN-specific relocation type for relative pointer (used to make NGen relocation section smaller)
#define IMAGE_REL_BASED_RELPTR 0x7D
+#if defined(FEATURE_PREJIT) && !defined(DACCESS_COMPILE)
+
+// All we really need is to pre-declare the PrecodeType enum, but g++ doesn't
+// support enum pre-declaration, so we need to include the declaration itself.
+/*#include "cgensys.h" // needed to include precode.h*/
+#include "precode.h"
+
+typedef BYTE ZapRelocationType; // IMAGE_REL_XXX enum
+
class CEEPreloader;
class ZapImage;
void DomainFile::AddDependencies()
{
STANDARD_VM_CONTRACT;
-
-#ifdef FEATURE_PREJIT
-
- //
- // CoreCLR hard binds to mscorlib.dll only. No need to track hardbound dependencies.
- //
-
-#endif // FEATURE_PREJIT
}
void DomainFile::EagerFixups()
{
GetCurrentModule()->RunEagerFixups();
}
-#ifdef FEATURE_READYTORUN
else
+#endif // FEATURE_PREJIT
+#ifdef FEATURE_READYTORUN
if (GetCurrentModule()->IsReadyToRun())
{
#ifndef CROSSGEN_COMPILE
GetCurrentModule() /* (void *)pLayout */);
}
#endif // FEATURE_READYTORUN
-
-#endif // FEATURE_PREJIT
}
void DomainFile::VtableFixups()
#ifdef FEATURE_PREJIT
return !m_arrayType.IsTagged() && (m_arrayType.IsNull() || m_arrayType.GetValue().IsRestored());
#else // FEATURE_PREJIT
- return m_arrayType.IsNull() || m_arrayType.GetValue().IsFullyLoaded();
+ // putting the IsFullyLoaded check here is tempting but incorrect
+ return TRUE;
#endif // FEATURE_PREJIT
}
#endif
LEAF_END GenericPInvokeCalliHelper, _TEXT
#ifdef FEATURE_PREJIT
-
// =========================================================================
NESTED_ENTRY StubDispatchFixupStub, _TEXT, NoHandler
STUB_PROLOG
// which disassembles the epilog to unwind the stack.
ret
NESTED_END StubDispatchFixupStub, _TEXT
+#endif // FEATURE_PREJIT
// ==========================================================================
NESTED_ENTRY ExternalMethodFixupStub, _TEXT_ NoHandler
#endif // FEATURE_READYTORUN
+#ifdef FEATURE_PREJIT
// =======================================================================================
// The call in softbound vtable slots initially points to this function.
// The pupose of this function is to transfer the control to right target and
// which disassembles the epilog to unwind the stack.
ret
NESTED_END VirtualMethodFixupStub, _TEXT
-
#endif // FEATURE_PREJIT
NESTED_ENTRY ThePreStub, _TEXT, NoHandler
EXTERN _CLRToCOMWorker@8:PROC
endif
-ifdef FEATURE_PREJIT
EXTERN _ExternalMethodFixupWorker@16:PROC
+
+ifdef FEATURE_PREJIT
EXTERN _VirtualMethodFixupWorker@8:PROC
EXTERN _StubDispatchFixupWorker@16:PROC
endif
endif
ifdef FEATURE_PREJIT
-
;=======================================================================================
; The call in softbound vtable slots initially points to this function.
; The pupose of this function is to transfer the control to right target and
ret
_VirtualMethodFixupStub@0 endp
-
-endif ; FEATURE_PREJIT
+endif
;==========================================================================
; The prestub
// Needed for PInvoke inlining in ngened images
#define HAS_NDIRECT_IMPORT_PRECODE 1
-#ifdef FEATURE_PREJIT
#define HAS_FIXUP_PRECODE 1
#define HAS_FIXUP_PRECODE_CHUNKS 1
-#endif
// ThisPtrRetBufPrecode one is necessary for closed delegates over static methods with return buffer
#define HAS_THISPTR_RETBUF_PRECODE 1
return pCode == GetPreStubEntryPoint();
}
+#ifdef FEATURE_PREJIT
//==========================================================================================
// In NGen image, virtual slots inherited from cross-module dependencies point to jump thunks.
// These jump thunk initially point to VirtualMethodFixupStub which transfers control here.
return PVOID(pCode);
}
-
+#endif // FEATURE_PREJIT
#ifdef FEATURE_READYTORUN
CONTRACTL
{
THROWS; // Creating a JumpStub could throw OutOfMemory
- GC_TRIGGERS;
+ GC_NOTRIGGER;
}
CONTRACTL_END;
CONTRACTL
{
THROWS; // Creating a JumpStub could throw OutOfMemory
- GC_TRIGGERS;
+ GC_NOTRIGGER;
}
CONTRACTL_END;
CONTRACTL
{
THROWS;
- GC_TRIGGERS;
+ GC_NOTRIGGER;
}
CONTRACTL_END;
CONTRACTL
{
THROWS;
- GC_TRIGGERS;
+ GC_NOTRIGGER;
}
CONTRACTL_END;
if (!pMT->IsRestored_NoLogging())
goto DelayCallback;
+#ifdef FEATURE_PREJIT
LogMethodTableAccessHelper(pMT);
+#endif
Module *pModule = pMT->GetModule();
goto DelayCallback;
}
+#ifdef FEATURE_PREJIT
Module *pPZModule = Module::GetPreferredZapModuleForMethodDesc(pMD);
token = pPZModule->LogInstantiatedMethod(pMD, flagNum);
if (!IsNilToken(token))
{
pPZModule->LogTokenAccess(token, MethodProfilingData, flagNum);
}
+#endif
}
else
{
WRAPPER_NO_CONTRACT;
pLogger->LogMethodAccessHelper((MethodDesc *)pValue1, (ULONG)(SIZE_T)pValue2);
}
+// Log access to method code or method header
+void IBCLogger::LogMethodCodeAccessHelper(MethodDesc *pMD)
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ PRECONDITION(g_IBCLogger.InstrEnabled());
+ }
+ CONTRACTL_END;
+
+ LogMethodAccessHelper(pMD, ReadMethodCode);
+}
+
+// Log access to method gc info
+void IBCLogger::LogMethodGCInfoAccessHelper(MethodDesc* pMD)
+{
+ WRAPPER_NO_CONTRACT;
+
+ _ASSERTE(InstrEnabled());
+
+ LogMethodAccessHelper(pMD, ReadGCInfo);
+ LogMethodAccessHelper(pMD, CommonReadGCInfo);
+}
+#ifdef FEATURE_PREJIT
void IBCLogger::LogMethodDescAccessHelper(const MethodDesc *pMD)
{
WRAPPER_NO_CONTRACT;
LogMethodAccessHelper(pMD, WriteMethodPrecode);
}
-// Log access to method code or method header
-void IBCLogger::LogMethodCodeAccessHelper(MethodDesc *pMD)
-{
- CONTRACTL
- {
- NOTHROW;
- GC_NOTRIGGER;
- MODE_ANY;
- PRECONDITION(g_IBCLogger.InstrEnabled());
- }
- CONTRACTL_END;
-
- LogMethodAccessHelper(pMD, ReadMethodCode);
-}
-
// Log access to the method code and method header for NDirect calls
void IBCLogger::LogNDirectCodeAccessHelper(MethodDesc *pMD)
{
LogMethodAccessHelper(pMD, ReadMethodCode);
}
-
-// Log access to method gc info
-void IBCLogger::LogMethodGCInfoAccessHelper(MethodDesc *pMD)
-{
- WRAPPER_NO_CONTRACT;
-
- _ASSERTE(InstrEnabled());
-
- LogMethodAccessHelper(pMD, ReadGCInfo);
- LogMethodAccessHelper(pMD, CommonReadGCInfo);
-}
-
// Log access to method table
void IBCLogger::LogMethodTableAccessHelper(MethodTable const * pMT)
{
DelayedCallbackPtr(LogRVADataAccessWrapper, pFD);
}
+#endif // FEATURE_PREJIT
#define LOADORDER_INSTR 0x00000001
#define RID_ACCESSORDER_INSTR 0x00000002
typedef Pair< Module*, mdToken > RidMapLogData;
-#if defined(FEATURE_PREJIT) && !defined(DACCESS_COMPILE) && !defined(CROSSGEN_COMPILE)
+#if !defined(DACCESS_COMPILE) && !defined(CROSSGEN_COMPILE)
#define IBCLOGGER_ENABLED
#endif
void DelayedCallbackPtr(pfnIBCAccessCallback callback, const void * pValue1, const void * pValue2 = NULL);
-#else // FEATURE_PREJIT && !DACCESS_COMPILE
+#else // IBCLOGGER_ENABLED
#define LOGACCESS_PTR(name,type) \
public: \
public: \
void Log##name##Access(type p) { SUPPORTS_DAC; } \
-#endif // FEATURE_PREJIT && !DACCESS_COMPILE
-
- // Log access to method desc (which adds the method desc to the required list)
- // Implemented by : code:IBCLogger.LogMethodDescAccessHelper
- LOGACCESS_PTR(MethodDesc, const MethodDesc)
+#endif // IBCLOGGER_ENABLED
// Log access to method code or method header
// Implemented by : code:IBCLogger.LogMethodCodeAccessHelper
LOGACCESS_PTR(MethodCode, MethodDesc)
+ // Log access to gc info
+ // Implemented by : code:IBCLogger.LogMethodGCInfoAccessHelper
+ LOGACCESS_PTR(MethodGCInfo, MethodDesc)
+
+// The accesses to individual datastructures matter for fragile NGen only
+#ifndef FEATURE_PREJIT
+
+#undef LOGACCESS_PTR
+#undef LOGACCESS_VALUE
+
+#define LOGACCESS_PTR(name,type) \
+public: \
+ void Log##name##Access(type* p) { SUPPORTS_DAC; } \
+
+#define LOGACCESS_VALUE(name, type) \
+public: \
+ void Log##name##Access(type p) { SUPPORTS_DAC; } \
+
+#endif // FEATURE_PREJIT
+
+ // Log access to method desc (which adds the method desc to the required list)
+ // Implemented by : code:IBCLogger.LogMethodDescAccessHelper
+ LOGACCESS_PTR(MethodDesc, const MethodDesc)
+
// Log access to the NDirect data stored for a MethodDesc
// also implies that the IL_STUB for the NDirect method is executed
// Implemented by : code:IBCLogger.LogNDirectCodeAccessHelper
// Implemented by : code:IBCLogger.LogMethodPrecodeWriteAccessHelper
LOGACCESS_PTR(MethodPrecodeWrite,MethodDesc)
- // Log access to gc info
- // Implemented by : code:IBCLogger.LogMethodGCInfoAccessHelper
- LOGACCESS_PTR(MethodGCInfo, MethodDesc)
-
// Log access to method table
// Implemented by : code:IBCLogger.LogMethodTableAccessHelper
LOGACCESS_PTR(MethodTable, MethodTable const)
RestoreSignatureContainingInternalTypes(pSig, cSigLen);
}
}
+#else // FEATURE_PREJIT
+void DynamicMethodDesc::Restore()
+{
+}
#endif // FEATURE_PREJIT
#ifdef FEATURE_NATIVE_IMAGE_GENERATION
#endif // !DACCESS_COMPILE
-#ifdef FEATURE_PREJIT
//*******************************************************************************
void MethodDesc::CheckRestore(ClassLoadLevel level)
{
// First restore method table pointer in singleton chunk;
// it might be out-of-module
+#ifdef FEATURE_PREJIT
GetMethodDescChunk()->RestoreMTPointer(level);
#ifdef _DEBUG
Module::RestoreMethodTablePointer(&m_pDebugMethodTable, NULL, level);
#endif
-
// Now restore wrapped method desc if present; we need this for the dictionary layout too
if (pIMD->IMD_IsWrapperStubWithInstantiations())
Module::RestoreMethodDescPointer(&pIMD->m_pWrappedMethodDesc);
{
GetMethodDictionary()->Restore(GetNumGenericMethodArgs(), level);
}
+#else
+ ClassLoader::EnsureLoaded(TypeHandle(GetMethodTable()), level);
+#endif
g_IBCLogger.LogMethodDescWriteAccess(this);
}
}
}
-#else // FEATURE_PREJIT
-//*******************************************************************************
-void MethodDesc::CheckRestore(ClassLoadLevel level)
-{
- LIMITED_METHOD_CONTRACT;
-}
-#endif // !FEATURE_PREJIT
// static
MethodDesc* MethodDesc::GetMethodDescFromStubAddr(PCODE addr, BOOL fSpeculative /*=FALSE*/)
#endif // FEATURE_NATIVE_IMAGE_GENERATION
-#ifdef FEATURE_PREJIT
-
//==========================================================================================
void MethodTable::CheckRestore()
{
g_IBCLogger.LogMethodTableAccess(this);
}
-#else // !FEATURE_PREJIT
-//==========================================================================================
-void MethodTable::CheckRestore()
-{
- LIMITED_METHOD_CONTRACT;
-}
-#endif // !FEATURE_PREJIT
-
-
#ifndef DACCESS_COMPILE
BOOL SatisfiesClassConstraints(TypeHandle instanceTypeHnd, TypeHandle typicalTypeHnd,
#include "common.h"
#include "peimagelayout.h"
#include "peimagelayout.inl"
+#include "dataimage.h"
#if defined(PLATFORM_WINDOWS) && !defined(CROSSGEN_COMPILE)
#include "amsi.h"
RETURN pAlloc.Extract();
}
-#ifdef FEATURE_PREJIT
-
#ifdef FEATURE_PAL
DWORD SectionCharacteristicsToPageProtection(UINT characteristics)
{
ClrFlushInstructionCache(pFlushRegion, cbFlushRegion);
}
}
-#endif // FEATURE_PREJIT
RawImageLayout::RawImageLayout(const void *flat, COUNT_T size, PEImage* pOwner)
ULONG Release();
const SString& GetPath();
-#ifdef FEATURE_PREJIT
void ApplyBaseRelocations();
-#endif
public:
#ifdef DACCESS_COMPILE
SIZE_T baseAddr = (SIZE_T)pLoadedLayout->GetBase();
-#ifdef FEATURE_READYTORUN_COMPILER
- if (pLoadedLayout->HasReadyToRunHeader())
+#ifdef FEATURE_PREJIT
+ if (!pLoadedLayout->HasReadyToRunHeader())
{
- ReadyToRunInfo::MethodIterator mi(pModule->GetReadyToRunInfo());
+ MethodIterator mi((PTR_Module)pModule);
while (mi.Next())
{
MethodDesc *hotDesc = mi.GetMethodDesc();
+ hotDesc->CheckRestore();
LogPreCompiledMethod(hotDesc, mi.GetMethodStartAddress(), baseAddr);
}
+ return;
}
- else
-#endif // FEATURE_READYTORUN_COMPILER
+#endif
+
+ ReadyToRunInfo::MethodIterator mi(pModule->GetReadyToRunInfo());
+ while (mi.Next())
{
- MethodIterator mi((PTR_Module)pModule);
- while (mi.Next())
- {
- MethodDesc *hotDesc = mi.GetMethodDesc();
- hotDesc->CheckRestore();
+ MethodDesc* hotDesc = mi.GetMethodDesc();
- LogPreCompiledMethod(hotDesc, mi.GetMethodStartAddress(), baseAddr);
- }
+ LogPreCompiledMethod(hotDesc, mi.GetMethodStartAddress(), baseAddr);
}
}
break;
}
-#ifdef FEATURE_PREJIT
case ELEMENT_TYPE_NATIVE_ARRAY_TEMPLATE_ZAPSIG:
{
#ifndef DACCESS_COMPILE
#endif
break;
}
-#endif // FEATURE_PREJIT
case ELEMENT_TYPE_VAR:
{
}
CONTRACTL_END;
+#ifdef FEATURE_PREJIT
// Both virtual and external import thunks have the same structure. We can use
// common code to handle them.
_ASSERTE(GetIP(pContext) == GetEEFuncEntryPoint(VirtualMethodFixupPatchLabel)
|| GetIP(pContext) == GetEEFuncEntryPoint(ExternalMethodFixupPatchLabel));
+#else
+ _ASSERTE(GetIP(pContext) == GetEEFuncEntryPoint(ExternalMethodFixupPatchLabel));
+#endif
*pRetAddr = (BYTE *)StubManagerHelpers::GetReturnAddress(pContext);
m_pPendingTypeLoad = NULL;
-#ifdef FEATURE_PREJIT
m_pIBCInfo = NULL;
-#endif
m_dwAVInRuntimeImplOkayCount = 0;
g_pThinLockThreadIdDispenser->DisposeId(GetThreadId());
-#ifdef FEATURE_PREJIT
if (m_pIBCInfo) {
delete m_pIBCInfo;
}
-#endif
#ifdef FEATURE_EVENT_TRACE
// Destruct the thread local type cache for allocation sampling
}
#endif
-#ifdef FEATURE_PREJIT
-
private:
ThreadLocalIBCInfo* m_pIBCInfo;
#endif // #ifndef DACCESS_COMPILE
-#endif // #ifdef FEATURE_PREJIT
-
// Indicate whether this thread should run in the background. Background threads
// don't interfere with the EE shutting down. Whereas a running non-background
// thread prevents us from shutting down (except through System.Exit(), of course)
// Forward function declarations
extern "C" void InContextTPQuickDispatchAsmStub();
+#ifdef FEATURE_PREJIT
extern "C" PCODE STDCALL StubDispatchFixupWorker(TransitionBlock * pTransitionBlock,
TADDR siteAddrForRegisterIndirect,
DWORD sectionIndex,
Module * pModule);
+#endif
extern "C" PCODE STDCALL VSD_ResolveWorker(TransitionBlock * pTransitionBlock,
TADDR siteAddrForRegisterIndirect,