summaryrefslogtreecommitdiff
path: root/src/vm/pefile.cpp
diff options
context:
space:
mode:
authordotnet-bot <dotnet-bot@microsoft.com>2015-05-06 23:43:46 -0700
committerJan Kotas <jkotas@microsoft.com>2015-05-07 12:03:00 -0700
commit484a2cf0b0c4e304a5093ec26e07fe41f8896c3c (patch)
tree348b56df4cdb235bb87ba9bc9118711c8db13bfd /src/vm/pefile.cpp
parentc6efc7047edb38075310cfef8ea28b91717b8108 (diff)
downloadcoreclr-484a2cf0b0c4e304a5093ec26e07fe41f8896c3c.tar.gz
coreclr-484a2cf0b0c4e304a5093ec26e07fe41f8896c3c.tar.bz2
coreclr-484a2cf0b0c4e304a5093ec26e07fe41f8896c3c.zip
Merge changes from parent branch
[tfs-changeset: 1466545]
Diffstat (limited to 'src/vm/pefile.cpp')
-rw-r--r--src/vm/pefile.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/vm/pefile.cpp b/src/vm/pefile.cpp
index 815071c486..658d7f5ca6 100644
--- a/src/vm/pefile.cpp
+++ b/src/vm/pefile.cpp
@@ -1948,6 +1948,13 @@ static BOOL RuntimeVerifyNativeImageTimestamps(const CORCOMPILE_VERSION_INFO *in
if (hMod == NULL)
{
+ // Unless this is an NGen worker process, we don't want to load JIT compiler just to do a timestamp check.
+ // In an ideal case, all assemblies have native images, and JIT compiler never needs to be loaded at runtime.
+ // Loading JIT compiler just to check its timestamp would reduce the benefits of have native images.
+ // Since CLR and JIT are intended to be serviced together, the possibility of accidentally using native
+ // images created by an older JIT is very small, and is deemed an acceptable risk.
+ // Note that when multiple JIT compilers are used (e.g., clrjit.dll and compatjit.dll on x64 in .NET 4.6),
+ // they must all be in the same patch family.
if (!IsCompilationProcess())
continue;
@@ -2160,6 +2167,19 @@ BOOL RuntimeVerifyNativeImageVersion(const CORCOMPILE_VERSION_INFO *info, Loggab
}
#endif // CROSSGEN_COMPILE
+#if defined(_TARGET_AMD64_) && !defined(FEATURE_CORECLR)
+ //
+ // Check the right JIT compiler
+ //
+
+ bool nativeImageBuiltWithRyuJit = ((info->wCodegenFlags & CORCOMPILE_CODEGEN_USE_RYUJIT) != 0);
+ if (UseRyuJit() != nativeImageBuiltWithRyuJit)
+ {
+ RuntimeVerifyLog(LL_ERROR, pLogAsm, W("JIT compiler used to generate native image doesn't match current JIT compiler."));
+ return FALSE;
+ }
+#endif
+
//
// The zap is up to date.
//