-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Delete code under FEATURE_PREJIT #57693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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. | ||
|
|
@@ -1256,32 +1250,9 @@ bool DacDbiInterfaceImpl::GetILImageInfoFromNgenPEFile(VMPTR_PEFile vmPEFile, | |
| DWORD &dwSize, | ||
| IStringHolder* pStrFilename) | ||
| { | ||
| #if !defined(FEATURE_PREJIT) | ||
|
|
||
| return false; | ||
|
|
||
| #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. | ||
|
|
@@ -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(""))); | ||
|
|
@@ -5796,42 +5742,14 @@ HRESULT DacDbiInterfaceImpl::SetNGENCompilerFlags(DWORD dwFlags) | |
| { | ||
| DD_ENTER_MAY_THROW; | ||
|
|
||
| #ifndef FEATURE_PREJIT | ||
| return CORDBG_E_NGEN_NOT_SUPPORTED; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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_PREJITdefine 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.