Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions src/gc/env/gcenv.structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,6 @@ class EEThreadId

#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 {
Expand Down
19 changes: 15 additions & 4 deletions src/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ inline BOOL ShouldTrackMovementForProfilerOrEtw()
}
#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
Expand Down Expand Up @@ -15285,10 +15289,14 @@ void gc_heap::gc1()
#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
)
{
Expand Down Expand Up @@ -15331,7 +15339,7 @@ void gc_heap::gc1()
#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();
}
Expand Down Expand Up @@ -16402,8 +16410,7 @@ int gc_heap::garbage_collect (int n)
}

{
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);
Expand Down Expand Up @@ -31185,6 +31192,10 @@ void gc_heap::background_sweep()
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
Expand Down
8 changes: 4 additions & 4 deletions src/gc/gcpriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ inline void FATAL_GC_ERROR()

#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
Expand Down
2 changes: 2 additions & 0 deletions src/inc/corcompile.h
Original file line number Diff line number Diff line change
Expand Up @@ -1924,6 +1924,8 @@ class ICorCompileInfo

virtual BOOL AreAllClassesFullyLoaded(CORINFO_MODULE_HANDLE moduleHandle) = 0;
#endif

virtual BOOL HasCustomAttribute(CORINFO_METHOD_HANDLE method, LPCSTR customAttributeName) = 0;
};

/*****************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion src/vm/appdomainstack.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class AppDomainStack
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);
}

Expand Down
8 changes: 4 additions & 4 deletions src/vm/classcompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ class MethodTableBuilder
UINT idResWhy,
mdMethodDef tokMethodDef)
{
WRAPPER_NO_CONTRACT;
STANDARD_VM_CONTRACT;
bmtError->resIDWhy = idResWhy;
bmtError->dMethodDefInError = tokMethodDef;
bmtError->szMethodNameForError = NULL;
Expand All @@ -647,7 +647,7 @@ class MethodTableBuilder
UINT idResWhy,
LPCUTF8 szMethodName)
{
WRAPPER_NO_CONTRACT;
STANDARD_VM_CONTRACT;
bmtError->resIDWhy = idResWhy;
bmtError->dMethodDefInError = mdMethodDefNil;
bmtError->szMethodNameForError = szMethodName;
Expand All @@ -659,15 +659,15 @@ class MethodTableBuilder
UINT idResWhy,
mdMethodDef tokMethodDef = mdMethodDefNil)
{
WRAPPER_NO_CONTRACT;
STANDARD_VM_CONTRACT;
BuildMethodTableThrowException(COR_E_TYPELOAD, idResWhy, tokMethodDef);
}

inline VOID DECLSPEC_NORETURN BuildMethodTableThrowException(
UINT idResWhy,
LPCUTF8 szMethodName)
{
WRAPPER_NO_CONTRACT;
STANDARD_VM_CONTRACT;
BuildMethodTableThrowException(COR_E_TYPELOAD, idResWhy, szMethodName);
}

Expand Down
7 changes: 7 additions & 0 deletions src/vm/compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2657,6 +2657,13 @@ BOOL CEECompileInfo::AreAllClassesFullyLoaded(CORINFO_MODULE_HANDLE moduleHandle

#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
Expand Down
2 changes: 2 additions & 0 deletions src/vm/compile.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,8 @@ class CEECompileInfo : public ICorCompileInfo
BOOL AreAllClassesFullyLoaded(CORINFO_MODULE_HANDLE moduleHandle);
#endif

BOOL HasCustomAttribute(CORINFO_METHOD_HANDLE method, LPCSTR customAttributeName);

//--------------------------------------------------------------------
// ZapperLoaderModules and the ZapperLoaderModuleTable
//
Expand Down
1 change: 1 addition & 0 deletions src/vm/i386/cgencpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ struct EHContext {

inline void Init()
{
LIMITED_METHOD_CONTRACT;
Eax = 0;
Ebx = 0;
Ecx = 0;
Expand Down
32 changes: 16 additions & 16 deletions src/vm/jitinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,33 +406,33 @@ class ICorMethodInfo_Hack
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
Expand Down
2 changes: 1 addition & 1 deletion src/vm/mixedmode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

IJWNOADThunk::IJWNOADThunk(HMODULE pModulebase, DWORD dwIndex, mdToken Token)
{
WRAPPER_NO_CONTRACT;
LIMITED_METHOD_CONTRACT;
m_pModulebase=pModulebase;
m_dwIndex=dwIndex;
m_Token=Token;
Expand Down
9 changes: 8 additions & 1 deletion src/vm/peimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,14 @@ void PEImage::VerifyIsILOrNIAssembly(BOOL fIL)

void DECLSPEC_NORETURN PEImage::ThrowFormat(HRESULT hrError)
{
WRAPPER_NO_CONTRACT;
CONTRACTL
{
GC_TRIGGERS;
THROWS;
MODE_ANY;
}
CONTRACTL_END;

EEFileLoadException::Throw(m_path, hrError);
}

Expand Down
1 change: 1 addition & 0 deletions src/vm/peimagelayout.inl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

inline const SString &PEImageLayout::GetPath()
{
LIMITED_METHOD_CONTRACT;
return m_pOwner?m_pOwner->GetPath():SString::Empty();
}

Expand Down
1 change: 1 addition & 0 deletions src/vm/security.inl
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ inline BOOL Security::CheckCriticalAccess(AccessCheckContext* pContext,
FieldDesc* pOptionalTargetField,
MethodTable * pOptionalTargetType)
{
WRAPPER_NO_CONTRACT;
return SecurityTransparent::CheckCriticalAccess(pContext,
pOptionalTargetMethod,
pOptionalTargetField,
Expand Down
8 changes: 7 additions & 1 deletion src/vm/sigformat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,13 @@ const char* FormatSig(MethodDesc * pMD, LoaderHeap * pHeap, AllocMemTracker * pa
/*******************************************************************/
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
Expand Down
9 changes: 5 additions & 4 deletions src/zap/zapimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3752,12 +3752,14 @@ ZapImage::CompileStatus ZapImage::TryCompileMethodWorker(CORINFO_METHOD_HANDLE h
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
Expand All @@ -3766,8 +3768,7 @@ ZapImage::CompileStatus ZapImage::TryCompileMethodWorker(CORINFO_METHOD_HANDLE h
// 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
Expand Down