#ifndef _INC_WINDOWS
-typedef union _LARGE_INTEGER {
- struct {
-#if BIGENDIAN
- int32_t HighPart;
- uint32_t LowPart;
-#else
- uint32_t LowPart;
- int32_t HighPart;
-#endif
- } u;
- int64_t QuadPart;
-} LARGE_INTEGER, *PLARGE_INTEGER;
-
#ifdef PLATFORM_UNIX
typedef struct _RTL_CRITICAL_SECTION {
}
#endif // defined(GC_PROFILING) || defined(FEATURE_EVENT_TRACE)
+#if defined(BACKGROUND_GC) && defined(FEATURE_EVENT_TRACE)
+BOOL bgc_heap_walk_for_etw_p = FALSE;
+#endif //BACKGROUND_GC && FEATURE_EVENT_TRACE
+
#if defined(FEATURE_REDHAWK)
#define MAYBE_UNUSED_VAR(v) v = v
#else
#if defined(VERIFY_HEAP) || (defined (FEATURE_EVENT_TRACE) && defined(BACKGROUND_GC))
if (FALSE
#ifdef VERIFY_HEAP
+ // Note that right now g_pConfig->GetHeapVerifyLevel always returns the same
+ // value. If we ever allow randomly adjusting this as the process runs,
+ // we cannot call it this way as joins need to match - we must have the same
+ // value for all heaps like we do with bgc_heap_walk_for_etw_p.
|| (g_pConfig->GetHeapVerifyLevel() & EEConfig::HEAPVERIFY_GC)
#endif
#if defined(FEATURE_EVENT_TRACE) && defined(BACKGROUND_GC)
- || (ETW::GCLog::ShouldTrackMovementForEtw() && settings.concurrent)
+ || (bgc_heap_walk_for_etw_p && settings.concurrent)
#endif
)
{
#ifdef BACKGROUND_GC
assert (settings.concurrent == (uint32_t)(bgc_thread_id.IsCurrentThread()));
#ifdef FEATURE_EVENT_TRACE
- if (ETW::GCLog::ShouldTrackMovementForEtw() && settings.concurrent)
+ if (bgc_heap_walk_for_etw_p && settings.concurrent)
{
make_free_lists_for_profiler_for_bgc();
}
}
{
- int gen_num_for_data = ((settings.condemned_generation < (max_generation - 1)) ?
- (settings.condemned_generation + 1) : (max_generation + 1));
+ int gen_num_for_data = max_generation + 1;
for (int i = 0; i <= gen_num_for_data; i++)
{
gc_data_per_heap.gen_data[i].size_before = generation_size (i);
if (bgc_t_join.joined())
#endif //MULTIPLE_HEAPS
{
+#ifdef FEATURE_EVENT_TRACE
+ bgc_heap_walk_for_etw_p = ETW::GCLog::ShouldTrackMovementForEtw();
+#endif //FEATURE_EVENT_TRACE
+
leave_spin_lock (&gc_lock);
#ifdef MULTIPLE_HEAPS
#if defined (SYNCHRONIZATION_STATS) || defined (STAGE_STATS)
#define BEGIN_TIMING(x) \
- LARGE_INTEGER x##_start; \
- x##_start = GCToOSInterface::QueryPerformanceCounter ()
+ int64_t x##_start; \
+ x##_start = GCToOSInterface::QueryPerformanceCounter()
#define END_TIMING(x) \
- LARGE_INTEGER x##_end; \
- x##_end = GCToOSInterface::QueryPerformanceCounter (); \
+ int64_t x##_end; \
+ x##_end = GCToOSInterface::QueryPerformanceCounter(); \
x += x##_end - x##_start
#else
virtual BOOL AreAllClassesFullyLoaded(CORINFO_MODULE_HANDLE moduleHandle) = 0;
#endif
+
+ virtual BOOL HasCustomAttribute(CORINFO_METHOD_HANDLE method, LPCSTR customAttributeName) = 0;
};
/*****************************************************************************/
public:
AppDomainStack() : m_numEntries(0), m_pExtraStack(NULL), m_ExtraStackSize(0), m_dwOverridesCount(0), m_dwAsserts(0), m_dwThreadWideSpecialFlags(0xFFFFFFFF)
{
- WRAPPER_NO_CONTRACT;
+ LIMITED_METHOD_CONTRACT;
FillEntries(m_pStack, ADSTACK_BLOCK_SIZE);
}
UINT idResWhy,
mdMethodDef tokMethodDef)
{
- WRAPPER_NO_CONTRACT;
+ STANDARD_VM_CONTRACT;
bmtError->resIDWhy = idResWhy;
bmtError->dMethodDefInError = tokMethodDef;
bmtError->szMethodNameForError = NULL;
UINT idResWhy,
LPCUTF8 szMethodName)
{
- WRAPPER_NO_CONTRACT;
+ STANDARD_VM_CONTRACT;
bmtError->resIDWhy = idResWhy;
bmtError->dMethodDefInError = mdMethodDefNil;
bmtError->szMethodNameForError = szMethodName;
UINT idResWhy,
mdMethodDef tokMethodDef = mdMethodDefNil)
{
- WRAPPER_NO_CONTRACT;
+ STANDARD_VM_CONTRACT;
BuildMethodTableThrowException(COR_E_TYPELOAD, idResWhy, tokMethodDef);
}
UINT idResWhy,
LPCUTF8 szMethodName)
{
- WRAPPER_NO_CONTRACT;
+ STANDARD_VM_CONTRACT;
BuildMethodTableThrowException(COR_E_TYPELOAD, idResWhy, szMethodName);
}
#endif // FEATURE_READYTORUN_COMPILER
+BOOL CEECompileInfo::HasCustomAttribute(CORINFO_METHOD_HANDLE method, LPCSTR customAttributeName)
+{
+ STANDARD_VM_CONTRACT;
+
+ MethodDesc * pMD = GetMethod(method);
+ return S_OK == pMD->GetMDImport()->GetCustomAttributeByName(pMD->GetMemberDef(), customAttributeName, NULL, NULL);
+}
#define OMFConst_Read 0x0001
#define OMFConst_Write 0x0002
BOOL AreAllClassesFullyLoaded(CORINFO_MODULE_HANDLE moduleHandle);
#endif
+ BOOL HasCustomAttribute(CORINFO_METHOD_HANDLE method, LPCSTR customAttributeName);
+
//--------------------------------------------------------------------
// ZapperLoaderModules and the ZapperLoaderModuleTable
//
inline void Init()
{
+ LIMITED_METHOD_CONTRACT;
Eax = 0;
Ebx = 0;
Ecx = 0;
class ICorModuleInfo_Hack
{
public:
- virtual void ICorModuleInfo_Hack_dummy() { WRAPPER_NO_CONTRACT; UNREACHABLE(); };
+ virtual void ICorModuleInfo_Hack_dummy() { LIMITED_METHOD_CONTRACT; UNREACHABLE(); };
};
class ICorClassInfo_Hack
{
public:
- virtual void ICorClassInfo_Hack_dummy1() { WRAPPER_NO_CONTRACT; UNREACHABLE(); };
- virtual void ICorClassInfo_Hack_dummy2() { WRAPPER_NO_CONTRACT; UNREACHABLE(); };
- virtual void ICorClassInfo_Hack_dummy3() { WRAPPER_NO_CONTRACT; UNREACHABLE(); };
- virtual void ICorClassInfo_Hack_dummy4() { WRAPPER_NO_CONTRACT; UNREACHABLE(); };
- virtual void ICorClassInfo_Hack_dummy5() { WRAPPER_NO_CONTRACT; UNREACHABLE(); };
- virtual void ICorClassInfo_Hack_dummy6() { WRAPPER_NO_CONTRACT; UNREACHABLE(); };
- virtual void ICorClassInfo_Hack_dummy7() { WRAPPER_NO_CONTRACT; UNREACHABLE(); };
- virtual void ICorClassInfo_Hack_dummy8() { WRAPPER_NO_CONTRACT; UNREACHABLE(); };
- virtual void ICorClassInfo_Hack_dummy9() { WRAPPER_NO_CONTRACT; UNREACHABLE(); };
- virtual void ICorClassInfo_Hack_dummy10() { WRAPPER_NO_CONTRACT; UNREACHABLE(); };
- virtual void ICorClassInfo_Hack_dummy11() { WRAPPER_NO_CONTRACT; UNREACHABLE(); };
- virtual void ICorClassInfo_Hack_dummy12() { WRAPPER_NO_CONTRACT; UNREACHABLE(); };
- virtual void ICorClassInfo_Hack_dummy13() { WRAPPER_NO_CONTRACT; UNREACHABLE(); };
- virtual void ICorClassInfo_Hack_dummy14() { WRAPPER_NO_CONTRACT; UNREACHABLE(); };
+ virtual void ICorClassInfo_Hack_dummy1() { LIMITED_METHOD_CONTRACT; UNREACHABLE(); };
+ virtual void ICorClassInfo_Hack_dummy2() { LIMITED_METHOD_CONTRACT; UNREACHABLE(); };
+ virtual void ICorClassInfo_Hack_dummy3() { LIMITED_METHOD_CONTRACT; UNREACHABLE(); };
+ virtual void ICorClassInfo_Hack_dummy4() { LIMITED_METHOD_CONTRACT; UNREACHABLE(); };
+ virtual void ICorClassInfo_Hack_dummy5() { LIMITED_METHOD_CONTRACT; UNREACHABLE(); };
+ virtual void ICorClassInfo_Hack_dummy6() { LIMITED_METHOD_CONTRACT; UNREACHABLE(); };
+ virtual void ICorClassInfo_Hack_dummy7() { LIMITED_METHOD_CONTRACT; UNREACHABLE(); };
+ virtual void ICorClassInfo_Hack_dummy8() { LIMITED_METHOD_CONTRACT; UNREACHABLE(); };
+ virtual void ICorClassInfo_Hack_dummy9() { LIMITED_METHOD_CONTRACT; UNREACHABLE(); };
+ virtual void ICorClassInfo_Hack_dummy10() { LIMITED_METHOD_CONTRACT; UNREACHABLE(); };
+ virtual void ICorClassInfo_Hack_dummy11() { LIMITED_METHOD_CONTRACT; UNREACHABLE(); };
+ virtual void ICorClassInfo_Hack_dummy12() { LIMITED_METHOD_CONTRACT; UNREACHABLE(); };
+ virtual void ICorClassInfo_Hack_dummy13() { LIMITED_METHOD_CONTRACT; UNREACHABLE(); };
+ virtual void ICorClassInfo_Hack_dummy14() { LIMITED_METHOD_CONTRACT; UNREACHABLE(); };
virtual mdMethodDef __stdcall ICorClassInfo_Hack_getMethodDefFromMethod(CORINFO_METHOD_HANDLE hMethod) = 0;
};
class ICorStaticInfo_Hack : public virtual ICorMethodInfo_Hack, public virtual ICorModuleInfo_Hack, public virtual ICorClassInfo_Hack
{
- virtual void ICorStaticInfo_Hack_dummy() { WRAPPER_NO_CONTRACT; UNREACHABLE(); };
+ virtual void ICorStaticInfo_Hack_dummy() { LIMITED_METHOD_CONTRACT; UNREACHABLE(); };
};
#endif // FEATURE_CORECLR
IJWNOADThunk::IJWNOADThunk(HMODULE pModulebase, DWORD dwIndex, mdToken Token)
{
- WRAPPER_NO_CONTRACT;
+ LIMITED_METHOD_CONTRACT;
m_pModulebase=pModulebase;
m_dwIndex=dwIndex;
m_Token=Token;
void DECLSPEC_NORETURN PEImage::ThrowFormat(HRESULT hrError)
{
- WRAPPER_NO_CONTRACT;
+ CONTRACTL
+ {
+ GC_TRIGGERS;
+ THROWS;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
EEFileLoadException::Throw(m_path, hrError);
}
inline const SString &PEImageLayout::GetPath()
{
+ LIMITED_METHOD_CONTRACT;
return m_pOwner?m_pOwner->GetPath():SString::Empty();
}
FieldDesc* pOptionalTargetField,
MethodTable * pOptionalTargetType)
{
+ WRAPPER_NO_CONTRACT;
return SecurityTransparent::CheckCriticalAccess(pContext,
pOptionalTargetMethod,
pOptionalTargetField,
/*******************************************************************/
const char* FormatSig(MethodDesc* pMD, AppDomain *pDomain, AllocMemTracker *pamTracker)
{
- WRAPPER_NO_CONTRACT;
+ CONTRACTL
+ {
+ THROWS;
+ GC_NOTRIGGER;
+ }
+ CONTRACTL_END;
+
return FormatSig(pMD,pDomain->GetLowFrequencyHeap(),pamTracker);
}
#endif
if (m_zapper->m_pOpt->m_onlyOneMethod && (m_zapper->m_pOpt->m_onlyOneMethod != md))
return NOT_COMPILED;
+ if (GetCompileInfo()->HasCustomAttribute(handle, "System.Runtime.BypassNGenAttribute"))
+ return NOT_COMPILED;
+
#ifdef MDIL
// This is a quick workaround to opt specific methods out of MDIL generation to work around bugs.
if (m_zapper->m_pOpt->m_compilerFlags & CORJIT_FLG_MDIL)
{
- HRESULT hr = m_pMDImport->GetCustomAttributeByName(md, "System.Runtime.BypassMdilAttribute", NULL, NULL);
- if (hr == S_OK)
+ if (GetCompileInfo()->HasCustomAttribute(handle, "System.Runtime.BypassMdilAttribute"))
return NOT_COMPILED;
}
#endif
// This is a quick workaround to opt specific methods out of ReadyToRun compilation to work around bugs.
if (IsReadyToRunCompilation())
{
- HRESULT hr = m_pMDImport->GetCustomAttributeByName(md, "System.Runtime.BypassReadyToRun", NULL, NULL);
- if (hr == S_OK)
+ if (GetCompileInfo()->HasCustomAttribute(handle, "System.Runtime.BypassReadyToRunAttribute"))
return NOT_COMPILED;
}
#endif