Merge pull request #2 from pgavlin/Jit64Scrub

Scrub jit64 from the codebase.
This commit is contained in:
Pat Gavlin 2015-02-13 08:30:36 -08:00
Родитель a7f7f28b4e 75bf022a5b
Коммит 303cdb747d
6 изменённых файлов: 296 добавлений и 404 удалений

Просмотреть файл

@ -20,45 +20,46 @@
#include "staticcontract.h"
// Note: PAL_SEH_RESTORE_GUARD_PAGE is only ever defined in clrex.h, so we only restore guard pages automatically
// when these macros are used from within the VM.
// Note: PAL_SEH_RESTORE_GUARD_PAGE is only ever defined in clrex.h, so we only
// restore guard pages automatically when these macros are used from within the
// VM.
#define PAL_SEH_RESTORE_GUARD_PAGE
#define PAL_TRY_NAKED \
{ \
bool __exHandled; __exHandled = false; \
DWORD __exCode; __exCode = 0; \
SCAN_EHMARKER(); \
__try \
{ \
#define PAL_TRY_NAKED \
{ \
bool __exHandled; __exHandled = false; \
DWORD __exCode; __exCode = 0; \
SCAN_EHMARKER(); \
__try \
{ \
SCAN_EHMARKER_TRY();
#define PAL_EXCEPT_NAKED(Disposition) \
} \
__except(__exCode = GetExceptionCode(), Disposition) \
{ \
__exHandled = true; \
SCAN_EHMARKER_CATCH(); \
#define PAL_EXCEPT_NAKED(Disposition) \
} \
__except(__exCode = GetExceptionCode(), Disposition) \
{ \
__exHandled = true; \
SCAN_EHMARKER_CATCH(); \
PAL_SEH_RESTORE_GUARD_PAGE
#define PAL_EXCEPT_FILTER_NAKED(pfnFilter, param) \
} \
__except(__exCode = GetExceptionCode(), \
pfnFilter(GetExceptionInformation(), param)) \
{ \
__exHandled = true; \
SCAN_EHMARKER_CATCH(); \
#define PAL_EXCEPT_FILTER_NAKED(pfnFilter, param) \
} \
__except(__exCode = GetExceptionCode(), \
pfnFilter(GetExceptionInformation(), param)) \
{ \
__exHandled = true; \
SCAN_EHMARKER_CATCH(); \
PAL_SEH_RESTORE_GUARD_PAGE
#define PAL_FINALLY_NAKED \
} \
__finally \
{ \
#define PAL_FINALLY_NAKED \
} \
__finally \
{ \
#define PAL_ENDTRY_NAKED \
} \
PAL_ENDTRY_NAKED_DBG \
} \
#define PAL_ENDTRY_NAKED \
} \
PAL_ENDTRY_NAKED_DBG \
} \
#if defined(_DEBUG) && !defined(DACCESS_COMPILE)
@ -67,177 +68,76 @@
// This way, the compiler will check that the body is not directly
// accessing any local variables and arguments.
//
#define PAL_TRY(__ParamType, __paramDef, __paramRef) \
{ \
__ParamType __param = __paramRef; \
__ParamType __paramToPassToFilter = __paramRef; \
class __Body \
{ \
public: \
static void Run(__ParamType __paramDef) \
{ \
#define PAL_TRY(__ParamType, __paramDef, __paramRef) \
{ \
__ParamType __param = __paramRef; \
__ParamType __paramToPassToFilter = __paramRef; \
class __Body \
{ \
public: \
static void Run(__ParamType __paramDef) \
{ \
PAL_TRY_HANDLER_DBG_BEGIN
// PAL_TRY implementation that abstracts usage of COMPILER_INSTANCE*, which is used by
// JIT64. On Windows, we dont need to do anything special as we dont have nested classes/methods
// as on PAL.
#define PAL_TRY_CI(__ParamType, __paramDef, __paramRef) \
{ \
struct __HandlerData { \
__ParamType __param; \
COMPILER_INSTANCE *__ciPtr; \
}; \
__HandlerData handlerData; \
handlerData.__param = __paramRef; \
handlerData.__ciPtr = ciPtr; \
__HandlerData* __param = &handlerData; \
__ParamType __paramToPassToFilter = __paramRef; \
class __Body \
{ \
public: \
static void Run(__HandlerData* __pHandlerData) \
{ \
PAL_TRY_HANDLER_DBG_BEGIN \
COMPILER_INSTANCE *ciPtr = __pHandlerData->__ciPtr; \
__ParamType __paramDef = __pHandlerData->__param;
#define PAL_TRY_FOR_DLLMAIN(__ParamType, __paramDef, __paramRef, __reason) \
{ \
__ParamType __param = __paramRef; \
__ParamType __paramToPassToFilter = __paramRef; \
class __Body \
{ \
public: \
static void Run(__ParamType __paramDef) \
{ \
PAL_TRY_HANDLER_DBG_BEGIN_DLLMAIN(__reason)
#define PAL_EXCEPT(Disposition) \
PAL_TRY_HANDLER_DBG_END \
} \
}; \
PAL_TRY_NAKED \
__Body::Run(__param); \
#define PAL_EXCEPT(Disposition) \
PAL_TRY_HANDLER_DBG_END \
} \
}; \
PAL_TRY_NAKED \
__Body::Run(__param); \
PAL_EXCEPT_NAKED(Disposition)
#define PAL_EXCEPT_FILTER(pfnFilter) \
PAL_TRY_HANDLER_DBG_END \
} \
}; \
PAL_TRY_NAKED \
__Body::Run(__param); \
#define PAL_EXCEPT_FILTER(pfnFilter) \
PAL_TRY_HANDLER_DBG_END \
} \
}; \
PAL_TRY_NAKED \
__Body::Run(__param); \
PAL_EXCEPT_FILTER_NAKED(pfnFilter, __paramToPassToFilter)
#define PAL_FINALLY \
PAL_TRY_HANDLER_DBG_END \
} \
}; \
PAL_TRY_NAKED \
__Body::Run(__param); \
#define PAL_FINALLY \
PAL_TRY_HANDLER_DBG_END \
} \
}; \
PAL_TRY_NAKED \
__Body::Run(__param); \
PAL_FINALLY_NAKED
#define PAL_ENDTRY \
PAL_ENDTRY_NAKED \
#define PAL_ENDTRY \
PAL_ENDTRY_NAKED \
}
#else // _DEBUG
#define PAL_TRY(__ParamType, __paramDef, __paramRef) \
{ \
__ParamType __param = __paramRef; \
__ParamType __paramDef = __param; \
PAL_TRY_NAKED \
#define PAL_TRY(__ParamType, __paramDef, __paramRef) \
{ \
__ParamType __param = __paramRef; \
__ParamType __paramDef = __param; \
PAL_TRY_NAKED \
PAL_TRY_HANDLER_DBG_BEGIN
// PAL_TRY implementation that abstracts usage of COMPILER_INSTANCE*, which is used by
// JIT64. On Windows, we dont need to do anything special as we dont have nested classes/methods
// as on PAL.
#define PAL_TRY_CI(__ParamType, __paramDef, __paramRef) PAL_TRY(__ParamType, __paramDef, __paramRef)
#define PAL_TRY_FOR_DLLMAIN(__ParamType, __paramDef, __paramRef, __reason) \
{ \
__ParamType __param = __paramRef; \
__ParamType __paramDef; __paramDef = __param; \
PAL_TRY_NAKED \
PAL_TRY_HANDLER_DBG_BEGIN_DLLMAIN(__reason)
#define PAL_EXCEPT(Disposition) \
PAL_TRY_HANDLER_DBG_END \
#define PAL_EXCEPT(Disposition) \
PAL_TRY_HANDLER_DBG_END \
PAL_EXCEPT_NAKED(Disposition)
#define PAL_EXCEPT_FILTER(pfnFilter) \
PAL_TRY_HANDLER_DBG_END \
#define PAL_EXCEPT_FILTER(pfnFilter) \
PAL_TRY_HANDLER_DBG_END \
PAL_EXCEPT_FILTER_NAKED(pfnFilter, __param)
#define PAL_FINALLY \
PAL_TRY_HANDLER_DBG_END \
#define PAL_FINALLY \
PAL_TRY_HANDLER_DBG_END \
PAL_FINALLY_NAKED
#define PAL_ENDTRY \
PAL_ENDTRY_NAKED \
#define PAL_ENDTRY \
PAL_ENDTRY_NAKED \
}
#endif // _DEBUG
#if defined(_DEBUG_IMPL) && !defined(JIT_BUILD) && !defined(JIT64_BUILD) && !defined(CROSS_COMPILE) && !defined(_TARGET_ARM_) // @ARMTODO: no contracts for speed
#define PAL_TRY_HANDLER_DBG_BEGIN \
BOOL ___oldOkayToThrowValue = FALSE; \
SO_INFRASTRUCTURE_CODE(BOOL ___oldSOTolerantState = FALSE;) \
ClrDebugState *___pState = ::GetClrDebugState(); \
__try \
{ \
___oldOkayToThrowValue = ___pState->IsOkToThrow(); \
SO_INFRASTRUCTURE_CODE(___oldSOTolerantState = ___pState->IsSOTolerant();) \
___pState->SetOkToThrow(); \
PAL_ENTER_THROWS_REGION;
// Special version that avoids touching the debug state after doing work in a DllMain for process or thread detach.
#define PAL_TRY_HANDLER_DBG_BEGIN_DLLMAIN(_reason) \
BOOL ___oldOkayToThrowValue = FALSE; \
SO_INFRASTRUCTURE_CODE(BOOL ___oldSOTolerantState = FALSE;) \
ClrDebugState *___pState = NULL; \
if (_reason != DLL_PROCESS_ATTACH) \
___pState = CheckClrDebugState(); \
__try \
{ \
if (___pState) \
{ \
___oldOkayToThrowValue = ___pState->IsOkToThrow(); \
SO_INFRASTRUCTURE_CODE(___oldSOTolerantState = ___pState->IsSOTolerant();) \
___pState->SetOkToThrow(); \
} \
if ((_reason == DLL_PROCESS_DETACH) || (_reason == DLL_THREAD_DETACH)) \
{ \
___pState = NULL; \
} \
PAL_ENTER_THROWS_REGION;
#define PAL_TRY_HANDLER_DBG_END \
PAL_LEAVE_THROWS_REGION \
} \
__finally \
{ \
if (___pState != NULL) \
{ \
_ASSERTE(___pState == CheckClrDebugState()); \
___pState->SetOkToThrow( ___oldOkayToThrowValue ); \
SO_INFRASTRUCTURE_CODE(___pState->SetSOTolerance( ___oldSOTolerantState );) \
} \
}
#define PAL_ENDTRY_NAKED_DBG \
if (__exHandled) \
{ \
RESTORE_SO_TOLERANCE_STATE; \
} \
#else
#define PAL_TRY_HANDLER_DBG_BEGIN ANNOTATION_TRY_BEGIN;
#define PAL_TRY_HANDLER_DBG_BEGIN_DLLMAIN(_reason) ANNOTATION_TRY_BEGIN;
#define PAL_TRY_HANDLER_DBG_END ANNOTATION_TRY_END;
#define PAL_ENDTRY_NAKED_DBG
#endif // defined(ENABLE_CONTRACTS_IMPL) && !defined(JIT64_BUILD)
#else // defined(_MSC_VER)
@ -546,7 +446,8 @@ extern "C"
void _Unwind_SetIP(struct _Unwind_Context *context, void *new_value);
void *_Unwind_GetCFA(struct _Unwind_Context *context);
void *_Unwind_GetGR(struct _Unwind_Context *context, int index);
void _Unwind_SetGR(struct _Unwind_Context *context, int index, void *new_value);
void _Unwind_SetGR(struct _Unwind_Context *context, int index,
void *new_value);
struct _Unwind_Exception;
@ -564,11 +465,15 @@ extern "C"
void _Unwind_DeleteException(struct _Unwind_Exception *exception_object);
typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)(struct _Unwind_Context *context, void *pvParam);
_Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn pfnTrace, void *pvParam);
typedef _Unwind_Reason_Code
(*_Unwind_Trace_Fn)(struct _Unwind_Context *context, void *pvParam);
_Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn pfnTrace,
void *pvParam);
_Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception *exception_object);
__attribute__((noreturn)) void _Unwind_Resume(struct _Unwind_Exception *exception_object);
_Unwind_Reason_Code
_Unwind_RaiseException(struct _Unwind_Exception *exception_object);
__attribute__((noreturn)) void
_Unwind_Resume(struct _Unwind_Exception *exception_object);
//
// Exception Handling ABI Level II: C++ ABI
@ -632,12 +537,15 @@ RaiseException(
// Possible results from PAL_TryExcept:
//
// returned exception pfExecuteHandler means
// ------------------ ---------------- ----------------------------------------
// NULL any No exception escaped from the try block.
// non-NULL FALSE An exception escaped from the try block,
// but the filter did not want to handle it.
// non-NULL TRUE An exception escaped from the try block,
// and the filter wanted to handle it.
// ------------------ ---------------- -----------------------------------
// NULL any No exception escaped from the try
// block.
// non-NULL FALSE An exception escaped from the try
// block, but the filter did not want
// to handle it.
// non-NULL TRUE An exception escaped from the try
// block, and the filter wanted to
// handle it.
//
#define DEBUG_OK_TO_RETURN_BEGIN(arg)
@ -691,90 +599,96 @@ public:
};
#endif // __cplusplus
#define PAL_TRY(__ParamType, __paramDef, __paramRef) \
{ \
struct __HandlerData \
{ \
__ParamType __param; \
EXCEPTION_DISPOSITION __handlerDisposition; \
__HandlerData(__ParamType param) : __param(param) {} \
}; \
__HandlerData __handlerData(__paramRef); \
class __Body \
{ \
public: \
static void Run(void *__pvHandlerData) \
{ \
__ParamType __paramDef = ((__HandlerData *)__pvHandlerData)->__param; \
#define PAL_TRY(__ParamType, __paramDef, __paramRef) \
{ \
struct __HandlerData \
{ \
__ParamType __param; \
EXCEPTION_DISPOSITION __handlerDisposition; \
__HandlerData(__ParamType param) : __param(param) {} \
}; \
__HandlerData __handlerData(__paramRef); \
class __Body \
{ \
public: \
static void Run(void *__pvHandlerData) \
{ \
__ParamType __paramDef = \
((__HandlerData *)__pvHandlerData)->__param; \
PAL_DUMMY_CALL;
// On Windows 32bit, we dont invoke filters on the second pass.
// To ensure the same happens on the Mac, we check if we are
// in the first phase or not. If we are, we invoke the
// filter and save the disposition in a local static.
// On Windows 32bit, we dont invoke filters on the second pass. To ensure the
// same happens on other platforms, we check if we are in the first phase or
// not. If we are, we invoke the filter and save the disposition in a local
// static.
//
// However, if we are not in the first phase but in the second,
// and thus unwinding, then we return the disposition saved
// from the first pass back (similar to how CRT
// does it on x86).
#define PAL_EXCEPT(dispositionExpression) \
} \
static EXCEPTION_DISPOSITION Handler( \
EXCEPTION_POINTERS *ExceptionPointers, \
PAL_DISPATCHER_CONTEXT *DispatcherContext, \
void *pvHandlerData) \
{ \
DEBUG_OK_TO_RETURN_BEGIN(PAL_EXCEPT) \
__HandlerData *pHandlerData = (__HandlerData *)pvHandlerData; \
void *pvParam = NULL; \
pvParam = pHandlerData->__param; \
if (!(ExceptionPointers->ExceptionRecord->ExceptionFlags & EXCEPTION_UNWINDING)) \
pHandlerData->__handlerDisposition = (EXCEPTION_DISPOSITION) (dispositionExpression); \
return pHandlerData->__handlerDisposition; \
DEBUG_OK_TO_RETURN_END(PAL_EXCEPT) \
} \
}; \
BOOL __fExecuteHandler; \
_Unwind_Exception *__exception = \
PAL_TryExcept(__Body::Run, __Body::Handler, &__handlerData, &__fExecuteHandler); \
PAL_NoHolder __exceptionHolder; \
if (__exception && __fExecuteHandler) \
{ \
PAL_CatchHolder __catchHolder(__exception); \
// However, if we are not in the first phase but in the second, and thus
// unwinding, then we return the disposition saved from the first pass back
// (similar to how CRT does it on x86).
#define PAL_EXCEPT(dispositionExpression) \
} \
static EXCEPTION_DISPOSITION Handler( \
EXCEPTION_POINTERS *ExceptionPointers, \
PAL_DISPATCHER_CONTEXT *DispatcherContext, \
void *pvHandlerData) \
{ \
DEBUG_OK_TO_RETURN_BEGIN(PAL_EXCEPT) \
__HandlerData *pHandlerData = (__HandlerData *)pvHandlerData; \
void *pvParam = NULL; \
pvParam = pHandlerData->__param; \
if (!(ExceptionPointers->ExceptionRecord->ExceptionFlags & \
EXCEPTION_UNWINDING)) \
pHandlerData->__handlerDisposition = \
(EXCEPTION_DISPOSITION) (dispositionExpression); \
return pHandlerData->__handlerDisposition; \
DEBUG_OK_TO_RETURN_END(PAL_EXCEPT) \
} \
}; \
BOOL __fExecuteHandler; \
_Unwind_Exception *__exception = \
PAL_TryExcept(__Body::Run, __Body::Handler, &__handlerData, \
&__fExecuteHandler); \
PAL_NoHolder __exceptionHolder; \
if (__exception && __fExecuteHandler) \
{ \
PAL_CatchHolder __catchHolder(__exception); \
__exception = NULL;
#define PAL_EXCEPT_FILTER(filter) PAL_EXCEPT(filter(ExceptionPointers, pvParam))
// Executes the handler if the specified exception code matches
// the one in the exception. Otherwise, returns EXCEPTION_CONTINUE_SEARCH.
#define PAL_EXCEPT_IF_EXCEPTION_CODE(dwExceptionCode) \
PAL_EXCEPT(((ExceptionPointers->ExceptionRecord->ExceptionCode == dwExceptionCode)?EXCEPTION_EXECUTE_HANDLER:EXCEPTION_CONTINUE_SEARCH))
#define PAL_EXCEPT_IF_EXCEPTION_CODE(dwExceptionCode) \
PAL_EXCEPT(((ExceptionPointers->ExceptionRecord->ExceptionCode == \
dwExceptionCode) ? \
EXCEPTION_EXECUTE_HANDLER:EXCEPTION_CONTINUE_SEARCH))
#define PAL_FINALLY \
} \
static EXCEPTION_DISPOSITION Filter( \
EXCEPTION_POINTERS *ExceptionPointers, \
PAL_DISPATCHER_CONTEXT *DispatcherContext, \
void *pvHandlerData) \
{ \
DEBUG_OK_TO_RETURN_BEGIN(PAL_FINALLY) \
return EXCEPTION_CONTINUE_SEARCH; \
DEBUG_OK_TO_RETURN_END(PAL_FINALLY) \
} \
}; \
BOOL __fExecuteHandler; \
_Unwind_Exception *__exception = \
PAL_TryExcept(__Body::Run, __Body::Filter, &__handlerData, &__fExecuteHandler); \
PAL_ExceptionHolder __exceptionHolder(__exception); \
#define PAL_FINALLY \
} \
static EXCEPTION_DISPOSITION Filter( \
EXCEPTION_POINTERS *ExceptionPointers, \
PAL_DISPATCHER_CONTEXT *DispatcherContext, \
void *pvHandlerData) \
{ \
DEBUG_OK_TO_RETURN_BEGIN(PAL_FINALLY) \
return EXCEPTION_CONTINUE_SEARCH; \
DEBUG_OK_TO_RETURN_END(PAL_FINALLY) \
} \
}; \
BOOL __fExecuteHandler; \
_Unwind_Exception *__exception = \
PAL_TryExcept(__Body::Run, __Body::Filter, &__handlerData, \
&__fExecuteHandler); \
PAL_ExceptionHolder __exceptionHolder(__exception); \
{
#define PAL_ENDTRY \
} \
if (__exception) \
{ \
__exceptionHolder.SuppressRelease(); \
_Unwind_Resume(__exception); \
} \
#define PAL_ENDTRY \
} \
if (__exception) \
{ \
__exceptionHolder.SuppressRelease(); \
_Unwind_Resume(__exception); \
} \
}
@ -809,13 +723,15 @@ typedef GUID CLSID;
#define DECLSPEC_UUID(x) __declspec(uuid(x))
#define MIDL_INTERFACE(x) struct DECLSPEC_UUID(x) __declspec(novtable)
#define EXTERN_GUID(itf,l1,s1,s2,c1,c2,c3,c4,c5,c6,c7,c8) \
EXTERN_C const IID DECLSPEC_SELECTANY itf = {l1,s1,s2,{c1,c2,c3,c4,c5,c6,c7,c8}}
#define EXTERN_GUID(itf,l1,s1,s2,c1,c2,c3,c4,c5,c6,c7,c8) \
EXTERN_C const IID DECLSPEC_SELECTANY itf = \
{l1,s1,s2,{c1,c2,c3,c4,c5,c6,c7,c8}}
#define interface struct
#define DECLARE_INTERFACE(iface) interface DECLSPEC_NOVTABLE iface
#define DECLARE_INTERFACE_(iface, baseiface) interface DECLSPEC_NOVTABLE iface : public baseiface
#define DECLARE_INTERFACE_(iface, baseiface) \
interface DECLSPEC_NOVTABLE iface : public baseiface
typedef interface IUnknown IUnknown;
@ -860,10 +776,6 @@ typedef WCHAR *BSTR;
typedef double DATE;
typedef struct tagDEC {
// Decimal.cs treats the first two shorts as one long
// And they seriable the data so we need to little endian
// seriliazation
// The wReserved overlaps with Variant's vt member
#if BIGENDIAN
union {
struct {
@ -904,8 +816,6 @@ struct tagVARIANT
struct
{
#if BIGENDIAN
// We need to make sure vt overlaps with DECIMAL's wReserved.
// See the DECIMAL type for details.
WORD wReserved1;
VARTYPE vt;
#else

Просмотреть файл

@ -1,135 +0,0 @@
//===------------------- include/Reader/jit64.h -----------------*- C++ -*-===//
//
// LLVM-MSILC
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
// See LICENSE file in the project root for full license information.
//
//===----------------------------------------------------------------------===//
//
// Declarations and defines for things that are common to various
// users of the reader framweork.
//
//===----------------------------------------------------------------------===//
#ifndef MSIL_READER_JIT64_H
#define MSIL_READER_JIT64_H
// ---------------------- HRESULT value definitions -----------------
//
// HRESULT definitions
//
//
// Values are 32 bit values layed out as follows:
//
// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
// +---+-+-+-----------------------+-------------------------------+
// |Sev|C|R| Facility | Code |
// +---+-+-+-----------------------+-------------------------------+
//
// where
//
// Sev - is the severity code
//
// 00 - Success
// 01 - Informational
// 10 - Warning
// 11 - Error
//
// C - is the Customer code flag
//
// R - is a reserved bit
//
// Facility - is the facility code
//
// Code - is the facility's status code
//
//
// Internal JIT exceptions.
#define FACILITY_JIT64 0x64 // This is a made up facility code
// Some fatal error occurred
#define JIT64_FATAL_ERROR CORJIT_INTERNALERROR
// An out of memory error occurred in the JIT64
#define JIT64_NOMEM_ERROR CORJIT_OUTOFMEM
#define JIT64_FATALEXCEPTION_CODE (0xE0000000 | FACILITY_JIT64 << 16 | 1)
#define JIT64_READEREXCEPTION_CODE (0xE0000000 | FACILITY_JIT64 << 16 | 2)
//===========================================================================
// Function: jitFilter
//
// Filter to detect/handle internal JIT exceptions.
// Returns EXCEPTION_EXECUTE_HANDLER for JIT64 exceptions,
// and EXCEPTION_CONTINUE_SEARCH for all others.
//
#ifdef __cplusplus
extern "C"
#endif
int
jitFilter(PEXCEPTION_POINTERS ExceptionPointersPtr, LPVOID Param);
extern void _cdecl fatal(int Errnum, ...);
// Global environment config variables (set by GetConfigString).
// These are defined/set in jit.cpp.
#ifdef __cplusplus
extern "C" {
#endif
extern UINT EnvConfigCseOn;
#ifndef NDEBUG
extern UINT EnvConfigCseBinarySearch;
extern UINT EnvConfigCseMax;
extern UINT EnvConfigCopyPropMax;
extern UINT EnvConfigDeadCodeMax;
extern UINT EnvConfigCseStats;
#endif // !NDEBUG
#if !defined(CC_PEVERIFY)
extern UINT EnvConfigTailCallOpt;
#if !defined(NODEBUG)
extern UINT EnvConfigDebugVerify;
extern UINT EnvConfigTailCallMax;
#endif // !NODEBUG
#endif // !CC_PEVERIFY
extern UINT EnvConfigPInvokeInline;
extern UINT EnvConfigPInvokeCalliOpt;
extern UINT EnvConfigNewGCCalc;
extern UINT EnvConfigTurnOffDebugInfo;
extern WCHAR *EnvConfigJitName;
extern BOOL HaveEnvConfigCseOn;
extern BOOL HaveEnvConfigCseStats;
#ifndef NDEBUG
extern BOOL HaveEnvConfigCseBinarySearch;
extern BOOL HaveEnvConfigCseMax;
extern BOOL HaveEnvConfigCopyPropMax;
extern BOOL HaveEnvConfigDeadCodeMax;
#endif // !NDEBUG
#if !defined(CC_PEVERIFY)
extern BOOL HaveEnvConfigTailCallOpt;
#if !defined(NODEBUG)
extern BOOL HaveEnvConfigDebugVerify;
extern BOOL HaveEnvConfigTailCallMax;
#endif // !NODEBUG
#endif // !CC_PEVERIFY
extern BOOL HaveEnvConfigPInvokeInline;
extern BOOL HaveEnvConfigPInvokeCalliOpt;
extern BOOL HaveEnvConfigNewGCCalc;
extern BOOL HaveEnvConfigTurnOffDebugInfo;
extern BOOL HaveEnvConfigJitName;
} // extern "C"
struct JITFilterParams {
CorJitResult *ErrorCode;
};
struct JITFilterCommonParams {
EXCEPTION_POINTERS ExceptionPointers;
};
#endif // MSIL_READER_JIT64_H

Просмотреть файл

@ -31,7 +31,6 @@
#include "corjit.h"
#include "readerenum.h"
#include "gverify.h"
#include "jit64.h"
#include "switches.h"
// as defined in src\vm\vars.hpp
@ -76,6 +75,124 @@
#define TODO()
#endif
// ---------------------- HRESULT value definitions -----------------
//
// HRESULT definitions
//
//
// Values are 32 bit values layed out as follows:
//
// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
// +---+-+-+-----------------------+-------------------------------+
// |Sev|C|R| Facility | Code |
// +---+-+-+-----------------------+-------------------------------+
//
// where
//
// Sev - is the severity code
//
// 00 - Success
// 01 - Informational
// 10 - Warning
// 11 - Error
//
// C - is the Customer code flag
//
// R - is a reserved bit
//
// Facility - is the facility code
//
// Code - is the facility's status code
//
//
// Internal JIT exceptions.
#define FACILITY_MSILCJIT 0x64 // This is a made up facility code
// Some fatal error occurred
#define MSILCJIT_FATAL_ERROR CORJIT_INTERNALERROR
// An out of memory error occurred in the MSILCJIT
#define MSILCJIT_NOMEM_ERROR CORJIT_OUTOFMEM
#define MSILCJIT_FATALEXCEPTION_CODE (0xE0000000 | FACILITY_MSILCJIT << 16 | 1)
#define MSILCJIT_READEREXCEPTION_CODE (0xE0000000 | FACILITY_MSILCJIT << 16 | 2)
//===========================================================================
// Function: jitFilter
//
// Filter to detect/handle internal JIT exceptions.
// Returns EXCEPTION_EXECUTE_HANDLER for MSILCJIT exceptions,
// and EXCEPTION_CONTINUE_SEARCH for all others.
//
#ifdef __cplusplus
extern "C"
#endif
int
jitFilter(PEXCEPTION_POINTERS ExceptionPointersPtr, LPVOID Param);
extern void _cdecl fatal(int Errnum, ...);
// Global environment config variables (set by GetConfigString).
// These are defined/set in jit.cpp.
#ifdef __cplusplus
extern "C" {
#endif
extern UINT EnvConfigCseOn;
#ifndef NDEBUG
extern UINT EnvConfigCseBinarySearch;
extern UINT EnvConfigCseMax;
extern UINT EnvConfigCopyPropMax;
extern UINT EnvConfigDeadCodeMax;
extern UINT EnvConfigCseStats;
#endif // !NDEBUG
#if !defined(CC_PEVERIFY)
extern UINT EnvConfigTailCallOpt;
#if !defined(NODEBUG)
extern UINT EnvConfigDebugVerify;
extern UINT EnvConfigTailCallMax;
#endif // !NODEBUG
#endif // !CC_PEVERIFY
extern UINT EnvConfigPInvokeInline;
extern UINT EnvConfigPInvokeCalliOpt;
extern UINT EnvConfigNewGCCalc;
extern UINT EnvConfigTurnOffDebugInfo;
extern WCHAR *EnvConfigJitName;
extern BOOL HaveEnvConfigCseOn;
extern BOOL HaveEnvConfigCseStats;
#ifndef NDEBUG
extern BOOL HaveEnvConfigCseBinarySearch;
extern BOOL HaveEnvConfigCseMax;
extern BOOL HaveEnvConfigCopyPropMax;
extern BOOL HaveEnvConfigDeadCodeMax;
#endif // !NDEBUG
#if !defined(CC_PEVERIFY)
extern BOOL HaveEnvConfigTailCallOpt;
#if !defined(NODEBUG)
extern BOOL HaveEnvConfigDebugVerify;
extern BOOL HaveEnvConfigTailCallMax;
#endif // !NODEBUG
#endif // !CC_PEVERIFY
extern BOOL HaveEnvConfigPInvokeInline;
extern BOOL HaveEnvConfigPInvokeCalliOpt;
extern BOOL HaveEnvConfigNewGCCalc;
extern BOOL HaveEnvConfigTurnOffDebugInfo;
extern BOOL HaveEnvConfigJitName;
} // extern "C"
struct JITFilterParams {
CorJitResult *ErrorCode;
};
struct JITFilterCommonParams {
EXCEPTION_POINTERS ExceptionPointers;
};
// Forward declarations for client defined structures
class GenIR; // Compiler dependent IR production
class IRNode; // Your compiler intermediate representation

Просмотреть файл

@ -254,7 +254,7 @@ typedef enum {
TRY_MCatch, // the try has only catch handlers
TRY_MCatchXcpt, // the try has both catch and except handlers
TRY_MXcpt, // the try has only except handlers
// for native compiler code, not used in current jit64
// for native compiler code, not used in current JIT
TRY_Xcpt, // native SEH except
TRY_CCatch // native C++ catch
} TryKind;

Просмотреть файл

@ -6521,7 +6521,7 @@ LONG objectFilter(PEXCEPTION_POINTERS ExceptionPointersPtr, LPVOID Param) {
(ReadBytesForFlowGraphNodeHelperParam *)Param;
if (ExceptionPointersPtr->ExceptionRecord->ExceptionCode ==
JIT64_READEREXCEPTION_CODE) {
MSILCJIT_READEREXCEPTION_CODE) {
ReadParam->Excep =
*(ReaderException **)
ExceptionPointersPtr->ExceptionRecord->ExceptionInformation;

Просмотреть файл

@ -676,7 +676,7 @@ void ReaderBase::debugError(const char *Filename, unsigned Linenumber,
};
// Fatal error, reader cannot continue.
void ReaderBase::fatal(int ErrNum) { MSILCJit::fatal(JIT64_FATAL_ERROR); }
void ReaderBase::fatal(int ErrNum) { MSILCJit::fatal(MSILCJIT_FATAL_ERROR); }
#pragma endregion