Skip to content

Commit 43e47b8

Browse files
jasper-djkotas
andauthored
Remove _NoLogging methods from VM (#89641)
* Remove getIX_NoLogging * Remove GetModule_NoLogging * Remove IsRestored_NoLogging * Remove GetOffset_NoLogging * Remove GetMethodTable_NoLogging * Remove HasClass[OrMethod]Instantiation_NoLogging * Remove GetNumVirtuals_NoLogging * Remove GetWriteableData[ForWrite]_NoLogging * Remove GetMemberDef_NoLogging * Remove GetApproxEnclosingMethodTable_NoLogging * Remove GetTypeDefRid_NoLogging * Remove GetCl_NoLogging * Rename GetClass_NoLogging and remove old GetClassWithPossibleAV * Update src/coreclr/vm/methodtable.h Co-authored-by: Jan Kotas <jkotas@microsoft.com>
1 parent 60cc345 commit 43e47b8

30 files changed

+132
-292
lines changed

src/coreclr/md/inc/metamodel.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -477,18 +477,6 @@ class CMiniMdBase : public IMetaModelCommonRO
477477
return GET_UNALIGNED_VAL32(pVal);
478478
}
479479

480-
inline static ULONG getIX_NoLogging(const void *pRec, CMiniColDef &def)
481-
{
482-
PVOID pVal = (BYTE *)pRec + def.m_oColumn;
483-
if (def.m_cbColumn == 2)
484-
{
485-
ULONG ix = GET_UNALIGNED_VAL16(pVal);
486-
return ix;
487-
}
488-
_ASSERTE(def.m_cbColumn == 4);
489-
return GET_UNALIGNED_VAL32(pVal);
490-
}
491-
492480
// Pull four bytes out of a record.
493481
FORCEINLINE static ULONG getI1(const void *pRec, CMiniColDef &def)
494482
{

src/coreclr/md/runtime/metamodelro.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ CMiniMd::vSearchTable(
264264
{ // Look at the one in the middle.
265265
mid = (lo + hi) / 2;
266266
IfFailRet(getRow(ixTbl, mid, &pRow));
267-
val = getIX_NoLogging(pRow, sColumn);
267+
val = getIX(pRow, sColumn);
268268
// If equal to the target, done.
269269
if (val == ulTarget)
270270
{
@@ -318,7 +318,7 @@ CMiniMd::vSearchTableNotGreater(
318318
{ // Look at the one in the middle.
319319
mid = (lo + hi) / 2;
320320
IfFailRet(getRow(ixTbl, mid, &pRow));
321-
val = getIX_NoLogging(pRow, sColumn);
321+
val = getIX(pRow, sColumn);
322322
// If equal to the target, done searching.
323323
if (val == ulTarget)
324324
break;

src/coreclr/vm/callhelpers.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void AssertMulticoreJitAllowedModule(PCODE pTarget)
2626
{
2727
MethodDesc* pMethod = Entry2MethodDesc(pTarget, NULL);
2828

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

3131
_ASSERTE(pModule->IsSystem());
3232
}
@@ -357,7 +357,7 @@ void MethodDescCallSite::CallTargetWorker(const ARG_SLOT *pArguments, ARG_SLOT *
357357
{
358358
TypeHandle th = m_methodSig.GetLastTypeHandleThrowing(ClassLoader::DontLoadTypes);
359359
CONSISTENCY_CHECK(th.CheckFullyLoaded());
360-
CONSISTENCY_CHECK(th.IsRestored_NoLogging());
360+
CONSISTENCY_CHECK(th.IsRestored());
361361
}
362362
}
363363
m_methodSig.Reset();

src/coreclr/vm/class.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2090,7 +2090,7 @@ TypeHandle MethodTable::SetupCoClassForInterface()
20902090
CoClassType = TypeName::GetTypeReferencedByCustomAttribute(ss.GetUnicode(), GetAssembly());
20912091

20922092
// Cache the coclass type
2093-
GetClass_NoLogging()->SetCoClassForInterface(CoClassType);
2093+
GetClass()->SetCoClassForInterface(CoClassType);
20942094
}
20952095
return CoClassType;
20962096
}
@@ -2456,7 +2456,7 @@ CorIfaceAttr MethodTable::GetComInterfaceType()
24562456
}
24572457

24582458
// Cache the interface type
2459-
GetClass_NoLogging()->SetComInterfaceType(ItfType);
2459+
GetClass()->SetComInterfaceType(ItfType);
24602460

24612461
return ItfType;
24622462
}
@@ -2542,14 +2542,14 @@ void MethodTable::DebugRecursivelyDumpInstanceFields(LPCUTF8 pszClassName, BOOL
25422542
{
25432543
FieldDesc *pFD = &GetClass()->GetFieldDescList()[i];
25442544
#ifdef DEBUG_LAYOUT
2545-
printf("offset %s%3d %s\n", pFD->IsByValue() ? "byvalue " : "", pFD->GetOffset_NoLogging(), pFD->GetName());
2545+
printf("offset %s%3d %s\n", pFD->IsByValue() ? "byvalue " : "", pFD->GetOffset(), pFD->GetName());
25462546
#endif
25472547
if(debug) {
2548-
ssBuff.Printf("offset %3d %s\n", pFD->GetOffset_NoLogging(), pFD->GetName());
2548+
ssBuff.Printf("offset %3d %s\n", pFD->GetOffset(), pFD->GetName());
25492549
OutputDebugStringUtf8(ssBuff.GetUTF8());
25502550
}
25512551
else {
2552-
LOG((LF_CLASSLOADER, LL_ALWAYS, "offset %3d %s\n", pFD->GetOffset_NoLogging(), pFD->GetName()));
2552+
LOG((LF_CLASSLOADER, LL_ALWAYS, "offset %3d %s\n", pFD->GetOffset(), pFD->GetName()));
25532553
}
25542554
}
25552555
}
@@ -2621,13 +2621,13 @@ void MethodTable::DebugDumpFieldLayout(LPCUTF8 pszClassName, BOOL debug)
26212621
{
26222622
FieldDesc *pFD = GetClass()->GetFieldDescList() + ((GetNumInstanceFields()-cParentInstanceFields) + i);
26232623
if(debug) {
2624-
ssBuff.Printf("offset %3d %s\n", pFD->GetOffset_NoLogging(), pFD->GetName());
2624+
ssBuff.Printf("offset %3d %s\n", pFD->GetOffset(), pFD->GetName());
26252625
OutputDebugStringUtf8(ssBuff.GetUTF8());
26262626
}
26272627
else
26282628
{
26292629
//LF_ALWAYS allowed here because this is controlled by special env var ShouldDumpOnClassLoad
2630-
LOG((LF_ALWAYS, LL_ALWAYS, "offset %3d %s\n", pFD->GetOffset_NoLogging(), pFD->GetName()));
2630+
LOG((LF_ALWAYS, LL_ALWAYS, "offset %3d %s\n", pFD->GetOffset(), pFD->GetName()));
26312631
}
26322632
}
26332633
}

src/coreclr/vm/classlayoutinfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ EEClassNativeLayoutInfo* EEClassNativeLayoutInfo::CollectNativeLayoutFieldMetada
10611061
{
10621062
for (UINT i = 0; i < cInstanceFields; i++)
10631063
{
1064-
_ASSERTE(pNativeFieldDescriptors[i].GetExternalOffset() == pNativeFieldDescriptors[i].GetFieldDesc()->GetOffset_NoLogging());
1064+
_ASSERTE(pNativeFieldDescriptors[i].GetExternalOffset() == pNativeFieldDescriptors[i].GetFieldDesc()->GetOffset());
10651065
_ASSERTE(pNativeFieldDescriptors[i].NativeSize() == pNativeFieldDescriptors[i].GetFieldDesc()->GetSize());
10661066
}
10671067
_ASSERTE(pNativeLayoutInfo->GetSize() == pEEClassLayoutInfo->GetManagedSize());

src/coreclr/vm/dllimport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ class ILStubState : public StubState
964964
if (pTargetMD)
965965
{
966966
pTargetMD->GetMethodInfoWithNewSig(strNamespaceOrClassName, strMethodName, strMethodSignature);
967-
uModuleId = (UINT64)(TADDR)pTargetMD->GetModule_NoLogging();
967+
uModuleId = (UINT64)(TADDR)pTargetMD->GetModule();
968968
}
969969

970970
//

src/coreclr/vm/dwbucketmanager.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ bool BaseBucketParamsManager::IsCodeContractsFrame(MethodDesc* pMD)
987987
if (!pMD)
988988
return false;
989989

990-
MethodTable* pMT = pMD->GetMethodTable_NoLogging();
990+
MethodTable* pMT = pMD->GetMethodTable();
991991
LPCUTF8 pszNamespace = NULL;
992992
LPCUTF8 pszName = NULL;
993993
pszName = pMT->GetFullyQualifiedNameInfo(&pszNamespace);

src/coreclr/vm/dwreport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ ContractFailureKind GetContractFailureKind(OBJECTREF obj)
10611061
// getting closer, now look for all three fields on ContractException
10621062
const int requiredFieldMatches = 3;
10631063

1064-
PTR_EEClass pEEClass = pMT->GetClass_NoLogging();
1064+
PTR_EEClass pEEClass = pMT->GetClass();
10651065

10661066
PTR_FieldDesc pFD = pEEClass->GetFieldDescList();
10671067
PTR_FieldDesc pFDEnd = pFD + numFields;

src/coreclr/vm/eventtrace.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3454,22 +3454,22 @@ VOID ETW::MethodLog::LogMethodInstrumentationData(MethodDesc* method, uint32_t c
34543454
}
34553455

34563456
ULONG ulMethodToken=0;
3457-
auto pModule = method->GetModule_NoLogging();
3457+
auto pModule = method->GetModule();
34583458
bool bIsDynamicMethod = method->IsDynamicMethod();
34593459
BOOL bIsGenericMethod = FALSE;
3460-
if(method->GetMethodTable_NoLogging())
3461-
bIsGenericMethod = method->HasClassOrMethodInstantiation_NoLogging();
3460+
if(method->GetMethodTable())
3461+
bIsGenericMethod = method->HasClassOrMethodInstantiation();
34623462

34633463
// Use MethodDesc if Dynamic or Generic methods
34643464
if( bIsDynamicMethod || bIsGenericMethod)
34653465
{
34663466
if(bIsGenericMethod)
3467-
ulMethodToken = (ULONG)method->GetMemberDef_NoLogging();
3467+
ulMethodToken = (ULONG)method->GetMemberDef();
34683468
if(bIsDynamicMethod) // if its a generic and a dynamic method, we would set the methodtoken to 0
34693469
ulMethodToken = (ULONG)0;
34703470
}
34713471
else
3472-
ulMethodToken = (ULONG)method->GetMemberDef_NoLogging();
3472+
ulMethodToken = (ULONG)method->GetMemberDef();
34733473

34743474
SString tNamespace, tMethodName, tMethodSignature;
34753475
method->GetMethodInfo(tNamespace, tMethodName, tMethodSignature);
@@ -3684,7 +3684,7 @@ VOID ETW::MethodLog::MethodTableRestored(MethodTable *pMethodTable)
36843684
for (; iter.IsValid(); iter.Next())
36853685
{
36863686
MethodDesc *pMD = (MethodDesc *)(iter.GetMethodDesc());
3687-
if(pMD && pMD->GetMethodTable_NoLogging() == pMethodTable)
3687+
if(pMD && pMD->GetMethodTable() == pMethodTable)
36883688
ETW::MethodLog::SendMethodEvent(pMD, ETW::EnumerationLog::EnumerationStructs::NgenMethodLoad, FALSE);
36893689
}
36903690
}
@@ -4463,7 +4463,7 @@ VOID ETW::MethodLog::SendMethodDetailsEvent(MethodDesc *pMethodDesc)
44634463

44644464
BulkTypeEventLogger typeLogger;
44654465

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

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

44994499
FireEtwMethodDetails((ULONGLONG)pMethodDesc, // MethodID
45004500
typeID, // MethodType
4501-
pMethodDesc->GetMemberDef_NoLogging(), // MethodToken
4501+
pMethodDesc->GetMemberDef(), // MethodToken
45024502
cParams,
45034503
loaderModuleID,
45044504
rgTypeParameters.OpenRawBuffer());
@@ -4545,14 +4545,14 @@ VOID ETW::MethodLog::SendMethodJitStartEvent(MethodDesc *pMethodDesc, SString *n
45454545
PCWSTR szDtraceOutput1=W(""),szDtraceOutput2=W(""),szDtraceOutput3=W("");
45464546

45474547
if(pMethodDesc) {
4548-
pModule = pMethodDesc->GetModule_NoLogging();
4548+
pModule = pMethodDesc->GetModule();
45494549

45504550
SendMethodDetailsEvent(pMethodDesc);
45514551

45524552
bool bIsDynamicMethod = pMethodDesc->IsDynamicMethod();
45534553
BOOL bIsGenericMethod = FALSE;
4554-
if(pMethodDesc->GetMethodTable_NoLogging())
4555-
bIsGenericMethod = pMethodDesc->HasClassOrMethodInstantiation_NoLogging();
4554+
if(pMethodDesc->GetMethodTable())
4555+
bIsGenericMethod = pMethodDesc->HasClassOrMethodInstantiation();
45564556

45574557
ullModuleID = (ULONGLONG)(TADDR) pModule;
45584558
ullMethodIdentifier = (ULONGLONG)pMethodDesc;
@@ -4561,12 +4561,12 @@ VOID ETW::MethodLog::SendMethodJitStartEvent(MethodDesc *pMethodDesc, SString *n
45614561
if( bIsDynamicMethod || bIsGenericMethod)
45624562
{
45634563
if(bIsGenericMethod)
4564-
ulMethodToken = (ULONG)pMethodDesc->GetMemberDef_NoLogging();
4564+
ulMethodToken = (ULONG)pMethodDesc->GetMemberDef();
45654565
if(bIsDynamicMethod) // if its a generic and a dynamic method, we would set the methodtoken to 0
45664566
ulMethodToken = (ULONG)0;
45674567
}
45684568
else
4569-
ulMethodToken = (ULONG)pMethodDesc->GetMemberDef_NoLogging();
4569+
ulMethodToken = (ULONG)pMethodDesc->GetMemberDef();
45704570

45714571
if(pMethodDesc->IsIL())
45724572
{
@@ -4645,12 +4645,12 @@ VOID ETW::MethodLog::SendMethodEvent(MethodDesc *pMethodDesc, DWORD dwEventOptio
46454645
KEYWORDZERO);
46464646
}
46474647

4648-
pModule = pMethodDesc->GetModule_NoLogging();
4648+
pModule = pMethodDesc->GetModule();
46494649
bIsDynamicMethod = (BOOL)pMethodDesc->IsDynamicMethod();
46504650
bHasSharedGenericCode = pMethodDesc->IsSharedByGenericInstantiations();
46514651

4652-
if(pMethodDesc->GetMethodTable_NoLogging())
4653-
bIsGenericMethod = pMethodDesc->HasClassOrMethodInstantiation_NoLogging();
4652+
if(pMethodDesc->GetMethodTable())
4653+
bIsGenericMethod = pMethodDesc->HasClassOrMethodInstantiation();
46544654

46554655
NativeCodeVersionId nativeCodeId = 0;
46564656
ulMethodFlags = ulMethodFlags |
@@ -4711,12 +4711,12 @@ VOID ETW::MethodLog::SendMethodEvent(MethodDesc *pMethodDesc, DWORD dwEventOptio
47114711
{
47124712
bShowVerboseOutput = TRUE;
47134713
if(bIsGenericMethod)
4714-
ulMethodToken = (ULONG)pMethodDesc->GetMemberDef_NoLogging();
4714+
ulMethodToken = (ULONG)pMethodDesc->GetMemberDef();
47154715
if(bIsDynamicMethod) // if its a generic and a dynamic method, we would set the methodtoken to 0
47164716
ulMethodToken = (ULONG)0;
47174717
}
47184718
else
4719-
ulMethodToken = (ULONG)pMethodDesc->GetMemberDef_NoLogging();
4719+
ulMethodToken = (ULONG)pMethodDesc->GetMemberDef();
47204720

47214721
SString tNamespace, tMethodName, tMethodSignature;
47224722

src/coreclr/vm/field.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ PTR_VOID FieldDesc::GetStaticAddressHandle(PTR_VOID base)
224224
MODE_ANY;
225225
FORBID_FAULT;
226226
PRECONDITION(IsStatic());
227-
PRECONDITION(GetEnclosingMethodTable()->IsRestored_NoLogging());
227+
PRECONDITION(GetEnclosingMethodTable()->IsRestored());
228228
}
229229
CONTRACTL_END
230230

0 commit comments

Comments
 (0)