Remove JIT-EE version ifdefs (dotnet/coreclr#10273)
authorBruce Forstall <brucefo@microsoft.com>
Sat, 18 Mar 2017 15:12:52 +0000 (08:12 -0700)
committerJan Kotas <jkotas@microsoft.com>
Sat, 18 Mar 2017 15:12:52 +0000 (08:12 -0700)
* Remove COR_JIT_EE_VERSION define

Currently, we maintain two versions of the JIT-EE interface in the
source tree: the current version, and .NET 4.6 version. This is
managed by the `COR_JIT_EE_VERSION` define. Any new changes to the JIT-EE
interface must be put under `#if COR_JIT_EE_VERSION > 460`. As of now,
there are quite a few of these `#if` statements in the tree.

We started doing this so we could build and ship a CTP (Community
Technology Preview) version of the JIT from the current source tree that
runs against earlier versions of the runtime that are widely available
to customers, so those customers can try out the new JIT and give us
early feedback. This was done during the RyuJIT/x64 bring-up before
shipping .NET 4.6, to get as much feedback as possible before replacing
JIT64. After 4.6 shipped, we re-based the old version of the JIT-EE
interface to the 4.6 version, and started adding the above `#if`
conditions, with the thought that if we ever shipped another CTP, it
would be expected to run on top of 4.6. We have not shipped such a
thing, and we currently have no plans to build another CTP in the same
way we did before. (Early adopters can try out the "live" JIT in the
.NET Core open source project, although that JIT can't be used on the
desktop.)

So, to simplify the code, and reduce the cost of adding to or changing
the JIT-EE interface, we are removing the `COR_JIT_EE_VERSION` define.

Commit migrated from https://github.com/dotnet/coreclr/commit/b0d7f96936e4560b02ba4e8d46cb60dfdf086e46

18 files changed:
src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitcompilerimpl.h
src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h
src/coreclr/src/inc/corinfo.h
src/coreclr/src/inc/corjit.h
src/coreclr/src/inc/jithelpers.h
src/coreclr/src/jit/ICorJitInfo_API_wrapper.hpp
src/coreclr/src/jit/compiler.cpp
src/coreclr/src/jit/compiler.h
src/coreclr/src/jit/compiler.hpp
src/coreclr/src/jit/ee_il_dll.cpp
src/coreclr/src/jit/ee_il_dll.hpp
src/coreclr/src/jit/flowgraph.cpp
src/coreclr/src/jit/importer.cpp
src/coreclr/src/jit/jitee.h
src/coreclr/src/jit/jitpch.h
src/coreclr/src/jit/lower.cpp
src/coreclr/src/jit/utils.cpp
src/coreclr/src/jit/valuenum.cpp

index e1190d7..0e36562 100644 (file)
@@ -57,11 +57,7 @@ public:
     // When the EE loads the System.Numerics.Vectors assembly, it asks the JIT what length (in bytes) of
     // SIMD vector it supports as an intrinsic type.  Zero means that the JIT does not support SIMD
     // intrinsics, so the EE should use the default size (i.e. the size of the IL implementation).
-#if COR_JIT_EE_VERSION > 460
     unsigned getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompileFlags); /* { return 0; } */
-#else
-    unsigned getMaxIntrinsicSIMDVectorLength(DWORD cpuCompileFlags); /* { return 0; } */
-#endif
 
     // IL obfuscators sometimes interpose on the EE-JIT interface. This function allows the VM to
     // tell the JIT to use a particular ICorJitCompiler to implement the methods of this interface,
index 1e83343..9385cf7 100644 (file)
@@ -136,16 +136,10 @@ public:
     // If a method's attributes have (getMethodAttribs) CORINFO_FLG_INTRINSIC set,
     // getIntrinsicID() returns the intrinsic ID.
     // *pMustExpand tells whether or not JIT must expand the intrinsic.
-#if COR_JIT_EE_VERSION > 460
     CorInfoIntrinsics getIntrinsicID(
             CORINFO_METHOD_HANDLE       method,
             bool*                       pMustExpand = NULL      /* OUT */
             );
-#else
-    CorInfoIntrinsics getIntrinsicID(
-            CORINFO_METHOD_HANDLE       method
-            );
-#endif
 
     // Is the given module the System.Numerics.Vectors module?
     // This defaults to false.
@@ -237,13 +231,11 @@ public:
     // failures during token resolution.
     void resolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN * pResolvedToken);
 
-#if COR_JIT_EE_VERSION > 460
     // Attempt to resolve a metadata token into a runtime method handle. Returns true
     // if resolution succeeded and false otherwise (e.g. if it encounters invalid metadata
     // during token reoslution). This method should be used instead of `resolveToken` in
     // situations that need to be resilient to invalid metadata.
     bool tryResolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN * pResolvedToken);
-#endif
 
     // Signature information about the call sig
     void findSig (
@@ -473,7 +465,6 @@ public:
             CORINFO_CLASS_HANDLE        cls
             );
 
-#if COR_JIT_EE_VERSION > 460
     bool getReadyToRunHelper(
             CORINFO_RESOLVED_TOKEN *        pResolvedToken,
             CORINFO_LOOKUP_KIND *           pGenericLookupKind,
@@ -486,14 +477,6 @@ public:
             CORINFO_CLASS_HANDLE     delegateType,
             CORINFO_CONST_LOOKUP *   pLookup
             );
-#else
-    void getReadyToRunHelper(
-            CORINFO_RESOLVED_TOKEN * pResolvedToken,
-            CorInfoHelpFunc          id,
-            CORINFO_CONST_LOOKUP *   pLookup
-            );
-#endif
-
 
     const char* getHelperName(
             CorInfoHelpFunc
@@ -810,7 +793,6 @@ public:
     void ThrowExceptionForHelper(
             const CORINFO_HELPER_DESC * throwHelper);
 
-#if COR_JIT_EE_VERSION > 460
     // Runs the given function under an error trap. This allows the JIT to make calls
     // to interface functions that may throw exceptions without needing to be aware of
     // the EH ABI, exception types, etc. Returns true if the given function completed
@@ -819,7 +801,6 @@ public:
         void (*function)(void*), // The function to run
         void* parameter          // The context parameter that will be passed to the function and the handler
         );
-#endif
 
 /*****************************************************************************
  * ICorStaticInfo contains EE interface methods which return values that are
@@ -871,16 +852,12 @@ public:
             size_t FQNameCapacity  /* IN */
             );
 
-#if COR_JIT_EE_VERSION > 460
-
     // returns whether the struct is enregisterable. Only valid on a System V VM. Returns true on success, false on failure.
     bool getSystemVAmd64PassStructInRegisterDescriptor(
         /* IN */    CORINFO_CLASS_HANDLE        structHnd,
         /* OUT */   SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr
         );
 
-#endif // COR_JIT_EE_VERSION
-
 /*****************************************************************************
  * ICorDynamicInfo contains EE interface methods which return values that may
  * change from invocation to invocation.  They cannot be embedded in persisted
@@ -1000,8 +977,7 @@ public:
                     );
 
     // NOTE: the two methods below--getPInvokeUnmanagedTarget and getAddressOfPInvokeFixup--are
-    //       deprecated. New code (i.e. anything that can depend on COR_JIT_EE_VERSION being
-    //       greater than 460) should instead use getAddressOfPInvokeTarget, which subsumes the
+    //       deprecated. New code should instead use getAddressOfPInvokeTarget, which subsumes the
     //       functionality of these methods.
 
     // return the unmanaged target *if method has already been prelinked.*
@@ -1016,14 +992,12 @@ public:
                     void                  **ppIndirection = NULL
                     );
 
-#if COR_JIT_EE_VERSION > 460
     // return the address of the PInvoke target. May be a fixup area in the
     // case of late-bound PInvoke calls.
     void getAddressOfPInvokeTarget(
                     CORINFO_METHOD_HANDLE  method,
                     CORINFO_CONST_LOOKUP  *pLookup
                     );
-#endif
 
     // Generate a cookie based on the signature that would needs to be passed
     // to CORINFO_HELP_PINVOKE_CALLI
@@ -1311,7 +1285,6 @@ public:
     // 
     DWORD getExpectedTargetArchitecture();
 
-#if COR_JIT_EE_VERSION > 460
     // Fetches extended flags for a particular compilation instance. Returns
     // the number of bytes written to the provided buffer.
     DWORD getJitFlags(
@@ -1319,6 +1292,5 @@ public:
         DWORD        sizeInBytes   /* IN: The size of the buffer. Note that this is effectively a
                                           version number for the CORJIT_FLAGS value. */
         );
-#endif
 
 #endif // _ICorJitInfoImpl
index 7473de8..e16a580 100644 (file)
@@ -213,23 +213,6 @@ TODO: Talk about initializing strutures before use
     #define SELECTANY extern __declspec(selectany)
 #endif
 
-// COR_JIT_EE_VERSION is a #define that specifies a JIT-EE version, but on a less granular basis than the GUID.
-// The #define is intended to be used on a per-product basis. That is, for each release that we support a JIT
-// CTP build, we'll update the COR_JIT_EE_VERSION. The GUID must change any time any part of the interface changes.
-//
-// COR_JIT_EE_VERSION is set, by convention, to a number related to the the product number. So, 460 is .NET 4.60.
-// 461 would indicate .NET 4.6.1. Etc.
-//
-// Note that the EE should always build with the most current (highest numbered) version. Only the JIT will
-// potentially build with a lower version number. In that case, the COR_JIT_EE_VERSION will be specified in the
-// CTP JIT build project, such as ctpjit.nativeproj.
-
-#if !defined(COR_JIT_EE_VERSION)
-#define COR_JIT_EE_VERSION 999999999    // This means we'll take everything in the interface
-#endif
-
-#if COR_JIT_EE_VERSION > 460
-
 // Update this one
 SELECTANY const GUID JITEEVersionIdentifier = { /* 3d43decb-a611-4413-a0af-a24278a00e2d */
     0x3d43decb,
@@ -238,27 +221,12 @@ SELECTANY const GUID JITEEVersionIdentifier = { /* 3d43decb-a611-4413-a0af-a2427
     {0xa0, 0xaf, 0xa2, 0x42, 0x78, 0xa0, 0x0e, 0x2d}
   };
 
-#else
-
-// ************ Leave this one alone ***************
-// We need it to build a .NET 4.6 compatible JIT for the RyuJIT CTP releases
-SELECTANY const GUID JITEEVersionIdentifier = { /* 9110edd8-8fc3-4e3d-8ac9-12555ff9be9c */
-    0x9110edd8,
-    0x8fc3,
-    0x4e3d,
-    { 0x8a, 0xc9, 0x12, 0x55, 0x5f, 0xf9, 0xbe, 0x9c }
-};
-
-#endif
-
 //////////////////////////////////////////////////////////////////////////////////////////////////////////
 //
 // END JITEEVersionIdentifier
 //
 //////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-#if COR_JIT_EE_VERSION > 460
-
 // For System V on the CLR type system number of registers to pass in and return a struct is the same.
 // The CLR type system allows only up to 2 eightbytes to be passed in registers. There is no SSEUP classification types.
 #define CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS   2 
@@ -381,8 +349,6 @@ private:
     }
 };
 
