Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 1b2a008

Browse files
authored
Delete special handling of IJW RVA fields at NGen time (#11818) (#11859)
Mixed mode managed C++ is not supported by CoreCLR so this is not needed for anything. Fixes #11761
1 parent 6e0d6de commit 1b2a008

File tree

6 files changed

+3
-73
lines changed

6 files changed

+3
-73
lines changed

src/inc/corcompile.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -468,15 +468,6 @@ struct CORCOMPILE_EE_INFO_TABLE
468468
DWORD threadTlsIndex;
469469

470470
DWORD rvaStaticTlsIndex;
471-
472-
// These are used by the 64-bit JITs to detect calls to thunks in the .nep section
473-
// and conditionally eliminate double-thunking (managed-to-native-to-managed).
474-
// During prejit these are set to the RVAs of the .nep section. When the prejitted
475-
// image is actually loaded, these are fixed up to point to the actual .nep section
476-
// of the ijw image (not the native image).
477-
478-
BYTE * nativeEntryPointStart;
479-
BYTE * nativeEntryPointEnd;
480471
};
481472

482473
/*********************************************************************************/

src/vm/ceeload.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9550,7 +9550,7 @@ void Module::Arrange(DataImage *image)
95509550
else if (TypeFromToken(token) == mdtFieldDef)
95519551
{
95529552
FieldDesc *pFD = LookupFieldDef(token);
9553-
if (pFD && pFD->IsILOnlyRVAField())
9553+
if (pFD && pFD->IsRVA())
95549554
{
95559555
if (entry->flags & (1 << RVAFieldData))
95569556
{

src/vm/compile.cpp

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -652,22 +652,6 @@ HRESULT CEECompileInfo::SetCompilationTarget(CORINFO_ASSEMBLY_HANDLE assembl
652652
}
653653
}
654654

655-
#ifdef FEATURE_READYTORUN_COMPILER
656-
if (IsReadyToRunCompilation() && !pModule->IsILOnly())
657-
{
658-
GetSvcLogger()->Printf(LogLevel_Error, W("Error: /readytorun not supported for mixed mode assemblies\n"));
659-
return E_FAIL;
660-
}
661-
#endif
662-
663-
#ifdef FEATURE_READYTORUN_COMPILER
664-
if (IsReadyToRunCompilation() && !pModule->IsILOnly())
665-
{
666-
GetSvcLogger()->Printf(LogLevel_Error, W("Error: /readytorun not supported for mixed mode assemblies\n"));
667-
return E_FAIL;
668-
}
669-
#endif
670-
671655
return S_OK;
672656
}
673657

@@ -6809,7 +6793,7 @@ void CEEPreloader::GetRVAFieldData(mdFieldDef fd, PVOID * ppData, DWORD * pcbSiz
68096793
if (pFD == NULL)
68106794
ThrowHR(COR_E_TYPELOAD);
68116795

6812-
_ASSERTE(pFD->IsILOnlyRVAField());
6796+
_ASSERTE(pFD->IsRVA());
68136797

68146798
UINT size = pFD->LoadSize();
68156799

src/vm/field.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ void FieldDesc::SaveContents(DataImage *image)
738738
// image.
739739
//
740740

741-
if (IsILOnlyRVAField())
741+
if (IsRVA())
742742
{
743743
//
744744
// Move the RVA data into the prejit image.

src/vm/field.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,6 @@ class FieldDesc
274274
: dwOffset;
275275
}
276276

277-
BOOL IsILOnlyRVAField()
278-
{
279-
WRAPPER_NO_CONTRACT;
280-
return (IsRVA() && GetModule()->GetFile()->IsILOnly());
281-
}
282-
283277
DWORD IsStatic() const
284278
{
285279
LIMITED_METHOD_DAC_CONTRACT;

src/zap/zapinfo.cpp

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2656,41 +2656,6 @@ void ZapInfo::getModuleNativeEntryPointRange(void** pStart, void** pEnd)
26562656
// Initialize outparams to default range of (0,0).
26572657
*pStart = 0;
26582658
*pEnd = 0;
2659-
2660-
// If this is ILONLY, there are no native entry points.
2661-
if (m_pImage->m_ModuleDecoder.IsILOnly())
2662-
{
2663-
return;
2664-
}
2665-
2666-
rvaStart = rvaEnd = 0;
2667-
2668-
// Walk the section table looking for a section named .nep.
2669-
2670-
IMAGE_SECTION_HEADER *section = m_pImage->m_ModuleDecoder.FindFirstSection();
2671-
IMAGE_SECTION_HEADER *sectionEnd = section + m_pImage->m_ModuleDecoder.GetNumberOfSections();
2672-
while (section < sectionEnd)
2673-
{
2674-
if (strncmp((const char *)(section->Name), ".nep", IMAGE_SIZEOF_SHORT_NAME) == 0)
2675-
{
2676-
rvaStart = VAL32(section->VirtualAddress);
2677-
rvaEnd = rvaStart + VAL32(section->Misc.VirtualSize);
2678-
if (rvaStart < rvaEnd)
2679-
{
2680-
// RVA will be fixed up to the actual address at runtime
2681-
CORCOMPILE_EE_INFO_TABLE * pEEInfoTable = (CORCOMPILE_EE_INFO_TABLE *)m_pImage->m_pEEInfoTable->GetData();
2682-
pEEInfoTable->nativeEntryPointStart = (BYTE*)((ULONG_PTR)rvaStart);
2683-
pEEInfoTable->nativeEntryPointEnd = (BYTE*)((ULONG_PTR)rvaEnd);
2684-
2685-
*pStart = m_pImage->GetInnerPtr(m_pImage->m_pEEInfoTable,
2686-
offsetof(CORCOMPILE_EE_INFO_TABLE, nativeEntryPointStart));
2687-
*pEnd = m_pImage->GetInnerPtr(m_pImage->m_pEEInfoTable,
2688-
offsetof(CORCOMPILE_EE_INFO_TABLE, nativeEntryPointEnd));
2689-
}
2690-
break;
2691-
}
2692-
section++;
2693-
}
26942659
}
26952660

26962661
DWORD ZapInfo::getExpectedTargetArchitecture()
@@ -3195,10 +3160,6 @@ void * ZapInfo::getArrayInitializationData(CORINFO_FIELD_HANDLE field, DWORD siz
31953160
if (m_pEEJitInfo->getClassModule(m_pEEJitInfo->getFieldClass(field)) != m_pImage->m_hModule)
31963161
return NULL;
31973162

3198-
// FieldDesc::SaveContents() does not save the RVA blob for IJW modules.
3199-
if (!m_pImage->m_ModuleDecoder.IsILOnly())
3200-
return NULL;
3201-
32023163
void * arrayData = m_pEEJitInfo->getArrayInitializationData(field, size);
32033164
if (!arrayData)
32043165
return NULL;

0 commit comments

Comments
 (0)