Improve FEATURE_NATIVE_IMAGE_GENERATION ifdefs
authorJan Kotas <jkotas@microsoft.com>
Thu, 12 Nov 2015 00:47:09 +0000 (16:47 -0800)
committerJan Kotas <jkotas@microsoft.com>
Thu, 12 Nov 2015 00:47:09 +0000 (16:47 -0800)
src/vm/appdomain.cpp
src/vm/ceeload.cpp
src/vm/compile.h
src/vm/domainfile.cpp
src/vm/jitinterface.cpp

index 8327adf..1aa549c 100644 (file)
@@ -14836,7 +14836,7 @@ PTR_DomainAssembly AppDomain::FindAssembly(PTR_ICLRPrivAssembly pHostAssembly)
 
 #endif //FEATURE_HOSTED_BINDER
 
-#if !defined(DACCESS_COMPILE) && defined(FEATURE_CORECLR)
+#if !defined(DACCESS_COMPILE) && defined(FEATURE_CORECLR) && defined(FEATURE_NATIVE_IMAGE_GENERATION)
 
 void ZapperSetBindingPaths(ICorCompilationDomain *pDomain, SString &trustedPlatformAssemblies, SString &platformResourceRoots, SString &appPaths, SString &appNiPaths)
 {
index ac8e3b9..6fa1e44 100644 (file)
@@ -1167,10 +1167,12 @@ BOOL Module::CanCacheWinRTTypeByGuid(MethodTable *pMT)
     if (WinRTTypeNameConverter::IsRedirectedWinRTSourceType(pMT))
         return FALSE;
 
+#ifdef FEATURE_NATIVE_IMAGE_GENERATION
     // Don't cache in a module that's not the NGen target, since the result
     // won't be saved, and since the such a module might be read-only.
     if (GetAppDomain()->ToCompilationDomain()->GetTargetModule() != this)
         return FALSE;
+#endif
 
     return TRUE;
 }
index 034f751..e19d93e 100644 (file)
@@ -115,9 +115,7 @@ CEEPreloader::AddFixup, which forwards it to the zapper
 #ifndef COMPILE_H_
 #define COMPILE_H_
 
-#ifndef FEATURE_PREJIT
-#error FEATURE_PREJIT is required for this file
-#endif // FEATURE_PREJIT
+#ifdef FEATURE_NATIVE_IMAGE_GENERATION
 
 struct ZapperLoaderModuleTableKey {
     ZapperLoaderModuleTableKey(Module *pDefinitionModule, 
@@ -923,4 +921,6 @@ class CompilationDomain : public AppDomain,
     void SetDependencyEmitter(IMetaDataAssemblyEmit *pEmitter);
 };
 
+#endif // FEATURE_NATIVE_IMAGE_GENERATION
+
 #endif // COMPILE_H_
index c0619f4..7d25cdc 100644 (file)
@@ -897,6 +897,7 @@ BOOL DomainFile::IsZapRequired()
         g_pConfig->RequireZaps() == EEConfig::REQUIRE_ZAPS_SUPPORTED)
         return FALSE;
 
+#ifdef FEATURE_NATIVE_IMAGE_GENERATION
     if (IsCompilationProcess())
     {
         // Ignore the assembly being ngened.
@@ -919,6 +920,7 @@ BOOL DomainFile::IsZapRequired()
         if (fileIsBeingNGened)
             return FALSE;
     }
+#endif
 
     return TRUE;
 }
@@ -997,6 +999,7 @@ void DomainFile::ClearNativeImageStress()
     // Different app-domains should make different decisions
     hash ^= HashString(this->GetAppDomain()->GetFriendlyName());
 
+#ifdef FEATURE_NATIVE_IMAGE_GENERATION
     // Since DbgRandomOnHashAndExe() is not so random under ngen.exe, also
     // factor in the module being compiled
     if (this->GetAppDomain()->IsCompilationDomain())
@@ -1006,6 +1009,7 @@ void DomainFile::ClearNativeImageStress()
         if (module)
             hash ^= HashStringA(module->GetSimpleName());
     }
+#endif
 
     if (DbgRandomOnHashAndExe(hash, float(stressPercentage)/100))
     {
index 2fb5db6..04f8244 100644 (file)
@@ -3340,7 +3340,7 @@ void CEEInfo::ComputeRuntimeLookupForSharedGenericToken(DictionaryEntryKind entr
 
     BOOL fInstrument = FALSE;
 
-#ifdef FEATURE_PREJIT
+#ifdef FEATURE_NATIVE_IMAGE_GENERATION
     // This will make sure that when IBC logging is turned on we will go through a version
     // of JIT_GenericHandle which logs the access. Note that we still want the dictionaries
     // to be populated to prepopulate the types at NGen time.
@@ -3349,7 +3349,7 @@ void CEEInfo::ComputeRuntimeLookupForSharedGenericToken(DictionaryEntryKind entr
     {
         fInstrument = TRUE;
     }
-#endif // FEATURE_PREJIT
+#endif // FEATURE_NATIVE_IMAGE_GENERATION
 
     // If we've got a  method type parameter of any kind then we must look in the method desc arg
     if (pContextMD->RequiresInstMethodDescArg())
@@ -5176,13 +5176,13 @@ void * CEEInfo::getArrayInitializationData(
     if (!pField                    ||
         !pField->IsRVA()           ||
         (pField->LoadSize() < size)
-#ifdef FEATURE_PREJIT
+#ifdef FEATURE_NATIVE_IMAGE_GENERATION
         // This will make sure that when IBC logging is on, the array initialization happens thru 
         // COMArrayInfo::InitializeArray. This gives a place to put the IBC probe that can help
         // separate hold and cold RVA blobs.
         || (IsCompilingForNGen() &&
             GetAppDomain()->ToCompilationDomain()->m_fForceInstrument)
-#endif // FEATURE_PREJIT
+#endif // FEATURE_NATIVE_IMAGE_GENERATION
         )
     {
         result = NULL;
@@ -6764,14 +6764,14 @@ CorInfoHelpFunc CEEInfo::getSecurityPrologHelper(CORINFO_METHOD_HANDLE ftn)
 
     JIT_TO_EE_TRANSITION();
 
-#ifdef FEATURE_PREJIT
+#ifdef FEATURE_NATIVE_IMAGE_GENERATION
     // This will make sure that when IBC logging is on, we call the slow helper with IBC probe
     if (IsCompilingForNGen() &&
         GetAppDomain()->ToCompilationDomain()->m_fForceInstrument)
     {
         result = CORINFO_HELP_SECURITY_PROLOG_FRAMED;
     }
-#endif // FEATURE_PREJIT
+#endif // FEATURE_NATIVE_IMAGE_GENERATION
 
     if (result == CORINFO_HELP_UNDEF)
     {