-#endif // COR_JIT_EE_VERSION
-
 // CorInfoHelpFunc defines the set of helpers (accessed via the ICorDynamicInfo::getHelperFtn())
 // These helpers can be called by native code which executes in the runtime.
 // Compilers can emit calls to these helpers.
@@ -433,9 +399,7 @@ enum CorInfoHelpFunc
     CORINFO_HELP_NEWSFAST,          // allocator for small, non-finalizer, non-array object
     CORINFO_HELP_NEWSFAST_ALIGN8,   // allocator for small, non-finalizer, non-array object, 8 byte aligned
     CORINFO_HELP_NEW_MDARR,         // multi-dim array helper (with or without lower bounds - dimensions passed in as vararg)
-#if COR_JIT_EE_VERSION > 460
     CORINFO_HELP_NEW_MDARR_NONVARARG,// multi-dim array helper (with or without lower bounds - dimensions passed in as unmanaged array)
-#endif
     CORINFO_HELP_NEWARR_1_DIRECT,   // helper for any one dimensional array creation
     CORINFO_HELP_NEWARR_1_OBJ,      // optimized 1-D object arrays
     CORINFO_HELP_NEWARR_1_VC,       // optimized 1-D value class arrays
@@ -481,9 +445,7 @@ enum CorInfoHelpFunc
     CORINFO_HELP_RNGCHKFAIL,        // array bounds check failed
     CORINFO_HELP_OVERFLOW,          // throw an overflow exception
     CORINFO_HELP_THROWDIVZERO,      // throw a divide by zero exception
-#if COR_JIT_EE_VERSION > 460
     CORINFO_HELP_THROWNULLREF,      // throw a null reference exception
-#endif // COR_JIT_EE_VERSION
 
     CORINFO_HELP_INTERNALTHROW,     // Support for really fast jit
     CORINFO_HELP_VERIFICATION,      // Throw a VerificationException
@@ -639,13 +601,9 @@ enum CorInfoHelpFunc
     CORINFO_HELP_READYTORUN_CHKCAST,
     CORINFO_HELP_READYTORUN_STATIC_BASE,
     CORINFO_HELP_READYTORUN_VIRTUAL_FUNC_PTR,
-#if COR_JIT_EE_VERSION > 460
     CORINFO_HELP_READYTORUN_GENERIC_HANDLE,
     CORINFO_HELP_READYTORUN_DELEGATE_CTOR,
     CORINFO_HELP_READYTORUN_GENERIC_STATIC_BASE,
-#else
-    #define CORINFO_HELP_READYTORUN_DELEGATE_CTOR CORINFO_HELP_EE_PRESTUB
-#endif // COR_JIT_EE_VERSION
 
     CORINFO_HELP_EE_PRESTUB,            // Not real JIT helper. Used in native images.
 
@@ -682,7 +640,6 @@ enum CorInfoHelpFunc
     CORINFO_HELP_LOOP_CLONE_CHOICE_ADDR, // Return the reference to a counter to decide to take cloned path in debug stress.
     CORINFO_HELP_DEBUG_LOG_LOOP_CLONING, // Print a message that a loop cloning optimization has occurred in debug mode.
 
-#if COR_JIT_EE_VERSION > 460
     CORINFO_HELP_THROW_ARGUMENTEXCEPTION,           // throw ArgumentException
     CORINFO_HELP_THROW_ARGUMENTOUTOFRANGEEXCEPTION, // throw ArgumentOutOfRangeException
 
@@ -693,7 +650,6 @@ enum CorInfoHelpFunc
     CORINFO_HELP_JIT_REVERSE_PINVOKE_EXIT,  // Transition to preemptive mode in reverse P/Invoke epilog, frame is the first argument
 
     CORINFO_HELP_GVMLOOKUP_FOR_SLOT,        // Resolve a generic virtual method target from this pointer and runtime method handle 
-#endif
 
     CORINFO_HELP_COUNT,
 };
@@ -1311,8 +1267,6 @@ enum CORINFO_RUNTIME_LOOKUP_KIND
     CORINFO_LOOKUP_CLASSPARAM,
 };
 
-#if COR_JIT_EE_VERSION > 460
-
 struct CORINFO_LOOKUP_KIND
 {
     bool                        needsRuntimeLookup;
@@ -1324,16 +1278,6 @@ struct CORINFO_LOOKUP_KIND
     void *                      runtimeLookupArgs;
 } ;
 
-#else
-
-struct CORINFO_LOOKUP_KIND
-{
-    bool                        needsRuntimeLookup;
-    CORINFO_RUNTIME_LOOKUP_KIND runtimeLookupKind;
-} ;
-
-#endif
-
 
 // CORINFO_RUNTIME_LOOKUP indicates the details of the runtime lookup
 // operation to be performed.
@@ -1611,10 +1555,8 @@ enum CorInfoTokenKind
     // token comes from CEE_CONSTRAINED
     CORINFO_TOKENKIND_Constrained = 0x100 | CORINFO_TOKENKIND_Class,
 
-#if COR_JIT_EE_VERSION > 460
     // token comes from CEE_NEWOBJ
     CORINFO_TOKENKIND_NewObj    = 0x200 | CORINFO_TOKENKIND_Method,
-#endif
 };
 
 struct CORINFO_RESOLVED_TOKEN
@@ -1713,15 +1655,11 @@ enum CORINFO_FIELD_ACCESSOR
     CORINFO_FIELD_STATIC_GENERICS_STATIC_HELPER, // static field access using the "generic static" helper (argument is MethodTable *)
     CORINFO_FIELD_STATIC_ADDR_HELPER,       // static field accessed using address-of helper (argument is FieldDesc *)
     CORINFO_FIELD_STATIC_TLS,               // unmanaged TLS access
-#if COR_JIT_EE_VERSION > 460
     CORINFO_FIELD_STATIC_READYTORUN_HELPER, // static field access using a runtime lookup helper
-#endif
 
     CORINFO_FIELD_INTRINSIC_ZERO,           // intrinsic zero (IntPtr.Zero, UIntPtr.Zero)
     CORINFO_FIELD_INTRINSIC_EMPTY_STRING,   // intrinsic emptry string (String.Empty)
-#if COR_JIT_EE_VERSION > 460
     CORINFO_FIELD_INTRINSIC_ISLITTLEENDIAN, // intrinsic BitConverter.IsLittleEndian
-#endif
 };
 
 // Set of flags returned in CORINFO_FIELD_INFO::fieldFlags
@@ -1833,7 +1771,6 @@ struct CORINFO_EE_INFO
     // Array offsets
     unsigned    offsetOfObjArrayData;
 
-#if COR_JIT_EE_VERSION > 460
     // Reverse PInvoke offsets
     unsigned    sizeOfReversePInvokeFrame;
 
@@ -1846,7 +1783,6 @@ struct CORINFO_EE_INFO
     // Target ABI. Combined with target architecture and OS to determine
     // GC, EH, and unwind styles.
     CORINFO_RUNTIME_ABI targetAbi;
-#endif
 
     CORINFO_OS  osType;
     unsigned    osMajor;
@@ -1863,18 +1799,6 @@ enum { LCL_FINALLY_MARK = 0xFC }; // FC = "Finally Call"
  * when it generates code
  **********************************************************************************/
 
-#if COR_JIT_EE_VERSION <= 460
-
-#define CORINFO_PAGE_SIZE   0x1000                           // the page size on the machine
-
-#ifndef FEATURE_PAL
-#define MAX_UNCHECKED_OFFSET_FOR_NULL_OBJECT ((32*1024)-1)   // when generating JIT code
-#else // !FEATURE_PAL
-#define MAX_UNCHECKED_OFFSET_FOR_NULL_OBJECT ((OS_PAGE_SIZE / 2) - 1)
-#endif // !FEATURE_PAL
-
-#endif // COR_JIT_EE_VERISION <= 460
-
 #include <pshpack4.h>
 
 typedef void* CORINFO_MethodPtr;            // a generic method pointer
@@ -2116,7 +2040,6 @@ public:
             unsigned*                   offsetAfterIndirection  /* OUT */
             ) = 0;
 
-#if COR_JIT_EE_VERSION > 460
     // Find the virtual method in implementingClass that overrides virtualMethod,
     // or the method in implementingClass that implements the interface method
     // represented by virtualMethod.
@@ -2128,21 +2051,14 @@ public:
             CORINFO_CLASS_HANDLE        implementingClass,      /* IN */
             CORINFO_CONTEXT_HANDLE      ownerType = NULL        /* IN */
             ) = 0;
-#endif
 
     // If a method's attributes have (getMethodAttribs) CORINFO_FLG_INTRINSIC set,
     // getIntrinsicID() returns the intrinsic ID.
     // *pMustExpand tells whether or not JIT must expand the intrinsic.
-#if COR_JIT_EE_VERSION > 460
     virtual CorInfoIntrinsics getIntrinsicID(
             CORINFO_METHOD_HANDLE       method,
             bool*                       pMustExpand = NULL      /* OUT */
             ) = 0;
-#else
-    virtual CorInfoIntrinsics getIntrinsicID(
-            CORINFO_METHOD_HANDLE       method
-            ) = 0;
-#endif
 
     // Is the given module the System.Numerics.Vectors module?
     // This defaults to false.
@@ -2234,13 +2150,11 @@ public:
     // failures during token resolution.
     virtual void resolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN * pResolvedToken) = 0;
 
-#if COR_JIT_EE_VERSION > 460
     // Attempt to resolve a metadata token into a runtime method handle. Returns true
     // if resolution succeeded and false otherwise (e.g. if it encounters invalid metadata
     // during token reoslution). This method should be used instead of `resolveToken` in
     // situations that need to be resilient to invalid metadata.
     virtual bool tryResolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN * pResolvedToken) = 0;
-#endif
 
     // Signature information about the call sig
     virtual void findSig (
@@ -2470,7 +2384,6 @@ public:
             CORINFO_CLASS_HANDLE        cls
             ) = 0;
 
