Skip to content

Commit 07d17b6

Browse files
authored
Remove IsZapped and GetZappedModule functions (#57823)
1 parent 52c6dcb commit 07d17b6

24 files changed

+88
-341
lines changed

src/coreclr/debug/daccess/dacdbiimpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1607,7 +1607,7 @@ void DacDbiInterfaceImpl::ComputeFieldData(PTR_FieldDesc pFD,
16071607
{
16081608
// RVA statics are relative to a base module address
16091609
DWORD offset = pFD->GetOffset();
1610-
PTR_VOID addr = pFD->GetModule()->GetRvaField(offset, pFD->IsZapped());
1610+
PTR_VOID addr = pFD->GetModule()->GetRvaField(offset);
16111611
if (pCurrentFieldData->OkToGetOrSetStaticAddress())
16121612
{
16131613
pCurrentFieldData->SetStaticAddress(PTR_TO_TADDR(addr));

src/coreclr/debug/daccess/request.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ BOOL DacValidateMD(MethodDesc * pMD)
205205
retval = FALSE;
206206
}
207207

208-
if (retval && pMD->HasTemporaryEntryPoint())
208+
if (retval)
209209
{
210210
MethodDesc *pMDCheck = MethodDesc::GetMethodDescFromStubAddr(pMD->GetTemporaryEntryPoint(), TRUE);
211211

src/coreclr/vm/ceeload.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2544,7 +2544,7 @@ void Module::FreeClassTables()
25442544
if (!th.IsTypeDesc())
25452545
{
25462546
MethodTable * pMT = th.AsMethodTable();
2547-
if (pMT->IsCanonicalMethodTable() && (!pMT->IsZapped() || pMT->GetZapModule() == this))
2547+
if (pMT->IsCanonicalMethodTable())
25482548
pMT->GetClass()->Destruct(pMT);
25492549
}
25502550
}
@@ -3261,7 +3261,7 @@ TADDR Module::GetIL(DWORD target)
32613261
return m_file->GetIL(target);
32623262
}
32633263

3264-
PTR_VOID Module::GetRvaField(DWORD rva, BOOL fZapped)
3264+
PTR_VOID Module::GetRvaField(DWORD rva)
32653265
{
32663266
WRAPPER_NO_CONTRACT;
32673267
SUPPORTS_DAC;
@@ -7657,9 +7657,8 @@ TADDR ReflectionModule::GetIL(RVA il) // virtual
76577657
#endif // DACCESS_COMPILE
76587658
}
76597659

7660-
PTR_VOID ReflectionModule::GetRvaField(RVA field, BOOL fZapped) // virtual
7660+
PTR_VOID ReflectionModule::GetRvaField(RVA field) // virtual
76617661
{
7662-
_ASSERTE(!fZapped);
76637662
#ifndef DACCESS_COMPILE
76647663
WRAPPER_NO_CONTRACT;
76657664
// This function should be call only if the target is a field or a field with RVA.

src/coreclr/vm/ceeload.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2079,7 +2079,7 @@ class Module
20792079
// These are overridden by reflection modules
20802080
virtual TADDR GetIL(RVA il);
20812081

2082-
virtual PTR_VOID GetRvaField(RVA field, BOOL fZapped);
2082+
virtual PTR_VOID GetRvaField(RVA field);
20832083
CHECK CheckRvaField(RVA field);
20842084
CHECK CheckRvaField(RVA field, COUNT_T size);
20852085

@@ -2538,7 +2538,7 @@ class ReflectionModule : public Module
25382538

25392539
// Overrides functions to access sections
25402540
virtual TADDR GetIL(RVA target);
2541-
virtual PTR_VOID GetRvaField(RVA rva, BOOL fZapped);
2541+
virtual PTR_VOID GetRvaField(RVA rva);
25422542

25432543
Assembly* GetCreatingAssembly( void )
25442544
{

src/coreclr/vm/class.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ void EEClass::Destruct(MethodTable * pOwningMT)
171171
}
172172

173173
#ifdef FEATURE_COMINTEROP
174-
if (GetSparseCOMInteropVTableMap() != NULL && !pOwningMT->IsZapped())
174+
if (GetSparseCOMInteropVTableMap() != NULL)
175175
delete GetSparseCOMInteropVTableMap();
176176
#endif // FEATURE_COMINTEROP
177177

src/coreclr/vm/comutilnative.cpp

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,14 +1718,11 @@ static BOOL HasOverriddenMethod(MethodTable* mt, MethodTable* classMT, WORD meth
17181718
return FALSE;
17191719
}
17201720

1721-
if (!classMT->IsZapped())
1721+
// If CoreLib is JITed, the slots can be patched and thus we need to compare the actual MethodDescs
1722+
// to detect match reliably
1723+
if (MethodTable::GetMethodDescForSlotAddress(actual) == MethodTable::GetMethodDescForSlotAddress(base))
17221724
{
1723-
// If CoreLib is JITed, the slots can be patched and thus we need to compare the actual MethodDescs
1724-
// to detect match reliably
1725-
if (MethodTable::GetMethodDescForSlotAddress(actual) == MethodTable::GetMethodDescForSlotAddress(base))
1726-
{
1727-
return FALSE;
1728-
}
1725+
return FALSE;
17291726
}
17301727

17311728
return TRUE;
@@ -2084,13 +2081,10 @@ static bool HasOverriddenStreamMethod(MethodTable * pMT, WORD slot)
20842081
if (actual == base)
20852082
return false;
20862083

2087-
if (!g_pStreamMT->IsZapped())
2088-
{
2089-
// If CoreLib is JITed, the slots can be patched and thus we need to compare the actual MethodDescs
2090-
// to detect match reliably
2091-
if (MethodTable::GetMethodDescForSlotAddress(actual) == MethodTable::GetMethodDescForSlotAddress(base))
2092-
return false;
2093-
}
2084+
// If CoreLib is JITed, the slots can be patched and thus we need to compare the actual MethodDescs
2085+
// to detect match reliably
2086+
if (MethodTable::GetMethodDescForSlotAddress(actual) == MethodTable::GetMethodDescForSlotAddress(base))
2087+
return false;
20942088

20952089
return true;
20962090
}

src/coreclr/vm/dllimport.cpp

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5949,12 +5949,9 @@ EXTERN_C LPVOID STDCALL NDirectImportWorker(NDirectMethodDesc* pMD)
59495949

59505950
if (pMD->IsEarlyBound())
59515951
{
5952-
if (!pMD->IsZapped())
5953-
{
5954-
// we need the MD to be populated in case we decide to build an intercept
5955-
// stub to wrap the target in InitEarlyBoundNDirectTarget
5956-
NDirect::PopulateNDirectMethodDesc(pMD);
5957-
}
5952+
// we need the MD to be populated in case we decide to build an intercept
5953+
// stub to wrap the target in InitEarlyBoundNDirectTarget
5954+
NDirect::PopulateNDirectMethodDesc(pMD);
59585955

59595956
pMD->InitEarlyBoundNDirectTarget();
59605957
}
@@ -5973,16 +5970,7 @@ EXTERN_C LPVOID STDCALL NDirectImportWorker(NDirectMethodDesc* pMD)
59735970
// With IL stubs, we don't have to do anything but ensure the DLL is loaded.
59745971
//
59755972

5976-
if (!pMD->IsZapped())
5977-
{
5978-
NDirect::PopulateNDirectMethodDesc(pMD);
5979-
}
5980-
else
5981-
{
5982-
// must have been populated at NGEN time
5983-
_ASSERTE(pMD->GetLibName() != NULL);
5984-
}
5985-
5973+
NDirect::PopulateNDirectMethodDesc(pMD);
59865974
pMD->CheckRestore();
59875975

59885976
NDirectLink(pMD);

src/coreclr/vm/ecall.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,6 @@ DWORD ECall::GetIDForMethod(MethodDesc *pMD)
317317
}
318318
CONTRACTL_END;
319319

320-
// We should not go here for NGened methods
321-
_ASSERTE(!pMD->IsZapped());
322-
323320
INT ImplsIndex = FindImplsIndexForClass(pMD->GetMethodTable());
324321
if (ImplsIndex < 0)
325322
return 0;

src/coreclr/vm/field.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ PTR_VOID FieldDesc::GetStaticAddressHandle(PTR_VOID base)
306306
if (IsRVA())
307307
{
308308
Module* pModule = GetModule();
309-
PTR_VOID ret = pModule->GetRvaField(GetOffset(), IsZapped());
309+
PTR_VOID ret = pModule->GetRvaField(GetOffset());
310310

311311
_ASSERTE(!pModule->IsPEFile() || !pModule->IsRvaFieldTls(GetOffset()));
312312

src/coreclr/vm/field.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -586,15 +586,6 @@ class FieldDesc
586586
return GetApproxEnclosingMethodTable()->GetModule();
587587
}
588588

589-
BOOL IsZapped()
590-
{
591-
WRAPPER_NO_CONTRACT;
592-
593-
// Field Desc's are currently always saved into the same module as their
594-
// corresponding method table.
595-
return GetApproxEnclosingMethodTable()->IsZapped();
596-
}
597-
598589
Module *GetLoaderModule()
599590
{
600591
WRAPPER_NO_CONTRACT;

0 commit comments

Comments
 (0)