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
8 changes: 0 additions & 8 deletions src/coreclr/binder/assembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ namespace BINDER_SPACE
m_pPEImage = NULL;
}

#ifdef FEATURE_PREJIT
if (m_pNativePEImage != NULL)
{
BinderReleasePEImage(m_pNativePEImage);
m_pNativePEImage = NULL;
}
#endif

SAFE_RELEASE(m_pAssemblyName);
SAFE_RELEASE(m_pMDImport);
}
Expand Down
29 changes: 0 additions & 29 deletions src/coreclr/debug/daccess/daccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5821,28 +5821,8 @@ ClrDataAccess::RawGetMethodName(
//
// Special-cased stub managers
//
#ifdef FEATURE_PREJIT
if (pStubManager == RangeSectionStubManager::g_pManager)
{
switch (RangeSectionStubManager::GetStubKind(TO_TADDR(address)))
{
case STUB_CODE_BLOCK_PRECODE:
goto PrecodeStub;

case STUB_CODE_BLOCK_JUMPSTUB:
goto JumpStub;

default:
break;
}
}
else
#endif
if (pStubManager == PrecodeStubManager::g_pManager)
{
#ifdef FEATURE_PREJIT
PrecodeStub:
#endif
PCODE alignedAddress = AlignDown(TO_TADDR(address), PRECODE_ALIGNMENT);

#ifdef TARGET_ARM
Expand Down Expand Up @@ -5887,9 +5867,6 @@ ClrDataAccess::RawGetMethodName(
else
if (pStubManager == JumpStubStubManager::g_pManager)
{
#ifdef FEATURE_PREJIT
JumpStub:
#endif
PCODE pTarget = decodeBackToBackJump(TO_TADDR(address));

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

return true;
}
Expand Down
82 changes: 0 additions & 82 deletions src/coreclr/debug/daccess/dacdbiimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,12 +705,6 @@ HRESULT DacDbiInterfaceImpl::SetCompilerFlags(VMPTR_DomainFile vmDomainFile,
HRESULT hr = S_OK;


#ifdef FEATURE_PREJIT
if (pModule->HasNativeImage())
{
ThrowHR(CORDBG_E_CANT_CHANGE_JIT_SETTING_FOR_ZAP_MODULE);
}
#endif
_ASSERTE(pModule != NULL);

// Initialize dwBits.
Expand Down Expand Up @@ -1256,32 +1250,9 @@ bool DacDbiInterfaceImpl::GetILImageInfoFromNgenPEFile(VMPTR_PEFile vmPEFile,
DWORD &dwSize,
IStringHolder* pStrFilename)
{
#if !defined(FEATURE_PREJIT)

return false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is now a dead code. Should it be deleted?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I wanted to keep this PR to just deleting things under the FEATURE_PREJIT define though, so I didn't do additional cleanup.

There's definitely a bunch of methods that now always return true/false/null or do nothing such that they and their usage can be removed. I'd rather handle those separately from the initial coarse delete of the ifdef-ed code.


#else // defined(FEATURE_PREJIT)

DD_ENTER_MAY_THROW;

PEFile * pPEFile = vmPEFile.GetDacPtr();
_ASSERTE(pPEFile != NULL);
if (pPEFile == NULL)
{
return false;
}

WCHAR wszFilePath[MAX_LONGPATH] = {0};
DWORD cchFilePath = MAX_LONGPATH;
bool ret = ClrDataAccess::GetILImageInfoFromNgenPEFile(pPEFile,
dwTimeStamp,
dwSize,
wszFilePath,
cchFilePath);

pStrFilename->AssignCopy(wszFilePath);
return ret;
#endif // !defined(FEATURE_PREJIT)
}

// Get start addresses and sizes for hot and cold regions for a native code blob.
Expand Down Expand Up @@ -4184,31 +4155,6 @@ BOOL DacDbiInterfaceImpl::GetModuleNGenPath(VMPTR_Module vmModule,
IStringHolder * pStrFilename)
{
DD_ENTER_MAY_THROW;
#ifdef FEATURE_PREJIT
Module * pModule = vmModule.GetDacPtr();
PEFile * pFile = pModule->GetFile();
if (pFile != NULL && pFile->HasNativeImage())
{
PEImage * pImage = pFile->GetPersistentNativeImage();
if (pImage != NULL && pImage->IsFile())
{
// We have an on-disk ngen image. Return the path.
// since we no longer support Win9x, we assume all paths will be in unicode format already
const WCHAR * szPath = pImage->GetPath().DacGetRawUnicode();
if (szPath == NULL)
{
szPath = pFile->GetModuleFileNameHint().DacGetRawUnicode();
if (szPath == NULL)
{
goto NoFileName;
}
}
IfFailThrow(pStrFilename->AssignCopy(szPath));
return TRUE;
}
}
NoFileName:
#endif // FEATURE_PREJIT

// no ngen filename
IfFailThrow(pStrFilename->AssignCopy(W("")));
Expand Down Expand Up @@ -5796,42 +5742,14 @@ HRESULT DacDbiInterfaceImpl::SetNGENCompilerFlags(DWORD dwFlags)
{
DD_ENTER_MAY_THROW;

#ifndef FEATURE_PREJIT
return CORDBG_E_NGEN_NOT_SUPPORTED;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can also be deleted.

#else
// verify that we are still early enough in runtime lifecycle to mutate these
// flags. Typically this is done in the CreateProcess event though it is possible
// to do it even earlier
if(!Debugger::s_fCanChangeNgenFlags)
return CORDBG_E_MUST_BE_IN_CREATE_PROCESS;

BOOL fAllowOpt =
((dwFlags & CORDEBUG_JIT_DISABLE_OPTIMIZATION) != CORDEBUG_JIT_DISABLE_OPTIMIZATION);
PEFile::SetNGENDebugFlags(fAllowOpt);
return S_OK;
#endif
}

HRESULT DacDbiInterfaceImpl::GetNGENCompilerFlags(DWORD *pdwFlags)
{
DD_ENTER_MAY_THROW;

#ifndef FEATURE_PREJIT
return CORDBG_E_NGEN_NOT_SUPPORTED;
#else
BOOL fAllowOpt = TRUE;
PEFile::GetNGENDebugFlags(&fAllowOpt);
if(!fAllowOpt)
{
*pdwFlags = CORDEBUG_JIT_DISABLE_OPTIMIZATION;
}
else
{
*pdwFlags = CORDEBUG_JIT_DEFAULT;
}

return S_OK;
#endif
}

typedef DPTR(OBJECTREF) PTR_ObjectRef;
Expand Down
12 changes: 0 additions & 12 deletions src/coreclr/debug/daccess/enummem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,9 +619,6 @@ HRESULT ClrDataAccess::EnumMemDumpModuleList(CLRDataEnumMemoryFlags flags)
ULONG32 length;
PEFile *file;
TSIZE_T cbMemoryReported = m_cbMemoryReported;
#ifdef FEATURE_PREJIT
COUNT_T count;
#endif // FEATURE_PREJIT

//
// Iterating through module list
Expand Down Expand Up @@ -668,15 +665,6 @@ HRESULT ClrDataAccess::EnumMemDumpModuleList(CLRDataEnumMemoryFlags flags)
file = modDef->GetFile();
base = PTR_TO_TADDR(file->GetLoadedImageContents(&length));
file->EnumMemoryRegions(flags);
#ifdef FEATURE_PREJIT

// If module has native image and it has debug map, we need to get the debug map.
//
if (modDef->HasNativeImage() && modDef->GetNativeImage()->HasNativeDebugMap())
{
modDef->GetNativeImage()->GetNativeDebugMap(&count);
}
#endif // FEATURE_PREJIT
}
EX_CATCH
{
Expand Down
Loading