-#if COR_JIT_EE_VERSION > 460
     virtual bool getReadyToRunHelper(
             CORINFO_RESOLVED_TOKEN *        pResolvedToken,
             CORINFO_LOOKUP_KIND *           pGenericLookupKind,
@@ -2483,14 +2396,6 @@ public:
             CORINFO_CLASS_HANDLE     delegateType,
             CORINFO_CONST_LOOKUP *   pLookup
             ) = 0;
-#else
-    virtual void getReadyToRunHelper(
-            CORINFO_RESOLVED_TOKEN * pResolvedToken,
-            CorInfoHelpFunc          id,
-            CORINFO_CONST_LOOKUP *   pLookup
-            ) = 0;
-#endif
-
 
     virtual const char* getHelperName(
             CorInfoHelpFunc
@@ -2807,7 +2712,6 @@ public:
     virtual void ThrowExceptionForHelper(
             const CORINFO_HELPER_DESC * throwHelper) = 0;
 
-#if COR_JIT_EE_VERSION > 460
     // Runs the given function under an error trap. This allows the JIT to make calls
     // to interface functions that may throw exceptions without needing to be aware of
     // the EH ABI, exception types, etc. Returns true if the given function completed
@@ -2816,7 +2720,6 @@ public:
         void (*function)(void*), // The function to run
         void* parameter          // The context parameter that will be passed to the function and the handler
         ) = 0;
-#endif
 
 /*****************************************************************************
  * ICorStaticInfo contains EE interface methods which return values that are
@@ -2868,16 +2771,12 @@ public:
             size_t FQNameCapacity  /* IN */
             ) = 0;
 
-#if COR_JIT_EE_VERSION > 460
-
     // returns whether the struct is enregisterable. Only valid on a System V VM. Returns true on success, false on failure.
     virtual bool getSystemVAmd64PassStructInRegisterDescriptor(
         /* IN */    CORINFO_CLASS_HANDLE        structHnd,
         /* OUT */   SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr
         ) = 0;
 
-#endif // COR_JIT_EE_VERSION
-
 };
 
 /*****************************************************************************
@@ -3003,8 +2902,7 @@ public:
                     ) = 0;
 
     // NOTE: the two methods below--getPInvokeUnmanagedTarget and getAddressOfPInvokeFixup--are
-    //       deprecated. New code (i.e. anything that can depend on COR_JIT_EE_VERSION being
-    //       greater than 460) should instead use getAddressOfPInvokeTarget, which subsumes the
+    //       deprecated. New code should instead use getAddressOfPInvokeTarget, which subsumes the
     //       functionality of these methods.
 
     // return the unmanaged target *if method has already been prelinked.*
@@ -3019,14 +2917,12 @@ public:
                     void                  **ppIndirection = NULL
                     ) = 0;
 
-#if COR_JIT_EE_VERSION > 460
     // return the address of the PInvoke target. May be a fixup area in the
     // case of late-bound PInvoke calls.
     virtual void getAddressOfPInvokeTarget(
                     CORINFO_METHOD_HANDLE  method,
                     CORINFO_CONST_LOOKUP  *pLookup
                     ) = 0;
-#endif
 
     // Generate a cookie based on the signature that would needs to be passed
     // to CORINFO_HELP_PINVOKE_CALLI
index 6d01b9f..f434fee 100644 (file)
@@ -72,86 +72,6 @@ enum CorJitResult
     CORJIT_RECOVERABLEERROR =  MAKE_HRESULT(SEVERITY_ERROR,FACILITY_NULL, 5),
 };
 
-
-#if COR_JIT_EE_VERSION <= 460
-
-/* values for flags in compileMethod */
-
-enum CorJitFlag
-{
-    CORJIT_FLG_SPEED_OPT           = 0x00000001,
-    CORJIT_FLG_SIZE_OPT            = 0x00000002,
-    CORJIT_FLG_DEBUG_CODE          = 0x00000004, // generate "debuggable" code (no code-mangling optimizations)
-    CORJIT_FLG_DEBUG_EnC           = 0x00000008, // We are in Edit-n-Continue mode
-    CORJIT_FLG_DEBUG_INFO          = 0x00000010, // generate line and local-var info
-    CORJIT_FLG_MIN_OPT             = 0x00000020, // disable all jit optimizations (not necesarily debuggable code)
-    CORJIT_FLG_GCPOLL_CALLS        = 0x00000040, // Emit calls to JIT_POLLGC for thread suspension.
-    CORJIT_FLG_MCJIT_BACKGROUND    = 0x00000080, // Calling from multicore JIT background thread, do not call JitComplete
-
-    CORJIT_FLG_UNUSED1             = 0x00000100,
-
-#if defined(_TARGET_X86_)
-
-    CORJIT_FLG_PINVOKE_RESTORE_ESP = 0x00000200, // Restore ESP after returning from inlined PInvoke
-    CORJIT_FLG_TARGET_P4           = 0x00000400,
-    CORJIT_FLG_USE_FCOMI           = 0x00000800, // Generated code may use fcomi(p) instruction
-    CORJIT_FLG_USE_CMOV            = 0x00001000, // Generated code may use cmov instruction
-    CORJIT_FLG_USE_SSE2            = 0x00002000, // Generated code may use SSE-2 instructions
-
-#elif defined(_TARGET_AMD64_)
-
-    CORJIT_FLG_USE_SSE3_4          = 0x00000200,
-    CORJIT_FLG_USE_AVX             = 0x00000400,
-    CORJIT_FLG_USE_AVX2            = 0x00000800,
-    CORJIT_FLG_USE_AVX_512         = 0x00001000,
-    CORJIT_FLG_FEATURE_SIMD        = 0x00002000,
-
-#else // !defined(_TARGET_X86_) && !defined(_TARGET_AMD64_)
-
-    CORJIT_FLG_UNUSED2             = 0x00000200,
-    CORJIT_FLG_UNUSED3             = 0x00000400,
-    CORJIT_FLG_UNUSED4             = 0x00000800,
-    CORJIT_FLG_UNUSED5             = 0x00001000,
-    CORJIT_FLG_UNUSED6             = 0x00002000,
-
-#endif // !defined(_TARGET_X86_) && !defined(_TARGET_AMD64_)
-
-    CORJIT_FLG_MAKEFINALCODE       = 0x00008000, // Use the final code generator, i.e., not the interpreter.
-    CORJIT_FLG_READYTORUN          = 0x00010000, // Use version-resilient code generation
-
-    CORJIT_FLG_PROF_ENTERLEAVE     = 0x00020000, // Instrument prologues/epilogues
-    CORJIT_FLG_PROF_REJIT_NOPS     = 0x00040000, // Insert NOPs to ensure code is re-jitable
-    CORJIT_FLG_PROF_NO_PINVOKE_INLINE
-                                   = 0x00080000, // Disables PInvoke inlining
-    CORJIT_FLG_SKIP_VERIFICATION   = 0x00100000, // (lazy) skip verification - determined without doing a full resolve. See comment below
-    CORJIT_FLG_PREJIT              = 0x00200000, // jit or prejit is the execution engine.
-    CORJIT_FLG_RELOC               = 0x00400000, // Generate relocatable code
-    CORJIT_FLG_IMPORT_ONLY         = 0x00800000, // Only import the function
-    CORJIT_FLG_IL_STUB             = 0x01000000, // method is an IL stub
-    CORJIT_FLG_PROCSPLIT           = 0x02000000, // JIT should separate code into hot and cold sections
-    CORJIT_FLG_BBINSTR             = 0x04000000, // Collect basic block profile information
-    CORJIT_FLG_BBOPT               = 0x08000000, // Optimize method based on profile information
-    CORJIT_FLG_FRAMED              = 0x10000000, // All methods have an EBP frame
-    CORJIT_FLG_ALIGN_LOOPS         = 0x20000000, // add NOPs before loops to align them at 16 byte boundaries
-    CORJIT_FLG_PUBLISH_SECRET_PARAM= 0x40000000, // JIT must place stub secret param into local 0.  (used by IL stubs)
-    CORJIT_FLG_GCPOLL_INLINE       = 0x80000000, // JIT must inline calls to GCPoll when possible
-};
-
-enum CorJitFlag2
-{
-    CORJIT_FLG2_SAMPLING_JIT_BACKGROUND = 0x00000001, // JIT is being invoked as a result of stack sampling for hot methods in the background
-};
-
-struct CORJIT_FLAGS
-{
-    unsigned corJitFlags;   // Values are from CorJitFlag
-    unsigned corJitFlags2;  // Values are from CorJitFlag2
-};
-
-#endif // COR_JIT_EE_VERSION <= 460
-
-#if COR_JIT_EE_VERSION > 460
-
 class CORJIT_FLAGS
 {
 public:
@@ -292,7 +212,6 @@ private:
     unsigned __int64 corJitFlags;
 };
 
-#endif // COR_JIT_EE_VERSION > 460
 
 /*****************************************************************************
 Here is how CORJIT_FLAG_SKIP_VERIFICATION should be interepreted.
@@ -450,14 +369,10 @@ enum CheckedWriteBarrierKinds {
     CWBKind_AddrOfLocal,     // Store through the address of a local (arguably a bug that this happens at all).
 };
 
-#if COR_JIT_EE_VERSION > 460
-
 #include "corjithost.h"
 
 extern "C" void __stdcall jitStartup(ICorJitHost* host);
 
-#endif
-
 class ICorJitCompiler;
 class ICorJitInfo;
 struct IEEMemoryManager;
@@ -515,11 +430,7 @@ public:
     // When the EE loads the System.Numerics.Vectors assembly, it asks the JIT what length (in bytes) of
     // SIMD vector it supports as an intrinsic type.  Zero means that the JIT does not support SIMD
     // intrinsics, so the EE should use the default size (i.e. the size of the IL implementation).
-#if COR_JIT_EE_VERSION > 460
     virtual unsigned getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompileFlags) { return 0; }
-#else
-    virtual unsigned getMaxIntrinsicSIMDVectorLength(DWORD cpuCompileFlags) { return 0; }
-#endif
 
     // IL obfuscators sometimes interpose on the EE-JIT interface. This function allows the VM to
     // tell the JIT to use a particular ICorJitCompiler to implement the methods of this interface,
@@ -702,7 +613,6 @@ public:
     // 
     virtual DWORD getExpectedTargetArchitecture() = 0;
 
-#if COR_JIT_EE_VERSION > 460
     // Fetches extended flags for a particular compilation instance. Returns
     // the number of bytes written to the provided buffer.
     virtual DWORD getJitFlags(
@@ -710,7 +620,6 @@ public:
         DWORD        sizeInBytes   /* IN: The size of the buffer. Note that this is effectively a
                                           version number for the CORJIT_FLAGS value. */
         ) = 0;
