Skip to content
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
12 changes: 0 additions & 12 deletions src/coreclr/md/inc/metamodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,18 +477,6 @@ class CMiniMdBase : public IMetaModelCommonRO
return GET_UNALIGNED_VAL32(pVal);
}

inline static ULONG getIX_NoLogging(const void *pRec, CMiniColDef &def)
{
PVOID pVal = (BYTE *)pRec + def.m_oColumn;
if (def.m_cbColumn == 2)
{
ULONG ix = GET_UNALIGNED_VAL16(pVal);
return ix;
}
_ASSERTE(def.m_cbColumn == 4);
return GET_UNALIGNED_VAL32(pVal);
}

// Pull four bytes out of a record.
FORCEINLINE static ULONG getI1(const void *pRec, CMiniColDef &def)
{
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/md/runtime/metamodelro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ CMiniMd::vSearchTable(
{ // Look at the one in the middle.
mid = (lo + hi) / 2;
IfFailRet(getRow(ixTbl, mid, &pRow));
val = getIX_NoLogging(pRow, sColumn);
val = getIX(pRow, sColumn);
// If equal to the target, done.
if (val == ulTarget)
{
Expand Down Expand Up @@ -318,7 +318,7 @@ CMiniMd::vSearchTableNotGreater(
{ // Look at the one in the middle.
mid = (lo + hi) / 2;
IfFailRet(getRow(ixTbl, mid, &pRow));
val = getIX_NoLogging(pRow, sColumn);
val = getIX(pRow, sColumn);
// If equal to the target, done searching.
if (val == ulTarget)
break;
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/vm/callhelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void AssertMulticoreJitAllowedModule(PCODE pTarget)
{
MethodDesc* pMethod = Entry2MethodDesc(pTarget, NULL);

Module * pModule = pMethod->GetModule_NoLogging();
Module * pModule = pMethod->GetModule();

_ASSERTE(pModule->IsSystem());
}
Expand Down Expand Up @@ -357,7 +357,7 @@ void MethodDescCallSite::CallTargetWorker(const ARG_SLOT *pArguments, ARG_SLOT *
{
TypeHandle th = m_methodSig.GetLastTypeHandleThrowing(ClassLoader::DontLoadTypes);
CONSISTENCY_CHECK(th.CheckFullyLoaded());
CONSISTENCY_CHECK(th.IsRestored_NoLogging());
CONSISTENCY_CHECK(th.IsRestored());
}
}
m_methodSig.Reset();
Expand Down
14 changes: 7 additions & 7 deletions src/coreclr/vm/class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2090,7 +2090,7 @@ TypeHandle MethodTable::SetupCoClassForInterface()
CoClassType = TypeName::GetTypeReferencedByCustomAttribute(ss.GetUnicode(), GetAssembly());

// Cache the coclass type
GetClass_NoLogging()->SetCoClassForInterface(CoClassType);
GetClass()->SetCoClassForInterface(CoClassType);
}
return CoClassType;
}
Expand Down Expand Up @@ -2456,7 +2456,7 @@ CorIfaceAttr MethodTable::GetComInterfaceType()
}

// Cache the interface type
GetClass_NoLogging()->SetComInterfaceType(ItfType);
GetClass()->SetComInterfaceType(ItfType);

return ItfType;
}
Expand Down Expand Up @@ -2542,14 +2542,14 @@ void MethodTable::DebugRecursivelyDumpInstanceFields(LPCUTF8 pszClassName, BOOL
{
FieldDesc *pFD = &GetClass()->GetFieldDescList()[i];
#ifdef DEBUG_LAYOUT
printf("offset %s%3d %s\n", pFD->IsByValue() ? "byvalue " : "", pFD->GetOffset_NoLogging(), pFD->GetName());
printf("offset %s%3d %s\n", pFD->IsByValue() ? "byvalue " : "", pFD->GetOffset(), pFD->GetName());
#endif
if(debug) {
ssBuff.Printf("offset %3d %s\n", pFD->GetOffset_NoLogging(), pFD->GetName());
ssBuff.Printf("offset %3d %s\n", pFD->GetOffset(), pFD->GetName());
OutputDebugStringUtf8(ssBuff.GetUTF8());
}
else {
LOG((LF_CLASSLOADER, LL_ALWAYS, "offset %3d %s\n", pFD->GetOffset_NoLogging(), pFD->GetName()));
LOG((LF_CLASSLOADER, LL_ALWAYS, "offset %3d %s\n", pFD->GetOffset(), pFD->GetName()));
}
}
}
Expand Down Expand Up @@ -2621,13 +2621,13 @@ void MethodTable::DebugDumpFieldLayout(LPCUTF8 pszClassName, BOOL debug)
{
FieldDesc *pFD = GetClass()->GetFieldDescList() + ((GetNumInstanceFields()-cParentInstanceFields) + i);
if(debug) {
ssBuff.Printf("offset %3d %s\n", pFD->GetOffset_NoLogging(), pFD->GetName());
ssBuff.Printf("offset %3d %s\n", pFD->GetOffset(), pFD->GetName());
OutputDebugStringUtf8(ssBuff.GetUTF8());
}
else
{
//LF_ALWAYS allowed here because this is controlled by special env var ShouldDumpOnClassLoad
LOG((LF_ALWAYS, LL_ALWAYS, "offset %3d %s\n", pFD->GetOffset_NoLogging(), pFD->GetName()));
LOG((LF_ALWAYS, LL_ALWAYS, "offset %3d %s\n", pFD->GetOffset(), pFD->GetName()));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/classlayoutinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ EEClassNativeLayoutInfo* EEClassNativeLayoutInfo::CollectNativeLayoutFieldMetada
{
for (UINT i = 0; i < cInstanceFields; i++)
{
_ASSERTE(pNativeFieldDescriptors[i].GetExternalOffset() == pNativeFieldDescriptors[i].GetFieldDesc()->GetOffset_NoLogging());
_ASSERTE(pNativeFieldDescriptors[i].GetExternalOffset() == pNativeFieldDescriptors[i].GetFieldDesc()->GetOffset());
_ASSERTE(pNativeFieldDescriptors[i].NativeSize() == pNativeFieldDescriptors[i].GetFieldDesc()->GetSize());
}
_ASSERTE(pNativeLayoutInfo->GetSize() == pEEClassLayoutInfo->GetManagedSize());
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/dllimport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ class ILStubState : public StubState
if (pTargetMD)
{
pTargetMD->GetMethodInfoWithNewSig(strNamespaceOrClassName, strMethodName, strMethodSignature);
uModuleId = (UINT64)(TADDR)pTargetMD->GetModule_NoLogging();
uModuleId = (UINT64)(TADDR)pTargetMD->GetModule();
}

//
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/dwbucketmanager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ bool BaseBucketParamsManager::IsCodeContractsFrame(MethodDesc* pMD)
if (!pMD)
return false;

MethodTable* pMT = pMD->GetMethodTable_NoLogging();
MethodTable* pMT = pMD->GetMethodTable();
LPCUTF8 pszNamespace = NULL;
LPCUTF8 pszName = NULL;
pszName = pMT->GetFullyQualifiedNameInfo(&pszNamespace);
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/dwreport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ ContractFailureKind GetContractFailureKind(OBJECTREF obj)
// getting closer, now look for all three fields on ContractException
const int requiredFieldMatches = 3;

PTR_EEClass pEEClass = pMT->GetClass_NoLogging();
PTR_EEClass pEEClass = pMT->GetClass();

PTR_FieldDesc pFD = pEEClass->GetFieldDescList();
PTR_FieldDesc pFDEnd = pFD + numFields;
Expand Down
36 changes: 18 additions & 18 deletions src/coreclr/vm/eventtrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3454,22 +3454,22 @@ VOID ETW::MethodLog::LogMethodInstrumentationData(MethodDesc* method, uint32_t c
}

ULONG ulMethodToken=0;
auto pModule = method->GetModule_NoLogging();
auto pModule = method->GetModule();
bool bIsDynamicMethod = method->IsDynamicMethod();
BOOL bIsGenericMethod = FALSE;
if(method->GetMethodTable_NoLogging())
bIsGenericMethod = method->HasClassOrMethodInstantiation_NoLogging();
if(method->GetMethodTable())
bIsGenericMethod = method->HasClassOrMethodInstantiation();

// Use MethodDesc if Dynamic or Generic methods
if( bIsDynamicMethod || bIsGenericMethod)
{
if(bIsGenericMethod)
ulMethodToken = (ULONG)method->GetMemberDef_NoLogging();
ulMethodToken = (ULONG)method->GetMemberDef();
if(bIsDynamicMethod) // if its a generic and a dynamic method, we would set the methodtoken to 0
ulMethodToken = (ULONG)0;
}
else
ulMethodToken = (ULONG)method->GetMemberDef_NoLogging();
ulMethodToken = (ULONG)method->GetMemberDef();

SString tNamespace, tMethodName, tMethodSignature;
method->GetMethodInfo(tNamespace, tMethodName, tMethodSignature);
Expand Down Expand Up @@ -3684,7 +3684,7 @@ VOID ETW::MethodLog::MethodTableRestored(MethodTable *pMethodTable)
for (; iter.IsValid(); iter.Next())
{
MethodDesc *pMD = (MethodDesc *)(iter.GetMethodDesc());
if(pMD && pMD->GetMethodTable_NoLogging() == pMethodTable)
if(pMD && pMD->GetMethodTable() == pMethodTable)
ETW::MethodLog::SendMethodEvent(pMD, ETW::EnumerationLog::EnumerationStructs::NgenMethodLoad, FALSE);
}
}
Expand Down Expand Up @@ -4463,7 +4463,7 @@ VOID ETW::MethodLog::SendMethodDetailsEvent(MethodDesc *pMethodDesc)

BulkTypeEventLogger typeLogger;

ULONGLONG typeID = (ULONGLONG)pMethodDesc->GetMethodTable_NoLogging();
ULONGLONG typeID = (ULONGLONG)pMethodDesc->GetMethodTable();
ETW::TypeSystemLog::LogTypeAndParametersIfNecessary(&typeLogger, typeID, ETW::TypeSystemLog::kTypeLogBehaviorAlwaysLog);
ULONGLONG loaderModuleID = (ULONGLONG)pMethodDesc->GetLoaderModule();

Expand Down Expand Up @@ -4498,7 +4498,7 @@ VOID ETW::MethodLog::SendMethodDetailsEvent(MethodDesc *pMethodDesc)

FireEtwMethodDetails((ULONGLONG)pMethodDesc, // MethodID
typeID, // MethodType
pMethodDesc->GetMemberDef_NoLogging(), // MethodToken
pMethodDesc->GetMemberDef(), // MethodToken
cParams,
loaderModuleID,
rgTypeParameters.OpenRawBuffer());
Expand Down Expand Up @@ -4545,14 +4545,14 @@ VOID ETW::MethodLog::SendMethodJitStartEvent(MethodDesc *pMethodDesc, SString *n
PCWSTR szDtraceOutput1=W(""),szDtraceOutput2=W(""),szDtraceOutput3=W("");

if(pMethodDesc) {
pModule = pMethodDesc->GetModule_NoLogging();
pModule = pMethodDesc->GetModule();

SendMethodDetailsEvent(pMethodDesc);

bool bIsDynamicMethod = pMethodDesc->IsDynamicMethod();
BOOL bIsGenericMethod = FALSE;
if(pMethodDesc->GetMethodTable_NoLogging())
bIsGenericMethod = pMethodDesc->HasClassOrMethodInstantiation_NoLogging();
if(pMethodDesc->GetMethodTable())
bIsGenericMethod = pMethodDesc->HasClassOrMethodInstantiation();

ullModuleID = (ULONGLONG)(TADDR) pModule;
ullMethodIdentifier = (ULONGLONG)pMethodDesc;
Expand All @@ -4561,12 +4561,12 @@ VOID ETW::MethodLog::SendMethodJitStartEvent(MethodDesc *pMethodDesc, SString *n
if( bIsDynamicMethod || bIsGenericMethod)
{
if(bIsGenericMethod)
ulMethodToken = (ULONG)pMethodDesc->GetMemberDef_NoLogging();
ulMethodToken = (ULONG)pMethodDesc->GetMemberDef();
if(bIsDynamicMethod) // if its a generic and a dynamic method, we would set the methodtoken to 0
ulMethodToken = (ULONG)0;
}
else
ulMethodToken = (ULONG)pMethodDesc->GetMemberDef_NoLogging();
ulMethodToken = (ULONG)pMethodDesc->GetMemberDef();

if(pMethodDesc->IsIL())
{
Expand Down Expand Up @@ -4645,12 +4645,12 @@ VOID ETW::MethodLog::SendMethodEvent(MethodDesc *pMethodDesc, DWORD dwEventOptio
KEYWORDZERO);
}

pModule = pMethodDesc->GetModule_NoLogging();
pModule = pMethodDesc->GetModule();
bIsDynamicMethod = (BOOL)pMethodDesc->IsDynamicMethod();
bHasSharedGenericCode = pMethodDesc->IsSharedByGenericInstantiations();

if(pMethodDesc->GetMethodTable_NoLogging())
bIsGenericMethod = pMethodDesc->HasClassOrMethodInstantiation_NoLogging();
if(pMethodDesc->GetMethodTable())
bIsGenericMethod = pMethodDesc->HasClassOrMethodInstantiation();

NativeCodeVersionId nativeCodeId = 0;
ulMethodFlags = ulMethodFlags |
Expand Down Expand Up @@ -4711,12 +4711,12 @@ VOID ETW::MethodLog::SendMethodEvent(MethodDesc *pMethodDesc, DWORD dwEventOptio
{
bShowVerboseOutput = TRUE;
if(bIsGenericMethod)
ulMethodToken = (ULONG)pMethodDesc->GetMemberDef_NoLogging();
ulMethodToken = (ULONG)pMethodDesc->GetMemberDef();
if(bIsDynamicMethod) // if its a generic and a dynamic method, we would set the methodtoken to 0
ulMethodToken = (ULONG)0;
}
else
ulMethodToken = (ULONG)pMethodDesc->GetMemberDef_NoLogging();
ulMethodToken = (ULONG)pMethodDesc->GetMemberDef();

SString tNamespace, tMethodName, tMethodSignature;

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ PTR_VOID FieldDesc::GetStaticAddressHandle(PTR_VOID base)
MODE_ANY;
FORBID_FAULT;
PRECONDITION(IsStatic());
PRECONDITION(GetEnclosingMethodTable()->IsRestored_NoLogging());
PRECONDITION(GetEnclosingMethodTable()->IsRestored());
}
CONTRACTL_END

Expand Down
18 changes: 3 additions & 15 deletions src/coreclr/vm/field.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,9 @@ class FieldDesc
return m_dwOffset;
}

DWORD GetOffset()
{
LIMITED_METHOD_DAC_CONTRACT;
return GetOffset_NoLogging();
}

// During class load m_pMTOfEnclosingClass has the field size in it, so it has to use this version of
// GetOffset during that time
DWORD GetOffset_NoLogging()
DWORD GetOffset()
{
LIMITED_METHOD_DAC_CONTRACT;

Expand All @@ -191,7 +185,7 @@ class FieldDesc
//
// As of 4/11/2012 I could repro this by turning on the COMPLUS log and
// the LOG() at line methodtablebuilder.cpp:7845
// MethodTableBuilder::PlaceRegularStaticFields() calls GetOffset_NoLogging()
// MethodTableBuilder::PlaceRegularStaticFields() calls GetOffset()
if((DWORD)(DWORD_PTR&)m_pMTOfEnclosingClass > 16)
{
_ASSERTE(!this->IsRVA() || (m_dwOffset == OutOfLine_BigRVAOffset()));
Expand Down Expand Up @@ -353,16 +347,10 @@ class FieldDesc
__int64 GetValue64(OBJECTREF o);
VOID SetValue64(OBJECTREF o, __int64 value);

PTR_MethodTable GetApproxEnclosingMethodTable_NoLogging()
{
LIMITED_METHOD_DAC_CONTRACT;
return m_pMTOfEnclosingClass;
}

PTR_MethodTable GetApproxEnclosingMethodTable()
{
LIMITED_METHOD_DAC_CONTRACT;
return GetApproxEnclosingMethodTable_NoLogging();
return m_pMTOfEnclosingClass;
}

PTR_MethodTable GetEnclosingMethodTable()
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/vm/genmeth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static MethodDesc* CreateMethodDesc(LoaderAllocator *pAllocator,
PRECONDITION(CheckPointer(pAllocator));
PRECONDITION(CheckPointer(pMT));
PRECONDITION(CheckPointer(pTemplateMD));
PRECONDITION(pMT->IsRestored_NoLogging());
PRECONDITION(pMT->IsRestored());
PRECONDITION(pTemplateMD->GetMethodTable()->GetCanonicalMethodTable() == pMT->GetCanonicalMethodTable());
}
CONTRACTL_END
Expand Down Expand Up @@ -731,7 +731,7 @@ MethodDesc::FindOrCreateAssociatedMethodDesc(MethodDesc* pDefMD,

PRECONDITION(CheckPointer(pDefMD));
PRECONDITION(CheckPointer(pExactMT));
PRECONDITION(pExactMT->IsRestored_NoLogging());
PRECONDITION(pExactMT->IsRestored());

// If the method descriptor belongs to a generic type then
// the input exact type must be an instantiation of that type.
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9637,7 +9637,7 @@ void Interpreter::DoCallWork(bool virtualCall, void* thisArg, CORINFO_RESOLVED_T
{
TypeHandle th = ms.GetLastTypeHandleThrowing(ClassLoader::LoadTypes);
CONSISTENCY_CHECK(th.CheckFullyLoaded());
CONSISTENCY_CHECK(th.IsRestored_NoLogging());
CONSISTENCY_CHECK(th.IsRestored());
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/vm/jithelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2454,7 +2454,7 @@ HCIMPL1(Object*, JIT_New, CORINFO_CLASS_HANDLE typeHnd_)

_ASSERTE(!typeHnd.IsTypeDesc()); // heap objects must have method tables
MethodTable *pMT = typeHnd.AsMethodTable();
_ASSERTE(pMT->IsRestored_NoLogging());
_ASSERTE(pMT->IsRestored());

#ifdef _DEBUG
if (g_pConfig->FastGCStressLevel()) {
Expand All @@ -2481,7 +2481,7 @@ HCIMPL1(Object*, JIT_NewMaybeFrozen, CORINFO_CLASS_HANDLE typeHnd_)

_ASSERTE(!typeHnd.IsTypeDesc()); // heap objects must have method tables
MethodTable* pMT = typeHnd.AsMethodTable();
_ASSERTE(pMT->IsRestored_NoLogging());
_ASSERTE(pMT->IsRestored());

#ifdef _DEBUG
if (g_pConfig->FastGCStressLevel()) {
Expand Down
Loading