Skip to content

Commit 4061822

Browse files
authored
Delete code under FEATURE_PREJIT (dotnet#57693)
1 parent c91a5c1 commit 4061822

File tree

124 files changed

+186
-22423
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+186
-22423
lines changed

src/coreclr/binder/assembly.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,6 @@ namespace BINDER_SPACE
4343
m_pPEImage = NULL;
4444
}
4545

46-
#ifdef FEATURE_PREJIT
47-
if (m_pNativePEImage != NULL)
48-
{
49-
BinderReleasePEImage(m_pNativePEImage);
50-
m_pNativePEImage = NULL;
51-
}
52-
#endif
53-
5446
SAFE_RELEASE(m_pAssemblyName);
5547
SAFE_RELEASE(m_pMDImport);
5648
}

src/coreclr/debug/daccess/daccess.cpp

-29
Original file line numberDiff line numberDiff line change
@@ -5821,28 +5821,8 @@ ClrDataAccess::RawGetMethodName(
58215821
//
58225822
// Special-cased stub managers
58235823
//
5824-
#ifdef FEATURE_PREJIT
5825-
if (pStubManager == RangeSectionStubManager::g_pManager)
5826-
{
5827-
switch (RangeSectionStubManager::GetStubKind(TO_TADDR(address)))
5828-
{
5829-
case STUB_CODE_BLOCK_PRECODE:
5830-
goto PrecodeStub;
5831-
5832-
case STUB_CODE_BLOCK_JUMPSTUB:
5833-
goto JumpStub;
5834-
5835-
default:
5836-
break;
5837-
}
5838-
}
5839-
else
5840-
#endif
58415824
if (pStubManager == PrecodeStubManager::g_pManager)
58425825
{
5843-
#ifdef FEATURE_PREJIT
5844-
PrecodeStub:
5845-
#endif
58465826
PCODE alignedAddress = AlignDown(TO_TADDR(address), PRECODE_ALIGNMENT);
58475827

58485828
#ifdef TARGET_ARM
@@ -5887,9 +5867,6 @@ ClrDataAccess::RawGetMethodName(
58875867
else
58885868
if (pStubManager == JumpStubStubManager::g_pManager)
58895869
{
5890-
#ifdef FEATURE_PREJIT
5891-
JumpStub:
5892-
#endif
58935870
PCODE pTarget = decodeBackToBackJump(TO_TADDR(address));
58945871

58955872
HRESULT hr = GetRuntimeNameByAddress(pTarget, flags, bufLen, symbolLen, symbolBuf, NULL);
@@ -6592,14 +6569,8 @@ bool ClrDataAccess::GetILImageInfoFromNgenPEFile(PEFile *peFile,
65926569
// Use DAC hint to retrieve the IL name.
65936570
peFile->GetModuleFileNameHint().DacGetUnicode(cchFilePath, wszFilePath, (COUNT_T *)(&dwWritten));
65946571
}
6595-
#ifdef FEATURE_PREJIT
6596-
// Need to get IL image information from cached info in the ngen image.
6597-
dwTimeStamp = peFile->GetLoaded()->GetNativeVersionInfo()->sourceAssembly.timeStamp;
6598-
dwSize = peFile->GetLoaded()->GetNativeVersionInfo()->sourceAssembly.ilImageSize;
6599-
#else
66006572
dwTimeStamp = 0;
66016573
dwSize = 0;
6602-
#endif // FEATURE_PREJIT
66036574

66046575
return true;
66056576
}

src/coreclr/debug/daccess/dacdbiimpl.cpp

-82
Original file line numberDiff line numberDiff line change
@@ -705,12 +705,6 @@ HRESULT DacDbiInterfaceImpl::SetCompilerFlags(VMPTR_DomainFile vmDomainFile,
705705
HRESULT hr = S_OK;
706706

707707

708-
#ifdef FEATURE_PREJIT
709-
if (pModule->HasNativeImage())
710-
{
711-
ThrowHR(CORDBG_E_CANT_CHANGE_JIT_SETTING_FOR_ZAP_MODULE);
712-
}
713-
#endif
714708
_ASSERTE(pModule != NULL);
715709

716710
// Initialize dwBits.
@@ -1256,32 +1250,9 @@ bool DacDbiInterfaceImpl::GetILImageInfoFromNgenPEFile(VMPTR_PEFile vmPEFile,
12561250
DWORD &dwSize,
12571251
IStringHolder* pStrFilename)
12581252
{
1259-
#if !defined(FEATURE_PREJIT)
12601253

12611254
return false;
12621255

1263-
#else // defined(FEATURE_PREJIT)
1264-
1265-
DD_ENTER_MAY_THROW;
1266-
1267-
PEFile * pPEFile = vmPEFile.GetDacPtr();
1268-
_ASSERTE(pPEFile != NULL);
1269-
if (pPEFile == NULL)
1270-
{
1271-
return false;
1272-
}
1273-
1274-
WCHAR wszFilePath[MAX_LONGPATH] = {0};
1275-
DWORD cchFilePath = MAX_LONGPATH;
1276-
bool ret = ClrDataAccess::GetILImageInfoFromNgenPEFile(pPEFile,
1277-
dwTimeStamp,
1278-
dwSize,
1279-
wszFilePath,
1280-
cchFilePath);
1281-
1282-
pStrFilename->AssignCopy(wszFilePath);
1283-
return ret;
1284-
#endif // !defined(FEATURE_PREJIT)
12851256
}
12861257

12871258
// Get start addresses and sizes for hot and cold regions for a native code blob.
@@ -4184,31 +4155,6 @@ BOOL DacDbiInterfaceImpl::GetModuleNGenPath(VMPTR_Module vmModule,
41844155
IStringHolder * pStrFilename)
41854156
{
41864157
DD_ENTER_MAY_THROW;
4187-
#ifdef FEATURE_PREJIT
4188-
Module * pModule = vmModule.GetDacPtr();
4189-
PEFile * pFile = pModule->GetFile();
4190-
if (pFile != NULL && pFile->HasNativeImage())
4191-
{
4192-
PEImage * pImage = pFile->GetPersistentNativeImage();
4193-
if (pImage != NULL && pImage->IsFile())
4194-
{
4195-
// We have an on-disk ngen image. Return the path.
4196-
// since we no longer support Win9x, we assume all paths will be in unicode format already
4197-
const WCHAR * szPath = pImage->GetPath().DacGetRawUnicode();
4198-
if (szPath == NULL)
4199-
{
4200-
szPath = pFile->GetModuleFileNameHint().DacGetRawUnicode();
4201-
if (szPath == NULL)
4202-
{
4203-
goto NoFileName;
4204-
}
4205-
}
4206-
IfFailThrow(pStrFilename->AssignCopy(szPath));
4207-
return TRUE;
4208-
}
4209-
}
4210-
NoFileName:
4211-
#endif // FEATURE_PREJIT
42124158

42134159
// no ngen filename
42144160
IfFailThrow(pStrFilename->AssignCopy(W("")));
@@ -5796,42 +5742,14 @@ HRESULT DacDbiInterfaceImpl::SetNGENCompilerFlags(DWORD dwFlags)
57965742
{
57975743
DD_ENTER_MAY_THROW;
57985744

5799-
#ifndef FEATURE_PREJIT
58005745
return CORDBG_E_NGEN_NOT_SUPPORTED;
5801-
#else
5802-
// verify that we are still early enough in runtime lifecycle to mutate these
5803-
// flags. Typically this is done in the CreateProcess event though it is possible
5804-
// to do it even earlier
5805-
if(!Debugger::s_fCanChangeNgenFlags)
5806-
return CORDBG_E_MUST_BE_IN_CREATE_PROCESS;
5807-
5808-
BOOL fAllowOpt =
5809-
((dwFlags & CORDEBUG_JIT_DISABLE_OPTIMIZATION) != CORDEBUG_JIT_DISABLE_OPTIMIZATION);
5810-
PEFile::SetNGENDebugFlags(fAllowOpt);
5811-
return S_OK;
5812-
#endif
58135746
}
58145747

58155748
HRESULT DacDbiInterfaceImpl::GetNGENCompilerFlags(DWORD *pdwFlags)
58165749
{
58175750
DD_ENTER_MAY_THROW;
58185751

5819-
#ifndef FEATURE_PREJIT
58205752
return CORDBG_E_NGEN_NOT_SUPPORTED;
5821-
#else
5822-
BOOL fAllowOpt = TRUE;
5823-
PEFile::GetNGENDebugFlags(&fAllowOpt);
5824-
if(!fAllowOpt)
5825-
{
5826-
*pdwFlags = CORDEBUG_JIT_DISABLE_OPTIMIZATION;
5827-
}
5828-
else
5829-
{
5830-
*pdwFlags = CORDEBUG_JIT_DEFAULT;
5831-
}
5832-
5833-
return S_OK;
5834-
#endif
58355753
}
58365754

58375755
typedef DPTR(OBJECTREF) PTR_ObjectRef;

src/coreclr/debug/daccess/enummem.cpp

-12
Original file line numberDiff line numberDiff line change
@@ -619,9 +619,6 @@ HRESULT ClrDataAccess::EnumMemDumpModuleList(CLRDataEnumMemoryFlags flags)
619619
ULONG32 length;
620620
PEFile *file;
621621
TSIZE_T cbMemoryReported = m_cbMemoryReported;
622-
#ifdef FEATURE_PREJIT
623-
COUNT_T count;
624-
#endif // FEATURE_PREJIT
625622

626623
//
627624
// Iterating through module list
@@ -668,15 +665,6 @@ HRESULT ClrDataAccess::EnumMemDumpModuleList(CLRDataEnumMemoryFlags flags)
668665
file = modDef->GetFile();
669666
base = PTR_TO_TADDR(file->GetLoadedImageContents(&length));
670667
file->EnumMemoryRegions(flags);
671-
#ifdef FEATURE_PREJIT
672-
673-
// If module has native image and it has debug map, we need to get the debug map.
674-
//
675-
if (modDef->HasNativeImage() && modDef->GetNativeImage()->HasNativeDebugMap())
676-
{
677-
modDef->GetNativeImage()->GetNativeDebugMap(&count);
678-
}
679-
#endif // FEATURE_PREJIT
680668
}
681669
EX_CATCH
682670
{

0 commit comments

Comments
 (0)