-#endif
 };
 
 /**********************************************************************************/
index 5f01a1b..4e56250 100644 (file)
@@ -75,9 +75,7 @@
     DYNAMICJITHELPER(CORINFO_HELP_NEWSFAST,             JIT_New,    CORINFO_HELP_SIG_REG_ONLY)
     DYNAMICJITHELPER(CORINFO_HELP_NEWSFAST_ALIGN8,      JIT_New,    CORINFO_HELP_SIG_REG_ONLY)
     JITHELPER(CORINFO_HELP_NEW_MDARR,                   JIT_NewMDArr,CORINFO_HELP_SIG_8_VA)
-#if COR_JIT_EE_VERSION > 460
     JITHELPER(CORINFO_HELP_NEW_MDARR_NONVARARG,         JIT_NewMDArrNonVarArg,CORINFO_HELP_SIG_4_STACK)
-#endif
     JITHELPER(CORINFO_HELP_NEWARR_1_DIRECT,             JIT_NewArr1,CORINFO_HELP_SIG_REG_ONLY)
     DYNAMICJITHELPER(CORINFO_HELP_NEWARR_1_OBJ,         JIT_NewArr1,CORINFO_HELP_SIG_REG_ONLY)
     DYNAMICJITHELPER(CORINFO_HELP_NEWARR_1_VC,          JIT_NewArr1,CORINFO_HELP_SIG_REG_ONLY)
     JITHELPER(CORINFO_HELP_RNGCHKFAIL,          JIT_RngChkFail,     CORINFO_HELP_SIG_REG_ONLY)
     JITHELPER(CORINFO_HELP_OVERFLOW,            JIT_Overflow,       CORINFO_HELP_SIG_REG_ONLY)
     JITHELPER(CORINFO_HELP_THROWDIVZERO,        JIT_ThrowDivZero,   CORINFO_HELP_SIG_REG_ONLY)
-#if COR_JIT_EE_VERSION > 460
     JITHELPER(CORINFO_HELP_THROWNULLREF,        JIT_ThrowNullRef,   CORINFO_HELP_SIG_REG_ONLY)
-#endif // COR_JIT_EE_VERSION
     JITHELPER(CORINFO_HELP_INTERNALTHROW,       JIT_InternalThrow,  CORINFO_HELP_SIG_REG_ONLY)
     JITHELPER(CORINFO_HELP_VERIFICATION,        IL_VerificationError,CORINFO_HELP_SIG_REG_ONLY)
     JITHELPER(CORINFO_HELP_SEC_UNMGDCODE_EXCPT, JIT_SecurityUnmanagedCodeException, CORINFO_HELP_SIG_REG_ONLY)
     JITHELPER(CORINFO_HELP_GETFIELDADDR,                JIT_GetFieldAddr,CORINFO_HELP_SIG_REG_ONLY)
 
     JITHELPER(CORINFO_HELP_GETSTATICFIELDADDR_CONTEXT,  NULL,       CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)
-
-#if COR_JIT_EE_VERSION > 460
     JITHELPER(CORINFO_HELP_GETSTATICFIELDADDR_TLS,      NULL,       CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)
-#else // COR_JIT_EE_VERSION
-    JITHELPER(CORINFO_HELP_GETSTATICFIELDADDR_TLS,      JIT_GetStaticFieldAddr_Tls,CORINFO_HELP_SIG_REG_ONLY)
-#endif // COR_JIT_EE_VERSION
 
     JITHELPER(CORINFO_HELP_GETGENERICS_GCSTATIC_BASE,   JIT_GetGenericsGCStaticBase,CORINFO_HELP_SIG_REG_ONLY)
     JITHELPER(CORINFO_HELP_GETGENERICS_NONGCSTATIC_BASE, JIT_GetGenericsNonGCStaticBase,CORINFO_HELP_SIG_REG_ONLY)
     JITHELPER(CORINFO_HELP_READYTORUN_CHKCAST,             NULL,   CORINFO_HELP_SIG_NO_ALIGN_STUB)
     JITHELPER(CORINFO_HELP_READYTORUN_STATIC_BASE,         NULL,   CORINFO_HELP_SIG_NO_ALIGN_STUB)
     JITHELPER(CORINFO_HELP_READYTORUN_VIRTUAL_FUNC_PTR,    NULL,   CORINFO_HELP_SIG_NO_ALIGN_STUB)
-#if COR_JIT_EE_VERSION > 460
     JITHELPER(CORINFO_HELP_READYTORUN_GENERIC_HANDLE,      NULL,   CORINFO_HELP_SIG_NO_ALIGN_STUB)
     JITHELPER(CORINFO_HELP_READYTORUN_DELEGATE_CTOR,       NULL,   CORINFO_HELP_SIG_NO_ALIGN_STUB)
     JITHELPER(CORINFO_HELP_READYTORUN_GENERIC_STATIC_BASE, NULL,   CORINFO_HELP_SIG_NO_ALIGN_STUB)
-#endif // COR_JIT_EE_VERSION
 
     JITHELPER(CORINFO_HELP_EE_PRESTUB,          ThePreStub,                 CORINFO_HELP_SIG_NO_ALIGN_STUB)
 
     JITHELPER(CORINFO_HELP_LOOP_CLONE_CHOICE_ADDR, JIT_LoopCloneChoiceAddr, CORINFO_HELP_SIG_REG_ONLY)
     JITHELPER(CORINFO_HELP_DEBUG_LOG_LOOP_CLONING, JIT_DebugLogLoopCloning, CORINFO_HELP_SIG_REG_ONLY)
 
-#if COR_JIT_EE_VERSION > 460
-
     JITHELPER(CORINFO_HELP_THROW_ARGUMENTEXCEPTION,           JIT_ThrowArgumentException,           CORINFO_HELP_SIG_REG_ONLY)
     JITHELPER(CORINFO_HELP_THROW_ARGUMENTOUTOFRANGEEXCEPTION, JIT_ThrowArgumentOutOfRangeException, CORINFO_HELP_SIG_REG_ONLY)
 
 
     JITHELPER(CORINFO_HELP_GVMLOOKUP_FOR_SLOT, NULL, CORINFO_HELP_SIG_NO_ALIGN_STUB)
 
-#endif // COR_JIT_EE_VERSION
-
 #undef JITHELPER
 #undef DYNAMICJITHELPER
 #undef JITHELPER
index 4272b27..2d08b4c 100644 (file)
@@ -129,8 +129,6 @@ void WrapICorJitInfo::getMethodVTableOffset(
     API_LEAVE(getMethodVTableOffset);
 }
 
-#if COR_JIT_EE_VERSION > 460
-
 CorInfoIntrinsics WrapICorJitInfo::getIntrinsicID(
             CORINFO_METHOD_HANDLE       method,
             bool*                       pMustExpand             /* OUT */)
@@ -141,18 +139,6 @@ CorInfoIntrinsics WrapICorJitInfo::getIntrinsicID(
     return temp;
 }
 
-#else
-
-CorInfoIntrinsics WrapICorJitInfo::getIntrinsicID(CORINFO_METHOD_HANDLE method)
-{
-    API_ENTER(getIntrinsicID);
-    CorInfoIntrinsics temp = wrapHnd->getIntrinsicID(method);
-    API_LEAVE(getIntrinsicID);
-    return temp;
-}
-
-#endif
-
 bool WrapICorJitInfo::isInSIMDModule(CORINFO_CLASS_HANDLE classHnd)
 {
     API_ENTER(isInSIMDModule);
@@ -281,8 +267,6 @@ void WrapICorJitInfo::resolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN * pResol
     API_LEAVE(resolveToken);
 }
 
-#if COR_JIT_EE_VERSION > 460
-
 bool WrapICorJitInfo::tryResolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN * pResolvedToken)
 {
     API_ENTER(tryResolveToken);
@@ -291,8 +275,6 @@ bool WrapICorJitInfo::tryResolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN * pRe
     return success;
 }
 
