From cc90f62e4b4f45e6b9b3e9ee2251df32fad9f2f0 Mon Sep 17 00:00:00 2001 From: Pat Gavlin Date: Mon, 7 Mar 2016 11:41:19 -0800 Subject: Reapply change 1578859: Add a new set of APIs for JIT configuration. SuperPMI has been udpated to accommodate this change, and should no longer crash when run using a JIT built with these changes. [tfs-changeset: 1582144] --- src/jit/jit.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/jit/jit.h') diff --git a/src/jit/jit.h b/src/jit/jit.h index 19a4f332d8..bfdb195e28 100644 --- a/src/jit/jit.h +++ b/src/jit/jit.h @@ -199,6 +199,18 @@ #define __PLACEMENT_NEW_INLINE // don't bring in the global placement new, it is easy to make a mistake // with our new(compiler*) pattern. +#if COR_JIT_EE_VER > 460 +#define NO_CLRCONFIG // Don't bring in the usual CLRConfig infrastructure, since the JIT uses the JIT/EE + // interface to retrieve config values. + +// This is needed for contract.inl when FEATURE_STACK_PROBE is enabled. +struct CLRConfig +{ + static struct ConfigKey { } EXTERNAL_NO_SO_NOT_MAINLINE; + static DWORD GetConfigValue(const ConfigKey& key) { return 0; } +}; +#endif + #include "utilcode.h" // this defines assert as _ASSERTE #include "host.h" // this redefines assert for the JIT to use assertAbort #include "utils.h" @@ -520,8 +532,7 @@ extern JitOptions jitOpts; template inline T UninitializedWord() { - static ConfigDWORD fDefaultFill; - __int64 word = 0x0101010101010101LL * (fDefaultFill.val(CLRConfig::INTERNAL_JitDefaultFill) & 0xFF); + __int64 word = 0x0101010101010101LL * (JitConfig.JitDefaultFill() & 0xFF); return (T)word; } -- cgit v1.2.3