summaryrefslogtreecommitdiff
path: root/src/zap
diff options
context:
space:
mode:
Diffstat (limited to 'src/zap')
-rw-r--r--src/zap/zapheaders.cpp33
-rw-r--r--src/zap/zapimport.cpp13
-rw-r--r--src/zap/zapper.cpp7
3 files changed, 32 insertions, 21 deletions
diff --git a/src/zap/zapheaders.cpp b/src/zap/zapheaders.cpp
index 7df102abf4..6a51605a8f 100644
--- a/src/zap/zapheaders.cpp
+++ b/src/zap/zapheaders.cpp
@@ -75,7 +75,7 @@ void ZapImage::SaveNativeHeader()
if (m_ModuleDecoder.HasDirectoryEntry(IMAGE_DIRECTORY_ENTRY_SECURITY))
nativeHeader.Flags |= CORCOMPILE_HEADER_HAS_SECURITY_DIRECTORY;
- nativeHeader.COR20Flags = m_ModuleDecoder.GetCorHeader()->Flags;
+ nativeHeader.COR20Flags = m_ModuleDecoder.GetCorHeader()->Flags;
#ifdef CROSSGEN_COMPILE
if (CLRConfig::GetConfigValue(CLRConfig::INTERNAL_CrossGenAssumeInputSigned))
@@ -91,24 +91,27 @@ void ZapImage::SaveNativeHeader()
}
#endif
- if (m_ModuleDecoder.HasReadyToRunHeader())
- {
- // Pretend that ready-to-run images are IL-only
- nativeHeader.COR20Flags |= COMIMAGE_FLAGS_ILONLY;
+ if (m_ModuleDecoder.HasReadyToRunHeader())
+ {
+ // Pretend that ready-to-run images are IL-only
+ nativeHeader.COR20Flags |= COMIMAGE_FLAGS_ILONLY;
- // Pretend that ready-to-run images do not have native header
- nativeHeader.COR20Flags &= ~COMIMAGE_FLAGS_IL_LIBRARY;
- }
+ // Pretend that ready-to-run images do not have native header
+ nativeHeader.COR20Flags &= ~COMIMAGE_FLAGS_IL_LIBRARY;
+
+ // Remember whether the source IL image had ReadyToRun header
+ nativeHeader.Flags |= CORCOMPILE_HEADER_IS_READY_TO_RUN;
+ }
- if (m_fHaveProfileData)
- nativeHeader.Flags |= CORCOMPILE_HEADER_IS_IBC_OPTIMIZED;
+ if (m_fHaveProfileData)
+ nativeHeader.Flags |= CORCOMPILE_HEADER_IS_IBC_OPTIMIZED;
- DWORD dwPEKind, dwMachine;
- m_ModuleDecoder.GetPEKindAndMachine(&dwPEKind, &dwMachine);
- nativeHeader.PEKind = dwPEKind;
- nativeHeader.Machine = (WORD)dwMachine;
+ DWORD dwPEKind, dwMachine;
+ m_ModuleDecoder.GetPEKindAndMachine(&dwPEKind, &dwMachine);
+ nativeHeader.PEKind = dwPEKind;
+ nativeHeader.Machine = (WORD)dwMachine;
- nativeHeader.Characteristics = m_ModuleDecoder.GetCharacteristics();
+ nativeHeader.Characteristics = m_ModuleDecoder.GetCharacteristics();
SetDirectoryData(&nativeHeader.EEInfoTable, m_pEEInfoTable);
diff --git a/src/zap/zapimport.cpp b/src/zap/zapimport.cpp
index c31ca019e7..1bc1568a7e 100644
--- a/src/zap/zapimport.cpp
+++ b/src/zap/zapimport.cpp
@@ -1134,7 +1134,18 @@ ZapImport * ZapImportTable::GetClassHandleImport(CORINFO_CLASS_HANDLE handle, PV
return GetImport<ZapClassHandleImport, ZapNodeType_Import_ClassHandle>(handle, pUniqueId);
}
- return GetImport<ZapClassHandleImport, ZapNodeType_Import_ClassHandle>(handle);
+ ZapImport * pImport = GetImport<ZapClassHandleImport, ZapNodeType_Import_ClassHandle>(handle);
+
+ if (IsReadyToRunCompilation() && !pImport->HasBlob())
+ {
+ SigBuilder sigBuilder;
+
+ EncodeClass(ENCODE_TYPE_HANDLE, handle, &sigBuilder);
+
+ pImport->SetBlob(GetBlob(&sigBuilder));
+ }
+
+ return pImport;
}
class ZapFieldHandleImport : public ZapImport
diff --git a/src/zap/zapper.cpp b/src/zap/zapper.cpp
index 0f85157e38..cdbc225f8e 100644
--- a/src/zap/zapper.cpp
+++ b/src/zap/zapper.cpp
@@ -904,10 +904,7 @@ void Zapper::InitEE(BOOL fForceDebug, BOOL fForceProfile, BOOL fForceInstrument)
//
// Also see the code and comments in EEJitManager::LoadJIT().
- static ConfigDWORD useRyuJitValue;
- bool fUseRyuJit = (useRyuJitValue.val(CLRConfig::INTERNAL_UseRyuJit) == 1);
-
- if (!fUseRyuJit) // Do we need to fall back to JIT64 for NGEN?
+ if (!UseRyuJit()) // Do we need to fall back to JIT64 for NGEN?
{
LPCWSTR pwzJitName = MAKEDLLNAME_W(L"compatjit");
@@ -2639,7 +2636,7 @@ HRESULT Zapper::Compile(LPCWSTR string, CORCOMPILE_NGEN_SIGNATURE * pNativeImage
#endif
#if defined(CROSSGEN_COMPILE) || defined(FEATURE_CORECLR)
- if (fMscorlib)
+ if (fMscorlib || IsReadyToRunCompilation())
{
//
// Disallow use of native image to force a new native image generation for mscorlib