-#endif
-
 void WrapICorJitInfo::findSig(
             CORINFO_MODULE_HANDLE       module,
             unsigned                    sigTOK,
@@ -617,8 +599,6 @@ CorInfoHelpFunc WrapICorJitInfo::getUnBoxHelper(
     return temp;
 }
 
-#if COR_JIT_EE_VERSION > 460
-
 bool WrapICorJitInfo::getReadyToRunHelper(
             CORINFO_RESOLVED_TOKEN * pResolvedToken,
             CORINFO_LOOKUP_KIND *    pGenericLookupKind,
@@ -641,20 +621,6 @@ void WrapICorJitInfo::getReadyToRunDelegateCtorHelper(
     API_LEAVE(getReadyToRunDelegateCtorHelper);
 }
 
-#else
-
-void WrapICorJitInfo::getReadyToRunHelper(
-            CORINFO_RESOLVED_TOKEN * pResolvedToken,
-            CorInfoHelpFunc          id,
-            CORINFO_CONST_LOOKUP *   pLookup)
-{
-    API_ENTER(getReadyToRunHelper);
-    wrapHnd->getReadyToRunHelper(pResolvedToken, id, pLookup);
-    API_LEAVE(getReadyToRunHelper);
-}
-
-#endif
-
 const char* WrapICorJitInfo::getHelperName(
             CorInfoHelpFunc funcNum)
 {
@@ -1094,8 +1060,6 @@ size_t WrapICorJitInfo::findNameOfToken(
     return result;
 }
 
-#if COR_JIT_EE_VERSION > 460
-
 bool WrapICorJitInfo::getSystemVAmd64PassStructInRegisterDescriptor(
         /* IN */    CORINFO_CLASS_HANDLE        structHnd,
         /* OUT */   SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr)
@@ -1106,8 +1070,6 @@ bool WrapICorJitInfo::getSystemVAmd64PassStructInRegisterDescriptor(
     return result;
 }
 
-#endif
-
 DWORD WrapICorJitInfo::getThreadTLSIndex(
                 void                  **ppIndirection)
 {
@@ -1271,8 +1233,6 @@ void* WrapICorJitInfo::getAddressOfPInvokeFixup(
     return temp;
 }
 
-#if COR_JIT_EE_VERSION > 460
-
 void WrapICorJitInfo::getAddressOfPInvokeTarget(
                 CORINFO_METHOD_HANDLE   method,
                 CORINFO_CONST_LOOKUP   *pLookup)
@@ -1282,8 +1242,6 @@ void WrapICorJitInfo::getAddressOfPInvokeTarget(
     API_LEAVE(getAddressOfPInvokeTarget);
 }
 
-#endif
-
 LPVOID WrapICorJitInfo::GetCookieForPInvokeCalliSig(
         CORINFO_SIG_INFO* szMetaSig,
         void           ** ppIndirection)
@@ -1474,8 +1432,6 @@ void* WrapICorJitInfo::getTailCallCopyArgsThunk(
 //
 /*********************************************************************************/
 
-#if COR_JIT_EE_VERSION > 460
-
 DWORD WrapICorJitInfo::getJitFlags(CORJIT_FLAGS *jitFlags, DWORD sizeInBytes)
 {
     API_ENTER(getJitFlags);
@@ -1489,8 +1445,6 @@ bool WrapICorJitInfo::runWithErrorTrap(void(*function)(void*), void *param)
     return wrapHnd->runWithErrorTrap(function, param);
 }
 
-#endif
-
 IEEMemoryManager* WrapICorJitInfo::getMemoryManager()
 {
     API_ENTER(getMemoryManager);
index b81ae24..5db4d3f 100644 (file)
@@ -4996,11 +4996,7 @@ int Compiler::compCompile(CORINFO_METHOD_HANDLE methodHnd,
     info.compMatchedVM = false;
 #endif
 
-#if COR_JIT_EE_VERSION > 460
     compMaxUncheckedOffsetForNullObject = eeGetEEInfo()->maxUncheckedOffsetForNullObject;
-#else  // COR_JIT_EE_VERSION <= 460
-    compMaxUncheckedOffsetForNullObject = MAX_UNCHECKED_OFFSET_FOR_NULL_OBJECT;
-#endif // COR_JIT_EE_VERSION > 460
 
     // Set the context for token lookup.
     if (compIsForInlining())
index 7baba5d..07ce772 100644 (file)
@@ -6561,11 +6561,7 @@ public:
     // Returns the page size for the target machine as reported by the EE.
     inline size_t eeGetPageSize()
     {
-#if COR_JIT_EE_VERSION > 460
         return eeGetEEInfo()->osPageSize;
-#else  // COR_JIT_EE_VERSION <= 460
-        return CORINFO_PAGE_SIZE;
-#endif // COR_JIT_EE_VERSION > 460
     }
 
     // Returns the frame size at which we will generate a loop to probe the stack.
@@ -6583,11 +6579,7 @@ public:
 
     inline bool IsTargetAbi(CORINFO_RUNTIME_ABI abi)
     {
-#if COR_JIT_EE_VERSION > 460
         return eeGetEEInfo()->targetAbi == abi;
-#else
-        return CORINFO_DESKTOP_ABI == abi;
-#endif
     }
 
     inline bool generateCFIUnwindCodes()
@@ -7782,28 +7774,20 @@ public:
         // PInvoke transitions inline (e.g. when targeting CoreRT).
         inline bool ShouldUsePInvokeHelpers()
         {
-#if COR_JIT_EE_VERSION > 460
             return jitFlags->IsSet(JitFlags::JIT_FLAG_USE_PINVOKE_HELPERS);
-#else
-            return false;
-#endif
         }
 
         // true if we should use insert the REVERSE_PINVOKE_{ENTER,EXIT} helpers in the method
         // prolog/epilog
         inline bool IsReversePInvoke()
         {
-#if COR_JIT_EE_VERSION > 460
             return jitFlags->IsSet(JitFlags::JIT_FLAG_REVERSE_PINVOKE);
-#else
-            return false;
-#endif
         }
 
         // true if we must generate code compatible with JIT32 quirks
         inline bool IsJit32Compat()
         {
-#if defined(_TARGET_X86_) && COR_JIT_EE_VERSION > 460
+#if defined(_TARGET_X86_)
             return jitFlags->IsSet(JitFlags::JIT_FLAG_DESKTOP_QUIRKS);
 #else
             return false;
@@ -7813,9 +7797,9 @@ public:
         // true if we must generate code compatible with Jit64 quirks
         inline bool IsJit64Compat()
         {
-#if defined(_TARGET_AMD64_) && COR_JIT_EE_VERSION > 460
+#if defined(_TARGET_AMD64_)
             return jitFlags->IsSet(JitFlags::JIT_FLAG_DESKTOP_QUIRKS);
-#elif defined(_TARGET_AMD64_) && !defined(FEATURE_CORECLR)
+#elif !defined(FEATURE_CORECLR)
             return true;
 #else
             return false;
index 3a6dd82..1649710 100644 (file)
@@ -2891,9 +2891,7 @@ inline bool Compiler::fgIsThrowHlpBlk(BasicBlock* block)
 
     if (!((call->gtCall.gtCallMethHnd == eeFindHelper(CORINFO_HELP_RNGCHKFAIL)) ||
           (call->gtCall.gtCallMethHnd == eeFindHelper(CORINFO_HELP_THROWDIVZERO)) ||
-#if COR_JIT_EE_VERSION > 460
           (call->gtCall.gtCallMethHnd == eeFindHelper(CORINFO_HELP_THROWNULLREF)) ||
-#endif // COR_JIT_EE_VERSION
           (call->gtCall.gtCallMethHnd == eeFindHelper(CORINFO_HELP_OVERFLOW))))
     {
         return false;
@@ -2907,11 +2905,8 @@ inline bool Compiler::fgIsThrowHlpBlk(BasicBlock* block)
     {
         if (block == add->acdDstBlk)
         {
-            return add->acdKind == SCK_RNGCHK_FAIL || add->acdKind == SCK_DIV_BY_ZERO || add->acdKind == SCK_OVERFLOW
-#if COR_JIT_EE_VERSION > 460
-                   || add->acdKind == SCK_ARG_EXCPN || add->acdKind == SCK_ARG_RNG_EXCPN
-#endif // COR_JIT_EE_VERSION
-                ;
+            return add->acdKind == SCK_RNGCHK_FAIL || add->acdKind == SCK_DIV_BY_ZERO || add->acdKind == SCK_OVERFLOW ||
+                   add->acdKind == SCK_ARG_EXCPN || add->acdKind == SCK_ARG_RNG_EXCPN;
         }
     }
 
@@ -2933,11 +2928,8 @@ inline unsigned Compiler::fgThrowHlpBlkStkLevel(BasicBlock* block)
         {
             // Compute assert cond separately as assert macro cannot have conditional compilation directives.
             bool cond =
-                (add->acdKind == SCK_RNGCHK_FAIL || add->acdKind == SCK_DIV_BY_ZERO || add->acdKind == SCK_OVERFLOW
-#if COR_JIT_EE_VERSION > 460
-                 || add->acdKind == SCK_ARG_EXCPN || add->acdKind == SCK_ARG_RNG_EXCPN
-#endif // COR_JIT_EE_VERSION
-                 );
+                (add->acdKind == SCK_RNGCHK_FAIL || add->acdKind == SCK_DIV_BY_ZERO || add->acdKind == SCK_OVERFLOW ||
+                 add->acdKind == SCK_ARG_EXCPN || add->acdKind == SCK_ARG_RNG_EXCPN);
             assert(cond);
 
             // TODO: bbTgtStkDepth is DEBUG-only.
index cfbc44c..c0384f3 100644 (file)
@@ -136,9 +136,6 @@ extern "C" BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID pvReserv
     {
         g_hInst = (HINSTANCE)hInstance;
         DisableThreadLibraryCalls((HINSTANCE)hInstance);
-#if defined(SELF_NO_HOST) && COR_JIT_EE_VERSION <= 460
-        jitStartup(JitHost::getJitHost());
-#endif
     }
     else if (dwReason == DLL_PROCESS_DETACH)
     {
@@ -158,10 +155,6 @@ extern "C" void __stdcall sxsJitStartup(CoreClrCallbacks const& cccallbacks)
 #ifndef SELF_NO_HOST
     InitUtilcode(cccallbacks);
 #endif
-
-#if COR_JIT_EE_VERSION <= 460
-    jitStartup(JitHost::getJitHost());
-#endif
 }
 
 #endif // !FEATURE_MERGE_JIT_AND_ENGINE
@@ -286,15 +279,11 @@ CorJitResult CILJit::compileMethod(
 
     JitFlags jitFlags;
 
-#if COR_JIT_EE_VERSION > 460
     assert(flags == CORJIT_FLAGS::CORJIT_FLAG_CALL_GETJITFLAGS);
     CORJIT_FLAGS corJitFlags;
     DWORD        jitFlagsSize = compHnd->getJitFlags(&corJitFlags, sizeof(corJitFlags));
     assert(jitFlagsSize == sizeof(corJitFlags));
     jitFlags.SetFromFlags(corJitFlags);
-#else  // COR_JIT_EE_VERSION <= 460
-    jitFlags.SetFromOldFlags(flags, 0);
-#endif // COR_JIT_EE_VERSION <= 460
 
     int                   result;
     void*                 methodCodePtr = nullptr;
@@ -382,11 +371,7 @@ void CILJit::getVersionIdentifier(GUID* versionIdentifier)
  * Determine the maximum length of SIMD vector supported by this JIT.
  */
 
-#if COR_JIT_EE_VERSION > 460
 unsigned CILJit::getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompileFlags)
-#else
-unsigned CILJit::getMaxIntrinsicSIMDVectorLength(DWORD cpuCompileFlags)
-#endif
 {
     if (g_realJitCompiler != nullptr)
     {
@@ -394,12 +379,7 @@ unsigned CILJit::getMaxIntrinsicSIMDVectorLength(DWORD cpuCompileFlags)
     }
 
     JitFlags jitFlags;
-
-#if COR_JIT_EE_VERSION > 460
     jitFlags.SetFromFlags(cpuCompileFlags);
-#else  // COR_JIT_EE_VERSION <= 460
-    jitFlags.SetFromOldFlags(cpuCompileFlags, 0);
-#endif // COR_JIT_EE_VERSION <= 460
 
 #ifdef FEATURE_SIMD
 #ifdef _TARGET_XARCH_
@@ -1244,146 +1224,6 @@ void Compiler::eeGetSystemVAmd64PassStructInRegisterDescriptor(
 
 #endif // FEATURE_UNIX_AMD64_STRUCT_PASSING
 
-#if COR_JIT_EE_VERSION <= 460
-
-// Validate the token to determine whether to turn the bad image format exception into
-// verification failure (for backward compatibility)
-static bool isValidTokenForTryResolveToken(ICorJitInfo* corInfo, CORINFO_RESOLVED_TOKEN* resolvedToken)
-{
-    if (!corInfo->isValidToken(resolvedToken->tokenScope, resolvedToken->token))
-        return false;
-
-    CorInfoTokenKind tokenType = resolvedToken->tokenType;
-    switch (TypeFromToken(resolvedToken->token))
-    {
-        case mdtModuleRef:
-        case mdtTypeDef:
-        case mdtTypeRef:
-        case mdtTypeSpec:
-            if ((tokenType & CORINFO_TOKENKIND_Class) == 0)
-                return false;
-            break;
-
-        case mdtMethodDef:
-        case mdtMethodSpec:
-            if ((tokenType & CORINFO_TOKENKIND_Method) == 0)
-                return false;
-            break;
-
-        case mdtFieldDef:
-            if ((tokenType & CORINFO_TOKENKIND_Field) == 0)
-                return false;
-            break;
-
-        case mdtMemberRef:
-            if ((tokenType & (CORINFO_TOKENKIND_Method | CORINFO_TOKENKIND_Field)) == 0)
-                return false;
-            break;
-
-        default:
-            return false;
-    }
-
-    return true;
-}
-
-// This type encapsulates the information necessary for `TryResolveTokenFilter` and
-// `eeTryResolveToken` below.
-struct TryResolveTokenFilterParam
-{
-    ICorJitInfo*            m_corInfo;
-    CORINFO_RESOLVED_TOKEN* m_resolvedToken;
-    EXCEPTION_POINTERS      m_exceptionPointers;
-    bool                    m_success;
-};
-
-LONG TryResolveTokenFilter(struct _EXCEPTION_POINTERS* exceptionPointers, void* theParam)
-{
-    assert(exceptionPointers->ExceptionRecord->ExceptionCode != SEH_VERIFICATION_EXCEPTION);
-
-    // Backward compatibility: Convert bad image format exceptions thrown by the EE while resolving token to
-    // verification exceptions if we are verifying. Verification exceptions will cause the JIT of the basic block to
-    // fail, but the JITing of the whole method is still going to succeed. This is done for backward compatibility only.
-    // Ideally, we would always treat bad tokens in the IL stream as fatal errors.
-    if (exceptionPointers->ExceptionRecord->ExceptionCode == EXCEPTION_COMPLUS)
-    {
-        auto* param = reinterpret_cast<TryResolveTokenFilterParam*>(theParam);
-        if (!isValidTokenForTryResolveToken(param->m_corInfo, param->m_resolvedToken))
-        {
-            param->m_exceptionPointers = *exceptionPointers;
-            return param->m_corInfo->FilterException(exceptionPointers);
-        }
-    }
-
-    return EXCEPTION_CONTINUE_SEARCH;
-}
-
-bool Compiler::eeTryResolveToken(CORINFO_RESOLVED_TOKEN* resolvedToken)
-{
-    TryResolveTokenFilterParam param;
-    param.m_corInfo       = info.compCompHnd;
-    param.m_resolvedToken = resolvedToken;
-    param.m_success       = true;
-
-    PAL_TRY(TryResolveTokenFilterParam*, pParam, &param)
-    {
-        pParam->m_corInfo->resolveToken(pParam->m_resolvedToken);
-    }
-    PAL_EXCEPT_FILTER(TryResolveTokenFilter)
-    {
-        if (param.m_exceptionPointers.ExceptionRecord->ExceptionCode == EXCEPTION_COMPLUS)
-        {
-            param.m_corInfo->HandleException(&param.m_exceptionPointers);
-        }
-
-        param.m_success = false;
-    }
-    PAL_ENDTRY
-
-    return param.m_success;
-}
-
-struct TrapParam
-{
-    ICorJitInfo*       m_corInfo;
-    EXCEPTION_POINTERS m_exceptionPointers;
-
-    void (*m_function)(void*);
-    void* m_param;
-    bool  m_success;
-};
-
-static LONG __EEFilter(PEXCEPTION_POINTERS exceptionPointers, void* param)
-{
-    auto* trapParam                = reinterpret_cast<TrapParam*>(param);
-    trapParam->m_exceptionPointers = *exceptionPointers;
-    return trapParam->m_corInfo->FilterException(exceptionPointers);
-}
-
-bool Compiler::eeRunWithErrorTrapImp(void (*function)(void*), void* param)
-{
-    TrapParam trapParam;
-    trapParam.m_corInfo  = info.compCompHnd;
-    trapParam.m_function = function;
-    trapParam.m_param    = param;
-    trapParam.m_success  = true;
-
-    PAL_TRY(TrapParam*, __trapParam, &trapParam)
-    {
-        __trapParam->m_function(__trapParam->m_param);
-    }
-    PAL_EXCEPT_FILTER(__EEFilter)
-    {
-        trapParam.m_corInfo->HandleException(&trapParam.m_exceptionPointers);
-        trapParam.m_success = false;
-    }
-    PAL_ENDTRY
-
-    return trapParam.m_success;
-}
-
-#else // CORJIT_EE_VER <= 460
-
 bool Compiler::eeTryResolveToken(CORINFO_RESOLVED_TOKEN* resolvedToken)
 {
     return info.compCompHnd->tryResolveToken(resolvedToken);
@@ -1394,8 +1234,6 @@ bool Compiler::eeRunWithErrorTrapImp(void (*function)(void*), void* param)
     return info.compCompHnd->runWithErrorTrap(function, param);
 }
 
-#endif // CORJIT_EE_VER > 460
-
 /*****************************************************************************
  *
  *                      Utility functions
index 3899d92..0565d6f 100644 (file)
@@ -21,11 +21,7 @@ class CILJit : public ICorJitCompiler
     void getVersionIdentifier(GUID* versionIdentifier /* OUT */
                               );
 
-#if COR_JIT_EE_VERSION > 460
     unsigned getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompileFlags);
-#else
-    unsigned getMaxIntrinsicSIMDVectorLength(DWORD cpuCompileFlags);
-#endif
 
     void setRealJit(ICorJitCompiler* realJitCompiler);
 };
index dd99411..252966d 100644 (file)
@@ -6725,9 +6725,7 @@ bool Compiler::fgIsThrow(GenTreePtr tree)
         (tree->gtCall.gtCallMethHnd == eeFindHelper(CORINFO_HELP_VERIFICATION)) ||
         (tree->gtCall.gtCallMethHnd == eeFindHelper(CORINFO_HELP_RNGCHKFAIL)) ||
         (tree->gtCall.gtCallMethHnd == eeFindHelper(CORINFO_HELP_THROWDIVZERO)) ||
-#if COR_JIT_EE_VERSION > 460
         (tree->gtCall.gtCallMethHnd == eeFindHelper(CORINFO_HELP_THROWNULLREF)) ||
-#endif // COR_JIT_EE_VERSION
         (tree->gtCall.gtCallMethHnd == eeFindHelper(CORINFO_HELP_THROW)) ||
         (tree->gtCall.gtCallMethHnd == eeFindHelper(CORINFO_HELP_RETHROW)))
     {
@@ -7138,13 +7136,8 @@ GenTreePtr Compiler::fgOptimizeDelegateConstructor(GenTreeCall* call, CORINFO_CO
                 helperArgs->gtOp.gtOp2 = gtNewArgList(call->gtCallArgs->gtOp.gtOp1);
 
                 call = gtNewHelperCallNode(CORINFO_HELP_READYTORUN_DELEGATE_CTOR, TYP_VOID, GTF_EXCEPT, helperArgs);
-#if COR_JIT_EE_VERSION > 460
                 info.compCompHnd->getReadyToRunDelegateCtorHelper(targetMethod->gtFptrVal.gtLdftnResolvedToken, clsHnd,
                                                                   &entryPoint);
-#else
-                info.compCompHnd->getReadyToRunHelper(targetMethod->gtFptrVal.gtLdftnResolvedToken,
-                                                      CORINFO_HELP_READYTORUN_DELEGATE_CTOR, &entryPoint);
-#endif
                 call->setEntryPoint(entryPoint);
             }
         }
@@ -7932,7 +7925,6 @@ void Compiler::fgAddReversePInvokeEnterExit()
 {
     assert(opts.IsReversePInvoke());
 
-#if COR_JIT_EE_VERSION > 460
     lvaReversePInvokeFrameVar = lvaGrabTempWithImplicitUse(false DEBUGARG("Reverse Pinvoke FrameVar"));
 
     LclVarDsc* varDsc   = &lvaTable[lvaReversePInvokeFrameVar];
@@ -7979,8 +7971,6 @@ void Compiler::fgAddReversePInvokeEnterExit()
         printf("\n");
     }
 #endif
-
-#endif // COR_JIT_EE_VERSION > 460
 }
 
 /*****************************************************************************
@@ -17530,12 +17520,10 @@ unsigned Compiler::acdHelper(SpecialCodeKind codeKind)
     {
         case SCK_RNGCHK_FAIL:
             return CORINFO_HELP_RNGCHKFAIL;
-#if COR_JIT_EE_VERSION > 460
         case SCK_ARG_EXCPN:
             return CORINFO_HELP_THROW_ARGUMENTEXCEPTION;
         case SCK_ARG_RNG_EXCPN:
             return CORINFO_HELP_THROW_ARGUMENTOUTOFRANGEEXCEPTION;
-#endif // COR_JIT_EE_VERSION
         case SCK_DIV_BY_ZERO:
             return CORINFO_HELP_THROWDIVZERO;
         case SCK_ARITH_EXCPN:
@@ -17662,14 +17650,12 @@ BasicBlock* Compiler::fgAddCodeRef(BasicBlock* srcBlk, unsigned refData, Special
             case SCK_OVERFLOW:
                 msg = " for OVERFLOW";
                 break;
-#if COR_JIT_EE_VERSION > 460
             case SCK_ARG_EXCPN:
                 msg = " for ARG_EXCPN";
                 break;
             case SCK_ARG_RNG_EXCPN:
                 msg = " for ARG_RNG_EXCPN";
                 break;
-#endif // COR_JIT_EE_VERSION
             default:
                 msg = " for ??";
                 break;
@@ -17716,7 +17702,6 @@ BasicBlock* Compiler::fgAddCodeRef(BasicBlock* srcBlk, unsigned refData, Special
             noway_assert(SCK_OVERFLOW == SCK_ARITH_EXCPN);
             break;
 
-#if COR_JIT_EE_VERSION > 460
         case SCK_ARG_EXCPN:
             helper = CORINFO_HELP_THROW_ARGUMENTEXCEPTION;
             break;
@@ -17724,7 +17709,6 @@ BasicBlock* Compiler::fgAddCodeRef(BasicBlock* srcBlk, unsigned refData, Special
         case SCK_ARG_RNG_EXCPN:
             helper = CORINFO_HELP_THROW_ARGUMENTOUTOFRANGEEXCEPTION;
             break;
-#endif // COR_JIT_EE_VERSION
 
         // case SCK_PAUSE_EXEC:
         //     noway_assert(!"add code to pause exec");
index f336ee3..6b9c457 100644 (file)
@@ -1850,14 +1850,10 @@ GenTreeCall* Compiler::impReadyToRunHelperToTree(
     CORINFO_LOOKUP_KIND*    pGenericLookupKind /* =NULL. Only used with generics */)
 {
     CORINFO_CONST_LOOKUP lookup;
-#if COR_JIT_EE_VERSION > 460
     if (!info.compCompHnd->getReadyToRunHelper(pResolvedToken, pGenericLookupKind, helper, &lookup))
     {
         return nullptr;
     }
-#else
-    info.compCompHnd->getReadyToRunHelper(pResolvedToken, helper, &lookup);
-#endif
 
     GenTreeCall* op1 = gtNewHelperCallNode(helper, type, GTF_EXCEPT, args);
 
@@ -2997,14 +2993,12 @@ GenTreePtr Compiler::impInitializeArrayIntrinsic(CORINFO_SIG_INFO* sig)
 #endif
             )
     {
-#if COR_JIT_EE_VERSION > 460
         if (newArrayCall->gtCall.gtCallMethHnd != eeFindHelper(CORINFO_HELP_NEW_MDARR_NONVARARG))
         {
             return nullptr;
         }
 
         isMDArray = true;
-#endif
     }
 
     CORINFO_CLASS_HANDLE arrayClsHnd = (CORINFO_CLASS_HANDLE)newArrayCall->gtCall.compileTimeHelperArgumentHandle;
@@ -3278,13 +3272,9 @@ GenTreePtr Compiler::impIntrinsic(GenTreePtr            newobjThis,
                                   bool                  tailCall,
                                   CorInfoIntrinsics*    pIntrinsicID)
 {
-    bool mustExpand = false;
-#if COR_JIT_EE_VERSION > 460
+    bool              mustExpand  = false;
     CorInfoIntrinsics intrinsicID = info.compCompHnd->getIntrinsicID(method, &mustExpand);
-#else
-    CorInfoIntrinsics intrinsicID                                      = info.compCompHnd->getIntrinsicID(method);
-#endif
-    *pIntrinsicID = intrinsicID;
+    *pIntrinsicID                 = intrinsicID;
 
 #ifndef _TARGET_ARM_
     genTreeOps interlockedOperator;
@@ -4989,7 +4979,6 @@ GenTreePtr Compiler::impImportLdvirtftn(GenTreePtr              thisPtr,
         NO_WAY("Virtual call to a function added via EnC is not supported");
     }
 
-#if COR_JIT_EE_VERSION > 460
     // CoreRT generic virtual method
     if (((pCallInfo->sig.callConv & CORINFO_CALLCONV_GENERIC) != 0) && IsTargetAbi(CORINFO_CORERT_ABI))
     {
@@ -5006,7 +4995,6 @@ GenTreePtr Compiler::impImportLdvirtftn(GenTreePtr              thisPtr,
         return gtNewHelperCallNode(CORINFO_HELP_GVMLOOKUP_FOR_SLOT, TYP_I_IMPL, GTF_EXCEPT,
                                    gtNewArgList(thisPtr, runtimeMethodHandle));
     }
-#endif // COR_JIT_EE_VERSION
 
 #ifdef FEATURE_READYTORUN_COMPILER
     if (opts.IsReadyToRun())
@@ -5257,7 +5245,6 @@ void Compiler::impImportNewObjArray(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORI
     //
     CLANG_FORMAT_COMMENT_ANCHOR;
 
-#if COR_JIT_EE_VERSION > 460
     if (!opts.IsReadyToRun() || IsTargetAbi(CORINFO_CORERT_ABI))
     {
         LclVarDsc* newObjArrayArgsVar;
@@ -5317,7 +5304,6 @@ void Compiler::impImportNewObjArray(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORI
         node = gtNewHelperCallNode(CORINFO_HELP_NEW_MDARR_NONVARARG, TYP_REF, 0, args);
     }
     else
-#endif
     {
         //
         // The varargs helper needs the type and method handles as last
@@ -5941,7 +5927,7 @@ GenTreePtr Compiler::impImportStaticFieldAccess(CORINFO_RESOLVED_TOKEN* pResolve
             }
             break;
         }
-#if COR_JIT_EE_VERSION > 460
+
         case CORINFO_FIELD_STATIC_READYTORUN_HELPER:
         {
 #ifdef FEATURE_READYTORUN_COMPILER
@@ -5970,7 +5956,7 @@ GenTreePtr Compiler::impImportStaticFieldAccess(CORINFO_RESOLVED_TOKEN* pResolve
 #endif // FEATURE_READYTORUN_COMPILER
         }
         break;
-#endif // COR_JIT_EE_VERSION > 460
+
         default:
         {
             if (!(access & CORINFO_ACCESS_ADDRESS))
@@ -12430,11 +12416,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)
                 /* NEWOBJ does not respond to CONSTRAINED */
                 prefixFlags &= ~PREFIX_CONSTRAINED;
 
-#if COR_JIT_EE_VERSION > 460
                 _impResolveToken(CORINFO_TOKENKIND_NewObj);
-#else
-                _impResolveToken(CORINFO_TOKENKIND_Method);
-#endif
 
                 eeGetCallInfo(&resolvedToken, nullptr /* constraint typeRef*/,
                               addVerifyFlag(combine(CORINFO_CALLINFO_SECURITYCHECKS, CORINFO_CALLINFO_ALLOWINSTPARAM)),
@@ -12921,9 +12903,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)
                             return;
 
                         case CORINFO_FIELD_STATIC_GENERICS_STATIC_HELPER:
-#if COR_JIT_EE_VERSION > 460
                         case CORINFO_FIELD_STATIC_READYTORUN_HELPER:
-#endif
                             /* We may be able to inline the field accessors in specific instantiations of generic
                              * methods */
                             compInlineResult->NoteFatal(InlineObservation::CALLSITE_LDFLD_NEEDS_HELPER);
@@ -13154,9 +13134,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)
                     case CORINFO_FIELD_STATIC_RVA_ADDRESS:
                     case CORINFO_FIELD_STATIC_SHARED_STATIC_HELPER:
                     case CORINFO_FIELD_STATIC_GENERICS_STATIC_HELPER:
-#if COR_JIT_EE_VERSION > 460
                     case CORINFO_FIELD_STATIC_READYTORUN_HELPER:
-#endif
                         op1 = impImportStaticFieldAccess(&resolvedToken, (CORINFO_ACCESS_FLAGS)aflags, &fieldInfo,
                                                          lclTyp);
                         break;
@@ -13180,19 +13158,17 @@ void Compiler::impImportBlockCode(BasicBlock* block)
                     }
                     break;
 
-#if COR_JIT_EE_VERSION > 460
                     case CORINFO_FIELD_INTRINSIC_ISLITTLEENDIAN:
                     {
                         assert(aflags & CORINFO_ACCESS_GET);
 #if BIGENDIAN
                         op1 = gtNewIconNode(0, lclTyp);
 #else
-                        op1 = gtNewIconNode(1, lclTyp);
+                        op1                     = gtNewIconNode(1, lclTyp);
 #endif
                         goto FIELD_DONE;
                     }
                     break;
-#endif
 
                     default:
                         assert(!"Unexpected fieldAccessor");
@@ -13314,10 +13290,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)
                             return;
 
                         case CORINFO_FIELD_STATIC_GENERICS_STATIC_HELPER:
-#if COR_JIT_EE_VERSION > 460
                         case CORINFO_FIELD_STATIC_READYTORUN_HELPER:
-#endif
-
                             /* We may be able to inline the field accessors in specific instantiations of generic
                              * methods */
                             compInlineResult->NoteFatal(InlineObservation::CALLSITE_STFLD_NEEDS_HELPER);
@@ -13436,9 +13409,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)
                     case CORINFO_FIELD_STATIC_RVA_ADDRESS:
                     case CORINFO_FIELD_STATIC_SHARED_STATIC_HELPER:
                     case CORINFO_FIELD_STATIC_GENERICS_STATIC_HELPER:
-#if COR_JIT_EE_VERSION > 460
                     case CORINFO_FIELD_STATIC_READYTORUN_HELPER:
-#endif
                         op1 = impImportStaticFieldAccess(&resolvedToken, (CORINFO_ACCESS_FLAGS)aflags, &fieldInfo,
                                                          lclTyp);
                         break;
@@ -18363,9 +18334,7 @@ bool Compiler::IsMathIntrinsic(GenTreePtr tree)
 //     can enable further devirtualization. We currently reinvoke this
 //     code after inlining, if the return value of the inlined call is
 //     the 'this obj' of a subsequent virtual call.
-
-#if COR_JIT_EE_VERSION > 460
-
+//
 void Compiler::impDevirtualizeCall(GenTreeCall*            call,
                                    GenTreePtr              thisObj,
                                    CORINFO_CALL_INFO*      callInfo,
@@ -18635,17 +18604,4 @@ void Compiler::impDevirtualizeCall(GenTreeCall*            call,
                baseMethodName, derivedClassName, derivedMethodName, note);
     }
 #endif // defined(DEBUG)
-}
-
-#else
-
-// Stubbed out implementation for 4.6 compatjit
-void Compiler::impDevirtualizeCall(GenTreeCall*            call,
-                                   GenTreePtr              thisObj,
-                                   CORINFO_CALL_INFO*      callInfo,
-                                   CORINFO_CONTEXT_HANDLE* exactContextHandle)
-{
-    return;
-}
-
-#endif // COR_JIT_EE_VERSION > 460
+}
\ No newline at end of file
index f9bd83f..810c93e 100644 (file)
@@ -127,72 +127,6 @@ public:
         return m_jitFlags == 0;
     }
 
-#if COR_JIT_EE_VERSION <= 460
-
-    void SetFromOldFlags(unsigned corJitFlags, unsigned corJitFlags2)
-    {
-        Reset();
-
-#define CONVERT_OLD_FLAG(oldf, newf)                                                                                   \
-    if ((corJitFlags & (oldf)) != 0)                                                                                   \
-        this->Set(JitFlags::newf);
-#define CONVERT_OLD_FLAG2(oldf, newf)                                                                                  \
-    if ((corJitFlags2 & (oldf)) != 0)                                                                                  \
-        this->Set(JitFlags::newf);
-
-        CONVERT_OLD_FLAG(CORJIT_FLG_SPEED_OPT, JIT_FLAG_SPEED_OPT)
-        CONVERT_OLD_FLAG(CORJIT_FLG_SIZE_OPT, JIT_FLAG_SIZE_OPT)
-        CONVERT_OLD_FLAG(CORJIT_FLG_DEBUG_CODE, JIT_FLAG_DEBUG_CODE)
-        CONVERT_OLD_FLAG(CORJIT_FLG_DEBUG_EnC, JIT_FLAG_DEBUG_EnC)
-        CONVERT_OLD_FLAG(CORJIT_FLG_DEBUG_INFO, JIT_FLAG_DEBUG_INFO)
-        CONVERT_OLD_FLAG(CORJIT_FLG_MIN_OPT, JIT_FLAG_MIN_OPT)
-        CONVERT_OLD_FLAG(CORJIT_FLG_GCPOLL_CALLS, JIT_FLAG_GCPOLL_CALLS)
-        CONVERT_OLD_FLAG(CORJIT_FLG_MCJIT_BACKGROUND, JIT_FLAG_MCJIT_BACKGROUND)
-
-#if defined(_TARGET_X86_)
-
-        CONVERT_OLD_FLAG(CORJIT_FLG_PINVOKE_RESTORE_ESP, JIT_FLAG_PINVOKE_RESTORE_ESP)
-        CONVERT_OLD_FLAG(CORJIT_FLG_TARGET_P4, JIT_FLAG_TARGET_P4)
-        CONVERT_OLD_FLAG(CORJIT_FLG_USE_FCOMI, JIT_FLAG_USE_FCOMI)
-        CONVERT_OLD_FLAG(CORJIT_FLG_USE_CMOV, JIT_FLAG_USE_CMOV)
-        CONVERT_OLD_FLAG(CORJIT_FLG_USE_SSE2, JIT_FLAG_USE_SSE2)
-
-#elif defined(_TARGET_AMD64_)
-
-        CONVERT_OLD_FLAG(CORJIT_FLG_USE_SSE3_4, JIT_FLAG_USE_SSE3_4)
-        CONVERT_OLD_FLAG(CORJIT_FLG_USE_AVX, JIT_FLAG_USE_AVX)
-        CONVERT_OLD_FLAG(CORJIT_FLG_USE_AVX2, JIT_FLAG_USE_AVX2)
-        CONVERT_OLD_FLAG(CORJIT_FLG_USE_AVX_512, JIT_FLAG_USE_AVX_512)
-        CONVERT_OLD_FLAG(CORJIT_FLG_FEATURE_SIMD, JIT_FLAG_FEATURE_SIMD)
-
-#endif // !defined(_TARGET_X86_) && !defined(_TARGET_AMD64_)
-
-        CONVERT_OLD_FLAG(CORJIT_FLG_MAKEFINALCODE, JIT_FLAG_MAKEFINALCODE)
-        CONVERT_OLD_FLAG(CORJIT_FLG_READYTORUN, JIT_FLAG_READYTORUN)
-        CONVERT_OLD_FLAG(CORJIT_FLG_PROF_ENTERLEAVE, JIT_FLAG_PROF_ENTERLEAVE)
-        CONVERT_OLD_FLAG(CORJIT_FLG_PROF_REJIT_NOPS, JIT_FLAG_PROF_REJIT_NOPS)
-        CONVERT_OLD_FLAG(CORJIT_FLG_PROF_NO_PINVOKE_INLINE, JIT_FLAG_PROF_NO_PINVOKE_INLINE)
-        CONVERT_OLD_FLAG(CORJIT_FLG_SKIP_VERIFICATION, JIT_FLAG_SKIP_VERIFICATION)
-        CONVERT_OLD_FLAG(CORJIT_FLG_PREJIT, JIT_FLAG_PREJIT)
-        CONVERT_OLD_FLAG(CORJIT_FLG_RELOC, JIT_FLAG_RELOC)
-        CONVERT_OLD_FLAG(CORJIT_FLG_IMPORT_ONLY, JIT_FLAG_IMPORT_ONLY)
-        CONVERT_OLD_FLAG(CORJIT_FLG_IL_STUB, JIT_FLAG_IL_STUB)
-        CONVERT_OLD_FLAG(CORJIT_FLG_PROCSPLIT, JIT_FLAG_PROCSPLIT)
-        CONVERT_OLD_FLAG(CORJIT_FLG_BBINSTR, JIT_FLAG_BBINSTR)
-        CONVERT_OLD_FLAG(CORJIT_FLG_BBOPT, JIT_FLAG_BBOPT)
-        CONVERT_OLD_FLAG(CORJIT_FLG_FRAMED, JIT_FLAG_FRAMED)
-        CONVERT_OLD_FLAG(CORJIT_FLG_ALIGN_LOOPS, JIT_FLAG_ALIGN_LOOPS)
-        CONVERT_OLD_FLAG(CORJIT_FLG_PUBLISH_SECRET_PARAM, JIT_FLAG_PUBLISH_SECRET_PARAM)
-        CONVERT_OLD_FLAG(CORJIT_FLG_GCPOLL_INLINE, JIT_FLAG_GCPOLL_INLINE)
-
-        CONVERT_OLD_FLAG2(CORJIT_FLG2_SAMPLING_JIT_BACKGROUND, JIT_FLAG_SAMPLING_JIT_BACKGROUND)
-
-#undef CONVERT_OLD_FLAG
-#undef CONVERT_OLD_FLAG2
-    }
-
-#else // COR_JIT_EE_VERSION > 460
-
     void SetFromFlags(CORJIT_FLAGS flags)
     {
         // We don't want to have to check every one, so we assume it is exactly the same values as the JitFlag
@@ -257,8 +191,6 @@ public:
 #undef FLAGS_EQUAL
     }
 
-#endif // COR_JIT_EE_VERSION > 460
-
 private:
     unsigned __int64 m_jitFlags;
 };
index 2e69e79..1fe8f27 100644 (file)
 #include <cstdlib>
 #include <intrin.h>
 
-#if COR_JIT_EE_VERSION <= 460
-#include "corjithost.h"
-#include "jithost.h"
-#endif
 #include "jitconfig.h"
 #include "jit.h"
 #include "iallocator.h"
index 85445a9..05a087f 100644 (file)
@@ -3029,7 +3029,6 @@ void Lowering::InsertPInvokeCallProlog(GenTreeCall* call)
 
     noway_assert(comp->lvaInlinedPInvokeFrameVar != BAD_VAR_NUM);
 
-#if COR_JIT_EE_VERSION > 460
     if (comp->opts.ShouldUsePInvokeHelpers())
     {
         // First argument is the address of the frame variable.
@@ -3045,7 +3044,6 @@ void Lowering::InsertPInvokeCallProlog(GenTreeCall* call)
         LowerNode(helperCall); // helper call is inserted before current node and should be lowered here.
         return;
     }
-#endif
 
     // Emit the following sequence:
     //
@@ -3178,7 +3176,6 @@ void Lowering::InsertPInvokeCallEpilog(GenTreeCall* call)
 {
     JITDUMP("======= Inserting PInvoke call epilog\n");
 
-#if COR_JIT_EE_VERSION > 460
     if (comp->opts.ShouldUsePInvokeHelpers())
     {
         noway_assert(comp->lvaInlinedPInvokeFrameVar != BAD_VAR_NUM);
@@ -3196,7 +3193,6 @@ void Lowering::InsertPInvokeCallEpilog(GenTreeCall* call)
         BlockRange().InsertAfter(call, LIR::SeqTree(comp, helperCall));
         return;
     }
-#endif
 
     // gcstate = 1
     GenTree* insertionPoint = call->gtNext;
@@ -3317,18 +3313,7 @@ GenTree* Lowering::LowerNonvirtPinvokeCall(GenTreeCall* call)
         CORINFO_METHOD_HANDLE methHnd = call->gtCallMethHnd;
 
         CORINFO_CONST_LOOKUP lookup;
-#if COR_JIT_EE_VERSION > 460
         comp->info.compCompHnd->getAddressOfPInvokeTarget(methHnd, &lookup);
-#else
-        void* pIndirection;
-        lookup.accessType = IAT_PVALUE;
-        lookup.addr       = comp->info.compCompHnd->getAddressOfPInvokeFixup(methHnd, &pIndirection);
-        if (lookup.addr == nullptr)
-        {
-            lookup.accessType = IAT_PPVALUE;
-            lookup.addr       = pIndirection;
-        }
-#endif
 
         void* addr = lookup.addr;
         switch (lookup.accessType)
index e3654b0..b110525 100644 (file)
@@ -780,7 +780,7 @@ void ConfigMethodRange::InitRanges(const wchar_t* rangeStr, unsigned capacity)
     }
 
     // Allocate some persistent memory
-    ICorJitHost* jitHost = JitHost::getJitHost();
+    ICorJitHost* jitHost = g_jitHost;
     m_ranges             = (Range*)jitHost->allocateMemory(capacity * sizeof(Range));
     m_entries            = capacity;
 
@@ -1412,9 +1412,7 @@ void HelperCallProperties::init()
             case CORINFO_HELP_GETGENERICS_GCSTATIC_BASE:
             case CORINFO_HELP_GETGENERICS_NONGCSTATIC_BASE:
             case CORINFO_HELP_READYTORUN_STATIC_BASE:
-#if COR_JIT_EE_VERSION > 460
             case CORINFO_HELP_READYTORUN_GENERIC_STATIC_BASE:
-#endif // COR_JIT_EE_VERSION > 460
 
                 // These may invoke static class constructors
                 // These can throw InvalidProgram exception if the class can not be constructed
@@ -1464,9 +1462,7 @@ void HelperCallProperties::init()
             case CORINFO_HELP_VERIFICATION:
             case CORINFO_HELP_RNGCHKFAIL:
             case CORINFO_HELP_THROWDIVZERO:
-#if COR_JIT_EE_VERSION > 460
             case CORINFO_HELP_THROWNULLREF:
-#endif // COR_JIT_EE_VERSION
             case CORINFO_HELP_THROW:
             case CORINFO_HELP_RETHROW:
 
index 98251f2..66b7978 100644 (file)
@@ -7591,11 +7591,9 @@ VNFunc Compiler::fgValueNumberHelperMethVNFunc(CorInfoHelpFunc helpFunc)
         case CORINFO_HELP_READYTORUN_STATIC_BASE:
             vnf = VNF_ReadyToRunStaticBase;
             break;
-#if COR_JIT_EE_VERSION > 460
         case CORINFO_HELP_READYTORUN_GENERIC_STATIC_BASE:
             vnf = VNF_ReadyToRunGenericStaticBase;
             break;
-#endif // COR_JIT_EE_VERSION > 460
         case CORINFO_HELP_GETSHARED_GCSTATIC_BASE_DYNAMICCLASS:
             vnf = VNF_GetsharedGcstaticBaseDynamicclass;
             break;