// 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,
// 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.
// 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 (
CORINFO_CLASS_HANDLE cls
);
-#if COR_JIT_EE_VERSION > 460
bool getReadyToRunHelper(
CORINFO_RESOLVED_TOKEN * pResolvedToken,
CORINFO_LOOKUP_KIND * pGenericLookupKind,
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
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
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
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
);
// 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.*
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
//
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(
DWORD sizeInBytes /* IN: The size of the buffer. Note that this is effectively a
version number for the CORJIT_FLAGS value. */
);
-#endif
#endif // _ICorJitInfoImpl
#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,
{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
}
};
-#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.
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
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
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.
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
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,
};
CORINFO_LOOKUP_CLASSPARAM,
};
-#if COR_JIT_EE_VERSION > 460
-
struct CORINFO_LOOKUP_KIND
{
bool needsRuntimeLookup;
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.
// 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
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
// Array offsets
unsigned offsetOfObjArrayData;
-#if COR_JIT_EE_VERSION > 460
// Reverse PInvoke offsets
unsigned sizeOfReversePInvokeFrame;
// 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;
* 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
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.
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.
// 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 (
CORINFO_CLASS_HANDLE cls
) = 0;
-#if COR_JIT_EE_VERSION > 460
virtual bool getReadyToRunHelper(
CORINFO_RESOLVED_TOKEN * pResolvedToken,
CORINFO_LOOKUP_KIND * pGenericLookupKind,
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
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
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
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
-
};
/*****************************************************************************
) = 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.*
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
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:
unsigned __int64 corJitFlags;
};
-#endif // COR_JIT_EE_VERSION > 460
/*****************************************************************************
Here is how CORJIT_FLAG_SKIP_VERIFICATION should be interepreted.
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;
// 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,
//
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(
DWORD sizeInBytes /* IN: The size of the buffer. Note that this is effectively a
version number for the CORJIT_FLAGS value. */
) = 0;
-#endif
};
/**********************************************************************************/
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
API_LEAVE(getMethodVTableOffset);
}
-#if COR_JIT_EE_VERSION > 460
-
CorInfoIntrinsics WrapICorJitInfo::getIntrinsicID(
CORINFO_METHOD_HANDLE method,
bool* pMustExpand /* OUT */)
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);
API_LEAVE(resolveToken);
}
-#if COR_JIT_EE_VERSION > 460
-
bool WrapICorJitInfo::tryResolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN * pResolvedToken)
{
API_ENTER(tryResolveToken);
return success;
}
-#endif
-
void WrapICorJitInfo::findSig(
CORINFO_MODULE_HANDLE module,
unsigned sigTOK,
return temp;
}
-#if COR_JIT_EE_VERSION > 460
-
bool WrapICorJitInfo::getReadyToRunHelper(
CORINFO_RESOLVED_TOKEN * pResolvedToken,
CORINFO_LOOKUP_KIND * pGenericLookupKind,
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)
{
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)
return result;
}
-#endif
-
DWORD WrapICorJitInfo::getThreadTLSIndex(
void **ppIndirection)
{
return temp;
}
-#if COR_JIT_EE_VERSION > 460
-
void WrapICorJitInfo::getAddressOfPInvokeTarget(
CORINFO_METHOD_HANDLE method,
CORINFO_CONST_LOOKUP *pLookup)
API_LEAVE(getAddressOfPInvokeTarget);
}
-#endif
-
LPVOID WrapICorJitInfo::GetCookieForPInvokeCalliSig(
CORINFO_SIG_INFO* szMetaSig,
void ** ppIndirection)
//
/*********************************************************************************/
-#if COR_JIT_EE_VERSION > 460
-
DWORD WrapICorJitInfo::getJitFlags(CORJIT_FLAGS *jitFlags, DWORD sizeInBytes)
{
API_ENTER(getJitFlags);
return wrapHnd->runWithErrorTrap(function, param);
}
-#endif
-
IEEMemoryManager* WrapICorJitInfo::getMemoryManager()
{
API_ENTER(getMemoryManager);
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())
// 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.
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()
// 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;
// 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;
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;
{
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;
}
}
{
// 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.
{
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)
{
#ifndef SELF_NO_HOST
InitUtilcode(cccallbacks);
#endif
-
-#if COR_JIT_EE_VERSION <= 460
- jitStartup(JitHost::getJitHost());
-#endif
}
#endif // !FEATURE_MERGE_JIT_AND_ENGINE
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;
* 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)
{
}
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_
#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, ¶m)
- {
- pParam->m_corInfo->resolveToken(pParam->m_resolvedToken);
- }
- PAL_EXCEPT_FILTER(TryResolveTokenFilter)
- {
- if (param.m_exceptionPointers.ExceptionRecord->ExceptionCode == EXCEPTION_COMPLUS)
- {
- param.m_corInfo->HandleException(¶m.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);
return info.compCompHnd->runWithErrorTrap(function, param);
}
-#endif // CORJIT_EE_VER > 460
-
/*****************************************************************************
*
* Utility functions
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);
};
(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)))
{
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);
}
}
{
assert(opts.IsReversePInvoke());
-#if COR_JIT_EE_VERSION > 460
lvaReversePInvokeFrameVar = lvaGrabTempWithImplicitUse(false DEBUGARG("Reverse Pinvoke FrameVar"));
LclVarDsc* varDsc = &lvaTable[lvaReversePInvokeFrameVar];
printf("\n");
}
#endif
-
-#endif // COR_JIT_EE_VERSION > 460
}
/*****************************************************************************
{
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:
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;
noway_assert(SCK_OVERFLOW == SCK_ARITH_EXCPN);
break;
-#if COR_JIT_EE_VERSION > 460
case SCK_ARG_EXCPN:
helper = CORINFO_HELP_THROW_ARGUMENTEXCEPTION;
break;
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");
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);
#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;
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;
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))
{
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())
//
CLANG_FORMAT_COMMENT_ANCHOR;
-#if COR_JIT_EE_VERSION > 460
if (!opts.IsReadyToRun() || IsTargetAbi(CORINFO_CORERT_ABI))
{
LclVarDsc* newObjArrayArgsVar;
node = gtNewHelperCallNode(CORINFO_HELP_NEW_MDARR_NONVARARG, TYP_REF, 0, args);
}
else
-#endif
{
//
// The varargs helper needs the type and method handles as last
}
break;
}
-#if COR_JIT_EE_VERSION > 460
+
case CORINFO_FIELD_STATIC_READYTORUN_HELPER:
{
#ifdef FEATURE_READYTORUN_COMPILER
#endif // FEATURE_READYTORUN_COMPILER
}
break;
-#endif // COR_JIT_EE_VERSION > 460
+
default:
{
if (!(access & CORINFO_ACCESS_ADDRESS))
/* 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)),
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);
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;
}
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");
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);
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;
// 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,
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
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
#undef FLAGS_EQUAL
}
-#endif // COR_JIT_EE_VERSION > 460
-
private:
unsigned __int64 m_jitFlags;
};
#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"
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.
LowerNode(helperCall); // helper call is inserted before current node and should be lowered here.
return;
}
-#endif
// Emit the following sequence:
//
{
JITDUMP("======= Inserting PInvoke call epilog\n");
-#if COR_JIT_EE_VERSION > 460
if (comp->opts.ShouldUsePInvokeHelpers())
{
noway_assert(comp->lvaInlinedPInvokeFrameVar != BAD_VAR_NUM);
BlockRange().InsertAfter(call, LIR::SeqTree(comp, helperCall));
return;
}
-#endif
// gcstate = 1
GenTree* insertionPoint = call->gtNext;
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)
}
// Allocate some persistent memory
- ICorJitHost* jitHost = JitHost::getJitHost();
+ ICorJitHost* jitHost = g_jitHost;
m_ranges = (Range*)jitHost->allocateMemory(capacity * sizeof(Range));
m_entries = capacity;
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
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:
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;