зеркало из https://github.com/microsoft/BPerf.git
Update CoreCLR Headers for .NET 5
This commit is contained in:
Родитель
9dba8a3205
Коммит
5e54ace306
|
@ -82,7 +82,7 @@ BPerfProfilerCallback::~BPerfProfilerCallback()
|
|||
|
||||
HRESULT STDMETHODCALLTYPE BPerfProfilerCallback::Initialize(IUnknown* pICorProfilerInfoUnk)
|
||||
{
|
||||
const HRESULT queryInterfaceResult = pICorProfilerInfoUnk->QueryInterface(__uuidof(ICorProfilerInfo10), reinterpret_cast<void**>(&this->corProfilerInfo));
|
||||
const HRESULT queryInterfaceResult = pICorProfilerInfoUnk->QueryInterface(__uuidof(ICorProfilerInfo11), reinterpret_cast<void**>(&this->corProfilerInfo));
|
||||
|
||||
if (FAILED(queryInterfaceResult))
|
||||
{
|
||||
|
|
|
@ -222,7 +222,7 @@ public:
|
|||
private:
|
||||
|
||||
std::atomic<int> refCount;
|
||||
ICorProfilerInfo10* corProfilerInfo;
|
||||
ICorProfilerInfo11* corProfilerInfo;
|
||||
|
||||
/* Exception Counters */
|
||||
std::atomic<size_t> numberOfExceptionsThrown;
|
||||
|
|
|
@ -13,4 +13,4 @@ if ("${LINK_TYPE}" STREQUAL "Static")
|
|||
add_compile_options(/MT$<$<CONFIG:Debug>:d>)
|
||||
add_link_options(/SOURCELINK:${SourceLinkJson})
|
||||
endif()
|
||||
add_library (Microsoft.BPerf.CoreCLRProfiler SHARED "BPerfProfilerCallback.cpp" "BPerfProfilerCallback.h" "Microsoft.BPerf.CoreCLRProfiler.cpp" "ETWHeaders.h" "CQuickBytes.h" "CQuickBytes.cpp" "PrettyPrintSig.cpp" "sha1.cpp" "sha1.h" "profiler_pal.h" "PortableString.h" "exports.def")
|
||||
add_library (Microsoft.BPerf.CoreCLRProfiler SHARED "BPerfProfilerCallback.cpp" "BPerfProfilerCallback.h" "Microsoft.BPerf.CoreCLRProfiler.cpp" "ETWHeaders.h" "CQuickBytes.h" "CQuickBytes.cpp" "PrettyPrintSig.cpp" "sha1.cpp" "sha1.h" "profiler_pal.h" "PortableString.h" "coreclr_headers/src/pal/prebuilt/idl/corprof_i.cpp" "exports.def")
|
||||
|
|
|
@ -7,63 +7,51 @@ set( CORGUIDS_IDL_SOURCES
|
|||
corprof.idl
|
||||
corpub.idl
|
||||
mscorsvc.idl
|
||||
clrprivappxhosting.idl
|
||||
clrprivbinding.idl
|
||||
clrprivhosting.idl
|
||||
clrprivruntimebinders.idl
|
||||
corsym.idl
|
||||
sospriv.idl
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
#Build for corguids is done in two steps:
|
||||
#1. compile .idl to *_i.c : This is done using custom midl command
|
||||
#2. compile *_i.c to .lib
|
||||
if(CLR_CMAKE_HOST_WIN32)
|
||||
#Build for corguids is done in two steps:
|
||||
#1. compile .idl to *_i.c : This is done using custom midl command
|
||||
#2. compile *_i.c to .lib
|
||||
|
||||
# Get the current list of definitions to pass to midl
|
||||
get_compile_definitions(MIDL_DEFINITIONS)
|
||||
get_include_directories(MIDL_INCLUDE_DIRECTORIES)
|
||||
# Get the current list of definitions to pass to midl
|
||||
get_compile_definitions(MIDL_DEFINITIONS)
|
||||
get_include_directories(MIDL_INCLUDE_DIRECTORIES)
|
||||
|
||||
|
||||
# Run custom midl command over each idl file
|
||||
FIND_PROGRAM( MIDL midl.exe )
|
||||
foreach(GENERATE_IDL IN LISTS CORGUIDS_IDL_SOURCES)
|
||||
get_filename_component(IDLNAME ${GENERATE_IDL} NAME_WE)
|
||||
set(OUT_NAME ${CMAKE_CURRENT_BINARY_DIR}/idls_out/${IDLNAME}_i.c)
|
||||
list(APPEND CORGUIDS_SOURCES ${OUT_NAME})
|
||||
add_custom_command(OUTPUT ${OUT_NAME}
|
||||
# Run custom midl command over each idl file
|
||||
FIND_PROGRAM( MIDL midl.exe )
|
||||
foreach(GENERATE_IDL IN LISTS CORGUIDS_IDL_SOURCES)
|
||||
get_filename_component(IDLNAME ${GENERATE_IDL} NAME_WE)
|
||||
set(OUT_NAME ${CMAKE_CURRENT_BINARY_DIR}/idls_out/${IDLNAME}_i.c)
|
||||
list(APPEND CORGUIDS_SOURCES ${OUT_NAME})
|
||||
add_custom_command(OUTPUT ${OUT_NAME}
|
||||
COMMAND ${MIDL} ${MIDL_INCLUDE_DIRECTORIES} /h ${CMAKE_CURRENT_BINARY_DIR}/idls_out/${IDLNAME}.h ${MIDL_DEFINITIONS} /out ${CMAKE_CURRENT_BINARY_DIR}/idls_out ${CMAKE_CURRENT_SOURCE_DIR}/${GENERATE_IDL}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${GENERATE_IDL}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${GENERATE_IDL}
|
||||
COMMENT "Compiling ${GENERATE_IDL}")
|
||||
endforeach(GENERATE_IDL)
|
||||
endforeach(GENERATE_IDL)
|
||||
|
||||
set_source_files_properties(${CORGUIDS_SOURCES}
|
||||
set_source_files_properties(${CORGUIDS_SOURCES}
|
||||
PROPERTIES GENERATED TRUE)
|
||||
|
||||
# Compile *_i.c as C files
|
||||
add_compile_options(/TC)
|
||||
# Compile *_i.c as C files
|
||||
add_compile_options(/TC)
|
||||
|
||||
else()
|
||||
else(CLR_CMAKE_HOST_WIN32)
|
||||
|
||||
#The MIDL tool exists for Windows only, so for other systems, we have the prebuilt xxx_i.cpp files checked in
|
||||
#The MIDL tool exists for Windows only, so for other systems, we have the prebuilt xxx_i.cpp files checked in
|
||||
|
||||
# The prebuilt files contain extra '!_MIDL_USE_GUIDDEF_' after the #endif, but not in the comment.
|
||||
# In order to not to have to modify these prebuilt files, we disable the extra tokens warning.
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Wno-extra-tokens)
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
add_compile_options(-Wno-endif-labels)
|
||||
endif()
|
||||
add_compile_options(-D_MIDL_USE_GUIDDEF_)
|
||||
foreach(IDL_SOURCE IN LISTS CORGUIDS_IDL_SOURCES)
|
||||
get_filename_component(IDLNAME ${IDL_SOURCE} NAME_WE)
|
||||
set(C_SOURCE ../pal/prebuilt/idl/${IDLNAME}_i.cpp)
|
||||
list(APPEND CORGUIDS_SOURCES ${C_SOURCE})
|
||||
endforeach(IDL_SOURCE)
|
||||
|
||||
add_compile_options(-D_MIDL_USE_GUIDDEF_)
|
||||
foreach(IDL_SOURCE IN LISTS CORGUIDS_IDL_SOURCES)
|
||||
get_filename_component(IDLNAME ${IDL_SOURCE} NAME_WE)
|
||||
set(C_SOURCE ../pal/prebuilt/idl/${IDLNAME}_i.cpp)
|
||||
list(APPEND CORGUIDS_SOURCES ${C_SOURCE})
|
||||
endforeach(IDL_SOURCE)
|
||||
|
||||
add_compile_options(-fPIC)
|
||||
endif(WIN32)
|
||||
endif(CLR_CMAKE_HOST_WIN32)
|
||||
|
||||
if(FEATURE_JIT_PITCHING)
|
||||
add_definitions(-DFEATURE_JIT_PITCHING)
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
//
|
||||
//
|
||||
// This tool exists to transform a high level description of Crst dependencies (i.e. which Crst type may be
|
||||
// acquired before or after other Crst types) into a header file that defines a enum to describe each Crst
|
||||
// type and tables that map type to numerical ranking and a string based name.
|
||||
//
|
||||
// To use the tool, run "csc.exe CrstTypeTool.cs" and run the resulting executable.
|
||||
//
|
||||
//
|
||||
// The Crst type definition file is written in a very simple language. Comments begin with '//' and continue
|
||||
// to the end of the line. All remaining tokens after comment removal are simply sequences of non-whitespace
|
||||
// characters separated by whitespace. Keywords are case-insensitive and identifiers (which are always Crst
|
||||
|
@ -65,7 +65,7 @@ class CrstTypeTool
|
|||
{
|
||||
// Calculate the filenames of the input and output files.
|
||||
string inputFile = "CrstTypes.def";
|
||||
string outputFile = "CrstTypes.h";
|
||||
string outputFile = "crsttypes.h";
|
||||
|
||||
// A common error is to forget to check out the CrstTypes.h file first. Handle this case specially
|
||||
// so we can give a good error message.
|
||||
|
@ -143,7 +143,7 @@ class CrstTypeTool
|
|||
writer.WriteLine();
|
||||
writer.WriteLine("// This file describes the range of Crst types available and their mapping to a numeric level (used by the");
|
||||
writer.WriteLine("// runtime in debug mode to validate we're deadlock free). To modify these settings edit the");
|
||||
writer.WriteLine("// file:CrstTypes.def file and run the clr\\bin\\CrstTypeTool utility to generate a new version of this file.");
|
||||
writer.WriteLine("// file:CrstTypes.def file and run the clr\\artifacts\\CrstTypeTool utility to generate a new version of this file.");
|
||||
writer.WriteLine();
|
||||
|
||||
// Emit the CrstType enum to define a value for each crst type (along with the kNumberOfCrstTypes
|
||||
|
@ -173,10 +173,10 @@ class CrstTypeTool
|
|||
writer.WriteLine("int g_rgCrstLevelMap[] =");
|
||||
writer.WriteLine("{");
|
||||
foreach (CrstType crst in crsts)
|
||||
{
|
||||
string crstLine = " " + crst.Level + ",";
|
||||
crstLine = crstLine + new string(' ', 16 - crstLine.Length);
|
||||
writer.WriteLine(crstLine + "// Crst" + crst.Name);
|
||||
{
|
||||
string crstLine = " " + crst.Level + ",";
|
||||
crstLine = crstLine + new string(' ', 16 - crstLine.Length);
|
||||
writer.WriteLine(crstLine + "// Crst" + crst.Name);
|
||||
}
|
||||
writer.WriteLine("};");
|
||||
writer.WriteLine();
|
||||
|
@ -803,7 +803,7 @@ class TypeFileParser
|
|||
for (int i = 0; i < expected.Length - 1; i++)
|
||||
message.Append(String.Format("{0}, ", IdToName(expected[i])));
|
||||
message.Append(IdToName(expected[expected.Length - 1]));
|
||||
|
||||
|
||||
}
|
||||
|
||||
return message.ToString();
|
||||
|
|
|
@ -105,7 +105,7 @@ Crst AssemblyDependencyGraph
|
|||
End
|
||||
|
||||
Crst AvailableParamTypes
|
||||
AcquiredBefore IbcProfile LoaderHeap
|
||||
AcquiredBefore ModuleLookupTable IbcProfile LoaderHeap
|
||||
End
|
||||
|
||||
Crst BaseDomain
|
||||
|
@ -156,12 +156,8 @@ Crst Contexts
|
|||
StubUnwindInfoHeapSegments SyncBlockCache TypeIDMap UnresolvedClassLock
|
||||
End
|
||||
|
||||
Crst CoreCLRBinderLog
|
||||
Unordered
|
||||
End
|
||||
|
||||
Crst CSPCache
|
||||
AcquiredBefore JumpStubCache
|
||||
AcquiredBefore JumpStubCache
|
||||
End
|
||||
|
||||
Crst DeadlockDetection
|
||||
|
@ -169,14 +165,14 @@ End
|
|||
|
||||
Crst DebuggerController
|
||||
// AcquiredBefore DebuggerHeapLock DebuggerJitInfo LoaderHeap
|
||||
|
||||
// See bug: 581892. This has a conflict with CrstInstMethodHashTableRanking.
|
||||
|
||||
// See bug: 581892. This has a conflict with CrstInstMethodHashTableRanking.
|
||||
// The controller logic will be moved to OOP in V3, and so this lock will no longer be necessary.
|
||||
// Fixing this in-proc would be difficult, and it would all be throwaway as we go oop.
|
||||
Unordered
|
||||
End
|
||||
|
||||
// This is a leaf debugger lock.
|
||||
// This is a leaf debugger lock.
|
||||
Crst DebuggerFavorLock
|
||||
AcquiredAfter DebuggerJitInfo DebuggerMutex
|
||||
End
|
||||
|
@ -189,32 +185,32 @@ End
|
|||
Crst DebuggerHeapLock
|
||||
AcquiredAfter DebuggerFavorLock DebuggerJitInfo DebuggerMutex
|
||||
// Disabled per bug 581892
|
||||
// AcquiredAfter DebuggerController
|
||||
// AcquiredAfter DebuggerController
|
||||
End
|
||||
|
||||
Crst DebuggerJitInfo
|
||||
AcquiredBefore DebuggerHeapLock
|
||||
End
|
||||
|
||||
// This is the major debugger lock.
|
||||
// This is the major debugger lock.
|
||||
// It's the largest of the debugger locks.
|
||||
Crst DebuggerMutex
|
||||
AcquiredBefore AvailableParamTypes ConnectionNameTable
|
||||
AcquiredBefore AvailableParamTypes ConnectionNameTable
|
||||
DynamicIL LoaderHeap ModuleLookupTable
|
||||
|
||||
// Disabled per bug 581892
|
||||
// AcquiredBefore DebuggerController
|
||||
// AcquiredBefore DebuggerController
|
||||
AcquiredBefore DebuggerHeapLock DebuggerJitInfo
|
||||
|
||||
End
|
||||
|
||||
// This lock is used only for testing data consistency (see code:DataTest::TestDataSafety)
|
||||
// This lock is used only for testing data consistency (see code:DataTest::TestDataSafety)
|
||||
// and is released before taking any other lock except for CrstDataTest2
|
||||
Crst DataTest1
|
||||
AcquiredAfter DebuggerMutex
|
||||
End
|
||||
|
||||
// This lock is used only for testing data consistency (see code:DataTest::TestDataSafety)
|
||||
// This lock is used only for testing data consistency (see code:DataTest::TestDataSafety)
|
||||
// and is released before taking any other lockCrst DataTest2
|
||||
Crst DataTest2
|
||||
AcquiredAfter DataTest1
|
||||
|
@ -284,7 +280,7 @@ Crst NativeImageCache
|
|||
End
|
||||
|
||||
Crst GCCover
|
||||
AcquiredBefore LoaderHeap ReJITDomainTable
|
||||
AcquiredBefore LoaderHeap CodeVersioning
|
||||
End
|
||||
|
||||
Crst GCMemoryPressure
|
||||
|
@ -355,14 +351,18 @@ End
|
|||
Crst JitGenericHandleCache
|
||||
End
|
||||
|
||||
Crst JitPatchpoint
|
||||
AcquiredBefore LoaderHeap
|
||||
End
|
||||
|
||||
Crst JitPerf
|
||||
Unordered
|
||||
End
|
||||
|
||||
Crst JumpStubCache
|
||||
AcquiredBefore ExecuteManRangeLock LoaderHeap SingleUseLock
|
||||
AcquiredAfter AppDomainCache ExecuteManLock
|
||||
ILStubGen ThreadpoolTimerQueue ThreadpoolWaitThreads
|
||||
AcquiredAfter AppDomainCache ExecuteManLock
|
||||
ILStubGen ThreadpoolTimerQueue ThreadpoolWaitThreads
|
||||
TPMethodTable TypeIDMap BaseDomain AssemblyLoader
|
||||
End
|
||||
|
||||
|
@ -482,6 +482,9 @@ End
|
|||
Crst RCWCleanupList
|
||||
End
|
||||
|
||||
Crst ExternalObjectContextCache
|
||||
End
|
||||
|
||||
Crst ReDacl
|
||||
End
|
||||
|
||||
|
@ -490,7 +493,7 @@ Crst Reflection
|
|||
End
|
||||
|
||||
// Used to synchronize all rejit information stored in a given AppDomain.
|
||||
Crst ReJITDomainTable
|
||||
Crst CodeVersioning
|
||||
AcquiredBefore LoaderHeap SingleUseLock DeadlockDetection JumpStubCache DebuggerController FuncPtrStubs
|
||||
AcquiredAfter ReJITGlobalRequest ThreadStore GlobalStrLiteralMap SystemDomain DebuggerMutex MethodDescBackpatchInfoTracker
|
||||
End
|
||||
|
@ -499,7 +502,7 @@ End
|
|||
// new functions to rejit tables, or request Reverts on existing functions in the rejit
|
||||
// tables. One of these crsts exist per runtime.
|
||||
Crst ReJITGlobalRequest
|
||||
AcquiredBefore ThreadStore ReJITDomainTable SystemDomain
|
||||
AcquiredBefore ThreadStore CodeVersioning SystemDomain JitInlineTrackingMap
|
||||
End
|
||||
|
||||
// ETW infrastructure uses this crst to protect a hash table of TypeHandles which is
|
||||
|
@ -507,7 +510,7 @@ End
|
|||
// same type).
|
||||
Crst EtwTypeLogHash
|
||||
AcquiredAfter ThreadStore AllowedFiles Cer TPMethodTable
|
||||
AcquiredBefore AvailableParamTypes ConnectionNameTable DeadlockDetection DebuggerController
|
||||
AcquiredBefore AvailableParamTypes ConnectionNameTable DeadlockDetection DebuggerController
|
||||
DebuggerHeapLock DebuggerJitInfo DynamicIL ExecuteManRangeLock HandleTable IbcProfile
|
||||
JitGenericHandleCache JumpStubCache LoaderHeap ModuleLookupTable ProfilingAPIStatus
|
||||
ProfilerGCRefDataFreeList RWLock SingleUseLock SyncBlockCache SystemDomainDelayedUnloadList
|
||||
|
@ -616,7 +619,7 @@ Crst ThreadStaticDataHashTable
|
|||
End
|
||||
|
||||
Crst ThreadStore
|
||||
AcquiredBefore AvailableParamTypes ConnectionNameTable DeadlockDetection DebuggerController
|
||||
AcquiredBefore AvailableParamTypes ConnectionNameTable DeadlockDetection DebuggerController
|
||||
DebuggerHeapLock DebuggerJitInfo DynamicIL ExecuteManRangeLock HandleTable IbcProfile
|
||||
JitGenericHandleCache JumpStubCache LoaderHeap ModuleLookupTable ProfilingAPIStatus
|
||||
ProfilerGCRefDataFreeList RWLock SingleUseLock SyncBlockCache SystemDomainDelayedUnloadList
|
||||
|
@ -669,10 +672,10 @@ Crst MulticoreJitManager
|
|||
End
|
||||
|
||||
Crst WinRTFactoryCache
|
||||
AcquiredBefore HandleTable
|
||||
AcquiredBefore HandleTable
|
||||
End
|
||||
|
||||
Crst SqmManager
|
||||
Crst SqmManager
|
||||
End
|
||||
|
||||
Crst StackSampler
|
||||
|
@ -683,7 +686,7 @@ Crst InlineTrackingMap
|
|||
End
|
||||
|
||||
Crst JitInlineTrackingMap
|
||||
AcquiredBefore ReJITDomainTable ThreadStore LoaderAllocator
|
||||
AcquiredBefore CodeVersioning ThreadStore LoaderAllocator
|
||||
End
|
||||
|
||||
Crst EventPipe
|
||||
|
@ -699,6 +702,7 @@ Crst ReadyToRunEntryPointToMethodDescMap
|
|||
End
|
||||
|
||||
Crst TieredCompilation
|
||||
AcquiredAfter CodeVersioning
|
||||
AcquiredBefore ThreadpoolTimerQueue
|
||||
End
|
||||
|
||||
|
@ -709,3 +713,6 @@ Crst MethodDescBackpatchInfoTracker
|
|||
AcquiredBefore FuncPtrStubs ThreadStore SystemDomain
|
||||
AcquiredAfter ReJITGlobalRequest
|
||||
End
|
||||
|
||||
Crst NativeImageEagerFixups
|
||||
End
|
||||
|
|
|
@ -10,11 +10,6 @@
|
|||
** **
|
||||
**************************************************************************************/
|
||||
|
||||
cpp_quote("#define DECLARE_DEPRECATED ")
|
||||
cpp_quote("#define DEPRECATED_CLR_STDAPI STDAPI")
|
||||
|
||||
cpp_quote("")
|
||||
|
||||
//
|
||||
// Interface descriptions
|
||||
//
|
||||
|
@ -29,9 +24,6 @@ interface IHostControl;
|
|||
cpp_quote("struct ICLRControl;")
|
||||
interface ICLRControl;
|
||||
|
||||
// CLSID ComCallUnmarshal2
|
||||
cpp_quote("EXTERN_GUID(CLSID_ComCallUnmarshalV4, 0x45fb4600,0xe6e8,0x4928,0xb2,0x5e,0x50,0x47,0x6f,0xf7,0x94,0x25);")
|
||||
|
||||
// IID ICLRRuntimeHost: uuid(90F1A06C-7712-4762-86B5-7A5EBA6BDB02)
|
||||
cpp_quote("EXTERN_GUID(IID_ICLRRuntimeHost, 0x90F1A06C, 0x7712, 0x4762, 0x86, 0xB5, 0x7A, 0x5E, 0xBA, 0x6B, 0xDB, 0x02);")
|
||||
|
||||
|
@ -63,27 +55,27 @@ typedef enum {
|
|||
STARTUP_SINGLE_VERSION_HOSTING_INTERFACE = 0x4000, // Disallow mixing hosting interface
|
||||
STARTUP_LEGACY_IMPERSONATION = 0x10000, // Do not flow impersonation across async points by default
|
||||
STARTUP_DISABLE_COMMITTHREADSTACK = 0x20000, // Don't eagerly commit thread stack
|
||||
STARTUP_ALWAYSFLOW_IMPERSONATION = 0x40000, // Force flow impersonation across async points
|
||||
// (impersonations achieved thru p/invoke and managed will flow.
|
||||
STARTUP_ALWAYSFLOW_IMPERSONATION = 0x40000, // Force flow impersonation across async points
|
||||
// (impersonations achieved thru p/invoke and managed will flow.
|
||||
// default is to flow only managed impersonation)
|
||||
STARTUP_TRIM_GC_COMMIT = 0x80000, // GC uses less committed space when system memory low
|
||||
STARTUP_ETW = 0x100000,
|
||||
STARTUP_ARM = 0x400000, // Enable the ARM feature.
|
||||
STARTUP_SINGLE_APPDOMAIN = 0x800000, // application runs in default domain, no more domains are created
|
||||
STARTUP_SINGLE_APPDOMAIN = 0x800000, // application runs in default domain, no more domains are created
|
||||
STARTUP_APPX_APP_MODEL = 0x1000000, // jupiter app
|
||||
STARTUP_DISABLE_RANDOMIZED_STRING_HASHING = 0x2000000 // Disable the randomized string hashing (not supported)
|
||||
} STARTUP_FLAGS;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
APPDOMAIN_SECURITY_DEFAULT =0x0,
|
||||
APPDOMAIN_SECURITY_DEFAULT =0x0,
|
||||
APPDOMAIN_SECURITY_SANDBOXED = 0x1, // appdomain is sandboxed
|
||||
APPDOMAIN_SECURITY_FORBID_CROSSAD_REVERSE_PINVOKE = 0x2, // no cross ad reverse pinvokes
|
||||
APPDOMAIN_IGNORE_UNHANDLED_EXCEPTIONS = 0x4, //
|
||||
APPDOMAIN_FORCE_TRIVIAL_WAIT_OPERATIONS = 0x08, // do not pump messages during wait operations, do not call sync context
|
||||
// When passed by the host, this flag will allow any assembly to perform PInvoke or COMInterop operations.
|
||||
// Otherwise, by default, only platform assemblies can perform those operations.
|
||||
APPDOMAIN_ENABLE_PINVOKE_AND_CLASSIC_COMINTEROP = 0x10,
|
||||
APPDOMAIN_ENABLE_PINVOKE_AND_CLASSIC_COMINTEROP = 0x10,
|
||||
|
||||
APPDOMAIN_ENABLE_PLATFORM_SPECIFIC_APPS = 0x40,
|
||||
APPDOMAIN_ENABLE_ASSEMBLY_LOADFILE = 0x80,
|
||||
|
@ -97,35 +89,19 @@ typedef enum {
|
|||
WAIT_NOTINDEADLOCK = 0x4
|
||||
}WAIT_OPTION;
|
||||
|
||||
typedef enum ETaskType
|
||||
{
|
||||
TT_DEBUGGERHELPER = 0x1,
|
||||
TT_GC = 0x2,
|
||||
TT_FINALIZER = 0x4,
|
||||
TT_THREADPOOL_TIMER = 0x8,
|
||||
TT_THREADPOOL_GATE = 0x10,
|
||||
TT_THREADPOOL_WORKER = 0x20,
|
||||
TT_THREADPOOL_IOCOMPLETION = 0x40,
|
||||
TT_ADUNLOAD = 0x80,
|
||||
TT_USER = 0x100,
|
||||
TT_THREADPOOL_WAIT = 0x200,
|
||||
|
||||
TT_UNKNOWN = 0x80000000,
|
||||
} ETaskType;
|
||||
|
||||
typedef enum {
|
||||
// Default to minidump
|
||||
DUMP_FLAVOR_Mini = 0,
|
||||
|
||||
|
||||
// Include critical CLR state
|
||||
DUMP_FLAVOR_CriticalCLRState = 1,
|
||||
|
||||
|
||||
// Include critical CLR state and ngen images without including hosted heap
|
||||
// It is host's responsibility to report hosted heap.
|
||||
DUMP_FLAVOR_NonHeapCLRState = 2,
|
||||
|
||||
DUMP_FLAVOR_Default = DUMP_FLAVOR_Mini
|
||||
|
||||
|
||||
} ECustomDumpFlavor;
|
||||
|
||||
const DWORD BucketParamsCount = 10;
|
||||
|
@ -153,61 +129,6 @@ typedef struct _BucketParameters
|
|||
WCHAR pszParams[BucketParamsCount][BucketParamLength]; // Parameter strings.
|
||||
} BucketParameters;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
OPR_ThreadAbort,
|
||||
OPR_ThreadRudeAbortInNonCriticalRegion,
|
||||
OPR_ThreadRudeAbortInCriticalRegion,
|
||||
OPR_AppDomainUnload,
|
||||
OPR_AppDomainRudeUnload,
|
||||
OPR_ProcessExit,
|
||||
OPR_FinalizerRun,
|
||||
MaxClrOperation
|
||||
// Do not add anything after this
|
||||
} EClrOperation;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
FAIL_NonCriticalResource,
|
||||
FAIL_CriticalResource,
|
||||
FAIL_FatalRuntime,
|
||||
FAIL_OrphanedLock,
|
||||
FAIL_StackOverflow,
|
||||
// In CoreCLR, we will treat AV specially, based upon the escalation policy.
|
||||
// Currently only used in CoreCLR.
|
||||
FAIL_AccessViolation,
|
||||
FAIL_CodeContract,
|
||||
MaxClrFailure
|
||||
// Do not add anything after this
|
||||
} EClrFailure;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
eRuntimeDeterminedPolicy, // default
|
||||
eHostDeterminedPolicy, // revert back to Everett behavior, i.e. swallow all exception
|
||||
} EClrUnhandledException;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
// !!! Please keep these ordered by severity
|
||||
// !!! If you don't, you need to change EEPolicy::IsValidActionForOperation
|
||||
// !!! and EEPolicy::IsValidActionForFailure
|
||||
eNoAction,
|
||||
eThrowException,
|
||||
eAbortThread,
|
||||
eRudeAbortThread,
|
||||
eUnloadAppDomain,
|
||||
eRudeUnloadAppDomain,
|
||||
eExitProcess,
|
||||
// Look at CorHost2::Stop. For eFastExitProcess, eRudeExitProcess, eDisableRuntime,
|
||||
// Stop bypasses finalizer run.
|
||||
eFastExitProcess,
|
||||
eRudeExitProcess,
|
||||
MaxPolicyAction
|
||||
} EPolicyAction;
|
||||
|
||||
|
||||
//*****************************************************************************
|
||||
// New interface for hosting mscoree
|
||||
//*****************************************************************************
|
||||
|
@ -273,16 +194,16 @@ interface ICLRRuntimeHost2 : ICLRRuntimeHost
|
|||
// set of properties.
|
||||
HRESULT CreateAppDomainWithManager([in] LPCWSTR wszFriendlyName,
|
||||
[in] DWORD dwFlags,
|
||||
[in] LPCWSTR wszAppDomainManagerAssemblyName,
|
||||
[in] LPCWSTR wszAppDomainManagerTypeName,
|
||||
[in] int nProperties,
|
||||
[in] LPCWSTR* pPropertyNames,
|
||||
[in] LPCWSTR* pPropertyValues,
|
||||
[in] LPCWSTR wszAppDomainManagerAssemblyName,
|
||||
[in] LPCWSTR wszAppDomainManagerTypeName,
|
||||
[in] int nProperties,
|
||||
[in] LPCWSTR* pPropertyNames,
|
||||
[in] LPCWSTR* pPropertyValues,
|
||||
[out] DWORD* pAppDomainID);
|
||||
|
||||
HRESULT CreateDelegate([in] DWORD appDomainID,
|
||||
[in] LPCWSTR wszAssemblyName,
|
||||
[in] LPCWSTR wszClassName,
|
||||
[in] LPCWSTR wszAssemblyName,
|
||||
[in] LPCWSTR wszClassName,
|
||||
[in] LPCWSTR wszMethodName,
|
||||
[out] INT_PTR* fnPtr);
|
||||
|
||||
|
@ -320,7 +241,3 @@ interface ICLRRuntimeHost4 : ICLRRuntimeHost2
|
|||
[in] BOOL fWaitUntilDone,
|
||||
[out] int *pLatchedExitCode);
|
||||
};
|
||||
|
||||
cpp_quote("#undef DEPRECATED_CLR_STDAPI")
|
||||
cpp_quote("#undef DECLARE_DEPRECATED")
|
||||
cpp_quote("#undef DEPRECATED_CLR_API_MESG")
|
||||
|
|
|
@ -49,7 +49,7 @@ $endHeaderComment .= "==========================================================
|
|||
$usingAndRefEmitNmsp = "namespace System.Reflection.Emit\n{\n\n";
|
||||
$obsoleteAttr = " [Obsolete(\"This API has been deprecated. https://go.microsoft.com/fwlink/?linkid=14202\")]\n";
|
||||
|
||||
# Open source file and target files
|
||||
# Open source file and target files
|
||||
|
||||
open (OPCODE, "opcode.def") or die "Couldn't open opcode.def: $!\n";
|
||||
open (OUTPUT, ">OpCodes.cs") or die "Couldn't open OpCodes.cs: $!\n";
|
||||
|
@ -116,7 +116,7 @@ while (<OPCODE>)
|
|||
s/^OPDEF\(\s*//; # Strip off "OP("
|
||||
s/,\s*/,/g; # Remove whitespace
|
||||
s/\).*$//; # Strip off ")" and everything behind it at end
|
||||
|
||||
|
||||
# Split the line up into its basic parts
|
||||
($enumname, $stringname, $pop, $push, $operand, $type, $size, $s1, $s2, $ctrl) = split(/,/);
|
||||
$s1 =~ s/0x//;
|
||||
|
@ -252,7 +252,7 @@ while (<OPCODE>)
|
|||
my $opcodeName = $enumname;
|
||||
|
||||
# Tailcall OpCode enum name does not comply with convention
|
||||
# that all enum names are exactly the same as names in opcode.def
|
||||
# that all enum names are exactly the same as names in opcode.def
|
||||
# file less leading CEE_ and changed casing convention
|
||||
$enumname = substr $enumname, 0, 4 unless $enumname !~ m/Tailcall$/;
|
||||
|
||||
|
@ -266,12 +266,12 @@ while (<OPCODE>)
|
|||
}
|
||||
|
||||
my $lineEnum;
|
||||
if ($size == 1)
|
||||
if ($size == 1)
|
||||
{
|
||||
$lineEnum = sprintf(" %s = 0x%.2x,\n", $enumname, $s2);
|
||||
$opcodeEnum{$s2} = $lineEnum;
|
||||
}
|
||||
elsif ($size == 2)
|
||||
elsif ($size == 2)
|
||||
{
|
||||
$lineEnum = sprintf(" %s = 0x%.4x,\n", $enumname, $s2 + 256 * $s1);
|
||||
$opcodeEnum{$s2 + 256 * $s1} = $lineEnum;
|
||||
|
@ -314,7 +314,7 @@ while (<OPCODE>)
|
|||
|
||||
$line .= sprintf(" (%s << OpCode.SizeShift) |\n", $size);
|
||||
if ($ctrl =~ m/Return/ || $ctrl =~ m/^Branch/ || $ctrl =~ m/^Throw/ || $enumname =~ m/Jmp/){
|
||||
$line .= sprintf(" OpCode.EndsUncondJmpBlkFlag |\n", $size);
|
||||
$line .= sprintf(" OpCode.EndsUncondJmpBlkFlag |\n", $size);
|
||||
}
|
||||
$line .= sprintf(" (%d << OpCode.StackChangeShift)\n", $popstate);
|
||||
$line .= sprintf(" );\n\n");
|
||||
|
@ -363,7 +363,7 @@ foreach $key (sort {$a cmp $b} keys (%controlFlow))
|
|||
print FCOUTPUT $obsoleteAttr;
|
||||
print FCOUTPUT " Phi";
|
||||
print FCOUTPUT " = $ctrlflowcount,\n";
|
||||
$ctrlflowcount++;
|
||||
$ctrlflowcount++;
|
||||
}
|
||||
}
|
||||
#end the flowcontrol enum
|
||||
|
@ -390,7 +390,7 @@ foreach $key (sort {$a cmp $b} keys (%opcodetype))
|
|||
if ($ctrlflowcount == 0){
|
||||
print OCOUTPUT $obsoleteAttr;
|
||||
print OCOUTPUT " Annotation = 0,\n";
|
||||
$ctrlflowcount++;
|
||||
$ctrlflowcount++;
|
||||
}
|
||||
print OCOUTPUT " $key";
|
||||
print OCOUTPUT " = $ctrlflowcount,\n";
|
||||
|
@ -409,7 +409,7 @@ foreach $key (sort {$a cmp $b} keys (%operandtype))
|
|||
if ($key =~ m/InlineNone/){
|
||||
print OPOUTPUT $obsoleteAttr;
|
||||
print OPOUTPUT " InlinePhi = 6,\n";
|
||||
$ctrlflowcount++;
|
||||
$ctrlflowcount++;
|
||||
}
|
||||
if ($key =~ m/^InlineR$/){
|
||||
$ctrlflowcount++;
|
||||
|
|
|
@ -6,17 +6,17 @@
|
|||
/*********************************************************************/
|
||||
|
||||
/* check for alloca overruns (which otherwise are hard to track down
|
||||
and often only repro on optimized builds).
|
||||
and often only repro on optimized builds).
|
||||
|
||||
USAGE:
|
||||
|
||||
void foo() {
|
||||
void foo() {
|
||||
ALLOCA_CHECK(); // Declare at function level scope
|
||||
|
||||
....
|
||||
void* mem = ALLOCA(size); // does an alloca,
|
||||
void* mem = ALLOCA(size); // does an alloca,
|
||||
|
||||
} // destructor of ALLOCA_CHECK for buffer overruns.
|
||||
} // destructor of ALLOCA_CHECK for buffer overruns.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
@ -45,11 +45,11 @@ public:
|
|||
|
||||
public:
|
||||
/***************************************************/
|
||||
AllocaCheck() {
|
||||
sentinals = 0;
|
||||
AllocaCheck() {
|
||||
sentinals = 0;
|
||||
}
|
||||
|
||||
~AllocaCheck() {
|
||||
~AllocaCheck() {
|
||||
AllocaSentinal* ptr = sentinals;
|
||||
while (ptr != 0) {
|
||||
if (ptr->check != (int)CheckBytes)
|
||||
|
@ -76,9 +76,9 @@ private:
|
|||
|
||||
#else
|
||||
|
||||
#define ALLOCA_CHECK()
|
||||
#define ALLOCA_CHECK()
|
||||
#define ALLOCA(size) _alloca(size)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,171 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// APIThreadStress.cpp (API thread stresser)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define LOGGING 1
|
||||
#endif
|
||||
|
||||
#include "apithreadstress.h"
|
||||
#include "clrhost.h"
|
||||
#include "ex.h"
|
||||
#include "log.h"
|
||||
|
||||
|
||||
|
||||
// For now, thread stress is incompatible with hosting. We need a host CreateThread
|
||||
// to fix this.
|
||||
#undef SetEvent
|
||||
#undef ResetEvent
|
||||
|
||||
int APIThreadStress::s_threadStressCount = 0;
|
||||
|
||||
APIThreadStress::APIThreadStress()
|
||||
{
|
||||
m_threadCount = 0;
|
||||
|
||||
// Don't "fork" stress threads
|
||||
if (ClrFlsGetValue(TlsIdx_StressThread) == NULL)
|
||||
m_threadCount = s_threadStressCount;
|
||||
|
||||
if (m_threadCount != 0)
|
||||
{
|
||||
m_setupOK = TRUE;
|
||||
|
||||
m_hThreadArray = new (nothrow) HANDLE [ m_threadCount ];
|
||||
if (m_hThreadArray == NULL)
|
||||
m_setupOK = FALSE;
|
||||
else
|
||||
{
|
||||
HANDLE *p = m_hThreadArray;
|
||||
HANDLE *pEnd = p + m_threadCount;
|
||||
|
||||
while (p < pEnd)
|
||||
{
|
||||
DWORD id;
|
||||
*p = ::CreateThread(NULL, 0, StartThread, this, 0, &id);
|
||||
if (*p == NULL)
|
||||
m_setupOK = FALSE;
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
||||
m_syncEvent = ClrCreateManualEvent(FALSE);
|
||||
if (m_syncEvent == INVALID_HANDLE_VALUE)
|
||||
m_setupOK = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
APIThreadStress::~APIThreadStress()
|
||||
{
|
||||
if (m_threadCount > 0)
|
||||
{
|
||||
HANDLE *p = m_hThreadArray;
|
||||
HANDLE *pEnd = p + m_threadCount;
|
||||
|
||||
if (p != NULL)
|
||||
{
|
||||
while (p < pEnd)
|
||||
{
|
||||
if (*p != NULL)
|
||||
{
|
||||
if (m_threadCount > 0 && m_setupOK)
|
||||
WaitForSingleObjectEx(*p, INFINITE, FALSE);
|
||||
|
||||
::CloseHandle(*p);
|
||||
}
|
||||
p++;
|
||||
}
|
||||
delete [] m_hThreadArray;
|
||||
}
|
||||
|
||||
if (m_syncEvent != INVALID_HANDLE_VALUE)
|
||||
CloseHandle(m_syncEvent);
|
||||
}
|
||||
}
|
||||
|
||||
void APIThreadStress::SetThreadStressCount(int threadCount)
|
||||
{
|
||||
s_threadStressCount = threadCount;
|
||||
}
|
||||
|
||||
|
||||
DWORD WINAPI APIThreadStress::StartThread(void *arg)
|
||||
{
|
||||
APIThreadStress *pThis = (APIThreadStress *) arg;
|
||||
|
||||
ClrFlsSetValue(TlsIdx_StressThread, pThis);
|
||||
|
||||
EX_TRY
|
||||
{
|
||||
// Perform initial synchronization
|
||||
WaitForSingleObjectEx(pThis->m_syncEvent, INFINITE, FALSE);
|
||||
InterlockedIncrement(&pThis->m_runCount);
|
||||
|
||||
LOG((LF_SYNC, LL_INFO100, "Stressing operation on thread %d\n", GetCurrentThreadId()));
|
||||
((APIThreadStress *)arg)->Invoke();
|
||||
LOG((LF_SYNC, LL_INFO100, "End stress operation on thread %d\n", GetCurrentThreadId()));
|
||||
|
||||
if (InterlockedDecrement(&pThis->m_runCount) == 0)
|
||||
::SetEvent(pThis->m_syncEvent);
|
||||
}
|
||||
EX_CATCH
|
||||
{
|
||||
LOG((LF_SYNC, LL_ERROR, "Exception during stress operation on thread %d\n", GetCurrentThreadId()));
|
||||
}
|
||||
EX_END_CATCH(SwallowAllExceptions);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL APIThreadStress::DoThreadStress()
|
||||
{
|
||||
if (m_threadCount > 0 && m_setupOK)
|
||||
{
|
||||
HANDLE *p = m_hThreadArray;
|
||||
HANDLE *pEnd = p + m_threadCount;
|
||||
|
||||
while (p < pEnd)
|
||||
{
|
||||
::ResumeThread(*p);
|
||||
p++;
|
||||
}
|
||||
|
||||
// Start the threads at the same time
|
||||
::SetEvent(m_syncEvent);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
SyncThreadStress();
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void APIThreadStress::SyncThreadStress()
|
||||
{
|
||||
APIThreadStress *pThis = (APIThreadStress *) ClrFlsGetValue(TlsIdx_StressThread);
|
||||
|
||||
if (pThis != NULL)
|
||||
{
|
||||
LOG((LF_SYNC, LL_INFO1000, "Syncing stress operation on thread %d\n", GetCurrentThreadId()));
|
||||
|
||||
::ResetEvent(pThis->m_syncEvent);
|
||||
|
||||
if (InterlockedDecrement(&pThis->m_runCount) == 0)
|
||||
::SetEvent(pThis->m_syncEvent);
|
||||
else
|
||||
WaitForSingleObjectEx(pThis->m_syncEvent, INFINITE, FALSE);
|
||||
InterlockedIncrement(&pThis->m_runCount);
|
||||
|
||||
LOG((LF_SYNC, LL_INFO1000, "Resuming stress operation on thread %d\n", GetCurrentThreadId()));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
// ---------------------------------------------------------------------------
|
||||
// APIThreadStress.h (API thread stresser)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// This class provides a simple base to wrap "thread stress" logic around an API,
|
||||
// which will (in thread stress mode) cause an API to "fork" onto many threads
|
||||
// executing the same operation simulatenously. This can help to expose race
|
||||
// conditions.
|
||||
//
|
||||
// Usage:
|
||||
//
|
||||
// First, subtype APIThreadStress and override Invoke to implement the operation.
|
||||
// You will likely need to add data members for the arguments.
|
||||
//
|
||||
// Next, inside the API, write code like this:
|
||||
//
|
||||
// void MyRoutine(int a1, void *a2)
|
||||
// {
|
||||
// class stress : APIThreadStress
|
||||
// {
|
||||
// int a1;
|
||||
// void *a2;
|
||||
// stress(int a1, void *a2) : a1(a1), a2(a2)
|
||||
// { DoThreadStress(); }
|
||||
// void Invoke() { MyRoutine(a1, a2); }
|
||||
// } ts (a1, a2);
|
||||
//
|
||||
// // implementation
|
||||
//
|
||||
// // perhaps we have a common sub-point in the routine where we want the threads to
|
||||
// // queue up and race again
|
||||
//
|
||||
// ts.SyncThreadStress();
|
||||
//
|
||||
// // more implementation
|
||||
// }
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
#ifndef _APITHREADSTRESS_H_
|
||||
#define _APITHREADSTRESS_H_
|
||||
|
||||
#include "utilcode.h"
|
||||
|
||||
class APIThreadStress
|
||||
{
|
||||
public:
|
||||
BOOL DoThreadStress() { return FALSE; }
|
||||
static void SyncThreadStress() { }
|
||||
static void SetThreadStressCount(int count) { }
|
||||
};
|
||||
|
||||
#endif // _APITHREADSTRESS_H_
|
|
@ -11,11 +11,6 @@
|
|||
#include "clrtypes.h"
|
||||
#include "appmodel.h"
|
||||
|
||||
#define PACKAGE_FILTER_CLR_DEFAULT (PACKAGE_FILTER_HEAD|PACKAGE_FILTER_DIRECT)
|
||||
|
||||
|
||||
typedef PACKAGE_INFO * PPACKAGE_INFO;
|
||||
typedef PACKAGE_INFO const * PCPACKAGE_INFO;
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
// Forward declarations
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
template <class T>
|
||||
class ArrayHolder
|
||||
class ArrayHolder
|
||||
{
|
||||
public:
|
||||
ArrayHolder(T *ptr)
|
||||
|
@ -15,7 +15,7 @@ public:
|
|||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
|
||||
ArrayHolder(const ArrayHolder &rhs)
|
||||
{
|
||||
m_ptr = const_cast<ArrayHolder *>(&rhs)->Detach();
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// list of pointers, stored in chunks. Modification is by appending
|
||||
// only currently. Access is by index (efficient if the number of
|
||||
// elements stays small) and iteration (efficient in all cases).
|
||||
//
|
||||
//
|
||||
// An important property of an ArrayList is that the list remains
|
||||
// coherent while it is being modified. This means that readers
|
||||
// never need to lock when accessing it.
|
||||
|
@ -41,7 +41,7 @@ class ArrayListBase
|
|||
{
|
||||
SPTR(ArrayListBlock) m_next;
|
||||
DWORD m_blockSize;
|
||||
#ifdef _WIN64
|
||||
#ifdef HOST_64BIT
|
||||
DWORD m_padding;
|
||||
#endif
|
||||
PTR_VOID m_array[0];
|
||||
|
@ -61,7 +61,7 @@ class ArrayListBase
|
|||
{
|
||||
PTR_ArrayListBlock m_next;
|
||||
DWORD m_blockSize;
|
||||
#ifdef _WIN64
|
||||
#ifdef HOST_64BIT
|
||||
DWORD m_padding;
|
||||
#endif
|
||||
void * m_array[ARRAY_BLOCK_SIZE_START];
|
||||
|
@ -75,18 +75,18 @@ class ArrayListBase
|
|||
public:
|
||||
|
||||
PTR_VOID *GetPtr(DWORD index) const;
|
||||
PTR_VOID Get(DWORD index) const
|
||||
{
|
||||
PTR_VOID Get(DWORD index) const
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
SUPPORTS_DAC;
|
||||
|
||||
return *GetPtr(index);
|
||||
|
||||
return *GetPtr(index);
|
||||
}
|
||||
|
||||
void Set(DWORD index, PTR_VOID element)
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
*GetPtr(index) = element;
|
||||
|
||||
void Set(DWORD index, PTR_VOID element)
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
*GetPtr(index) = element;
|
||||
}
|
||||
|
||||
DWORD GetCount() const { LIMITED_METHOD_DAC_CONTRACT; return m_count; }
|
||||
|
@ -101,7 +101,7 @@ class ArrayListBase
|
|||
void Init()
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
|
||||
|
||||
m_count = 0;
|
||||
m_firstBlock.m_next = NULL;
|
||||
m_firstBlock.m_blockSize = ARRAY_BLOCK_SIZE_START;
|
||||
|
@ -116,10 +116,10 @@ class ArrayListBase
|
|||
#ifdef DACCESS_COMPILE
|
||||
void EnumMemoryRegions(CLRDataEnumMemoryFlags flags);
|
||||
#endif
|
||||
|
||||
|
||||
class ConstIterator;
|
||||
|
||||
class Iterator
|
||||
class Iterator
|
||||
{
|
||||
friend class ArrayListBase;
|
||||
friend class ConstIterator;
|
||||
|
@ -130,13 +130,13 @@ class ArrayListBase
|
|||
void SetEmpty()
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
|
||||
|
||||
m_block = NULL;
|
||||
m_index = (DWORD)-1;
|
||||
m_remaining = 0;
|
||||
m_total = 0;
|
||||
}
|
||||
|
||||
|
||||
PTR_VOID GetElement() {LIMITED_METHOD_DAC_CONTRACT; return m_block->m_array[m_index]; }
|
||||
PTR_VOID * GetElementPtr() {LIMITED_METHOD_CONTRACT; return m_block->m_array + m_index; }
|
||||
DWORD GetIndex() {LIMITED_METHOD_CONTRACT; return m_index + m_total; }
|
||||
|
@ -211,7 +211,7 @@ class ArrayListBase
|
|||
}
|
||||
|
||||
public:
|
||||
|
||||
|
||||
BOOL Next()
|
||||
{
|
||||
if (m_block != NULL)
|
||||
|
@ -231,7 +231,7 @@ class ArrayListBase
|
|||
{
|
||||
if (m_remaining < m_block->m_blockSize)
|
||||
ZeroMemory(&(m_block->m_array[m_remaining]), (m_block->m_blockSize - m_remaining) * sizeof(void*));
|
||||
#ifdef _WIN64
|
||||
#ifdef HOST_64BIT
|
||||
m_block->m_padding = 0;
|
||||
#endif
|
||||
}
|
||||
|
@ -245,7 +245,7 @@ class ArrayListBase
|
|||
{
|
||||
return m_block;
|
||||
}
|
||||
|
||||
|
||||
SIZE_T GetBlockSize()
|
||||
{
|
||||
return offsetof(ArrayListBlock, m_array) + (m_block->m_blockSize * sizeof(void*));
|
||||
|
@ -282,7 +282,7 @@ public:
|
|||
#endif
|
||||
};
|
||||
|
||||
/* to be used as static variable - no constructor/destructor, assumes zero
|
||||
/* to be used as static variable - no constructor/destructor, assumes zero
|
||||
initialized memory */
|
||||
class ArrayListStatic : public ArrayListBase
|
||||
{
|
||||
|
|
|
@ -19,9 +19,9 @@
|
|||
#ifndef _BBSWEEP_H_
|
||||
#define _BBSWEEP_H_
|
||||
|
||||
#ifndef FEATURE_PAL
|
||||
#ifndef TARGET_UNIX
|
||||
#include <aclapi.h>
|
||||
#endif // !FEATURE_PAL
|
||||
#endif // !TARGET_UNIX
|
||||
|
||||
// The CLR headers don't allow us to use methods like SetEvent directly (instead
|
||||
// we need to use the host APIs). However, this file is included both in the CLR
|
||||
|
@ -55,7 +55,7 @@ public:
|
|||
|
||||
/* BBSweep is used by both the CLR and the BBSweep utility.
|
||||
* BBSweep: calls the PerformSweep method which returns after all the CLR processes
|
||||
* have written their profile data to disk.
|
||||
* have written their profile data to disk.
|
||||
* CLR: starts up a sweeper thread which calls WatchForSweepEvents and waits until the
|
||||
* sweeper program is invoked. At that point, all the CLR processes will synchronize
|
||||
* and write their profile data to disk one at a time. The sweeper threads will then
|
||||
|
@ -66,7 +66,7 @@ public:
|
|||
class BBSweep
|
||||
{
|
||||
public:
|
||||
BBSweep()
|
||||
BBSweep()
|
||||
{
|
||||
// The BBSweep constructor could be called even the the object is not used, so
|
||||
// don't do any work here.
|
||||
|
@ -99,12 +99,12 @@ public:
|
|||
{
|
||||
success = success && ::SetEvent(hSweepEvent);
|
||||
{
|
||||
for (int i=0; i<MAX_COUNT; i++)
|
||||
for (int i=0; i<MAX_COUNT; i++)
|
||||
{
|
||||
::WaitForSingleObject(hProfWriterSemaphore, INFINITE);
|
||||
}
|
||||
|
||||
::ReleaseSemaphore(hProfWriterSemaphore, MAX_COUNT, NULL);
|
||||
::ReleaseSemaphore(hProfWriterSemaphore, MAX_COUNT, NULL);
|
||||
|
||||
}
|
||||
success = success && ::ResetEvent(hSweepEvent);
|
||||
|
@ -123,7 +123,7 @@ public:
|
|||
|
||||
bool success = true;
|
||||
|
||||
while (!bTerminate)
|
||||
while (!bTerminate)
|
||||
{
|
||||
::WaitForSingleObject(hSweepMutex, INFINITE);
|
||||
{
|
||||
|
@ -158,7 +158,7 @@ public:
|
|||
{
|
||||
// Set the termination event and wait for the BBSweep thread to terminate on its own.
|
||||
// Note that this is called by the shutdown thread (and never called by the BBSweep thread).
|
||||
if (hBBSweepThread && bInitialized)
|
||||
if (hBBSweepThread && bInitialized)
|
||||
{
|
||||
bTerminate = true;
|
||||
::SetEvent(hTerminationEvent);
|
||||
|
@ -182,7 +182,7 @@ private:
|
|||
// IF YOU CHANGE THIS CODE, YOU MUST ALSO CHANGE THAT TO MATCH!
|
||||
bool Initialize(DWORD processID = INVALID_PID, BOOL fromRuntime = TRUE)
|
||||
{
|
||||
if (!bInitialized)
|
||||
if (!bInitialized)
|
||||
{
|
||||
SECURITY_ATTRIBUTES * pSecurityAttributes = NULL;
|
||||
|
||||
|
@ -196,7 +196,7 @@ private:
|
|||
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken))
|
||||
goto cleanup;
|
||||
|
||||
// don't set pSecurityAttributes for Metro processes
|
||||
// don't set pSecurityAttributes for AppContainer processes
|
||||
if(!IsAppContainerProcess(hToken))
|
||||
{
|
||||
SECURITY_ATTRIBUTES securityAttributes;
|
||||
|
@ -206,7 +206,7 @@ private:
|
|||
|
||||
#ifdef _PREFAST_
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:6211) // PREfast warning: Leaking memory 'pSD' due to an exception.
|
||||
#pragma warning(disable:6211) // PREfast warning: Leaking memory 'pSD' due to an exception.
|
||||
#endif /*_PREFAST_ */
|
||||
pSD = (PSECURITY_DESCRIPTOR) new char[SECURITY_DESCRIPTOR_MIN_LENGTH];
|
||||
if (!pSD)
|
||||
|
@ -258,7 +258,7 @@ private:
|
|||
ea[1].Trustee.TrusteeType = TRUSTEE_IS_GROUP;
|
||||
ea[1].Trustee.ptstrName = (LPTSTR) pAdminSid;
|
||||
|
||||
if (SetEntriesInAcl(2, ea, NULL, &pACL) != ERROR_SUCCESS)
|
||||
if (SetEntriesInAcl(2, ea, NULL, &pACL) != ERROR_SUCCESS)
|
||||
goto cleanup;
|
||||
|
||||
if (!InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION))
|
||||
|
@ -305,7 +305,7 @@ cleanup:
|
|||
#endif
|
||||
}
|
||||
|
||||
bInitialized = hSweepMutex &&
|
||||
bInitialized = hSweepMutex &&
|
||||
hProfDataWriterMutex &&
|
||||
hSweepEvent &&
|
||||
hTerminationEvent &&
|
||||
|
@ -315,7 +315,7 @@ cleanup:
|
|||
return bInitialized;
|
||||
}
|
||||
|
||||
#ifndef FEATURE_PAL
|
||||
#ifndef TARGET_UNIX
|
||||
BOOL IsAppContainerProcess(HANDLE hToken)
|
||||
{
|
||||
#ifndef TokenIsAppContainer
|
||||
|
@ -330,37 +330,37 @@ cleanup:
|
|||
}
|
||||
return fIsAppContainerProcess;
|
||||
}
|
||||
#endif // !FEATURE_PAL
|
||||
#endif // !TARGET_UNIX
|
||||
|
||||
// helper to get the correct object name prefix
|
||||
void GetObjectNamePrefix(DWORD processID, BOOL fromRuntime, __inout_z WCHAR* objectNamePrefix)
|
||||
{
|
||||
// default prefix
|
||||
swprintf_s(objectNamePrefix, MAX_LONGPATH, W("Global"));
|
||||
#ifndef FEATURE_PAL
|
||||
#ifndef TARGET_UNIX
|
||||
//
|
||||
// This method can be called:
|
||||
// 1. From process init code
|
||||
// 2. From bbsweepclr.exe
|
||||
//
|
||||
// When called from process init code, processID is always INVALID_PID.
|
||||
// In case it is a Win8-Metro/WP8 process, we need to add the AppContainerNamedObjectPath to prefix.
|
||||
// And if it is a non-Metro process, we will continue to use the default prefix (Global).
|
||||
// In case it is a AppContainer process, we need to add the AppContainerNamedObjectPath to prefix.
|
||||
// And if it is a non-AppContainer process, we will continue to use the default prefix (Global).
|
||||
// We use IsAppContainerProcess(CurrentProcessId) to make this decision.
|
||||
//
|
||||
//
|
||||
// When called from bbsweepclr, processID is valid when sweeping a Metro or WP8 process.
|
||||
// We use this valid processID to determine if the process being swept is Metro/WP8 indeed and then
|
||||
// When called from bbsweepclr, processID is valid when sweeping a AppContainer process.
|
||||
// We use this valid processID to determine if the process being swept is AppContainer indeed and then
|
||||
// add AppContainerNamedObjectPath to prefix. This is done by IsAppContainerProcess(processID).
|
||||
//
|
||||
// In case INVALID_PID is passed(non-Metro process), we have to use default prefix. To handle this
|
||||
// case we use IsAppContainerProcess(CurrentProcessId) and since bbsweepclr is a non-Metro process,
|
||||
// In case INVALID_PID is passed(non-AppContainer process), we have to use default prefix. To handle this
|
||||
// case we use IsAppContainerProcess(CurrentProcessId) and since bbsweepclr is a non-AppContainer process,
|
||||
// this check always returns false and we end up using the intended(default) prefix.
|
||||
//
|
||||
if(processID == INVALID_PID) {
|
||||
// we reach here when:
|
||||
// * called from process init code:
|
||||
// * called from bbsweepclr.exe and no processID has been passed as argument, that is, when sweeping a non-Metro process
|
||||
// * called from bbsweepclr.exe and no processID has been passed as argument, that is, when sweeping a non-AppContainer process
|
||||
processID = GetCurrentProcessId();
|
||||
}
|
||||
|
||||
|
@ -368,7 +368,7 @@ cleanup:
|
|||
if (hProcess != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
HandleHolder hToken = NULL;
|
||||
// if in the process init code of a Metro app or if bbsweepclr is used to sweep a Metro app,
|
||||
// if in the process init code of a AppContainer app or if bbsweepclr is used to sweep a AppContainer app,
|
||||
// construct the object name prefix using AppContainerNamedObjectPath
|
||||
if (OpenProcessToken(hProcess, TOKEN_QUERY, &hToken) && IsAppContainerProcess(hToken))
|
||||
{
|
||||
|
@ -377,7 +377,7 @@ cleanup:
|
|||
|
||||
if (fromRuntime)
|
||||
{
|
||||
// for Metro apps, create the object in the "default" object path, i.e. do not provide any prefix
|
||||
// for AppContainer apps, create the object in the "default" object path, i.e. do not provide any prefix
|
||||
objectNamePrefix[0] = W('\0');
|
||||
}
|
||||
else
|
||||
|
@ -394,7 +394,7 @@ cleanup:
|
|||
GetProcAddress(WszGetModuleHandle(MODULE_NAME), "GetAppContainerNamedObjectPath");
|
||||
if (pfnGetAppContainerNamedObjectPath)
|
||||
{
|
||||
// for bbsweepclr sweeping a Metro app, create the object specifying the AppContainer's path
|
||||
// for bbsweepclr sweeping a AppContainer app, create the object specifying the AppContainer's path
|
||||
DWORD sessionId = 0;
|
||||
ProcessIdToSessionId(processID, &sessionId);
|
||||
pfnGetAppContainerNamedObjectPath(hToken, NULL, sizeof (appxNamedObjPath) / sizeof (WCHAR), appxNamedObjPath, &appxNamedObjPathBufLen);
|
||||
|
@ -403,7 +403,7 @@ cleanup:
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif // FEATURE_PAL
|
||||
#endif // TARGET_UNIX
|
||||
}
|
||||
private:
|
||||
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
//
|
||||
//
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// BitMask.h
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// BitMask is an arbitrarily large sized bitfield which has optimal storage
|
||||
// for 32 bits or less.
|
||||
// Storage is proportional to the highest index which is set.
|
||||
// BitMask is an arbitrarily large sized bitfield which has optimal storage
|
||||
// for 32 bits or less.
|
||||
// Storage is proportional to the highest index which is set.
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
@ -63,7 +63,7 @@ class BitMask
|
|||
|
||||
// Need more bits...
|
||||
void GrowArray(COUNT_T newSize);
|
||||
|
||||
|
||||
union
|
||||
{
|
||||
COUNT_T m_mask;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
//
|
||||
//
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// BitMask.inl
|
||||
|
@ -34,7 +34,7 @@ inline COUNT_T BitMask::BitToShift(int bit)
|
|||
return (bit+1) & BIT_SIZE_MASK;
|
||||
}
|
||||
|
||||
// Array access. Note the first array element is the count of the
|
||||
// Array access. Note the first array element is the count of the
|
||||
// rest of the elements
|
||||
|
||||
inline COUNT_T *BitMask::GetMaskArray()
|
||||
|
@ -48,7 +48,7 @@ inline COUNT_T *BitMask::GetMaskArray()
|
|||
else
|
||||
return &m_mask;
|
||||
}
|
||||
|
||||
|
||||
inline COUNT_T BitMask::GetMaskArraySize()
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
|
@ -81,7 +81,7 @@ inline void BitMask::GrowArray(COUNT_T newSize)
|
|||
|
||||
COUNT_T *newArray = new COUNT_T [newSize+1];
|
||||
*newArray = newSize;
|
||||
|
||||
|
||||
CopyMemory(newArray+1, GetMaskArray(), oldSize * sizeof(COUNT_T));
|
||||
ZeroMemory(newArray+oldSize+1, (newSize - oldSize) * sizeof(COUNT_T));
|
||||
|
||||
|
@ -90,7 +90,7 @@ inline void BitMask::GrowArray(COUNT_T newSize)
|
|||
|
||||
m_maskArray = newArray;
|
||||
}
|
||||
|
||||
|
||||
inline BitMask::BitMask()
|
||||
: m_mask(1)
|
||||
{
|
||||
|
@ -129,7 +129,7 @@ inline void BitMask::SetBit(int bit)
|
|||
|
||||
if (index >= GetMaskArraySize())
|
||||
GrowArray(index+1);
|
||||
|
||||
|
||||
GetMaskArray()[index] |= (1 << BitToShift(bit));
|
||||
}
|
||||
|
||||
|
@ -141,7 +141,7 @@ inline void BitMask::ClearBit(int bit)
|
|||
|
||||
if (index >= GetMaskArraySize())
|
||||
return;
|
||||
|
||||
|
||||
GetMaskArray()[index] &= ~(1 << BitToShift(bit));
|
||||
}
|
||||
|
||||
|
|
|
@ -25,11 +25,11 @@ inline
|
|||
unsigned BitPosition(unsigned value)
|
||||
{
|
||||
_ASSERTE((value != 0) && ((value & (value-1)) == 0));
|
||||
#if defined(_ARM_) && defined(__llvm__)
|
||||
#if defined(HOST_ARM) && defined(__llvm__)
|
||||
// use intrinsic functions for arm32
|
||||
// this is applied for LLVM only but it may work for some compilers
|
||||
DWORD index = __builtin_clz(__builtin_arm_rbit(value));
|
||||
#elif !defined(_AMD64_)
|
||||
#elif !defined(HOST_AMD64)
|
||||
const unsigned PRIME = 37;
|
||||
|
||||
static const char hashTable[PRIME] =
|
||||
|
|
|
@ -46,13 +46,13 @@
|
|||
Uses one machine word if vector fits in machine word (minus a bit)
|
||||
|
||||
Some caveates:
|
||||
You should use mutator operators &=, |= ... instead of the
|
||||
You should use mutator operators &=, |= ... instead of the
|
||||
non-mutators whenever possible to avoid creating a temps
|
||||
|
||||
Specifically did NOT supply automatic coersions to
|
||||
and from short types so that the programmer is aware of
|
||||
when code was being injected on his behalf. The upshot of this
|
||||
is that you have to use the BitVector() toUnsigned() to convert
|
||||
when code was being injected on their behalf. The upshot of this
|
||||
is that you have to use the BitVector() toUnsigned() to convert
|
||||
*/
|
||||
|
||||
/***************************************************************************/
|
||||
|
@ -60,7 +60,7 @@
|
|||
class BitVector {
|
||||
// Set this to be unsigned char to do testing, should be UINT_PTR for real life
|
||||
|
||||
typedef UINT_PTR ChunkType; // The size of integer type that the machine can operate on directly
|
||||
typedef UINT_PTR ChunkType; // The size of integer type that the machine can operate on directly
|
||||
// typedef BYTE ChunkType; // Use for testing
|
||||
|
||||
// Maximum number of bits in our bitvector
|
||||
|
@ -76,7 +76,7 @@ class BitVector {
|
|||
|
||||
public:
|
||||
BitVector()
|
||||
{
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
SUPPORTS_DAC;
|
||||
|
||||
|
@ -111,7 +111,7 @@ public:
|
|||
{
|
||||
doBigInit(arg);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
m_val = ChunkType(arg << 1);
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ public:
|
|||
m_val = arg.m_val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void operator <<=(unsigned shift)
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
|
@ -162,7 +162,7 @@ public:
|
|||
{
|
||||
doBigLeftShiftAssign(shift);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
m_val <<= shift;
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ public:
|
|||
m_val &= ~IS_BIG; // clear the isBig bit if it got set
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void operator |=(const BitVector& arg)
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
|
@ -252,7 +252,7 @@ public:
|
|||
return ((arg1.m_val & arg2.m_val) != 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BOOL operator ==(const BitVector& arg) const
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
|
@ -277,7 +277,7 @@ public:
|
|||
}
|
||||
|
||||
friend ChunkType toUnsigned(const BitVector& arg)
|
||||
{
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
SUPPORTS_DAC;
|
||||
|
||||
|
@ -285,7 +285,7 @@ public:
|
|||
{
|
||||
return arg.m_vals.m_chunks[0]; // Note truncation
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
return arg.smallBits();
|
||||
}
|
||||
|
@ -318,11 +318,11 @@ private:
|
|||
|
||||
static const ChunkType MaxVal = ((ChunkType)1 << SMALL_BITS) - 1; // Maximum value that can be stored in m_val
|
||||
|
||||
// This is the structure that we use when the bit vector overflows.
|
||||
// It is a simple vector.
|
||||
// This is the structure that we use when the bit vector overflows.
|
||||
// It is a simple vector.
|
||||
struct Vals {
|
||||
unsigned m_encodedLength; // An encoding of the current length of the 'm_chunks' array
|
||||
ChunkType m_chunks[VALS_COUNT];
|
||||
ChunkType m_chunks[VALS_COUNT];
|
||||
|
||||
BOOL isBig() const
|
||||
{
|
||||
|
@ -336,7 +336,7 @@ private:
|
|||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
SUPPORTS_DAC;
|
||||
|
||||
|
||||
if (isBig())
|
||||
{
|
||||
unsigned length = (m_encodedLength >> 1);
|
||||
|
|
|
@ -63,7 +63,7 @@ protected:
|
|||
CBlobFetcher& operator=(const CBlobFetcher & src);
|
||||
|
||||
public:
|
||||
#if defined(_WIN64)
|
||||
#if defined(HOST_64BIT)
|
||||
// needs to be 64 so that we can purposefully cache align code in ngen'd images
|
||||
enum { maxAlign = 64 }; // maximum alignment we support
|
||||
#else
|
||||
|
@ -90,7 +90,7 @@ public:
|
|||
// Write out the section to memory
|
||||
HRESULT WriteMem(void ** pMem);
|
||||
|
||||
// Get the total length of all our data (sum of all the pillar's data length's)
|
||||
// Get the total length of all our data (sum of all the pillar's data length's)
|
||||
// cached value, so light weight & no computations
|
||||
unsigned GetDataLen() const;
|
||||
|
||||
|
@ -138,7 +138,7 @@ inline ULONG32 CBlobFetcher::CPillar::GetOffset(__in char *ptr)
|
|||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
_ASSERTE(Contains(ptr));
|
||||
|
||||
|
||||
return (ULONG32)(ptr - m_dataStart);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
//*****************************************************************************
|
||||
// File: CAHLPR.H
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//*****************************************************************************
|
||||
#ifndef __CAHLPR_H__
|
||||
|
|
|
@ -135,7 +135,7 @@ public:
|
|||
*pVal = GetI1();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
HRESULT GetTag(CorSerializationType *pVal)
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
|
@ -257,7 +257,7 @@ public:
|
|||
HRESULT hr;
|
||||
unsigned __int16 val;
|
||||
IfFailRet(GetProlog(&val));
|
||||
|
||||
|
||||
if (val != 0x0001)
|
||||
return META_E_CA_INVALID_BLOB;
|
||||
|
||||
|
@ -364,7 +364,7 @@ public:
|
|||
|
||||
int BytesLeft()
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
return (int)(m_cbBlob - (m_pbCur - m_pbBlob));
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ class CeeFileGenWriter : public CCeeGen
|
|||
HRESULT allocateIAT();
|
||||
public:
|
||||
// Create with one of these two methods, not operator new
|
||||
static HRESULT CreateNewInstance(CCeeGen *pCeeFileGenFrom, CeeFileGenWriter* & pGenWriter,
|
||||
static HRESULT CreateNewInstance(CCeeGen *pCeeFileGenFrom, CeeFileGenWriter* & pGenWriter,
|
||||
DWORD createFlags = ICEE_CREATE_FILE_PURE_IL);
|
||||
// See ICeeFileGen.h for the definition of the bits used in createFlags
|
||||
static HRESULT CreateNewInstanceEx(CCeeGen *pCeeFileGenFrom, CeeFileGenWriter* & pGenWriter,
|
||||
|
@ -189,7 +189,10 @@ inline LPWSTR CeeFileGenWriter::getResourceFileName() {
|
|||
}
|
||||
|
||||
inline HRESULT CeeFileGenWriter::setDllSwitch(bool dllSwitch) {
|
||||
if((m_dllSwitch = dllSwitch)) m_objSwitch = FALSE; return S_OK;
|
||||
if((m_dllSwitch = dllSwitch))
|
||||
m_objSwitch = FALSE;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
inline bool CeeFileGenWriter::getDllSwitch() {
|
||||
|
@ -197,7 +200,10 @@ inline bool CeeFileGenWriter::getDllSwitch() {
|
|||
}
|
||||
|
||||
inline HRESULT CeeFileGenWriter::setObjSwitch(bool objSwitch) {
|
||||
if((m_objSwitch = objSwitch)) m_dllSwitch = FALSE; return S_OK;
|
||||
if((m_objSwitch = objSwitch))
|
||||
m_dllSwitch = FALSE;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
inline bool CeeFileGenWriter::getObjSwitch() {
|
||||
|
|
|
@ -25,7 +25,7 @@ typedef DWORD StringRef;
|
|||
|
||||
This is a description of the current implementation of these types for generating
|
||||
CLR modules.
|
||||
|
||||
|
||||
ICeeGen - interface to generate in-memory CLR module.
|
||||
|
||||
CCeeGen - implementation of ICeeGen. Currently it uses both CeeSections
|
||||
|
@ -98,16 +98,16 @@ class CeeSectionImpl {
|
|||
public:
|
||||
virtual unsigned dataLen() = 0;
|
||||
virtual char * getBlock(
|
||||
unsigned len,
|
||||
unsigned len,
|
||||
unsigned align = 1) = 0;
|
||||
virtual HRESULT addSectReloc(
|
||||
unsigned offset,
|
||||
CeeSection & relativeTo,
|
||||
CeeSectionRelocType reloc = srRelocAbsolute,
|
||||
unsigned offset,
|
||||
CeeSection & relativeTo,
|
||||
CeeSectionRelocType reloc = srRelocAbsolute,
|
||||
CeeSectionRelocExtra * extra = NULL) = 0;
|
||||
virtual HRESULT addBaseReloc(
|
||||
unsigned offset,
|
||||
CeeSectionRelocType reloc = srRelocHighLow,
|
||||
unsigned offset,
|
||||
CeeSectionRelocType reloc = srRelocHighLow,
|
||||
CeeSectionRelocExtra * extra = NULL) = 0;
|
||||
virtual HRESULT directoryEntry(unsigned num) = 0;
|
||||
virtual unsigned char * name() = 0;
|
||||
|
|
|
@ -48,18 +48,18 @@ public:
|
|||
};
|
||||
|
||||
static int IndexForType(mdToken tk);
|
||||
|
||||
|
||||
CeeGenTokenMapper() : m_pIImport(0), m_cRefs(1), m_pIMapToken(NULL) { LIMITED_METHOD_CONTRACT; }
|
||||
virtual ~CeeGenTokenMapper() {}
|
||||
|
||||
//*****************************************************************************
|
||||
// IUnknown implementation.
|
||||
// IUnknown implementation.
|
||||
//*****************************************************************************
|
||||
virtual ULONG STDMETHODCALLTYPE AddRef()
|
||||
{LIMITED_METHOD_CONTRACT; return ++m_cRefs; }
|
||||
|
||||
virtual ULONG STDMETHODCALLTYPE Release()
|
||||
{
|
||||
{
|
||||
STATIC_CONTRACT_NOTHROW;
|
||||
STATIC_CONTRACT_FORBID_FAULT;
|
||||
SUPPORTS_DAC_HOST_ONLY;
|
||||
|
@ -72,7 +72,7 @@ public:
|
|||
m_pIMapToken->Release();
|
||||
m_pIMapToken = NULL;
|
||||
}
|
||||
|
||||
|
||||
delete this;
|
||||
}
|
||||
return cRefs;
|
||||
|
@ -99,7 +99,7 @@ public:
|
|||
IUnknown *GetMapTokenIface() const
|
||||
{ LIMITED_METHOD_CONTRACT; return ((IUnknown *) this); }
|
||||
|
||||
|
||||
|
||||
//*****************************************************************************
|
||||
// Hand out a copy of the meta data information.
|
||||
//*****************************************************************************
|
||||
|
@ -136,7 +136,7 @@ protected:
|
|||
IMetaDataImport *m_pIImport;
|
||||
ULONG m_cRefs; // Ref count.
|
||||
IMapToken *m_pIMapToken;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // __CeeGenTokenMapper_h__
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
// ===========================================================================
|
||||
// File: CeeSectionString.h
|
||||
//
|
||||
//
|
||||
// ===========================================================================
|
||||
|
||||
#ifndef CeeSectionString_H
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "static_assert.h"
|
||||
#include "daccess.h"
|
||||
#include "unreachable.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
|
@ -28,7 +29,7 @@
|
|||
#if !defined(DISABLE_CONTRACTS)
|
||||
#define CHECK_INVARIANTS 1
|
||||
#define VALIDATE_OBJECTS 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
|
@ -39,7 +40,7 @@
|
|||
#ifdef _DEBUG
|
||||
#define DEBUG_ARG(x) , x
|
||||
#else
|
||||
#define DEBUG_ARG(x)
|
||||
#define DEBUG_ARG(x)
|
||||
#endif
|
||||
|
||||
#define CHECK_STRESS 1
|
||||
|
@ -49,12 +50,12 @@
|
|||
// failure. It not only contains the result of the check, but if the check fails,
|
||||
// also records information about the condition and call site.
|
||||
//
|
||||
// CHECK also serves as a holder to prevent recursive CHECKS. These can be
|
||||
// CHECK also serves as a holder to prevent recursive CHECKS. These can be
|
||||
// particularly common when putting preconditions inside predicates, especially
|
||||
// routines called by an invariant.
|
||||
//
|
||||
// Note that using CHECK is perfectly efficient in a free build - the CHECK becomes
|
||||
// a simple string constant pointer (typically either NULL or (LPCSTR)1, although some
|
||||
// a simple string constant pointer (typically either NULL or (LPCSTR)1, although some
|
||||
// check failures may include messages)
|
||||
//
|
||||
// NOTE: you should NEVER use the CHECK class API directly - use the macros below.
|
||||
|
@ -79,6 +80,8 @@ protected:
|
|||
// Keep leakage counters.
|
||||
static size_t s_cLeakedBytes;
|
||||
static size_t s_cNumFailures;
|
||||
|
||||
static thread_local LONG t_count;
|
||||
#endif
|
||||
|
||||
static BOOL s_neverEnforceAsserts;
|
||||
|
@ -143,10 +146,7 @@ public: // !!! NOTE: Called from macros only!!!
|
|||
|
||||
static void SetAssertEnforcement(BOOL value);
|
||||
|
||||
static void ReleaseTls(void* pCountTLS);
|
||||
|
||||
private:
|
||||
static LONG* InitTls();
|
||||
#ifdef _DEBUG
|
||||
static LPCSTR AllocateDynamicMessage(const SString &s);
|
||||
#endif
|
||||
|
@ -157,14 +157,14 @@ public: // !!! NOTE: Called from macros only!!!
|
|||
// These CHECK macros are the correct way to propagate an assertion. These
|
||||
// routines are designed for use inside "Check" routines. Such routines may
|
||||
// be Invariants, Validate routines, or any other assertional predicates.
|
||||
//
|
||||
// A Check routine should return a value of type CHECK.
|
||||
//
|
||||
// It should consist of multiple CHECK or CHECK_MSG statements (along with appropritate
|
||||
// A Check routine should return a value of type CHECK.
|
||||
//
|
||||
// It should consist of multiple CHECK or CHECK_MSG statements (along with appropritate
|
||||
// control flow) and should end with CHECK_OK() if all other checks pass.
|
||||
//
|
||||
// It may contain a CONTRACT_CHECK contract, but this is only appropriate if the
|
||||
// check is used for non-assertional purposes (otherwise the contract will never execute).
|
||||
// check is used for non-assertional purposes (otherwise the contract will never execute).
|
||||
// Note that CONTRACT_CHECK contracts do not support postconditions.
|
||||
//
|
||||
// CHECK: Check the given condition, return a CHECK failure if FALSE
|
||||
|
@ -175,7 +175,7 @@ public: // !!! NOTE: Called from macros only!!!
|
|||
#ifdef _DEBUG
|
||||
#define DEBUG_ONLY_MESSAGE(msg) msg
|
||||
#else
|
||||
// On retail, we don't want to add a bunch of string literals to the image,
|
||||
// On retail, we don't want to add a bunch of string literals to the image,
|
||||
// so we just use the same one everywhere.
|
||||
#define DEBUG_ONLY_MESSAGE(msg) ((LPCSTR)1)
|
||||
#endif
|
||||
|
@ -217,14 +217,14 @@ do \
|
|||
return CHECK::OK()
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
// ASSERT_CHECK is the proper way to trigger a check result. If the CHECK
|
||||
// has failed, the diagnostic assertion routines will fire with appropriate
|
||||
// ASSERT_CHECK is the proper way to trigger a check result. If the CHECK
|
||||
// has failed, the diagnostic assertion routines will fire with appropriate
|
||||
// context information.
|
||||
//
|
||||
// Note that the condition may either be a raw boolean expression or a CHECK result
|
||||
// returned from a Check routine.
|
||||
//
|
||||
// Recursion note: ASSERT_CHECKs are only performed if there is no current check in
|
||||
// Recursion note: ASSERT_CHECKs are only performed if there is no current check in
|
||||
// progress.
|
||||
//--------------------------------------------------------------------------------
|
||||
|
||||
|
@ -259,24 +259,24 @@ do \
|
|||
// ex: ASSERT_CHECKF(1+2==4, "my reason", ("Woah %d", 1+3));
|
||||
// note that the double parenthesis, the 'args' param below will include one pair of parens.
|
||||
#define ASSERT_CHECKF(_condition, _reason, _args) \
|
||||
ASSERT_CHECK(_condition, CHECK::FormatMessage _args, _reason)
|
||||
ASSERT_CHECK(_condition, CHECK::FormatMessage _args, _reason)
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
// INVARIANTS are descriptions of conditions which are always true at well defined
|
||||
// points of execution. Invariants may be checked by the caller or callee at any
|
||||
// time as paranoia requires.
|
||||
// time as paranoia requires.
|
||||
//
|
||||
// There are really two flavors of invariant. The "public invariant" describes
|
||||
// to the caller invariant behavior about the abstraction which is visible from
|
||||
// the public API (and of course it should be expressible in that public API).
|
||||
//
|
||||
// The "internal invariant" (or representation invariant), on the other hand, is
|
||||
// a description of the private implementation of the abstraction, which may examine
|
||||
// to the caller invariant behavior about the abstraction which is visible from
|
||||
// the public API (and of course it should be expressible in that public API).
|
||||
//
|
||||
// The "internal invariant" (or representation invariant), on the other hand, is
|
||||
// a description of the private implementation of the abstraction, which may examine
|
||||
// internal state of the abstraction or use private entry points.
|
||||
//
|
||||
// Classes with invariants should introduce methods called
|
||||
// Classes with invariants should introduce methods called
|
||||
// void Invariant();
|
||||
// and
|
||||
// and
|
||||
// void InternalInvariant();
|
||||
// to allow invariant checks.
|
||||
//--------------------------------------------------------------------------------
|
||||
|
@ -310,18 +310,18 @@ CHECK CheckInvariant(TYPENAME &obj)
|
|||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
// VALIDATE is a check to be made on an object type which identifies a pointer as
|
||||
// a valid instance of the object, by calling CheckPointer on it. Normally a null
|
||||
// pointer is treated as an error; VALIDATE_NULL (or CheckPointer(o, NULL_OK))
|
||||
// may be used when a null pointer is acceptible.
|
||||
//
|
||||
// In addition to the null/non-null check, a type may provide a specific Check method
|
||||
// for more sophisticated identification. In general, the Check method
|
||||
// VALIDATE is a check to be made on an object type which identifies a pointer as
|
||||
// a valid instance of the object, by calling CheckPointer on it. Normally a null
|
||||
// pointer is treated as an error; VALIDATE_NULL (or CheckPointer(o, NULL_OK))
|
||||
// may be used when a null pointer is acceptible.
|
||||
//
|
||||
// In addition to the null/non-null check, a type may provide a specific Check method
|
||||
// for more sophisticated identification. In general, the Check method
|
||||
// should answer the question
|
||||
// "Is this a valid instance of its declared compile-time type?". For instance, if
|
||||
// "Is this a valid instance of its declared compile-time type?". For instance, if
|
||||
// runtype type identification were supported for the type, it should be invoked here.
|
||||
//
|
||||
// Note that CheckPointer will also check the invariant(s) if appropriate, so the
|
||||
//
|
||||
// Note that CheckPointer will also check the invariant(s) if appropriate, so the
|
||||
// invariants should NOT be explicitly invoked from the Check method.
|
||||
//--------------------------------------------------------------------------------
|
||||
|
||||
|
@ -394,7 +394,7 @@ CHECK CheckValue(TYPENAME &val)
|
|||
#if VALIDATE_OBJECTS
|
||||
|
||||
#define VALIDATE(o) \
|
||||
ASSERT_CHECK(CheckPointer(o), "Validation failure")
|
||||
ASSERT_CHECK(CheckPointer(o), "Validation failure")
|
||||
#define VALIDATE_NULL(o) \
|
||||
ASSERT_CHECK(CheckPointer(o, NULL_OK), "Validation failure")
|
||||
|
||||
|
@ -474,8 +474,8 @@ CHECK CheckValue(TYPENAME &val)
|
|||
#endif // !_DEBUG_IMPL
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
// COMPILER_ASSUME_MSG is a statement that tells the compiler to assume the
|
||||
// condition is true. In a checked build these turn into asserts;
|
||||
// COMPILER_ASSUME_MSG is a statement that tells the compiler to assume the
|
||||
// condition is true. In a checked build these turn into asserts;
|
||||
// in a free build they are passed through to the compiler to use in optimization.
|
||||
//--------------------------------------------------------------------------------
|
||||
|
||||
|
@ -509,7 +509,7 @@ CHECK CheckValue(TYPENAME &val)
|
|||
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
// PREFIX_ASSUME_MSG and PREFAST_ASSUME_MSG are just another name
|
||||
// PREFIX_ASSUME_MSG and PREFAST_ASSUME_MSG are just another name
|
||||
// for COMPILER_ASSUME_MSG
|
||||
// In a checked build these turn into asserts; in a free build
|
||||
// they are passed through to the compiler to use in optimization;
|
||||
|
@ -535,8 +535,8 @@ CHECK CheckValue(TYPENAME &val)
|
|||
COMPILER_ASSUME_MSG(_condition, "")
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
// UNREACHABLE points are locations in the code which should not be able to be
|
||||
// reached under any circumstances (e.g. a default in a switch which is supposed to
|
||||
// UNREACHABLE points are locations in the code which should not be able to be
|
||||
// reached under any circumstances (e.g. a default in a switch which is supposed to
|
||||
// cover all cases.). This macro tells the compiler this, and also embeds a check
|
||||
// to make sure it is always true.
|
||||
//--------------------------------------------------------------------------------
|
||||
|
@ -557,19 +557,6 @@ CHECK CheckValue(TYPENAME &val)
|
|||
|
||||
#endif // __llvm__ else
|
||||
|
||||
#if defined(_MSC_VER) || defined(_PREFIX_)
|
||||
#if defined(_TARGET_AMD64_)
|
||||
// Empty methods that consist of UNREACHABLE() result in a zero-sized declspec(noreturn) method
|
||||
// which causes the pdb file to make the next method declspec(noreturn) as well, thus breaking BBT
|
||||
// Remove when we get a VC compiler that fixes VSW 449170
|
||||
# define __UNREACHABLE() DebugBreak(); __assume(0);
|
||||
#else
|
||||
# define __UNREACHABLE() __assume(0)
|
||||
#endif
|
||||
#else
|
||||
#define __UNREACHABLE() __builtin_unreachable()
|
||||
#endif
|
||||
|
||||
#ifdef _DEBUG_IMPL
|
||||
|
||||
// Note that the "do { } while (0)" syntax trick here doesn't work, as the compiler
|
||||
|
@ -619,8 +606,8 @@ CHECK CheckValue(TYPENAME &val)
|
|||
|
||||
//--------------------------------------------------------------------------------
|
||||
// CCHECK is used for Check functions which may fail due to out of memory
|
||||
// or other transient failures. These failures should be ignored when doing
|
||||
// assertions, but they cannot be ignored when the Check function is used in
|
||||
// or other transient failures. These failures should be ignored when doing
|
||||
// assertions, but they cannot be ignored when the Check function is used in
|
||||
// normal code.
|
||||
// @todo: really crufty to have 2 sets of CHECK macros
|
||||
//--------------------------------------------------------------------------------
|
||||
|
@ -725,7 +712,7 @@ CHECK CheckUnderflow(const void *address, void *address2);
|
|||
|
||||
CHECK CheckZeroedMemory(const void *memory, SIZE_T size);
|
||||
|
||||
// These include overflow checks
|
||||
// These include overflow checks
|
||||
CHECK CheckBounds(const void *rangeBase, UINT32 rangeSize, UINT32 offset);
|
||||
CHECK CheckBounds(const void *rangeBase, UINT32 rangeSize, UINT32 offset, UINT32 size);
|
||||
|
||||
|
|
|
@ -10,51 +10,13 @@
|
|||
#include "debugmacros.h"
|
||||
#include "clrtypes.h"
|
||||
|
||||
inline LONG *CHECK::InitTls()
|
||||
{
|
||||
#pragma push_macro("HeapAlloc")
|
||||
#pragma push_macro("GetProcessHeap")
|
||||
#undef HeapAlloc
|
||||
#undef GetProcessHeap
|
||||
|
||||
LONG *pCount = (LONG *)::HeapAlloc(GetProcessHeap(), 0, sizeof(LONG));
|
||||
if (pCount)
|
||||
*pCount = 0;
|
||||
|
||||
#pragma pop_macro("HeapAlloc")
|
||||
#pragma pop_macro("GetProcessHeap")
|
||||
ClrFlsSetValue(TlsIdx_Check, pCount);
|
||||
ClrFlsAssociateCallback(TlsIdx_Check, ReleaseCheckTls);
|
||||
return pCount;
|
||||
}
|
||||
|
||||
inline void CHECK::ReleaseTls(void* pCountTLS)
|
||||
{
|
||||
#pragma push_macro("HeapFree")
|
||||
#pragma push_macro("GetProcessHeap")
|
||||
#undef HeapFree
|
||||
#undef GetProcessHeap
|
||||
LONG* pCount = (LONG*) pCountTLS;
|
||||
if (pCount)
|
||||
::HeapFree(GetProcessHeap(), 0, pCount);
|
||||
|
||||
#pragma pop_macro("HeapFree")
|
||||
#pragma pop_macro("GetProcessHeap")
|
||||
}
|
||||
|
||||
FORCEINLINE BOOL CHECK::EnterAssert()
|
||||
{
|
||||
if (s_neverEnforceAsserts)
|
||||
return FALSE;
|
||||
|
||||
#ifdef _DEBUG_IMPL
|
||||
m_pCount = (LONG *)ClrFlsGetValue(TlsIdx_Check);
|
||||
if (!m_pCount)
|
||||
{
|
||||
m_pCount = InitTls();
|
||||
if (!m_pCount)
|
||||
return FALSE;
|
||||
}
|
||||
m_pCount = &t_count;
|
||||
|
||||
if (!*m_pCount)
|
||||
{
|
||||
|
@ -81,12 +43,9 @@ FORCEINLINE BOOL CHECK::IsInAssert()
|
|||
{
|
||||
#ifdef _DEBUG_IMPL
|
||||
if (!m_pCount)
|
||||
m_pCount = (LONG *)ClrFlsGetValue(TlsIdx_Check);
|
||||
m_pCount = &t_count;
|
||||
|
||||
if (!m_pCount)
|
||||
return FALSE;
|
||||
else
|
||||
return *m_pCount;
|
||||
return *m_pCount;
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
|
@ -180,7 +139,7 @@ inline CHECK CheckAligned(UINT value, UINT alignment)
|
|||
CHECK_OK;
|
||||
}
|
||||
|
||||
#ifndef PLATFORM_UNIX
|
||||
#ifndef HOST_UNIX
|
||||
// For Unix this and the previous function get the same types.
|
||||
// So, exclude this one.
|
||||
inline CHECK CheckAligned(ULONG value, UINT alignment)
|
||||
|
@ -189,7 +148,7 @@ inline CHECK CheckAligned(ULONG value, UINT alignment)
|
|||
CHECK(AlignmentTrim(value, alignment) == 0);
|
||||
CHECK_OK;
|
||||
}
|
||||
#endif // PLATFORM_UNIX
|
||||
#endif // HOST_UNIX
|
||||
|
||||
inline CHECK CheckAligned(UINT64 value, UINT alignment)
|
||||
{
|
||||
|
@ -270,7 +229,7 @@ inline CHECK CheckUnderflow(UINT value1, UINT value2)
|
|||
CHECK_OK;
|
||||
}
|
||||
|
||||
#ifndef PLATFORM_UNIX
|
||||
#ifndef HOST_UNIX
|
||||
// For Unix this and the previous function get the same types.
|
||||
// So, exclude this one.
|
||||
inline CHECK CheckUnderflow(ULONG value1, ULONG value2)
|
||||
|
@ -279,7 +238,7 @@ inline CHECK CheckUnderflow(ULONG value1, ULONG value2)
|
|||
|
||||
CHECK_OK;
|
||||
}
|
||||
#endif // PLATFORM_UNIX
|
||||
#endif // HOST_UNIX
|
||||
|
||||
inline CHECK CheckUnderflow(UINT64 value1, UINT64 value2)
|
||||
{
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
|
||||
#ifndef _CIRCULARLOG_H__
|
||||
|
||||
#define _CIRCULARLOG_H__
|
||||
|
||||
#include "sstring.h"
|
||||
|
||||
class CircularLog
|
||||
{
|
||||
public:
|
||||
CircularLog();
|
||||
~CircularLog();
|
||||
|
||||
bool Init(const WCHAR* logname, const WCHAR* logHeader, DWORD maxSize = 1024*1024);
|
||||
void Shutdown();
|
||||
void Log(const WCHAR* string);
|
||||
|
||||
protected:
|
||||
|
||||
void CheckForLogReset(BOOL fOverflow);
|
||||
BOOL CheckLogHeader();
|
||||
HANDLE OpenFile();
|
||||
void CloseFile();
|
||||
|
||||
bool m_bInit;
|
||||
SString m_LogFilename;
|
||||
SString m_LogHeader;
|
||||
SString m_OldLogFilename;
|
||||
SString m_LockFilename;
|
||||
DWORD m_MaxSize;
|
||||
unsigned m_uLogCount;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -10,7 +10,5 @@
|
|||
#define _clr_fs_h_
|
||||
|
||||
#include "fs/path.h"
|
||||
#include "fs/file.h"
|
||||
#include "fs/dir.h"
|
||||
|
||||
#endif // _clr_fs_h_
|
||||
|
|
|
@ -1,129 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
//
|
||||
|
||||
//
|
||||
// This header provides general directory-related file system services.
|
||||
|
||||
#ifndef _clr_fs_Dir_h_
|
||||
#define _clr_fs_Dir_h_
|
||||
|
||||
#include "clrtypes.h"
|
||||
#include "clr/str.h"
|
||||
#include "strsafe.h"
|
||||
|
||||
#ifndef countof
|
||||
#define countof(x) (sizeof(x) / sizeof(x[0]))
|
||||
#endif // !countof
|
||||
|
||||
namespace clr
|
||||
{
|
||||
namespace fs
|
||||
{
|
||||
class Dir
|
||||
{
|
||||
public:
|
||||
static inline bool Exists(
|
||||
LPCWSTR wzDirPath)
|
||||
{
|
||||
DWORD attrs = WszGetFileAttributes(wzDirPath);
|
||||
return (attrs != INVALID_FILE_ATTRIBUTES) && (attrs & FILE_ATTRIBUTE_DIRECTORY);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
// Creates new directory indicated by wzDirPath.
|
||||
//
|
||||
// Returns:
|
||||
// S_OK - on success directory creation
|
||||
// S_FALSE - when directory previously existed
|
||||
// HR(ERROR_PATH_NOT_FOUND) - when creation of dir fails.
|
||||
static inline HRESULT Create(
|
||||
LPCWSTR wzDirPath)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
if (!WszCreateDirectory(wzDirPath, nullptr))
|
||||
{
|
||||
hr = HRESULT_FROM_GetLastError();
|
||||
if (hr == HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS))
|
||||
{
|
||||
hr = S_FALSE;
|
||||
}
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
// Creates the specified directory and all required subdirectories. wzDirPath will be
|
||||
// temporarily modified in the process.
|
||||
//
|
||||
// Returns:
|
||||
// S_OK - on success directory creation
|
||||
// S_FALSE - when directory previously existed
|
||||
// HR(ERROR_PATH_NOT_FOUND) - when creation of any dir fails.
|
||||
static inline HRESULT CreateRecursively(
|
||||
__inout_z LPWSTR wzDirPath,
|
||||
size_t cchDirPath = 0)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
if (wzDirPath == nullptr)
|
||||
{
|
||||
return E_POINTER;
|
||||
}
|
||||
|
||||
if (cchDirPath == 0)
|
||||
{
|
||||
cchDirPath = wcslen(wzDirPath);
|
||||
}
|
||||
|
||||
// Try to create the path. If it fails, assume that's because the parent folder does
|
||||
// not exist. Try to create the parent then re-attempt.
|
||||
WCHAR chOrig = wzDirPath[cchDirPath];
|
||||
hr = Create(wzDirPath);
|
||||
if (hr == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND))
|
||||
{
|
||||
for (WCHAR* pCurCh = wzDirPath + cchDirPath - 1; pCurCh != wzDirPath; --pCurCh)
|
||||
{
|
||||
if (*pCurCh == W('\\') || *pCurCh == W('\0'))
|
||||
{
|
||||
WCHAR chOrig = *pCurCh;
|
||||
*pCurCh = W('\0');
|
||||
IfFailRet(CreateRecursively(wzDirPath, pCurCh - wzDirPath));
|
||||
*pCurCh = chOrig;
|
||||
break;
|
||||
}
|
||||
}
|
||||
IfFailRet(Create(wzDirPath));
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
// Creates the specified directory and all required subdirectories.
|
||||
static inline HRESULT CreateRecursively(
|
||||
LPCWSTR wzDirPath)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
if (wzDirPath == nullptr)
|
||||
{
|
||||
return E_POINTER;
|
||||
}
|
||||
|
||||
// Make a writable copy of wzDirPath
|
||||
size_t cchDirPath = wcslen(wzDirPath);
|
||||
CQuickWSTR wzBuffer;
|
||||
IfFailRet(wzBuffer.ReSizeNoThrow(cchDirPath + 1));
|
||||
wcscpy_s(wzBuffer.Ptr(), wzBuffer.Size(), wzDirPath);
|
||||
IfFailRet(CreateRecursively(wzBuffer.Ptr(), cchDirPath));
|
||||
|
||||
return hr;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _clr_fs_Dir_h_
|
|
@ -1,40 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
//
|
||||
|
||||
//
|
||||
// This header provides general filename-related file system services.
|
||||
|
||||
#ifndef _clr_fs_File_h_
|
||||
#define _clr_fs_File_h_
|
||||
|
||||
#include "clrtypes.h"
|
||||
#include "cor.h" // SELECTANY
|
||||
|
||||
namespace clr
|
||||
{
|
||||
namespace fs
|
||||
{
|
||||
// This list taken from ndp/clr/src/bcl/system/io/path.cs
|
||||
SELECTANY WCHAR const g_rgInvalidFileNameChars[] =
|
||||
{ W('"'), W('<'), W('>'), W('|'), W('\0'), (WCHAR)1, (WCHAR)2, (WCHAR)3, (WCHAR)4, (WCHAR)5, (WCHAR)6,
|
||||
(WCHAR)7, (WCHAR)8, (WCHAR)9, (WCHAR)10, (WCHAR)11, (WCHAR)12, (WCHAR)13, (WCHAR)14,
|
||||
(WCHAR)15, (WCHAR)16, (WCHAR)17, (WCHAR)18, (WCHAR)19, (WCHAR)20, (WCHAR)21, (WCHAR)22,
|
||||
(WCHAR)23, (WCHAR)24, (WCHAR)25, (WCHAR)26, (WCHAR)27, (WCHAR)28, (WCHAR)29, (WCHAR)30,
|
||||
(WCHAR)31, W(':'), W('*'), W('?'), W('\\'), W('/') };
|
||||
|
||||
class File
|
||||
{
|
||||
public:
|
||||
static inline bool Exists(
|
||||
LPCWSTR wzFilePath)
|
||||
{
|
||||
DWORD attrs = WszGetFileAttributes(wzFilePath);
|
||||
return (attrs != INVALID_FILE_ATTRIBUTES) && !(attrs & FILE_ATTRIBUTE_DIRECTORY);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _clr_fs_File_h_
|
|
@ -16,43 +16,13 @@
|
|||
|
||||
#include "clr/str.h"
|
||||
|
||||
#ifndef LONG_FORMAT_PATH_PREFIX
|
||||
#define LONG_FORMAT_PATH_PREFIX W("\\\\?\\")
|
||||
#endif
|
||||
|
||||
namespace clr
|
||||
{
|
||||
namespace fs
|
||||
{
|
||||
// This list taken from ndp/clr/src/bcl/system/io/path.cs
|
||||
SELECTANY WCHAR const g_rgInvalidPathChars[] =
|
||||
{ W('"'), W('<'), W('>'), W('|'), W('\0'), (WCHAR)1, (WCHAR)2, (WCHAR)3, (WCHAR)4, (WCHAR)5, (WCHAR)6,
|
||||
(WCHAR)7, (WCHAR)8, (WCHAR)9, (WCHAR)10, (WCHAR)11, (WCHAR)12, (WCHAR)13, (WCHAR)14,
|
||||
(WCHAR)15, (WCHAR)16, (WCHAR)17, (WCHAR)18, (WCHAR)19, (WCHAR)20, (WCHAR)21, (WCHAR)22,
|
||||
(WCHAR)23, (WCHAR)24, (WCHAR)25, (WCHAR)26, (WCHAR)27, (WCHAR)28, (WCHAR)29, (WCHAR)30,
|
||||
(WCHAR)31 };
|
||||
|
||||
class Path
|
||||
{
|
||||
public:
|
||||
//-----------------------------------------------------------------------------------------
|
||||
static inline bool
|
||||
Exists(
|
||||
LPCWSTR wzPath)
|
||||
{
|
||||
DWORD attrs = WszGetFileAttributes(wzPath);
|
||||
return (attrs != INVALID_FILE_ATTRIBUTES);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
// Returns true if wzPath represents a long format path (i.e., prefixed with '\\?\').
|
||||
static inline bool
|
||||
HasLongFormatPrefix(LPCWSTR wzPath)
|
||||
{
|
||||
_ASSERTE(!clr::str::IsNullOrEmpty(wzPath)); // Must check this first.
|
||||
return wcscmp(wzPath, LONG_FORMAT_PATH_PREFIX) == 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
// Returns true if wzPath represents a relative path.
|
||||
static inline bool
|
||||
|
@ -61,7 +31,7 @@ namespace clr
|
|||
_ASSERTE(wzPath != nullptr);
|
||||
|
||||
// Similar to System.IO.Path.IsRelative()
|
||||
#if PLATFORM_UNIX
|
||||
#if TARGET_UNIX
|
||||
if(wzPath[0] == VOLUME_SEPARATOR_CHAR_W)
|
||||
{
|
||||
return false;
|
||||
|
@ -89,51 +59,6 @@ namespace clr
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
// Combines two path parts. wzPathLeft must be a directory path and may be either absolute
|
||||
// or relative. wzPathRight may be a directory or file path and must be relative. The
|
||||
// result is placed in wzBuffer and the number of chars written is placed in pcchBuffer on
|
||||
// success; otherwise an error HRESULT is returned.
|
||||
static HRESULT
|
||||
Combine(LPCWSTR wzPathLeft, LPCWSTR wzPathRight, __in DWORD *pcchBuffer, __out_ecount(*pcchBuffer) LPWSTR wzBuffer)
|
||||
{
|
||||
STATIC_CONTRACT_NOTHROW;
|
||||
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
if (clr::str::IsNullOrEmpty(wzPathLeft) || clr::str::IsNullOrEmpty(wzPathRight) || pcchBuffer == nullptr)
|
||||
return E_INVALIDARG;
|
||||
|
||||
LPWSTR wzBuf = wzBuffer;
|
||||
size_t cchBuf = *pcchBuffer;
|
||||
|
||||
IfFailRet(StringCchCopyExW(wzBuf, cchBuf, wzPathLeft, &wzBuf, &cchBuf, STRSAFE_NULL_ON_FAILURE));
|
||||
IfFailRet(StringCchCatExW(wzBuf, cchBuf, wzBuf[-1] == DIRECTORY_SEPARATOR_CHAR_W ? W("") : DIRECTORY_SEPARATOR_STR_W, &wzBuf, &cchBuf, STRSAFE_NULL_ON_FAILURE));
|
||||
IfFailRet(StringCchCatExW(wzBuf, cchBuf, wzPathRight, &wzBuf, &cchBuf, STRSAFE_NULL_ON_FAILURE));
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
// Checks if the path provided is valid within the specified constraints.
|
||||
// ***NOTE: does not yet check for invalid path characters.
|
||||
static bool
|
||||
IsValid(LPCWSTR wzPath, DWORD cchPath, bool fAllowLongFormat)
|
||||
{
|
||||
if (clr::str::IsNullOrEmpty(wzPath))
|
||||
return false;
|
||||
|
||||
bool fIsLongFormat = HasLongFormatPrefix(wzPath);
|
||||
|
||||
if (fIsLongFormat && !fAllowLongFormat)
|
||||
return false;
|
||||
|
||||
if (!fIsLongFormat && cchPath > _MAX_PATH)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,8 +22,8 @@ namespace std
|
|||
template<class iter, class CompareFunc>
|
||||
iter find_if ( iter first, iter last, CompareFunc comp )
|
||||
{
|
||||
for ( ; first!=last ; first++ )
|
||||
if ( comp(*first) )
|
||||
for ( ; first!=last ; first++ )
|
||||
if ( comp(*first) )
|
||||
break;
|
||||
return first;
|
||||
}
|
||||
|
|
|
@ -186,6 +186,70 @@ namespace std
|
|||
typedef _Ty1 type;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
// TEMPLATE CLASS make_unsigned
|
||||
template<typename Type1>
|
||||
struct make_unsigned
|
||||
{
|
||||
};
|
||||
|
||||
template<>
|
||||
struct make_unsigned<int>
|
||||
{
|
||||
typedef unsigned int type;
|
||||
};
|
||||
|
||||
#ifndef TARGET_UNIX
|
||||
|
||||
template<>
|
||||
struct make_unsigned<long>
|
||||
{
|
||||
typedef unsigned long type;
|
||||
};
|
||||
|
||||
#endif // !TARGET_UNIX
|
||||
|
||||
template<>
|
||||
struct make_unsigned<__int64>
|
||||
{
|
||||
typedef unsigned __int64 type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct make_unsigned<size_t>
|
||||
{
|
||||
typedef size_t type;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
// TEMPLATE CLASS make_signed
|
||||
template<typename Type1>
|
||||
struct make_signed
|
||||
{
|
||||
};
|
||||
|
||||
template<>
|
||||
struct make_signed<unsigned int>
|
||||
{
|
||||
typedef signed int type;
|
||||
};
|
||||
|
||||
#ifndef TARGET_UNIX
|
||||
|
||||
template<>
|
||||
struct make_signed<unsigned long>
|
||||
{
|
||||
typedef signed long type;
|
||||
};
|
||||
|
||||
#endif // !TARGET_UNIX
|
||||
|
||||
template<>
|
||||
struct make_signed<unsigned __int64>
|
||||
{
|
||||
typedef signed __int64 type;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
// TEMPLATE CLASS is_lvalue_reference
|
||||
template<class _Ty>
|
||||
|
@ -269,14 +333,6 @@ namespace std
|
|||
{ // determine whether _Ty is integral
|
||||
};
|
||||
|
||||
#ifdef _NATIVE_WCHAR_T_DEFINED
|
||||
template<>
|
||||
struct _Is_integral<wchar_t>
|
||||
: true_type
|
||||
{ // determine whether _Ty is integral
|
||||
};
|
||||
#endif /* _NATIVE_WCHAR_T_DEFINED */
|
||||
|
||||
template<>
|
||||
struct _Is_integral<unsigned short>
|
||||
: true_type
|
||||
|
@ -303,7 +359,7 @@ namespace std
|
|||
|
||||
// On Unix 'long' is a 64-bit type (same as __int64) and the following two definitions
|
||||
// conflict with _Is_integral<unsigned __int64> and _Is_integral<signed __int64>.
|
||||
#ifndef PLATFORM_UNIX
|
||||
#ifndef TARGET_UNIX
|
||||
template<>
|
||||
struct _Is_integral<unsigned long>
|
||||
: true_type
|
||||
|
@ -315,7 +371,7 @@ namespace std
|
|||
: true_type
|
||||
{ // determine whether _Ty is integral
|
||||
};
|
||||
#endif /* PLATFORM_UNIX */
|
||||
#endif /* TARGET_UNIX */
|
||||
|
||||
#if _HAS_CHAR16_T_LANGUAGE_SUPPORT
|
||||
template<>
|
||||
|
@ -371,7 +427,7 @@ namespace std
|
|||
|
||||
// In PAL, we define long as int and so this becomes int double,
|
||||
// which is a nonsense
|
||||
#ifndef FEATURE_PAL
|
||||
#ifndef TARGET_UNIX
|
||||
template<>
|
||||
struct _Is_floating_point<long double>
|
||||
: true_type
|
||||
|
@ -460,7 +516,7 @@ namespace std
|
|||
};
|
||||
|
||||
template <class T>
|
||||
struct conversion<T, T>
|
||||
struct conversion<T, T>
|
||||
{
|
||||
static const bool exists = true;
|
||||
static const bool exists2Way = true;
|
||||
|
@ -468,7 +524,7 @@ namespace std
|
|||
};
|
||||
|
||||
template <class T>
|
||||
struct conversion<void, T>
|
||||
struct conversion<void, T>
|
||||
{
|
||||
static const bool exists = false;
|
||||
static const bool exists2Way = false;
|
||||
|
@ -476,7 +532,7 @@ namespace std
|
|||
};
|
||||
|
||||
template <class T>
|
||||
struct conversion<T, void>
|
||||
struct conversion<T, void>
|
||||
{
|
||||
static const bool exists = false;
|
||||
static const bool exists2Way = false;
|
||||
|
@ -484,7 +540,7 @@ namespace std
|
|||
};
|
||||
|
||||
template <>
|
||||
struct conversion<void, void>
|
||||
struct conversion<void, void>
|
||||
{
|
||||
static const bool exists = true;
|
||||
static const bool exists2Way = true;
|
||||
|
@ -516,22 +572,6 @@ namespace std
|
|||
|
||||
#endif
|
||||
|
||||
// Use to determine if a template type parameter is a string.
|
||||
template <typename T>
|
||||
struct is_cstr
|
||||
: public std::false_type
|
||||
{};
|
||||
|
||||
template <typename T>
|
||||
struct is_cstr< T* >
|
||||
: public std::conditional<
|
||||
std::is_same<typename std::remove_cv<T>::type, char>::value ||
|
||||
std::is_same<typename std::remove_cv<T>::type, wchar_t>::value,
|
||||
std::true_type,
|
||||
std::false_type>::type
|
||||
|
||||
{ };
|
||||
|
||||
} // namespace std
|
||||
|
||||
#endif // !USE_STL
|
||||
|
|
|
@ -43,9 +43,9 @@ namespace std
|
|||
typedef ptrdiff_t difference_type;
|
||||
typedef T* pointer;
|
||||
typedef T& reference;
|
||||
|
||||
|
||||
typedef class vector<T>::iterator _MyIter;
|
||||
|
||||
|
||||
_MyIter &operator++()
|
||||
{
|
||||
m_ptr++;
|
||||
|
@ -140,7 +140,7 @@ namespace std
|
|||
public:
|
||||
typedef class vector<T>::const_iterator _MyIter;
|
||||
typedef class vector<T>::iterator _MyNonConstIter;
|
||||
|
||||
|
||||
_MyIter &operator++()
|
||||
{
|
||||
m_ptr++;
|
||||
|
@ -408,7 +408,7 @@ namespace std
|
|||
|
||||
private:
|
||||
size_t m_size; //# of elements
|
||||
size_t m_capacity; //# of elements allocated
|
||||
size_t m_capacity; //# of elements allocated
|
||||
T *m_pelements; //actual array
|
||||
// invariants:
|
||||
// dimensions == m_capacity
|
||||
|
@ -422,7 +422,7 @@ namespace std
|
|||
}; // class vector
|
||||
|
||||
}; // namespace std
|
||||
|
||||
|
||||
#endif /* __clr_std_vector_h__ */
|
||||
|
||||
#endif // !USE_STL
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------------------------------------
|
||||
// CLRConfig.h
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
// Unified method of accessing configuration values from environment variables, registry and config file(s).
|
||||
// This class replaces all GetConfigDWORD and GetConfigString methods in EEConfig and REGUTIL. To define a
|
||||
// flag, add an entry in the table in file:CLRConfigValues.h.
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
@ -26,9 +26,9 @@
|
|||
class CLRConfig
|
||||
{
|
||||
public:
|
||||
//
|
||||
//
|
||||
// Types
|
||||
//
|
||||
//
|
||||
|
||||
// Setting each option results in some change to the config value lookup method. Default behavior is (in
|
||||
// the following order):
|
||||
|
@ -39,40 +39,30 @@ public:
|
|||
// Link to BOTR documentation
|
||||
enum LookupOptions {
|
||||
// If set, don't look in environment variables.
|
||||
IgnoreEnv = 0x1,
|
||||
IgnoreEnv = 0x1,
|
||||
// If set, do not prepend "COMPlus_" when doing environment variable lookup.
|
||||
DontPrependCOMPlus_ = 0x2,
|
||||
DontPrependCOMPlus_ = 0x2,
|
||||
// If set, don't look in HKLM in the registry.
|
||||
IgnoreHKLM = 0x4,
|
||||
IgnoreHKLM = 0x4,
|
||||
// If set, don't look in HKCU in the registry.
|
||||
IgnoreHKCU = 0x8,
|
||||
// If set, don't look in any config files
|
||||
IgnoreConfigFiles = 0x10,
|
||||
// If set, look in config file(s) before looking in env/registry.
|
||||
FavorConfigFile = 0x20,
|
||||
// If set, look only in the system config file, ignoring other config files.
|
||||
IgnoreHKCU = 0x8,
|
||||
// If set, look only in the system config file, ignoring other config files.
|
||||
// (This option does not affect environment variable and registry lookups)
|
||||
ConfigFile_SystemOnly = 0x40,
|
||||
// If set, reverse the order of config file lookups (application config file first).
|
||||
ConfigFile_SystemOnly = 0x40,
|
||||
// If set, reverse the order of config file lookups (application config file first).
|
||||
// (This option does not affect environment variable and registry lookups)
|
||||
ConfigFile_ApplicationFirst = 0x80,
|
||||
ConfigFile_ApplicationFirst = 0x80,
|
||||
// Remove any whitespace at beginning and end of value. (Only applicable for
|
||||
// *string* configuration values.)
|
||||
TrimWhiteSpaceFromStringValue = 0x100,
|
||||
|
||||
// Legacy REGUTIL-style lookup.
|
||||
REGUTIL_default = IgnoreConfigFiles,
|
||||
// Legacy EEConfig-style lookup.
|
||||
EEConfig_default = 0,
|
||||
};
|
||||
|
||||
// Function pointer definition used for calling EEConfig::GetConfigValueCallback .
|
||||
typedef HRESULT (* GetConfigValueFunction)
|
||||
(__in_z LPCWSTR /*pKey*/, __deref_out_opt LPCWSTR* /*value*/, BOOL /*systemOnly*/, BOOL /*applicationFirst*/);
|
||||
|
||||
// Struct used to store information about where/how to find a Config DWORD.
|
||||
// NOTE: Please do NOT create instances of this struct. Use the macros in file:CLRConfigValues.h instead.
|
||||
typedef struct ConfigDWORDInfo
|
||||
typedef struct ConfigDWORDInfo
|
||||
{
|
||||
LPCWSTR name;
|
||||
DWORD defaultValue;
|
||||
|
@ -86,17 +76,17 @@ public:
|
|||
LPCWSTR name;
|
||||
LookupOptions options;
|
||||
} ConfigStringInfo;
|
||||
|
||||
//
|
||||
|
||||
//
|
||||
// Declaring structs using the macro table in CLRConfigValues.h
|
||||
//
|
||||
|
||||
//
|
||||
|
||||
// These macros declare ConfigDWORDInfo structs.
|
||||
#define RETAIL_CONFIG_DWORD_INFO(symbol, name, defaultValue, description) \
|
||||
static const ConfigDWORDInfo symbol;
|
||||
#define RETAIL_CONFIG_DWORD_INFO_EX(symbol, name, defaultValue, description, lookupOptions) \
|
||||
static const ConfigDWORDInfo symbol;
|
||||
|
||||
|
||||
// These macros declare ConfigStringInfo structs.
|
||||
#define RETAIL_CONFIG_STRING_INFO(symbol, name, description) \
|
||||
static const ConfigStringInfo symbol;
|
||||
|
@ -109,16 +99,16 @@ public:
|
|||
#define RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(symbol, name, description) \
|
||||
static const LPCWSTR symbol;
|
||||
#define RETAIL_CONFIG_STRING_INFO_DIRECT_ACCESS(symbol, name, description) \
|
||||
static const LPCWSTR symbol;
|
||||
static const LPCWSTR symbol;
|
||||
|
||||
//
|
||||
//
|
||||
// Debug versions of the macros
|
||||
//
|
||||
//
|
||||
#ifdef _DEBUG
|
||||
#define CONFIG_DWORD_INFO(symbol, name, defaultValue, description) \
|
||||
static const ConfigDWORDInfo symbol;
|
||||
#define CONFIG_DWORD_INFO_EX(symbol, name, defaultValue, description, lookupOptions) \
|
||||
static const ConfigDWORDInfo symbol;
|
||||
static const ConfigDWORDInfo symbol;
|
||||
#define CONFIG_STRING_INFO(symbol, name, description) \
|
||||
static const ConfigStringInfo symbol;
|
||||
#define CONFIG_STRING_INFO_EX(symbol, name, description, lookupOptions) \
|
||||
|
@ -128,12 +118,12 @@ public:
|
|||
#define CONFIG_STRING_INFO_DIRECT_ACCESS(symbol, name, description) \
|
||||
static const LPCWSTR symbol;
|
||||
#else
|
||||
#define CONFIG_DWORD_INFO(symbol, name, defaultValue, description)
|
||||
#define CONFIG_DWORD_INFO_EX(symbol, name, defaultValue, description, lookupOptions)
|
||||
#define CONFIG_STRING_INFO(symbol, name, description)
|
||||
#define CONFIG_STRING_INFO_EX(symbol, name, description, lookupOptions)
|
||||
#define CONFIG_DWORD_INFO(symbol, name, defaultValue, description)
|
||||
#define CONFIG_DWORD_INFO_EX(symbol, name, defaultValue, description, lookupOptions)
|
||||
#define CONFIG_STRING_INFO(symbol, name, description)
|
||||
#define CONFIG_STRING_INFO_EX(symbol, name, description, lookupOptions)
|
||||
#define CONFIG_DWORD_INFO_DIRECT_ACCESS(symbol, name, description)
|
||||
#define CONFIG_STRING_INFO_DIRECT_ACCESS(symbol, name, description)
|
||||
#define CONFIG_STRING_INFO_DIRECT_ACCESS(symbol, name, description)
|
||||
#endif // _DEBUG
|
||||
// Now that we have defined what what the macros in file:CLRConfigValues.h mean, include it to generate the code.
|
||||
#include "clrconfigvalues.h"
|
||||
|
@ -141,19 +131,19 @@ public:
|
|||
#undef RETAIL_CONFIG_DWORD_INFO
|
||||
#undef RETAIL_CONFIG_STRING_INFO
|
||||
#undef RETAIL_CONFIG_DWORD_INFO_EX
|
||||
#undef RETAIL_CONFIG_STRING_INFO_EX
|
||||
#undef RETAIL_CONFIG_STRING_INFO_EX
|
||||
#undef RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS
|
||||
#undef RETAIL_CONFIG_STRING_INFO_DIRECT_ACCESS
|
||||
#undef CONFIG_DWORD_INFO
|
||||
#undef CONFIG_STRING_INFO
|
||||
#undef CONFIG_DWORD_INFO_EX
|
||||
#undef CONFIG_STRING_INFO_EX
|
||||
#undef CONFIG_STRING_INFO_EX
|
||||
#undef CONFIG_DWORD_INFO_DIRECT_ACCESS
|
||||
#undef CONFIG_STRING_INFO_DIRECT_ACCESS
|
||||
|
||||
//
|
||||
//
|
||||
// Methods to do config value (DWORD and String) lookups.
|
||||
//
|
||||
//
|
||||
static BOOL IsConfigEnabled(const ConfigDWORDInfo & info);
|
||||
|
||||
// Look up a DWORD config value.
|
||||
|
@ -165,9 +155,9 @@ public:
|
|||
// Look up a string config value.
|
||||
// You own the string that's returned.
|
||||
static LPWSTR GetConfigValue(const ConfigStringInfo & info);
|
||||
|
||||
|
||||
// Look up a string config value, passing it out through a pointer reference. Reports out of memory
|
||||
// errors (HRESULT E_OUTOFMEMORY).
|
||||
// errors (HRESULT E_OUTOFMEMORY).
|
||||
// You own the string that's returned.
|
||||
static HRESULT GetConfigValue(const ConfigStringInfo & info, __deref_out_z LPWSTR * outVal);
|
||||
|
||||
|
@ -182,21 +172,15 @@ public:
|
|||
// Free a string returned by GetConfigValue
|
||||
static void FreeConfigString(__in __in_z LPWSTR name);
|
||||
|
||||
// Register EEConfig's GetConfigValueCallback function so CLRConfig can look in config files.
|
||||
static void RegisterGetConfigValueCallback(GetConfigValueFunction func);
|
||||
|
||||
private:
|
||||
// Function pointer to EEConfig's GetConfigValueCallback function (can't static bind from utilcode to VM)
|
||||
static GetConfigValueFunction s_GetConfigValueCallback;
|
||||
|
||||
|
||||
// Helper method to translate LookupOptions to REGUTIL::CORConfigLevel
|
||||
static REGUTIL::CORConfigLevel GetConfigLevel(LookupOptions options);
|
||||
|
||||
//
|
||||
//
|
||||
// Helper methods.
|
||||
//
|
||||
|
||||
//
|
||||
|
||||
// Helper method to check if a certain option is set in a ConfigDWORDInfo struct.
|
||||
static inline BOOL CheckLookupOption(const ConfigDWORDInfo & info, LookupOptions option)
|
||||
{
|
||||
|
|
|
@ -102,7 +102,6 @@
|
|||
///
|
||||
/// AppDomain
|
||||
///
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_AddRejitNops, W("AddRejitNops"), "Control for the profiler rejit feature infrastructure")
|
||||
CONFIG_DWORD_INFO(INTERNAL_ADDumpSB, W("ADDumpSB"), 0, "Not used")
|
||||
CONFIG_DWORD_INFO(INTERNAL_ADForceSB, W("ADForceSB"), 0, "Forces sync block creation for all objects")
|
||||
CONFIG_DWORD_INFO(INTERNAL_ADLogMemory, W("ADLogMemory"), 0, "Superseded by test hooks")
|
||||
|
@ -124,104 +123,104 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_JitPitchMaxVal, W("JitPitchMaxVal"), (DWORD)0x
|
|||
///
|
||||
/// Assembly Loader
|
||||
///
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_DesignerNamespaceResolutionEnabled, W("designerNamespaceResolution"), FALSE, "Set it to 1 to enable DesignerNamespaceResolve event for WinRT types", CLRConfig::IgnoreEnv | CLRConfig::IgnoreHKLM | CLRConfig::IgnoreHKCU | CLRConfig::FavorConfigFile)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_GetAssemblyIfLoadedIgnoreRidMap, W("GetAssemblyIfLoadedIgnoreRidMap"), 0, "Used to force loader to ignore assemblies cached in the rid-map", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_DesignerNamespaceResolutionEnabled, W("designerNamespaceResolution"), FALSE, "Set it to 1 to enable DesignerNamespaceResolve event for WinRT types", CLRConfig::IgnoreEnv | CLRConfig::IgnoreHKLM | CLRConfig::IgnoreHKCU)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_GetAssemblyIfLoadedIgnoreRidMap, W("GetAssemblyIfLoadedIgnoreRidMap"), 0, "Used to force loader to ignore assemblies cached in the rid-map", CLRConfig::EEConfig_default)
|
||||
|
||||
///
|
||||
/// Conditional breakpoints
|
||||
///
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_BreakOnBadExit, W("BreakOnBadExit"), 0, "", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_BreakOnBadExit, W("BreakOnBadExit"), 0, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_STRING_INFO(INTERNAL_BreakOnClassBuild, W("BreakOnClassBuild"), "Very useful for debugging class layout code.")
|
||||
CONFIG_STRING_INFO(INTERNAL_BreakOnClassLoad, W("BreakOnClassLoad"), "Very useful for debugging class loading code.")
|
||||
CONFIG_STRING_INFO(INTERNAL_BreakOnComToClrNativeInfoInit, W("BreakOnComToClrNativeInfoInit"), "Throws an assert when native information about a COM -> CLR call are about to be gathered.")
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnDebugBreak, W("BreakOnDebugBreak"), 0, "Allows an assert in debug builds when a user break is hit", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnDILoad, W("BreakOnDILoad"), 0, "Allows an assert when the DI is loaded", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnDumpToken, W("BreakOnDumpToken"), 0xffffffff, "Breaks when using internal logging on a particular token value.", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_BreakOnEELoad, W("BreakOnEELoad"), 0, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnDebugBreak, W("BreakOnDebugBreak"), 0, "Allows an assert in debug builds when a user break is hit", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnDILoad, W("BreakOnDILoad"), 0, "Allows an assert when the DI is loaded", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnDumpToken, W("BreakOnDumpToken"), 0xffffffff, "Breaks when using internal logging on a particular token value.", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_BreakOnEELoad, W("BreakOnEELoad"), 0, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO(INTERNAL_BreakOnEEShutdown, W("BreakOnEEShutdown"), 0, "")
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnExceptionInGetThrowable, W("BreakOnExceptionInGetThrowable"), 0, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnExceptionInGetThrowable, W("BreakOnExceptionInGetThrowable"), 0, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO(INTERNAL_BreakOnFindMethod, W("BreakOnFindMethod"), 0, "Breaks in findMethodInternal when it searches for the specified token.")
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnFirstPass, W("BreakOnFirstPass"), 0, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnHR, W("BreakOnHR"), 0, "Debug.cpp, IfFailxxx use this macro to stop if hr matches ", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnFirstPass, W("BreakOnFirstPass"), 0, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnHR, W("BreakOnHR"), 0, "Debug.cpp, IfFailxxx use this macro to stop if hr matches ", CLRConfig::EEConfig_default)
|
||||
CONFIG_STRING_INFO(INTERNAL_BreakOnInstantiation, W("BreakOnInstantiation"), "Very useful for debugging generic class instantiation.")
|
||||
CONFIG_STRING_INFO(INTERNAL_BreakOnInteropStubSetup, W("BreakOnInteropStubSetup"), "Throws an assert when marshaling stub for the given method is about to be built.")
|
||||
CONFIG_STRING_INFO_EX(INTERNAL_BreakOnInteropVTableBuild, W("BreakOnInteropVTableBuild"), "Specifies a type name for which an assert should be thrown when building interop v-table.", CLRConfig::REGUTIL_default)
|
||||
CONFIG_STRING_INFO_EX(INTERNAL_BreakOnInteropVTableBuild, W("BreakOnInteropVTableBuild"), "Specifies a type name for which an assert should be thrown when building interop v-table.", CLRConfig::EEConfig_default)
|
||||
CONFIG_STRING_INFO(INTERNAL_BreakOnMethodName, W("BreakOnMethodName"), "Very useful for debugging method override placement code.")
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnNotify, W("BreakOnNotify"), 0, "", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnRetailAssert, W("BreakOnRetailAssert"), 0, "Used for debugging \"retail\" asserts (fatal errors)", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnSecondPass, W("BreakOnSecondPass"), 0, "", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_BreakOnSO, W("BreakOnSO"), 0, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnNotify, W("BreakOnNotify"), 0, "", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnRetailAssert, W("BreakOnRetailAssert"), 0, "Used for debugging \"retail\" asserts (fatal errors)", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnSecondPass, W("BreakOnSecondPass"), 0, "", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_BreakOnSO, W("BreakOnSO"), 0, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_STRING_INFO(INTERNAL_BreakOnStructMarshalSetup, W("BreakOnStructMarshalSetup"), "Throws an assert when field marshalers for the given type with layout are about to be created.")
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnUEF, W("BreakOnUEF"), 0, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnUncaughtException, W("BreakOnUncaughtException"), 0, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnUEF, W("BreakOnUEF"), 0, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnUncaughtException, W("BreakOnUncaughtException"), 0, "", CLRConfig::EEConfig_default)
|
||||
|
||||
///
|
||||
|
||||
/// Debugger
|
||||
///
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_EnableDiagnostics, W("EnableDiagnostics"), 1, "Allows the debugger and profiler diagnostics to be disabled", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_D__FCE, W("D::FCE"), 0, "Allows an assert when crawling the managed stack for an exception handler", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakIfLocksUnavailable, W("DbgBreakIfLocksUnavailable"), 0, "Allows an assert when the debugger can't take a lock ", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakOnErr, W("DbgBreakOnErr"), 0, "Allows an assert when we get a failing hresult", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakOnMapPatchToDJI, W("DbgBreakOnMapPatchToDJI"), 0, "Allows an assert when mapping a patch to an address", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakOnRawInt3, W("DbgBreakOnRawInt3"), 0, "Allows an assert for test coverage for debug break or other int3 breaks", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakOnSendBreakpoint, W("DbgBreakOnSendBreakpoint"), 0, "Allows an assert when sending a breakpoint to the right side", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakOnSetIP, W("DbgBreakOnSetIP"), 0, "Allows an assert when setting the IP", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgCheckInt3, W("DbgCheckInt3"), 0, "Asserts if the debugger explicitly writes int3 instead of calling SetUnmanagedBreakpoint", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_EnableDiagnostics, W("EnableDiagnostics"), 1, "Allows the debugger, profiler, and EventPipe diagnostics to be disabled", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_D__FCE, W("D::FCE"), 0, "Allows an assert when crawling the managed stack for an exception handler", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakIfLocksUnavailable, W("DbgBreakIfLocksUnavailable"), 0, "Allows an assert when the debugger can't take a lock ", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakOnErr, W("DbgBreakOnErr"), 0, "Allows an assert when we get a failing hresult", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakOnMapPatchToDJI, W("DbgBreakOnMapPatchToDJI"), 0, "Allows an assert when mapping a patch to an address", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakOnRawInt3, W("DbgBreakOnRawInt3"), 0, "Allows an assert for test coverage for debug break or other int3 breaks", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakOnSendBreakpoint, W("DbgBreakOnSendBreakpoint"), 0, "Allows an assert when sending a breakpoint to the right side", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakOnSetIP, W("DbgBreakOnSetIP"), 0, "Allows an assert when setting the IP", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgCheckInt3, W("DbgCheckInt3"), 0, "Asserts if the debugger explicitly writes int3 instead of calling SetUnmanagedBreakpoint", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_DbgDACAssertOnMismatch, W("DbgDACAssertOnMismatch"), "Allows an assert when the mscordacwks and mscorwks dll versions don't match")
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgDACEnableAssert, W("DbgDACEnableAssert"), 0, "Enables extra validity checking in DAC - assumes target isn't corrupt", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_DbgDACSkipVerifyDlls, W("DbgDACSkipVerifyDlls"), 0, "Allows disabling the check to ensure mscordacwks and mscorwks dll versions match", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgDelayHelper, W("DbgDelayHelper"), 0, "Varies the wait in the helper thread startup for testing race between threads", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_DbgDisableDynamicSymsCompat, W("DbgDisableDynamicSymsCompat"), 0, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgDisableTargetConsistencyAsserts, W("DbgDisableTargetConsistencyAsserts"), 0, "Allows explicitly testing with corrupt targets", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_DbgEnableMixedModeDebugging, W("DbgEnableMixedModeDebuggingInternalOnly"), 0, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgExtraThreads, W("DbgExtraThreads"), 0, "Allows extra unmanaged threads to run and throw debug events for stress testing", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgExtraThreadsCantStop, W("DbgExtraThreadsCantStop"), 0, "Allows extra unmanaged threads in can't stop region to run and throw debug events for stress testing", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgExtraThreadsIB, W("DbgExtraThreadsIB"), 0, "Allows extra in-band unmanaged threads to run and throw debug events for stress testing", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgExtraThreadsOOB, W("DbgExtraThreadsOOB"), 0, "Allows extra out of band unmanaged threads to run and throw debug events for stress testing", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgFaultInHandleIPCEvent, W("DbgFaultInHandleIPCEvent"), 0, "Allows testing the unhandled event filter", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgInjectFEE, W("DbgInjectFEE"), 0, "Allows injecting a fatal execution error for testing Watson", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgLeakCheck, W("DbgLeakCheck"), 0, "Allows checking for leaked Cordb objects", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgNo2ndChance, W("DbgNo2ndChance"), 0, "Allows breaking on (and catching bogus) 2nd chance exceptions", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgNoDebugger, W("DbgNoDebugger"), 0, "Allows breaking if we don't want to lazily initialize the debugger", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_DbgNoForceContinue, W("DbgNoForceContinue"), 1, "Used to force a continue on longhorn", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgNoOpenMDByFile, W("DbgNoOpenMDByFile"), 0, "Allows opening MD by memory for perf testing", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgDACEnableAssert, W("DbgDACEnableAssert"), 0, "Enables extra validity checking in DAC - assumes target isn't corrupt", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_DbgDACSkipVerifyDlls, W("DbgDACSkipVerifyDlls"), 0, "Allows disabling the check to ensure mscordacwks and mscorwks dll versions match", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgDelayHelper, W("DbgDelayHelper"), 0, "Varies the wait in the helper thread startup for testing race between threads", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_DbgDisableDynamicSymsCompat, W("DbgDisableDynamicSymsCompat"), 0, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgDisableTargetConsistencyAsserts, W("DbgDisableTargetConsistencyAsserts"), 0, "Allows explicitly testing with corrupt targets", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_DbgEnableMixedModeDebugging, W("DbgEnableMixedModeDebuggingInternalOnly"), 0, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgExtraThreads, W("DbgExtraThreads"), 0, "Allows extra unmanaged threads to run and throw debug events for stress testing", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgExtraThreadsCantStop, W("DbgExtraThreadsCantStop"), 0, "Allows extra unmanaged threads in can't stop region to run and throw debug events for stress testing", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgExtraThreadsIB, W("DbgExtraThreadsIB"), 0, "Allows extra in-band unmanaged threads to run and throw debug events for stress testing", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgExtraThreadsOOB, W("DbgExtraThreadsOOB"), 0, "Allows extra out of band unmanaged threads to run and throw debug events for stress testing", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgFaultInHandleIPCEvent, W("DbgFaultInHandleIPCEvent"), 0, "Allows testing the unhandled event filter", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgInjectFEE, W("DbgInjectFEE"), 0, "Allows injecting a fatal execution error for testing Watson", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgLeakCheck, W("DbgLeakCheck"), 0, "Allows checking for leaked Cordb objects", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgNo2ndChance, W("DbgNo2ndChance"), 0, "Allows breaking on (and catching bogus) 2nd chance exceptions", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgNoDebugger, W("DbgNoDebugger"), 0, "Allows breaking if we don't want to lazily initialize the debugger", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_DbgNoForceContinue, W("DbgNoForceContinue"), 1, "Used to force a continue on longhorn", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgNoOpenMDByFile, W("DbgNoOpenMDByFile"), 0, "Allows opening MD by memory for perf testing", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO(INTERNAL_DbgOOBinFEEE, W("DbgOOBinFEEE"), 0, "Allows forcing oob breakpoints when a fatal error occurs")
|
||||
RETAIL_CONFIG_STRING_INFO_DIRECT_ACCESS(EXTERNAL_DbgPackShimPath, W("DbgPackShimPath"), "CoreCLR path to dbgshim.dll - we are trying to figure out if we can remove this")
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgPingInterop, W("DbgPingInterop"), 0, "Allows checking for deadlocks in interop debugging", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgRace, W("DbgRace"), 0, "Allows pausing for native debug events to get hijicked", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_DbgRedirect, W("DbgRedirect"), 0, "Allows for redirecting the event pipeline", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgPingInterop, W("DbgPingInterop"), 0, "Allows checking for deadlocks in interop debugging", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgRace, W("DbgRace"), 0, "Allows pausing for native debug events to get hijicked", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_DbgRedirect, W("DbgRedirect"), 0, "Allows for redirecting the event pipeline", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_STRING_INFO_DIRECT_ACCESS(EXTERNAL_DbgRedirectApplication, W("DbgRedirectApplication"), "Specifies the auxiliary debugger application to launch.")
|
||||
RETAIL_CONFIG_STRING_INFO_DIRECT_ACCESS(EXTERNAL_DbgRedirectAttachCmd, W("DbgRedirectAttachCmd"), "Specifies command parameters for attaching the auxiliary debugger.")
|
||||
RETAIL_CONFIG_STRING_INFO_DIRECT_ACCESS(EXTERNAL_DbgRedirectCommonCmd, W("DbgRedirectCommonCmd"), "Specifies a command line format string for the auxiliary debugger.")
|
||||
RETAIL_CONFIG_STRING_INFO_DIRECT_ACCESS(EXTERNAL_DbgRedirectCreateCmd, W("DbgRedirectCreateCmd"), "Specifies command parameters when creating the auxiliary debugger.")
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgShortcutCanary, W("DbgShortcutCanary"), 0, "Allows a way to force canary to fail to be able to test failure paths", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgSkipMEOnStep, W("DbgSkipMEOnStep"), 0, "Turns off MethodEnter checks", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgSkipVerCheck, W("DbgSkipVerCheck"), 0, "Allows different RS and LS versions (for servicing work)", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgTC, W("DbgTC"), 0, "Allows checking boundary compression for offset mappings", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgTransportFaultInject, W("DbgTransportFaultInject"), 0, "Allows injecting a fault for testing the debug transport", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgShortcutCanary, W("DbgShortcutCanary"), 0, "Allows a way to force canary to fail to be able to test failure paths", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgSkipMEOnStep, W("DbgSkipMEOnStep"), 0, "Turns off MethodEnter checks", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgSkipVerCheck, W("DbgSkipVerCheck"), 0, "Allows different RS and LS versions (for servicing work)", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgTC, W("DbgTC"), 0, "Allows checking boundary compression for offset mappings", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgTransportFaultInject, W("DbgTransportFaultInject"), 0, "Allows injecting a fault for testing the debug transport", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_DbgTransportLog, W("DbgTransportLog"), "Turns on logging for the debug transport")
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_DbgTransportLogClass, W("DbgTransportLogClass"), "Mask to control what is logged in DbgTransportLog")
|
||||
RETAIL_CONFIG_STRING_INFO_EX(UNSUPPORTED_DbgTransportProxyAddress, W("DbgTransportProxyAddress"), "Allows specifying the transport proxy address", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgTrapOnSkip, W("DbgTrapOnSkip"), 0, "Allows breaking when we skip a breakpoint", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgWaitTimeout, W("DbgWaitTimeout"), 1, "Specifies the timeout value for waits", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_DbgWFDETimeout, W("DbgWFDETimeout"), 25, "Specifies the timeout value for wait when waiting for a debug event", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_RaiseExceptionOnAssert, W("RaiseExceptionOnAssert"), 0, "Raise a first chance (if set to 1) or second chance (if set to 2) exception on asserts.", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DebugBreakOnAssert, W("DebugBreakOnAssert"), 0, "If DACCESS_COMPILE is defined, break on asserts.", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DebugBreakOnVerificationFailure, W("DebugBreakOnVerificationFailure"), 0, "Halts the jit on verification failure", CLRConfig::REGUTIL_default)
|
||||
CONFIG_STRING_INFO_EX(INTERNAL_DebuggerBreakPoint, W("DebuggerBreakPoint"), "Allows counting various debug events", CLRConfig::REGUTIL_default)
|
||||
CONFIG_STRING_INFO_EX(INTERNAL_DebugVerify, W("DebugVerify"), "Control for tracing in peverify", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(UNSUPPORTED_DbgTransportProxyAddress, W("DbgTransportProxyAddress"), "Allows specifying the transport proxy address", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgTrapOnSkip, W("DbgTrapOnSkip"), 0, "Allows breaking when we skip a breakpoint", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgWaitTimeout, W("DbgWaitTimeout"), 1, "Specifies the timeout value for waits", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_DbgWFDETimeout, W("DbgWFDETimeout"), 25, "Specifies the timeout value for wait when waiting for a debug event", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_RaiseExceptionOnAssert, W("RaiseExceptionOnAssert"), 0, "Raise a first chance (if set to 1) or second chance (if set to 2) exception on asserts.", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DebugBreakOnAssert, W("DebugBreakOnAssert"), 0, "If DACCESS_COMPILE is defined, break on asserts.", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DebugBreakOnVerificationFailure, W("DebugBreakOnVerificationFailure"), 0, "Halts the jit on verification failure", CLRConfig::EEConfig_default)
|
||||
CONFIG_STRING_INFO_EX(INTERNAL_DebuggerBreakPoint, W("DebuggerBreakPoint"), "Allows counting various debug events", CLRConfig::EEConfig_default)
|
||||
CONFIG_STRING_INFO_EX(INTERNAL_DebugVerify, W("DebugVerify"), "Control for tracing in peverify", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO(INTERNAL_EncApplyChanges, W("EncApplyChanges"), 0, "Allows breaking when ApplyEditAndContinue is called")
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_EnCBreakOnRemapComplete, W("EnCBreakOnRemapComplete"), 0, "Allows breaking after N RemapCompletes", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_EnCBreakOnRemapOpportunity, W("EnCBreakOnRemapOpportunity"), 0, "Allows breaking after N RemapOpportunities", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_EnCBreakOnRemapComplete, W("EnCBreakOnRemapComplete"), 0, "Allows breaking after N RemapCompletes", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_EnCBreakOnRemapOpportunity, W("EnCBreakOnRemapOpportunity"), 0, "Allows breaking after N RemapOpportunities", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO(INTERNAL_EncDumpApplyChanges, W("EncDumpApplyChanges"), 0, "Allows dumping edits in delta metadata and il files")
|
||||
CONFIG_DWORD_INFO(INTERNAL_EncFixupFieldBreak, W("EncFixupFieldBreak"), 0, "Unlikely that this is used anymore.")
|
||||
CONFIG_DWORD_INFO(INTERNAL_EncJitUpdatedFunction, W("EncJitUpdatedFunction"), 0, "Allows breaking when an updated function is jitted")
|
||||
CONFIG_DWORD_INFO(INTERNAL_EnCResolveField, W("EnCResolveField"), 0, "Allows breaking when computing the address of an EnC-added field")
|
||||
CONFIG_DWORD_INFO(INTERNAL_EncResumeInUpdatedFunction, W("EncResumeInUpdatedFunction"), 0, "Allows breaking when execution resumes in a new EnC version of a function")
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgAssertOnDebuggeeDebugBreak, W("DbgAssertOnDebuggeeDebugBreak"), 0, "If non-zero causes the managed-only debugger to assert on unhandled breakpoints in the debuggee", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgAssertOnDebuggeeDebugBreak, W("DbgAssertOnDebuggeeDebugBreak"), 0, "If non-zero causes the managed-only debugger to assert on unhandled breakpoints in the debuggee", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_DbgDontResumeThreadsOnUnhandledException, W("UNSUPPORTED_DbgDontResumeThreadsOnUnhandledException"), 0, "If non-zero, then don't try to unsuspend threads after continuing a 2nd-chance native exception")
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_DbgSkipStackCheck, W("DbgSkipStackCheck"), 0, "Skip the stack pointer check during stackwalking", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_DbgSkipStackCheck, W("DbgSkipStackCheck"), 0, "Skip the stack pointer check during stackwalking", CLRConfig::EEConfig_default)
|
||||
#ifdef DACCESS_COMPILE
|
||||
CONFIG_DWORD_INFO(INTERNAL_DumpGeneration_IntentionallyCorruptDataFromTarget, W("IntentionallyCorruptDataFromTarget"), 0, "Intentionally fakes bad data retrieved from target to try and break dump generation.")
|
||||
#endif
|
||||
|
@ -232,31 +231,31 @@ CONFIG_DWORD_INFO(UNSUPPORTED_Debugging_RequiredVersion, W("UNSUPPORTED_Debuggin
|
|||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_MiniMdBufferCapacity, W("MiniMdBufferCapacity"), 64 * 1024, "The max size of the buffer to store mini metadata information for triage- and mini-dumps.")
|
||||
#endif // FEATURE_MINIMETADATA_IN_TRIAGEDUMPS
|
||||
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgNativeCodeBpBindsAcrossVersions, W("DbgNativeCodeBpBindsAcrossVersions"), 0, "If non-zero causes native breakpoints at offset 0 to bind in all tiered compilation versions of the given method", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_DbgNativeCodeBpBindsAcrossVersions, W("DbgNativeCodeBpBindsAcrossVersions"), 0, "If non-zero causes native breakpoints at offset 0 to bind in all tiered compilation versions of the given method", CLRConfig::EEConfig_default)
|
||||
|
||||
///
|
||||
/// Diagnostics (internal general-purpose)
|
||||
///
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_ConditionalContracts, W("ConditionalContracts"), "If ENABLE_CONTRACTS_IMPL is defined, sets whether contracts are conditional. (?)")
|
||||
CONFIG_DWORD_INFO(INTERNAL_ConsistencyCheck, W("ConsistencyCheck"), 0, "")
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_ContinueOnAssert, W("ContinueOnAssert"), 0, "If set, doesn't break on asserts.", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_disableStackOverflowProbing, W("disableStackOverflowProbing"), 0, "", CLRConfig::FavorConfigFile)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_ContinueOnAssert, W("ContinueOnAssert"), 0, "If set, doesn't break on asserts.", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_disableStackOverflowProbing, W("disableStackOverflowProbing"), 0, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_InjectFatalError, W("InjectFatalError"), "")
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_InjectFault, W("InjectFault"), 0, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_InjectFault, W("InjectFault"), 0, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_SuppressChecks, W("SuppressChecks"), "")
|
||||
#ifdef WIN64EXCEPTIONS
|
||||
#ifdef FEATURE_EH_FUNCLETS
|
||||
CONFIG_DWORD_INFO(INTERNAL_SuppressLockViolationsOnReentryFromOS, W("SuppressLockViolationsOnReentryFromOS"), 0, "64 bit OOM tests re-enter the CLR via RtlVirtualUnwind. This indicates whether to suppress resulting locking violations.")
|
||||
#endif // WIN64EXCEPTIONS
|
||||
#endif // FEATURE_EH_FUNCLETS
|
||||
|
||||
///
|
||||
/// Exception Handling
|
||||
///
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_AssertOnFailFast, W("AssertOnFailFast"), "")
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_legacyCorruptedStateExceptionsPolicy, W("legacyCorruptedStateExceptionsPolicy"), 0, "Enabled Pre-V4 CSE behavior", CLRConfig::FavorConfigFile)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_SuppressLostExceptionTypeAssert, W("SuppressLostExceptionTypeAssert"), 0, "", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_FailFastOnCorruptedStateException, W("FailFastOnCorruptedStateException"), 0, "Failfast if a CSE is encountered", CLRConfig::FavorConfigFile)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_UseEntryPointFilter, W("UseEntryPointFilter"), 0, "", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_Corhost_Swallow_Uncaught_Exceptions, W("Corhost_Swallow_Uncaught_Exceptions"), 0, "", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_legacyCorruptedStateExceptionsPolicy, W("legacyCorruptedStateExceptionsPolicy"), 0, "Enabled Pre-V4 CSE behavior", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_SuppressLostExceptionTypeAssert, W("SuppressLostExceptionTypeAssert"), 0, "", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_FailFastOnCorruptedStateException, W("FailFastOnCorruptedStateException"), 0, "Failfast if a CSE is encountered", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_UseEntryPointFilter, W("UseEntryPointFilter"), 0, "", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_Corhost_Swallow_Uncaught_Exceptions, W("Corhost_Swallow_Uncaught_Exceptions"), 0, "", CLRConfig::EEConfig_default)
|
||||
|
||||
///
|
||||
/// Garbage collector
|
||||
|
@ -272,83 +271,49 @@ RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_gcConservative, W("gcConservative"), 0, "En
|
|||
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_gcServer, W("gcServer"), 0, "Enables server GC")
|
||||
CONFIG_STRING_INFO(INTERNAL_GcCoverage, W("GcCoverage"), "Specify a method or regular expression of method names to run with GCStress")
|
||||
CONFIG_STRING_INFO(INTERNAL_SkipGCCoverage, W("SkipGcCoverage"), "Specify a list of assembly names to skip with GC Coverage")
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_gcForceCompact, W("gcForceCompact"), "When set to true, always do compacting GC")
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_GCgen0size, W("GCgen0size"), "Specifies the smallest gen0 size")
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_GCGen0MaxBudget, W("GCGen0MaxBudget"), "Specifies the largest gen0 allocation budget")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_GCStressMix, W("GCStressMix"), 0, "Specifies whether the GC mix mode is enabled or not")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_GCStressStep, W("GCStressStep"), 1, "Specifies how often StressHeap will actually do a GC in GCStressMix mode")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_GCStressMaxFGCsPerBGC, W("GCStressMaxFGCsPerBGC"), ~0U, "Specifies how many FGCs will occur during one BGC in GCStressMix mode")
|
||||
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_StatsUpdatePeriod, W("StatsUpdatePeriod"), 60, "Specifies the interval, in seconds, at which to update the statistics")
|
||||
RETAIL_CONFIG_STRING_INFO(UNSUPPORTED_SuspendTimeLog, W("SuspendTimeLog"), "Specifies the name of the log file for suspension statistics")
|
||||
RETAIL_CONFIG_STRING_INFO(UNSUPPORTED_GCMixLog, W("GCMixLog"), "Specifies the name of the log file for GC mix statistics")
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_GCLatencyMode, W("GCLatencyMode"), "Specifies the GC latency mode - batch, interactive or low latency (note that the same thing can be specified via API which is the supported way)")
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCLatencyLevel, W("GCLatencyLevel"), 1, "Specifies the GC latency level that you want to optimize for")
|
||||
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_GCConfigLogEnabled, W("GCConfigLogEnabled"), 0, "Specifies if you want to turn on config logging in GC")
|
||||
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_GCLogEnabled, W("GCLogEnabled"), 0, "Specifies if you want to turn on logging in GC")
|
||||
RETAIL_CONFIG_STRING_INFO(UNSUPPORTED_GCLogFile, W("GCLogFile"), "Specifies the name of the GC log file")
|
||||
RETAIL_CONFIG_STRING_INFO(UNSUPPORTED_GCConfigLogFile, W("GCConfigLogFile"), "Specifies the name of the GC config log file")
|
||||
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_GCLogFileSize, W("GCLogFileSize"), 0, "Specifies the GC log file size")
|
||||
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_GCCompactRatio, W("GCCompactRatio"), 0, "Specifies the ratio compacting GCs vs sweeping ")
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(EXTERNAL_GCPollType, W("GCPollType"), "")
|
||||
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_GCRetainVM, W("GCRetainVM"), 0, "When set we put the segments that should be deleted on a standby list (instead of releasing them back to the OS) which will be considered to satisfy new segment requests (note that the same thing can be specified via API which is the supported way)")
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_GCSegmentSize, W("GCSegmentSize"), "Specifies the managed heap segment size")
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCLOHThreshold, W("GCLOHThreshold"), 0, "Specifies the size that will make objects go on LOH")
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_GCLOHCompact, W("GCLOHCompact"), "Specifies the LOH compaction mode")
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_gcAllowVeryLargeObjects, W("gcAllowVeryLargeObjects"), 1, "Allow allocation of 2GB+ objects on GC heap")
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_GCStress, W("GCStress"), 0, "Trigger GCs at regular intervals", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_GcStressOnDirectCalls, W("GcStressOnDirectCalls"), 0, "Whether to trigger a GC on direct calls", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCStressStart, W("GCStressStart"), 0, "Start GCStress after N stress GCs have been attempted")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_GCStressStartAtJit, W("GCStressStartAtJit"), 0, "Start GCStress after N items are jitted")
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(EXTERNAL_gcTrimCommitOnLowMemory, W("gcTrimCommitOnLowMemory"), "When set we trim the committed space more aggressively for the ephemeral seg. This is used for running many instances of server processes where they want to keep as little memory committed as possible")
|
||||
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_BGCSpinCount, W("BGCSpinCount"), 140, "Specifies the bgc spin count")
|
||||
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_BGCSpin, W("BGCSpin"), 2, "Specifies the bgc spin time")
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_GCStress, W("GCStress"), 0, "Trigger GCs at regular intervals", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_GcStressOnDirectCalls, W("GcStressOnDirectCalls"), 0, "Whether to trigger a GC on direct calls", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_HeapVerify, W("HeapVerify"), "When set verifies the integrity of the managed heap on entry and exit of each GC")
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_SetupGcCoverage, W("SetupGcCoverage"), "This doesn't appear to be a config flag", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_GCNumaAware, W("GCNumaAware"), 1, "Specifies if to enable GC NUMA aware")
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCCpuGroup, W("GCCpuGroup"), 0, "Specifies if to enable GC to support CPU groups")
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCHeapCount, W("GCHeapCount"), 0, "")
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCNoAffinitize, W("GCNoAffinitize"), 0, "")
|
||||
// this config is only in effect if the process is not running in multiple CPU groups.
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(EXTERNAL_GCHeapAffinitizeMask, W("GCHeapAffinitizeMask"), "Specifies processor mask for Server GC threads")
|
||||
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_GCProvModeStress, W("GCProvModeStress"), 0, "Stress the provisional modes")
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCHighMemPercent, W("GCHighMemPercent"), 0, "Specifies the percent for GC to consider as high memory")
|
||||
RETAIL_CONFIG_STRING_INFO(EXTERNAL_GCName, W("GCName"), "")
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(EXTERNAL_GCHeapHardLimit, W("GCHeapHardLimit"), "Specifies the maximum commit size for the GC heap")
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(EXTERNAL_GCHeapHardLimitPercent, W("GCHeapHardLimitPercent"), "Specifies the GC heap usage as a percentage of the total memory")
|
||||
RETAIL_CONFIG_STRING_INFO(EXTERNAL_GCHeapAffinitizeRanges, W("GCHeapAffinitizeRanges"), "Specifies list of processors for Server GC threads. The format is a comma separated list of processor numbers or ranges of processor numbers. Example: 1,3,5,7-9,12")
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(EXTERNAL_GCLargePages, W("GCLargePages"), "Specifies whether large pages should be used when a heap hard limit is set")
|
||||
|
||||
///
|
||||
/// IBC
|
||||
///
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_ConvertIbcData, W("ConvertIbcData"), 1, "Converts between v1 and v2 IBC data", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_ConvertIbcData, W("ConvertIbcData"), 1, "Converts between v1 and v2 IBC data", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_DisableHotCold, W("DisableHotCold"), "Master hot/cold splitting switch in Jit64")
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_DisableIBC, W("DisableIBC"), 0, "Disables the use of IBC data", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_UseIBCFile, W("UseIBCFile"), 0, "", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_DisableIBC, W("DisableIBC"), 0, "Disables the use of IBC data", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_UseIBCFile, W("UseIBCFile"), 0, "", CLRConfig::EEConfig_default)
|
||||
|
||||
|
||||
///
|
||||
/// JIT
|
||||
///
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_JitAlignLoops, W("JitAlignLoops"), "Aligns loop targets to 8 byte boundaries")
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_JitBreakEmit, W("JitBreakEmit"), (DWORD)-1, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_JitBreakEmit, W("JitBreakEmit"), (DWORD)-1, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_JitDebuggable, W("JitDebuggable"), "")
|
||||
#if !defined(DEBUG) && !defined(_DEBUG)
|
||||
#define INTERNAL_JitEnableNoWayAssert_Default 0
|
||||
#else
|
||||
#define INTERNAL_JitEnableNoWayAssert_Default 1
|
||||
#endif
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_JitEnableNoWayAssert, W("JitEnableNoWayAssert"), INTERNAL_JitEnableNoWayAssert_Default, "", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_JitEnableNoWayAssert, W("JitEnableNoWayAssert"), INTERNAL_JitEnableNoWayAssert_Default, "", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_JitFramed, W("JitFramed"), "Forces EBP frames")
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_JitGCStress, W("JitGCStress"), 0, "GC stress mode for jit", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_JitGCStress, W("JitGCStress"), 0, "GC stress mode for jit", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO(INTERNAL_JitHeartbeat, W("JitHeartbeat"), 0, "")
|
||||
CONFIG_DWORD_INFO(INTERNAL_JitHelperLogging, W("JitHelperLogging"), 0, "")
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_JITMinOpts, W("JITMinOpts"), "Forces MinOpts")
|
||||
RETAIL_CONFIG_STRING_INFO(EXTERNAL_JitName, W("JitName"), "Primary Jit to use")
|
||||
#if defined(ALLOW_SXS_JIT)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_AltJitName, W("AltJitName"), "Alternative Jit to use, will fall back to primary jit.", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_AltJit, W("AltJit"), "Enables AltJit and selectively limits it to the specified methods.", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_AltJitExcludeAssemblies, W("AltJitExcludeAssemblies"), "Do not use AltJit on this semicolon-delimited list of assemblies.", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_AltJitName, W("AltJitName"), "Alternative Jit to use, will fall back to primary jit.", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_AltJit, W("AltJit"), "Enables AltJit and selectively limits it to the specified methods.", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_AltJitExcludeAssemblies, W("AltJitExcludeAssemblies"), "Do not use AltJit on this semicolon-delimited list of assemblies.", CLRConfig::EEConfig_default)
|
||||
#endif // defined(ALLOW_SXS_JIT)
|
||||
|
||||
#if defined(FEATURE_STACK_SAMPLING)
|
||||
|
@ -359,49 +324,49 @@ RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_StackSamplingNumMethods, W("StackSamplingNu
|
|||
#endif // defined(FEATURE_JIT_SAMPLING)
|
||||
|
||||
#if defined(ALLOW_SXS_JIT_NGEN)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(INTERNAL_AltJitNgen, W("AltJitNgen"), "Enables AltJit for NGEN and selectively limits it to the specified methods.", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(INTERNAL_AltJitNgen, W("AltJitNgen"), "Enables AltJit for NGEN and selectively limits it to the specified methods.", CLRConfig::EEConfig_default)
|
||||
#endif // defined(ALLOW_SXS_JIT_NGEN)
|
||||
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_JitHostMaxSlabCache, W("JitHostMaxSlabCache"), 0x1000000, "Sets jit host max slab cache size, 16MB default")
|
||||
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(EXTERNAL_JitOptimizeType, W("JitOptimizeType"), "")
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_JitPrintInlinedMethods, W("JitPrintInlinedMethods"), 0, "", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_JitPrintInlinedMethods, W("JitPrintInlinedMethods"), 0, "", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_JitTelemetry, W("JitTelemetry"), 1, "If non-zero, gather JIT telemetry data")
|
||||
RETAIL_CONFIG_STRING_INFO(INTERNAL_JitTimeLogFile, W("JitTimeLogFile"), "If set, gather JIT throughput data and write to this file.")
|
||||
RETAIL_CONFIG_STRING_INFO(INTERNAL_JitTimeLogCsv, W("JitTimeLogCsv"), "If set, gather JIT throughput data and write to a CSV file. This mode must be used in internal retail builds.")
|
||||
RETAIL_CONFIG_STRING_INFO(INTERNAL_JitFuncInfoLogFile, W("JitFuncInfoLogFile"), "If set, gather JIT function info and write to this file.")
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_JitVerificationDisable, W("JitVerificationDisable"), "")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_JitLockWrite, W("JitLockWrite"), 0, "Force all volatile writes to be 'locked'")
|
||||
CONFIG_STRING_INFO_EX(INTERNAL_TailCallMax, W("TailCallMax"), "", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_TailCallOpt, W("TailCallOpt"), "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_STRING_INFO_EX(INTERNAL_TailCallMax, W("TailCallMax"), "", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_TailCallOpt, W("TailCallOpt"), "", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_TailCallLoopOpt, W("TailCallLoopOpt"), 1, "Convert recursive tail calls to loops")
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_Jit_NetFx40PInvokeStackResilience, W("NetFx40_PInvokeStackResilience"), (DWORD)-1, "Makes P/Invoke resilient against mismatched signature and calling convention (significant perf penalty).")
|
||||
|
||||
// AltJitAssertOnNYI should be 0 on targets where JIT is under development or bring up stage, so as to facilitate fallback to main JIT on hitting a NYI.
|
||||
#if defined(_TARGET_X86_)
|
||||
#if defined(TARGET_X86)
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_AltJitAssertOnNYI, W("AltJitAssertOnNYI"), 0, "Controls the AltJit behavior of NYI stuff")
|
||||
#else
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_AltJitAssertOnNYI, W("AltJitAssertOnNYI"), 1, "Controls the AltJit behavior of NYI stuff")
|
||||
#endif
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_JitLargeBranches, W("JitLargeBranches"), 0, "Force using the largest conditional branch format", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_JitRegisterFP, W("JitRegisterFP"), 3, "Control FP enregistration", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_JitLargeBranches, W("JitLargeBranches"), 0, "Force using the largest conditional branch format", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_JitRegisterFP, W("JitRegisterFP"), 3, "Control FP enregistration", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_JitELTHookEnabled, W("JitELTHookEnabled"), 0, "On ARM, setting this will emit Enter/Leave/TailCall callbacks")
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_JitMemStats, W("JitMemStats"), 0, "Display JIT memory usage statistics", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_JitMemStats, W("JitMemStats"), 0, "Display JIT memory usage statistics", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_JitVNMapSelBudget, W("JitVNMapSelBudget"), 100, "Max # of MapSelect's considered for a particular top-level invocation.")
|
||||
#if defined(_TARGET_AMD64_) || defined(_TARGET_X86_) || defined(_TARGET_ARM64_)
|
||||
#if defined(TARGET_AMD64) || defined(TARGET_X86) || defined(TARGET_ARM64)
|
||||
#define EXTERNAL_FeatureSIMD_Default 1
|
||||
#else // !(defined(_TARGET_AMD64_) || defined(_TARGET_X86_) || defined(_TARGET_ARM64_))
|
||||
#else // !(defined(TARGET_AMD64) || defined(TARGET_X86) || defined(TARGET_ARM64))
|
||||
#define EXTERNAL_FeatureSIMD_Default 0
|
||||
#endif // !(defined(_TARGET_AMD64_) || defined(_TARGET_X86_) || defined(_TARGET_ARM64_))
|
||||
#if defined(_TARGET_AMD64_) || defined(_TARGET_X86_)
|
||||
#endif // !(defined(TARGET_AMD64) || defined(TARGET_X86) || defined(TARGET_ARM64))
|
||||
#if defined(TARGET_AMD64) || defined(TARGET_X86)
|
||||
#define EXTERNAL_JitEnableAVX_Default 1
|
||||
#else // !(defined(_TARGET_AMD64_) || defined(_TARGET_X86_)
|
||||
#else // !(defined(TARGET_AMD64) || defined(TARGET_X86)
|
||||
#define EXTERNAL_JitEnableAVX_Default 0
|
||||
#endif // !(defined(_TARGET_AMD64_) || defined(_TARGET_X86_)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_FeatureSIMD, W("FeatureSIMD"), EXTERNAL_FeatureSIMD_Default, "Enable SIMD intrinsics recognition in System.Numerics.dll and/or System.Numerics.Vectors.dll", CLRConfig::REGUTIL_default)
|
||||
#endif // !(defined(TARGET_AMD64) || defined(TARGET_X86)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_FeatureSIMD, W("FeatureSIMD"), EXTERNAL_FeatureSIMD_Default, "Enable SIMD intrinsics recognition in System.Numerics.dll and/or System.Numerics.Vectors.dll", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_SIMD16ByteOnly, W("SIMD16ByteOnly"), 0, "Limit maximum SIMD vector length to 16 bytes (used by x64_arm64_altjit)")
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_EnableAVX, W("EnableAVX"), EXTERNAL_JitEnableAVX_Default, "Enable AVX instruction set for wide operations as default", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_TrackDynamicMethodDebugInfo, W("TrackDynamicMethodDebugInfo"), 0, "Specifies whether debug info should be generated and tracked for dynamic methods", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_EnableAVX, W("EnableAVX"), EXTERNAL_JitEnableAVX_Default, "Enable AVX instruction set for wide operations as default", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_TrackDynamicMethodDebugInfo, W("TrackDynamicMethodDebugInfo"), 0, "Specifies whether debug info should be generated and tracked for dynamic methods", CLRConfig::EEConfig_default)
|
||||
|
||||
#ifdef FEATURE_MULTICOREJIT
|
||||
|
||||
|
@ -414,18 +379,18 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_MultiCoreJitProfileWriteDelay, W("MultiCoreJit
|
|||
///
|
||||
/// Interpreter
|
||||
///
|
||||
RETAIL_CONFIG_STRING_INFO_EX(INTERNAL_Interpret, W("Interpret"), "Selectively uses the interpreter to execute the specified methods", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(INTERNAL_InterpretExclude, W("InterpretExclude"), "Excludes the specified methods from the set selected by 'Interpret'", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(INTERNAL_Interpret, W("Interpret"), "Selectively uses the interpreter to execute the specified methods", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(INTERNAL_InterpretExclude, W("InterpretExclude"), "Excludes the specified methods from the set selected by 'Interpret'", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterMethHashMin, W("InterpreterMethHashMin"), 0, "Only interpret methods selected by 'Interpret' whose hash is at least this value. or after nth")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterMethHashMax, W("InterpreterMethHashMax"), UINT32_MAX, "If non-zero, only interpret methods selected by 'Interpret' whose hash is at most this value")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterStubMin, W("InterpreterStubMin"), 0, "Only interpret methods selected by 'Interpret' whose stub num is at least this value.")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterStubMax, W("InterpreterStubMax"), UINT32_MAX, "If non-zero, only interpret methods selected by 'Interpret' whose stub number is at most this value.")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterJITThreshold, W("InterpreterJITThreshold"), 10, "The number of times a method should be interpreted before being JITted")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterDoLoopMethods, W("InterpreterDoLoopMethods"), 0, "If set, don't check for loops, start by interpreting *all* methods")
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_InterpreterUseCaching, W("InterpreterUseCaching"), 1, "If non-zero, use the caching mechanism.", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_InterpreterLooseRules, W("InterpreterLooseRules"), 1, "If non-zero, allow ECMA spec violations required by managed C++.", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_InterpreterUseCaching, W("InterpreterUseCaching"), 1, "If non-zero, use the caching mechanism.", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_InterpreterLooseRules, W("InterpreterLooseRules"), 1, "If non-zero, allow ECMA spec violations required by managed C++.", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterPrintPostMortem, W("InterpreterPrintPostMortem"), 0, "Prints summary information about the execution to the console")
|
||||
RETAIL_CONFIG_STRING_INFO_EX(INTERNAL_InterpreterLogFile, W("InterpreterLogFile"), "If non-null, append interpreter logging to this file, else use stdout", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(INTERNAL_InterpreterLogFile, W("InterpreterLogFile"), "If non-null, append interpreter logging to this file, else use stdout", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_DumpInterpreterStubs, W("DumpInterpreterStubs"), 0, "Prints all interpreter stubs that are created to the console")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_TraceInterpreterEntries, W("TraceInterpreterEntries"), 0, "Logs entries to interpreted methods to the console")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_TraceInterpreterIL, W("TraceInterpreterIL"), 0, "Logs individual instructions of interpreted methods to the console")
|
||||
|
@ -439,15 +404,12 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterFallback, W("InterpreterFallback"),
|
|||
///
|
||||
/// Loader
|
||||
///
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_APIThreadStress, W("APIThreadStress"), "Used to test Loader for race conditions")
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(EXTERNAL_ForceLog, W("ForceLog"), "Fusion flag to enforce assembly binding log. Heavily used and documented in MSDN and BLOGS.")
|
||||
RETAIL_CONFIG_STRING_INFO(INTERNAL_CoreClrBinderLog, W("CoreClrBinderLog"), "Debug flag that enabled detailed log for new binder (similar to stress logging).")
|
||||
RETAIL_CONFIG_STRING_INFO(INTERNAL_WinMDPath, W("WinMDPath"), "Path for Windows WinMD files")
|
||||
|
||||
///
|
||||
/// Loader heap
|
||||
///
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_LoaderHeapCallTracing, W("LoaderHeapCallTracing"), 0, "Loader heap troubleshooting", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_LoaderHeapCallTracing, W("LoaderHeapCallTracing"), 0, "Loader heap troubleshooting", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_CodeHeapReserveForJumpStubs, W("CodeHeapReserveForJumpStubs"), 1, "Percentage of code heap to reserve for jump stubs")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_NGenReserveForJumpStubs, W("NGenReserveForJumpStubs"), 0, "Percentage of ngen image size to reserve for jump stubs")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_BreakOnOutOfMemoryWithinRange, W("BreakOnOutOfMemoryWithinRange"), 0, "Break before out of memory within range exception is thrown")
|
||||
|
@ -459,11 +421,10 @@ RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_LogEnable, W("LogEnable"), "Turn
|
|||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_LogFacility, W("LogFacility"), "Specifies a facility mask for CLR log. (See 'loglf.h'; VM interprets string value as hex number.) Also used by stresslog.")
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_LogFacility2, W("LogFacility2"), "Specifies a facility mask for CLR log. (See 'loglf.h'; VM interprets string value as hex number.) Also used by stresslog.")
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_logFatalError, W("logFatalError"), 1, "Specifies whether EventReporter logs fatal errors in the Windows event log.")
|
||||
CONFIG_STRING_INFO_EX(INTERNAL_LogFile, W("LogFile"), "Specifies a file name for the CLR log.", CLRConfig::REGUTIL_default)
|
||||
CONFIG_STRING_INFO_EX(INTERNAL_LogFile, W("LogFile"), "Specifies a file name for the CLR log.", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_LogFileAppend, W("LogFileAppend"), "Specifies whether to append to or replace the CLR log file.")
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_LogFlushFile, W("LogFlushFile"), "Specifies whether to flush the CLR log file on each write.")
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(EXTERNAL_LogLevel, W("LogLevel"), "4=10 msgs, 9=1000000, 10=everything")
|
||||
RETAIL_CONFIG_STRING_INFO_DIRECT_ACCESS(INTERNAL_LogPath, W("LogPath"), "?Fusion debug log path.")
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_LogToConsole, W("LogToConsole"), "Writes the CLR log to console.")
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_LogToDebugger, W("LogToDebugger"), "Writes the CLR log to debugger (OutputDebugStringA).")
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_LogToFile, W("LogToFile"), "Writes the CLR log to a file.")
|
||||
|
@ -472,22 +433,22 @@ CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_LogWithPid, W("LogWithPid"), "Appends p
|
|||
///
|
||||
/// MetaData
|
||||
///
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_MD_ApplyDeltaBreak, W("MD_ApplyDeltaBreak"), 0, "ASSERT when applying EnC", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_MD_ApplyDeltaBreak, W("MD_ApplyDeltaBreak"), 0, "ASSERT when applying EnC", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_AssertOnBadImageFormat, W("AssertOnBadImageFormat"), "ASSERT when invalid MD read")
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_MD_DeltaCheck, W("MD_DeltaCheck"), 1, "Some checks of GUID when applying EnC (?)", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_MD_EncDelta, W("MD_EncDelta"), 0, "Forces EnC Delta format in MD (?)", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_MD_ForceNoColDesSharing, W("MD_ForceNoColDesSharing"), 0, "Don't know - the only usage I could find is #if 0 (?)", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_MD_KeepKnownCA, W("MD_KeepKnownCA"), 0, "Something with known CAs (?)", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_MD_MiniMDBreak, W("MD_MiniMDBreak"), 0, "ASSERT when creating CMiniMdRw class", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_MD_PreSaveBreak, W("MD_PreSaveBreak"), 0, "ASSERT when calling CMiniMdRw::PreSave", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_MD_RegMetaBreak, W("MD_RegMetaBreak"), 0, "ASSERT when creating RegMeta class", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_MD_RegMetaDump, W("MD_RegMetaDump"), 0, "Dump MD in 4 functions (?)", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_MD_DeltaCheck, W("MD_DeltaCheck"), 1, "Some checks of GUID when applying EnC (?)", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_MD_EncDelta, W("MD_EncDelta"), 0, "Forces EnC Delta format in MD (?)", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_MD_ForceNoColDesSharing, W("MD_ForceNoColDesSharing"), 0, "Don't know - the only usage I could find is #if 0 (?)", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_MD_KeepKnownCA, W("MD_KeepKnownCA"), 0, "Something with known CAs (?)", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_MD_MiniMDBreak, W("MD_MiniMDBreak"), 0, "ASSERT when creating CMiniMdRw class", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_MD_PreSaveBreak, W("MD_PreSaveBreak"), 0, "ASSERT when calling CMiniMdRw::PreSave", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_MD_RegMetaBreak, W("MD_RegMetaBreak"), 0, "ASSERT when creating RegMeta class", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_MD_RegMetaDump, W("MD_RegMetaDump"), 0, "Dump MD in 4 functions (?)", CLRConfig::EEConfig_default)
|
||||
// MetaData - Desktop-only
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_MD_WinMD_Disable, W("MD_WinMD_Disable"), 0, "Never activate the WinMD import adapter", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_MD_WinMD_AssertOnIllegalUsage, W("MD_WinMD_AssertOnIllegalUsage"), 0, "ASSERT if a WinMD import adapter detects a tool incompatibility", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_MD_WinMD_Disable, W("MD_WinMD_Disable"), 0, "Never activate the WinMD import adapter", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_MD_WinMD_AssertOnIllegalUsage, W("MD_WinMD_AssertOnIllegalUsage"), 0, "ASSERT if a WinMD import adapter detects a tool incompatibility", CLRConfig::EEConfig_default)
|
||||
|
||||
// Metadata - mscordbi only - this flag is only intended to mitigate potential issues in bug fix 458597.
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_MD_PreserveDebuggerMetadataMemory, W("MD_PreserveDebuggerMetadataMemory"), 0, "Save all versions of metadata memory in the debugger when debuggee metadata is updated", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_MD_PreserveDebuggerMetadataMemory, W("MD_PreserveDebuggerMetadataMemory"), 0, "Save all versions of metadata memory in the debugger when debuggee metadata is updated", CLRConfig::EEConfig_default)
|
||||
|
||||
///
|
||||
/// Spinning heuristics
|
||||
|
@ -509,20 +470,20 @@ CONFIG_DWORD_INFO(INTERNAL_NgenBind_ZapForbid, W("NgenBind_ZapForbid
|
|||
CONFIG_STRING_INFO(INTERNAL_NgenBind_ZapForbidExcludeList, W("NgenBind_ZapForbidExcludeList"), "")
|
||||
CONFIG_STRING_INFO(INTERNAL_NgenBind_ZapForbidList, W("NgenBind_ZapForbidList"), "")
|
||||
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_SymDiffDump, W("SymDiffDump"), 0, "Used to create the map file while binding the assembly. Used by SemanticDiffer", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_SymDiffDump, W("SymDiffDump"), 0, "Used to create the map file while binding the assembly. Used by SemanticDiffer", CLRConfig::EEConfig_default)
|
||||
|
||||
///
|
||||
/// NGEN
|
||||
///
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_NGen_JitName, W("NGen_JitName"), "", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_NGenFramed, W("NGenFramed"), (DWORD)-1, "Same as JitFramed, but for ngen", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_NGenOnlyOneMethod, W("NGenOnlyOneMethod"), 0, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_NgenOrder, W("NgenOrder"), 0, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_partialNGenStress, W("partialNGenStress"), 0, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_ZapDoNothing, W("ZapDoNothing"), 0, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_NgenForceFailureMask, W("NgenForceFailureMask"), (DWORD)-1, "Bitmask used to control which locations will check and raise the failure (defaults to bits: -1)", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_NgenForceFailureCount, W("NgenForceFailureCount"), 0, "If set to >0 and we have IBC data we will force a failure after we reference an IBC data item <value> times", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_NgenForceFailureKind, W("NgenForceFailureKind"), 1, "If set to 1, We will throw a TypeLoad exception; If set to 2, We will cause an A/V", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_NGen_JitName, W("NGen_JitName"), "", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_NGenFramed, W("NGenFramed"), (DWORD)-1, "Same as JitFramed, but for ngen", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_NGenOnlyOneMethod, W("NGenOnlyOneMethod"), 0, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_NgenOrder, W("NgenOrder"), 0, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_partialNGenStress, W("partialNGenStress"), 0, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_ZapDoNothing, W("ZapDoNothing"), 0, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_NgenForceFailureMask, W("NgenForceFailureMask"), (DWORD)-1, "Bitmask used to control which locations will check and raise the failure (defaults to bits: -1)", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_NgenForceFailureCount, W("NgenForceFailureCount"), 0, "If set to >0 and we have IBC data we will force a failure after we reference an IBC data item <value> times", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_NgenForceFailureKind, W("NgenForceFailureKind"), 1, "If set to 1, We will throw a TypeLoad exception; If set to 2, We will cause an A/V", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_NGenEnableCreatePdb, W("NGenEnableCreatePdb"), 0, "If set to >0 ngen.exe displays help on, recognizes createpdb in the command line")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_NGenSimulateDiskFull, W("NGenSimulateDiskFull"), 0, "If set to 1, ngen will throw a Disk full exception in ZapWriter.cpp:Save()")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_PartialNGen, W("PartialNGen"), (DWORD)-1, "Generate partial NGen images")
|
||||
|
@ -536,17 +497,17 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_CrossGenAssumeInputSigned, W("CrossGenAssumeIn
|
|||
///
|
||||
/// Profiling API / ETW
|
||||
///
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_COR_ENABLE_PROFILING, W("COR_ENABLE_PROFILING"), 0, "Flag to indicate whether profiling should be enabled for the currently running process.", CLRConfig::DontPrependCOMPlus_ | CLRConfig::IgnoreConfigFiles)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_COR_ENABLE_PROFILING, W("COR_ENABLE_PROFILING"), 0, "Flag to indicate whether profiling should be enabled for the currently running process.", CLRConfig::DontPrependCOMPlus_)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_COR_PROFILER, W("COR_PROFILER"), "Specifies GUID of profiler to load into currently running process", CLRConfig::DontPrependCOMPlus_)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_COR_PROFILER_PATH, W("COR_PROFILER_PATH"), "Specifies the path to the DLL of profiler to load into currently running process", CLRConfig::DontPrependCOMPlus_)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_COR_PROFILER_PATH_32, W("COR_PROFILER_PATH_32"), "Specifies the path to the DLL of profiler to load into currently running 32 bits process", CLRConfig::DontPrependCOMPlus_)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_COR_PROFILER_PATH_64, W("COR_PROFILER_PATH_64"), "Specifies the path to the DLL of profiler to load into currently running 64 bits process", CLRConfig::DontPrependCOMPlus_)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_CORECLR_ENABLE_PROFILING, W("CORECLR_ENABLE_PROFILING"), 0, "CoreCLR only: Flag to indicate whether profiling should be enabled for the currently running process.", CLRConfig::DontPrependCOMPlus_ | CLRConfig::IgnoreConfigFiles)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_CORECLR_ENABLE_PROFILING, W("CORECLR_ENABLE_PROFILING"), 0, "CoreCLR only: Flag to indicate whether profiling should be enabled for the currently running process.", CLRConfig::DontPrependCOMPlus_)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER, W("CORECLR_PROFILER"), "CoreCLR only: Specifies GUID of profiler to load into currently running process", CLRConfig::DontPrependCOMPlus_)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER_PATH, W("CORECLR_PROFILER_PATH"), "CoreCLR only: Specifies the path to the DLL of profiler to load into currently running process", CLRConfig::DontPrependCOMPlus_)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER_PATH_32, W("CORECLR_PROFILER_PATH_32"), "CoreCLR only: Specifies the path to the DLL of profiler to load into currently running 32 process", CLRConfig::DontPrependCOMPlus_)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER_PATH_64, W("CORECLR_PROFILER_PATH_64"), "CoreCLR only: Specifies the path to the DLL of profiler to load into currently running 64 process", CLRConfig::DontPrependCOMPlus_)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_ProfAPI_ProfilerCompatibilitySetting, W("ProfAPI_ProfilerCompatibilitySetting"), "Specifies the profiler loading policy (the default is not to load a V2 profiler in V4)", CLRConfig::REGUTIL_default | CLRConfig::TrimWhiteSpaceFromStringValue)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_ProfAPI_ProfilerCompatibilitySetting, W("ProfAPI_ProfilerCompatibilitySetting"), "Specifies the profiler loading policy (the default is not to load a V2 profiler in V4)", CLRConfig::EEConfig_default | CLRConfig::TrimWhiteSpaceFromStringValue)
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_ProfAPI_DetachMinSleepMs, W("ProfAPI_DetachMinSleepMs"), 0, "The minimum time, in milliseconds, the CLR will wait before checking whether a profiler that is in the process of detaching is ready to be unloaded.")
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_ProfAPI_DetachMaxSleepMs, W("ProfAPI_DetachMaxSleepMs"), 0, "The maximum time, in milliseconds, the CLR will wait before checking whether a profiler that is in the process of detaching is ready to be unloaded.")
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_ProfAPI_RejitOnAttach, W("ProfApi_RejitOnAttach"), 1, "Enables the ability for profilers to rejit methods on attach.")
|
||||
|
@ -558,13 +519,15 @@ CONFIG_DWORD_INFO(INTERNAL_TestOnlyEnableICorProfilerInfo, W("ProfAPI_TestOnlyEn
|
|||
CONFIG_DWORD_INFO(INTERNAL_TestOnlyEnableObjectAllocatedHook, W("TestOnlyEnableObjectAllocatedHook"), 0, "Test-only flag that forces CLR to initialize on startup as if ObjectAllocated callback were requested, to enable post-attach ObjectAllocated functionality.")
|
||||
CONFIG_DWORD_INFO(INTERNAL_TestOnlyEnableSlowELTHooks, W("TestOnlyEnableSlowELTHooks"), 0, "Test-only flag that forces CLR to initialize on startup as if slow-ELT were requested, to enable post-attach ELT functionality.")
|
||||
|
||||
RETAIL_CONFIG_STRING_INFO_EX(UNSUPPORTED_ETW_ObjectAllocationEventsPerTypePerSec, W("ETW_ObjectAllocationEventsPerTypePerSec"), "Desired number of GCSampledObjectAllocation ETW events to be logged per type per second. If 0, then the default built in to the implementation for the enabled event (e.g., High, Low), will be used.", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(UNSUPPORTED_ETW_ObjectAllocationEventsPerTypePerSec, W("ETW_ObjectAllocationEventsPerTypePerSec"), "Desired number of GCSampledObjectAllocation ETW events to be logged per type per second. If 0, then the default built in to the implementation for the enabled event (e.g., High, Low), will be used.", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_ProfAPI_ValidateNGENInstrumentation, W("ProfAPI_ValidateNGENInstrumentation"), 0, "This flag enables additional validations when using the IMetaDataEmit APIs for NGEN'ed images to ensure only supported edits are made.")
|
||||
|
||||
#ifdef FEATURE_PERFMAP
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_PerfMapEnabled, W("PerfMapEnabled"), 0, "This flag is used on Linux to enable writing /tmp/perf-$pid.map. It is disabled by default", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_PerfMapIgnoreSignal, W("PerfMapIgnoreSignal"), 0, "When perf map is enabled, this option will configure the specified signal to be accepted and ignored as a marker in the perf logs. It is disabled by default", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_PerfMapEnabled, W("PerfMapEnabled"), 0, "This flag is used on Linux to enable writing /tmp/perf-$pid.map. It is disabled by default", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_PerfMapJitDumpPath, W("PerfMapJitDumpPath"), "Specifies a path to write the perf jitdump file. Defaults to GetTempPathA()", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_PerfMapIgnoreSignal, W("PerfMapIgnoreSignal"), 0, "When perf map is enabled, this option will configure the specified signal to be accepted and ignored as a marker in the perf logs. It is disabled by default", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_PerfMapShowOptimizationTiers, W("PerfMapShowOptimizationTiers"), 1, "Shows optimization tiers in the perf map for methods, as part of the symbol name. Useful for seeing separate stack frames for different optimization tiers of each method.")
|
||||
RETAIL_CONFIG_STRING_INFO(EXTERNAL_NativeImagePerfMapFormat, W("NativeImagePerfMapFormat"), "Specifies the format of native image perfmap files generated by crossgen. Valid options are RVA or OFFSET.")
|
||||
#endif
|
||||
|
||||
RETAIL_CONFIG_STRING_INFO(EXTERNAL_StartupDelayMS, W("StartupDelayMS"), "")
|
||||
|
@ -572,12 +535,11 @@ RETAIL_CONFIG_STRING_INFO(EXTERNAL_StartupDelayMS, W("StartupDelayMS"), "")
|
|||
///
|
||||
/// Stress
|
||||
///
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_StressCOMCall, W("StressCOMCall"), 0, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_StressCOMCall, W("StressCOMCall"), 0, "", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_StressLog, W("StressLog"), "Turns on the stress log.")
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_ForceEnc, W("ForceEnc"), "Forces Edit and Continue to be on for all eligible modules.")
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_StressLogSize, W("StressLogSize"), "Stress log size in bytes per thread.")
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_StressOn, W("StressOn"), "Enables the STRESS_ASSERT macro that stops runtime quickly (to prevent the clr state from changing significantly before breaking)")
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_stressSynchronized, W("stressSynchronized"), 0, "Unknown if or where this is used; unless a test is specifically depending on this, it can be removed.", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_stressSynchronized, W("stressSynchronized"), 0, "Unknown if or where this is used; unless a test is specifically depending on this, it can be removed.", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(EXTERNAL_StressThreadCount, W("StressThreadCount"), "")
|
||||
|
||||
///
|
||||
|
@ -603,12 +565,12 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_ForceMaxWorkerThreads, W("ThreadPoo
|
|||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_DisableStarvationDetection, W("ThreadPool_DisableStarvationDetection"), 0, "Disables the ThreadPool feature that forces new threads to be added when workitems run for too long")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_DebugBreakOnWorkerStarvation, W("ThreadPool_DebugBreakOnWorkerStarvation"), 0, "Breaks into the debugger if the ThreadPool detects work queue starvation")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_EnableWorkerTracking, W("ThreadPool_EnableWorkerTracking"), 0, "Enables extra expensive tracking of how many workers threads are working simultaneously")
|
||||
#ifdef _TARGET_ARM64_
|
||||
#ifdef TARGET_ARM64
|
||||
// Spinning scheme is currently different on ARM64, see CLRLifoSemaphore::Wait(DWORD, UINT32, UINT32)
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_UnfairSemaphoreSpinLimit, W("ThreadPool_UnfairSemaphoreSpinLimit"), 0x32, "Maximum number of spins per processor a thread pool worker thread performs before waiting for work")
|
||||
#else // !_TARGET_ARM64_
|
||||
#else // !TARGET_ARM64
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_UnfairSemaphoreSpinLimit, W("ThreadPool_UnfairSemaphoreSpinLimit"), 0x46, "Maximum number of spins a thread pool worker thread performs before waiting for work")
|
||||
#endif // _TARGET_ARM64_
|
||||
#endif // TARGET_ARM64
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_Thread_UseAllCpuGroups, W("Thread_UseAllCpuGroups"), 0, "Specifies if to automatically distribute thread across CPU Groups")
|
||||
|
||||
CONFIG_DWORD_INFO(INTERNAL_ThreadpoolTickCountAdjustment, W("ThreadpoolTickCountAdjustment"), 0, "")
|
||||
|
@ -635,10 +597,27 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_HillClimbing_GainExponent,
|
|||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_TieredCompilation, W("TieredCompilation"), 1, "Enables tiered compilation")
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_TC_QuickJit, W("TC_QuickJit"), 1, "For methods that would be jitted, enable using quick JIT when appropriate.")
|
||||
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_TC_QuickJitForLoops, W("TC_QuickJitForLoops"), 0, "When quick JIT is enabled, quick JIT may also be used for methods that contain loops.")
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_TC_AggressiveTiering, W("TC_AggressiveTiering"), 0, "Transition through tiers aggressively.")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_TC_CallCountThreshold, W("TC_CallCountThreshold"), 30, "Number of times a method must be called in tier 0 after which it is promoted to the next tier.")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_TC_CallCountingDelayMs, W("TC_CallCountingDelayMs"), 100, "A perpetual delay in milliseconds that is applied call counting in tier 0 and jitting at higher tiers, while there is startup-like activity.")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_TC_DelaySingleProcMultiplier, W("TC_DelaySingleProcMultiplier"), 10, "Multiplier for TC_CallCountingDelayMs that is applied on a single-processor machine or when the process is affinitized to a single processor.")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_TC_CallCounting, W("TC_CallCounting"), 1, "Enabled by default (only activates when TieredCompilation is also enabled). If disabled immediately backpatches prestub, and likely prevents any promotion to higher tiers")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_TC_UseCallCountingStubs, W("TC_UseCallCountingStubs"), 1, "Uses call counting stubs for faster call counting.")
|
||||
#ifdef _DEBUG
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_TC_DeleteCallCountingStubsAfter, W("TC_DeleteCallCountingStubsAfter"), 1, "Deletes call counting stubs after this many have completed. Zero to disable deleting.")
|
||||
#else
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_TC_DeleteCallCountingStubsAfter, W("TC_DeleteCallCountingStubsAfter"), 4096, "Deletes call counting stubs after this many have completed. Zero to disable deleting.")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
///
|
||||
/// On-Stack Replacement
|
||||
///
|
||||
#ifdef FEATURE_ON_STACK_REPLACEMENT
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_OSR_CounterBump, W("OSR_CounterBump"), 1000, "Counter reload value when a patchpoint is hit")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_OSR_HitLimit, W("OSR_HitLimit"), 10, "Number of times a patchpoint must call back to trigger an OSR transition")
|
||||
CONFIG_DWORD_INFO(INTERNAL_OSR_LowId, W("OSR_LowId"), (DWORD)-1, "Low end of enabled patchpoint range (inclusive)");
|
||||
CONFIG_DWORD_INFO(INTERNAL_OSR_HighId, W("OSR_HighId"), 10000000, "High end of enabled patchpoint range (inclusive)");
|
||||
#endif
|
||||
|
||||
///
|
||||
|
@ -656,37 +635,40 @@ CONFIG_DWORD_INFO(INTERNAL_TypeLoader_InjectInterfaceDuplicates, W("INTERNAL_Typ
|
|||
///
|
||||
/// Virtual call stubs
|
||||
///
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubCollideMonoPct, W("VirtualCallStubCollideMonoPct"), 0, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubCollideWritePct, W("VirtualCallStubCollideWritePct"), 100, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubDumpLogCounter, W("VirtualCallStubDumpLogCounter"), 0, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubDumpLogIncr, W("VirtualCallStubDumpLogIncr"), 0, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_VirtualCallStubLogging, W("VirtualCallStubLogging"), 0, "Worth keeping, but should be moved into \"#ifdef STUB_LOGGING\" blocks. This goes for most (or all) of the stub logging infrastructure.", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubMissCount, W("VirtualCallStubMissCount"), 100, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubResetCacheCounter, W("VirtualCallStubResetCacheCounter"), 0, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubResetCacheIncr, W("VirtualCallStubResetCacheIncr"), 0, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubCollideMonoPct, W("VirtualCallStubCollideMonoPct"), 0, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubCollideWritePct, W("VirtualCallStubCollideWritePct"), 100, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubDumpLogCounter, W("VirtualCallStubDumpLogCounter"), 0, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubDumpLogIncr, W("VirtualCallStubDumpLogIncr"), 0, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_VirtualCallStubLogging, W("VirtualCallStubLogging"), 0, "Worth keeping, but should be moved into \"#ifdef STUB_LOGGING\" blocks. This goes for most (or all) of the stub logging infrastructure.", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubMissCount, W("VirtualCallStubMissCount"), 100, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubResetCacheCounter, W("VirtualCallStubResetCacheCounter"), 0, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubResetCacheIncr, W("VirtualCallStubResetCacheIncr"), 0, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::EEConfig_default)
|
||||
|
||||
///
|
||||
/// Watson
|
||||
///
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_DisableWatsonForManagedExceptions, W("DisableWatsonForManagedExceptions"), 0, "Disable Watson and debugger launching for managed exceptions")
|
||||
|
||||
///
|
||||
/// Dump generation
|
||||
///
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_DbgEnableMiniDump, W("DbgEnableMiniDump"), 0, "Enable unhandled exception crash dump generation")
|
||||
RETAIL_CONFIG_STRING_INFO(INTERNAL_DbgMiniDumpName, W("DbgMiniDumpName"), "Crash dump name")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_DbgMiniDumpType, W("DbgMiniDumpType"), 0, "Crash dump type: 1 normal, 2 withheap, 3 triage, 4 full")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_CreateDumpDiagnostics, W("CreateDumpDiagnostics"), 0, "Enable crash dump generation diagnostic logging")
|
||||
|
||||
///
|
||||
/// Zap
|
||||
///
|
||||
RETAIL_CONFIG_STRING_INFO_EX(INTERNAL_ZapBBInstr, W("ZapBBInstr"), "", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(INTERNAL_ZapBBInstr, W("ZapBBInstr"), "", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_STRING_INFO(EXTERNAL_ZapBBInstrDir, W("ZapBBInstrDir"), "")
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_ZapDisable, W("ZapDisable"), 0, "")
|
||||
CONFIG_STRING_INFO_EX(INTERNAL_ZapExclude, W("ZapExclude"), "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_STRING_INFO_EX(INTERNAL_ZapOnly, W("ZapOnly"), "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_STRING_INFO_EX(INTERNAL_ZapExclude, W("ZapExclude"), "", CLRConfig::EEConfig_default)
|
||||
CONFIG_STRING_INFO_EX(INTERNAL_ZapOnly, W("ZapOnly"), "", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(EXTERNAL_ZapRequire, W("ZapRequire"), "")
|
||||
RETAIL_CONFIG_STRING_INFO(EXTERNAL_ZapRequireExcludeList, W("ZapRequireExcludeList"), "")
|
||||
RETAIL_CONFIG_STRING_INFO(EXTERNAL_ZapRequireList, W("ZapRequireList"), "")
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_ZapSet, W("ZapSet"), "", CLRConfig::REGUTIL_default)
|
||||
|
||||
#ifdef FEATURE_LAZY_COW_PAGES
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_ZapLazyCOWPagesEnabled, W("ZapLazyCOWPagesEnabled"), 1, "");
|
||||
CONFIG_DWORD_INFO(INTERNAL_DebugAssertOnMissedCOWPage, W("DebugAssertOnMissedCOWPage"), 1, "");
|
||||
#endif //FEATURE_LAZY_COW_PAGES
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_ZapSet, W("ZapSet"), "", CLRConfig::EEConfig_default)
|
||||
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_ReadyToRun, W("ReadyToRun"), 1, "Enable/disable use of ReadyToRun native code") // On by default for CoreCLR
|
||||
RETAIL_CONFIG_STRING_INFO(EXTERNAL_ReadyToRunExcludeList, W("ReadyToRunExcludeList"), "List of assemblies that cannot use Ready to Run images")
|
||||
|
@ -702,7 +684,7 @@ RETAIL_CONFIG_STRING_INFO(INTERNAL_EventNameFilter, W("EventNameFilter"), "")
|
|||
/// Interop
|
||||
///
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_ExposeExceptionsInCOM, W("ExposeExceptionsInCOM"), "")
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_PInvokeInline, W("PInvokeInline"), "", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_PInvokeInline, W("PInvokeInline"), "", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_InteropValidatePinnedObjects, W("InteropValidatePinnedObjects"), 0, "After returning from a managed-to-unmanaged interop call, validate GC heap around objects pinned by IL stubs.")
|
||||
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_InteropLogArguments, W("InteropLogArguments"), 0, "Log all pinned arguments passed to an interop call")
|
||||
RETAIL_CONFIG_STRING_INFO(UNSUPPORTED_LogCCWRefCountChange, W("LogCCWRefCountChange"), "Outputs debug information and calls LogCCWRefCountChange_BREAKPOINT when AddRef or Release is called on a CCW.")
|
||||
|
@ -721,6 +703,11 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_EventPipeRundown, W("EventPipeRundown"), 1, "E
|
|||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_EventPipeCircularMB, W("EventPipeCircularMB"), 1024, "The EventPipe circular buffer size in megabytes.")
|
||||
RETAIL_CONFIG_DWORD_INFO(INTERNAL_EventPipeProcNumbers, W("EventPipeProcNumbers"), 0, "Enable/disable capturing processor numbers in EventPipe event headers")
|
||||
|
||||
//
|
||||
// Diagnostics Server
|
||||
//
|
||||
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_DOTNET_DiagnosticsServerAddress, W("DOTNET_DiagnosticsServerAddress"), "The full path including filename for the OS transport (NamedPipe on Windows; Unix Domain Socket on Linux) to be used by the Diagnostics Server", CLRConfig::DontPrependCOMPlus_);
|
||||
|
||||
//
|
||||
// LTTng
|
||||
//
|
||||
|
@ -750,40 +737,36 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_GDBJitEmitDebugFrame, W("GDBJitEmitDebugFrame"
|
|||
//
|
||||
// DO NOT ADD ANY MORE CONFIG SWITCHES TO THIS SECTION!
|
||||
// **
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_ActivatePatchSkip, W("ActivatePatchSkip"), 0, "Allows an assert when ActivatePatchSkip is called", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_ActivatePatchSkip, W("ActivatePatchSkip"), 0, "Allows an assert when ActivatePatchSkip is called", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_AlwaysUseMetadataInterfaceMapLayout, W("AlwaysUseMetadataInterfaceMapLayout"), "Used for debugging generic interface map layout.")
|
||||
CONFIG_DWORD_INFO(INTERNAL_AssertOnUnneededThis, W("AssertOnUnneededThis"), 0, "While the ConfigDWORD is unnecessary, the contained ASSERT should be kept. This may result in some work tracking down violating MethodDescCallSites.")
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_AssertStacktrace, W("AssertStacktrace"), 1, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_clearNativeImageStress, W("clearNativeImageStress"), 0, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_AssertStacktrace, W("AssertStacktrace"), 1, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_clearNativeImageStress, W("clearNativeImageStress"), 0, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_CPUFamily, W("CPUFamily"), "")
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_CPUFeatures, W("CPUFeatures"), "")
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_DisableConfigCache, W("DisableConfigCache"), 0, "Used to disable the \"probabilistic\" config cache, which walks through the appropriate config registry keys on init and probabilistically keeps track of which exist.", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_DisableConfigCache, W("DisableConfigCache"), 0, "Used to disable the \"probabilistic\" config cache, which walks through the appropriate config registry keys on init and probabilistically keeps track of which exist.", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(EXTERNAL_DisableStackwalkCache, W("DisableStackwalkCache"), "")
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_DoubleArrayToLargeObjectHeap, W("DoubleArrayToLargeObjectHeap"), "Controls double[] placement")
|
||||
CONFIG_DWORD_INFO(INTERNAL_DumpConfiguration, W("DumpConfiguration"), 0, "Dumps runtime properties of xml configuration files to the log.")
|
||||
CONFIG_STRING_INFO(INTERNAL_DumpOnClassLoad, W("DumpOnClassLoad"), "Dumps information about loaded class to log.")
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_ExpandAllOnLoad, W("ExpandAllOnLoad"), "")
|
||||
CONFIG_STRING_INFO_DIRECT_ACCESS(INTERNAL_ForcedRuntime, W("ForcedRuntime"), "Verify version of CLR loaded")
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_ForceRelocs, W("ForceRelocs"), 0, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_ForceRelocs, W("ForceRelocs"), 0, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_GenerateLongJumpDispatchStubRatio, W("GenerateLongJumpDispatchStubRatio"), "Useful for testing VSD on AMD64")
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_HashStack, W("HashStack"), 0, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_HashStack, W("HashStack"), 0, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO(INTERNAL_HostManagerConfig, W("HostManagerConfig"), (DWORD)-1, "")
|
||||
CONFIG_DWORD_INFO(INTERNAL_HostTestThreadAbort, W("HostTestThreadAbort"), 0, "")
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_IgnoreDllMainReturn, W("IgnoreDllMainReturn"), 0, "Don't check the return value of DllMain if this is set", CLRConfig::ConfigFile_ApplicationFirst)
|
||||
CONFIG_STRING_INFO(INTERNAL_InvokeHalt, W("InvokeHalt"), "Throws an assert when the given method is invoked through reflection.")
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_legacyNullReferenceExceptionPolicy, W("legacyNullReferenceExceptionPolicy"), "")
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_legacyUnhandledExceptionPolicy, W("legacyUnhandledExceptionPolicy"), "")
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_MaxStackDepth, W("MaxStackDepth"), "")
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_MaxStubUnwindInfoSegmentSize, W("MaxStubUnwindInfoSegmentSize"), "")
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_MaxThreadRecord, W("MaxThreadRecord"), "")
|
||||
CONFIG_DWORD_INFO(INTERNAL_MessageDebugOut, W("MessageDebugOut"), 0, "")
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_MscorsnLogging, W("MscorsnLogging"), 0, "Enables strong name logging", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_NativeImageRequire, W("NativeImageRequire"), 0, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_NestedEhOom, W("NestedEhOom"), 0, "", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_NativeImageRequire, W("NativeImageRequire"), 0, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_NestedEhOom, W("NestedEhOom"), 0, "", CLRConfig::EEConfig_default)
|
||||
#define INTERNAL_NoGuiOnAssert_Default 1
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_NoGuiOnAssert, W("NoGuiOnAssert"), INTERNAL_NoGuiOnAssert_Default, "", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_NoProcedureSplitting, W("NoProcedureSplitting"), 0, "", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_NoStringInterning, W("NoStringInterning"), 1, "Disallows string interning. I see no value in it anymore.", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_NoGuiOnAssert, W("NoGuiOnAssert"), INTERNAL_NoGuiOnAssert_Default, "", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_NoProcedureSplitting, W("NoProcedureSplitting"), 0, "", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_NoStringInterning, W("NoStringInterning"), 1, "Disallows string interning. I see no value in it anymore.", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(EXTERNAL_NotifyBadAppCfg, W("NotifyBadAppCfg"), "Whether to show a message box for bad application config file.")
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_PauseOnLoad, W("PauseOnLoad"), "Stops in SystemDomain::init. I think it can be removed.")
|
||||
CONFIG_DWORD_INFO(INTERNAL_PerfAllocsSizeThreshold, W("PerfAllocsSizeThreshold"), 0x3FFFFFFF, "Log facility LF_GCALLOC logs object allocations. This flag controls which ones also log stacktraces. Predates ClrProfiler.")
|
||||
|
@ -793,8 +776,8 @@ RETAIL_CONFIG_DWORD_INFO(EXTERNAL_Prepopulate1, W("Prepopulate1"), 1, "")
|
|||
CONFIG_STRING_INFO(INTERNAL_PrestubGC, W("PrestubGC"), "")
|
||||
CONFIG_STRING_INFO(INTERNAL_PrestubHalt, W("PrestubHalt"), "")
|
||||
RETAIL_CONFIG_STRING_INFO(EXTERNAL_RestrictedGCStressExe, W("RestrictedGCStressExe"), "")
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_ReturnSourceTypeForTesting, W("ReturnSourceTypeForTesting"), 0, "Allows returning the (internal only) source type of an IL to Native mapping for debugging purposes", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_RSStressLog, W("RSStressLog"), 0, "Allows turning on logging for RS startup", CLRConfig::REGUTIL_default)
|
||||
CONFIG_DWORD_INFO_EX(INTERNAL_ReturnSourceTypeForTesting, W("ReturnSourceTypeForTesting"), 0, "Allows returning the (internal only) source type of an IL to Native mapping for debugging purposes", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_RSStressLog, W("RSStressLog"), 0, "Allows turning on logging for RS startup", CLRConfig::EEConfig_default)
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_SaveThreadInfo, W("SaveThreadInfo"), "")
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_SaveThreadInfoMask, W("SaveThreadInfoMask"), "")
|
||||
CONFIG_DWORD_INFO(INTERNAL_SBDumpOnNewIndex, W("SBDumpOnNewIndex"), 0, "Used for Syncblock debugging. It's been a while since any of those have been used.")
|
||||
|
@ -803,11 +786,11 @@ CONFIG_DWORD_INFO(INTERNAL_SBDumpStyle, W("SBDumpStyle"), 0, "Used for Syncblock
|
|||
RETAIL_CONFIG_STRING_INFO_DIRECT_ACCESS(UNSUPPORTED_ShimDatabaseVersion, W("ShimDatabaseVersion"), "Force using shim database version in registry")
|
||||
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_SleepOnExit, W("SleepOnExit"), 0, "Used for lrak detection. I'd say deprecated by umdh.")
|
||||
CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_StubLinkerUnwindInfoVerificationOn, W("StubLinkerUnwindInfoVerificationOn"), "")
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_SuccessExit, W("SuccessExit"), 0, "", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_SuccessExit, W("SuccessExit"), 0, "", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(EXTERNAL_SymbolReadingPolicy, W("SymbolReadingPolicy"), "Specifies when PDBs may be read")
|
||||
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_TestDataConsistency, W("TestDataConsistency"), FALSE, "Allows ensuring the left side is not holding locks (and may thus be in an inconsistent state) when inspection occurs")
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_ThreadGuardPages, W("ThreadGuardPages"), 0, "", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_Timeline, W("Timeline"), 0, "", CLRConfig::REGUTIL_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_ThreadGuardPages, W("ThreadGuardPages"), 0, "", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_Timeline, W("Timeline"), 0, "", CLRConfig::EEConfig_default)
|
||||
RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_TotalStressLogSize, W("TotalStressLogSize"), "Total stress log size in bytes.")
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
|
|
@ -112,7 +112,7 @@ interface ICLRDataTarget : IUnknown
|
|||
* implementation this can fail.
|
||||
*/
|
||||
HRESULT GetCurrentThreadID([out] ULONG32* threadID);
|
||||
|
||||
|
||||
/*
|
||||
* Thread context.
|
||||
*/
|
||||
|
@ -137,7 +137,7 @@ interface ICLRDataTarget : IUnknown
|
|||
};
|
||||
|
||||
/*
|
||||
* Interface used by the data access services layer to manipulate
|
||||
* Interface used by the data access services layer to manipulate
|
||||
* virtual memory regions in the target. The target may not support
|
||||
* modification.
|
||||
*/
|
||||
|
@ -197,9 +197,23 @@ interface ICLRDataTarget3 : ICLRDataTarget2
|
|||
HRESULT GetExceptionThreadID([out] ULONG32* threadID);
|
||||
};
|
||||
|
||||
[
|
||||
object,
|
||||
local,
|
||||
uuid(b760bf44-9377-4597-8be7-58083bdc5146),
|
||||
pointer_default(unique)
|
||||
]
|
||||
interface ICLRRuntimeLocator : IUnknown
|
||||
{
|
||||
/*
|
||||
Returns the base address of the module containing the runtime.
|
||||
*/
|
||||
HRESULT GetRuntimeBase([out] CLRDATA_ADDRESS* baseAddress);
|
||||
};
|
||||
|
||||
/*
|
||||
* Interface used by the data access services layer to locate metadata
|
||||
* of assemblies in a target.
|
||||
* Interface used by the data access services layer to locate metadata
|
||||
* of assemblies in a target.
|
||||
*
|
||||
* The API client must implement this interface as appropriate for the
|
||||
* particular target (for example, a live process or a memory dump).
|
||||
|
@ -217,7 +231,7 @@ interface ICLRDataTarget3 : ICLRDataTarget2
|
|||
interface ICLRMetadataLocator : IUnknown
|
||||
{
|
||||
/*
|
||||
* Ask the target to retrieve metadata for an image.
|
||||
* Ask the target to retrieve metadata for an image.
|
||||
*/
|
||||
HRESULT GetMetadata([in] LPCWSTR imagePath,
|
||||
[in] ULONG32 imageTimestamp,
|
||||
|
@ -265,8 +279,8 @@ interface ICLRDataEnumMemoryRegionsCallback2 : ICLRDataEnumMemoryRegionsCallback
|
|||
{
|
||||
/*
|
||||
* ICLRDataEnumMemoryRegions::EnumMemoryRegions will call this function
|
||||
* for every memory regions it needs to overwrite/poison with the specified
|
||||
* data buffer passed as input argument.
|
||||
* for every memory regions it needs to overwrite/poison with the specified
|
||||
* data buffer passed as input argument.
|
||||
*/
|
||||
HRESULT UpdateMemoryRegion(
|
||||
[in] CLRDATA_ADDRESS address,
|
||||
|
@ -280,10 +294,10 @@ interface ICLRDataEnumMemoryRegionsCallback2 : ICLRDataEnumMemoryRegionsCallback
|
|||
typedef enum CLRDataEnumMemoryFlags
|
||||
{
|
||||
CLRDATA_ENUM_MEM_DEFAULT = 0x0,
|
||||
CLRDATA_ENUM_MEM_MINI = CLRDATA_ENUM_MEM_DEFAULT, // generating skinny mini-dump
|
||||
CLRDATA_ENUM_MEM_MINI = CLRDATA_ENUM_MEM_DEFAULT, // generating skinny mini-dump
|
||||
CLRDATA_ENUM_MEM_HEAP = 0x1, // generating heap dump
|
||||
CLRDATA_ENUM_MEM_TRIAGE = 0x2, // generating triage mini-dump
|
||||
|
||||
|
||||
/* More bits to be added here later */
|
||||
} CLRDataEnumMemoryFlags;
|
||||
|
||||
|
|
|
@ -56,176 +56,20 @@
|
|||
|
||||
#endif // _DEBUG
|
||||
|
||||
IExecutionEngine *GetExecutionEngine();
|
||||
IEEMemoryManager *GetEEMemoryManager();
|
||||
|
||||
LPVOID ClrVirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect);
|
||||
BOOL ClrVirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType);
|
||||
SIZE_T ClrVirtualQuery(LPCVOID lpAddress, PMEMORY_BASIC_INFORMATION lpBuffer, SIZE_T dwLength);
|
||||
BOOL ClrVirtualProtect(LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, PDWORD lpflOldProtect);
|
||||
LPVOID ClrDebugAlloc (size_t size, LPCSTR pszFile, int iLineNo);
|
||||
HANDLE ClrGetProcessHeap();
|
||||
HANDLE ClrHeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize);
|
||||
BOOL ClrHeapDestroy(HANDLE hHeap);
|
||||
LPVOID ClrHeapAlloc(HANDLE hHeap, DWORD dwFlags, S_SIZE_T dwBytes);
|
||||
BOOL ClrHeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem);
|
||||
BOOL ClrHeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem);
|
||||
HANDLE ClrGetProcessExecutableHeap();
|
||||
|
||||
#ifdef HOST_WINDOWS
|
||||
HANDLE ClrGetProcessExecutableHeap();
|
||||
#endif
|
||||
|
||||
#ifdef FAILPOINTS_ENABLED
|
||||
extern int RFS_HashStack();
|
||||
#endif
|
||||
|
||||
|
||||
void ClrFlsAssociateCallback(DWORD slot, PTLS_CALLBACK_FUNCTION callback);
|
||||
|
||||
typedef LPVOID* (*CLRFLSGETBLOCK)();
|
||||
extern CLRFLSGETBLOCK __ClrFlsGetBlock;
|
||||
|
||||
// Combining getter/setter into a single call
|
||||
inline void ClrFlsIncrementValue(DWORD slot, int increment)
|
||||
{
|
||||
STATIC_CONTRACT_NOTHROW;
|
||||
STATIC_CONTRACT_GC_NOTRIGGER;
|
||||
STATIC_CONTRACT_MODE_ANY;
|
||||
STATIC_CONTRACT_CANNOT_TAKE_LOCK;
|
||||
|
||||
_ASSERTE(increment != 0);
|
||||
|
||||
void **block = (*__ClrFlsGetBlock)();
|
||||
size_t value;
|
||||
|
||||
if (block != NULL)
|
||||
{
|
||||
value = (size_t) block[slot];
|
||||
|
||||
_ASSERTE((increment > 0) || (value + increment < value));
|
||||
block[slot] = (void *) (value + increment);
|
||||
}
|
||||
else
|
||||
{
|
||||
BEGIN_PRESERVE_LAST_ERROR;
|
||||
|
||||
IExecutionEngine * pEngine = GetExecutionEngine();
|
||||
value = (size_t) pEngine->TLS_GetValue(slot);
|
||||
|
||||
_ASSERTE((increment > 0) || (value + increment < value));
|
||||
pEngine->TLS_SetValue(slot, (void *) (value + increment));
|
||||
|
||||
END_PRESERVE_LAST_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline void * ClrFlsGetValue (DWORD slot)
|
||||
{
|
||||
STATIC_CONTRACT_NOTHROW;
|
||||
STATIC_CONTRACT_GC_NOTRIGGER;
|
||||
STATIC_CONTRACT_MODE_ANY;
|
||||
STATIC_CONTRACT_CANNOT_TAKE_LOCK;
|
||||
|
||||
void **block = (*__ClrFlsGetBlock)();
|
||||
if (block != NULL)
|
||||
{
|
||||
return block[slot];
|
||||
}
|
||||
else
|
||||
{
|
||||
void * value = GetExecutionEngine()->TLS_GetValue(slot);
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline BOOL ClrFlsCheckValue(DWORD slot, void ** pValue)
|
||||
{
|
||||
STATIC_CONTRACT_NOTHROW;
|
||||
STATIC_CONTRACT_GC_NOTRIGGER;
|
||||
STATIC_CONTRACT_MODE_ANY;
|
||||
|
||||
#ifdef _DEBUG
|
||||
*pValue = ULongToPtr(0xcccccccc);
|
||||
#endif //_DEBUG
|
||||
void **block = (*__ClrFlsGetBlock)();
|
||||
if (block != NULL)
|
||||
{
|
||||
*pValue = block[slot];
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOL result = GetExecutionEngine()->TLS_CheckValue(slot, pValue);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
inline void ClrFlsSetValue(DWORD slot, void *pData)
|
||||
{
|
||||
STATIC_CONTRACT_NOTHROW;
|
||||
STATIC_CONTRACT_GC_NOTRIGGER;
|
||||
STATIC_CONTRACT_MODE_ANY;
|
||||
STATIC_CONTRACT_CANNOT_TAKE_LOCK;
|
||||
|
||||
void **block = (*__ClrFlsGetBlock)();
|
||||
if (block != NULL)
|
||||
{
|
||||
block[slot] = pData;
|
||||
}
|
||||
else
|
||||
{
|
||||
BEGIN_PRESERVE_LAST_ERROR;
|
||||
|
||||
GetExecutionEngine()->TLS_SetValue(slot, pData);
|
||||
|
||||
END_PRESERVE_LAST_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef SELF_NO_HOST
|
||||
LPVOID EEHeapAllocInProcessHeap(DWORD dwFlags, SIZE_T dwBytes);
|
||||
BOOL EEHeapFreeInProcessHeap(DWORD dwFlags, LPVOID lpMem);
|
||||
#endif
|
||||
|
||||
inline LPVOID ClrAllocInProcessHeap(DWORD dwFlags, S_SIZE_T dwBytes)
|
||||
{
|
||||
STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY;
|
||||
if (dwBytes.IsOverflow())
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef SELF_NO_HOST
|
||||
return EEHeapAllocInProcessHeap(dwFlags, dwBytes.Value());
|
||||
#else
|
||||
#undef HeapAlloc
|
||||
#undef GetProcessHeap
|
||||
static HANDLE ProcessHeap = NULL;
|
||||
if (ProcessHeap == NULL)
|
||||
ProcessHeap = GetProcessHeap();
|
||||
return ::HeapAlloc(ProcessHeap,dwFlags,dwBytes.Value());
|
||||
#define HeapAlloc(hHeap, dwFlags, dwBytes) Dont_Use_HeapAlloc(hHeap, dwFlags, dwBytes)
|
||||
#define GetProcessHeap() Dont_Use_GetProcessHeap()
|
||||
#endif
|
||||
}
|
||||
|
||||
inline BOOL ClrFreeInProcessHeap(DWORD dwFlags, LPVOID lpMem)
|
||||
{
|
||||
STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY;
|
||||
#ifndef SELF_NO_HOST
|
||||
return EEHeapFreeInProcessHeap(dwFlags, lpMem);
|
||||
#else
|
||||
#undef HeapFree
|
||||
#undef GetProcessHeap
|
||||
static HANDLE ProcessHeap = NULL;
|
||||
if (ProcessHeap == NULL)
|
||||
ProcessHeap = GetProcessHeap();
|
||||
return (BOOL)(BYTE)::HeapFree(ProcessHeap, dwFlags, lpMem);
|
||||
#define HeapFree(hHeap, dwFlags, lpMem) Dont_Use_HeapFree(hHeap, dwFlags, lpMem)
|
||||
#define GetProcessHeap() Dont_Use_GetProcessHeap()
|
||||
#endif
|
||||
}
|
||||
|
||||
// Critical section support for CLR DLLs other than the the EE.
|
||||
// Include the header defining each Crst type and its corresponding level (relative rank). This is
|
||||
// auto-generated from a tool that takes a high-level description of each Crst type and its dependencies.
|
||||
|
@ -233,29 +77,10 @@ inline BOOL ClrFreeInProcessHeap(DWORD dwFlags, LPVOID lpMem)
|
|||
|
||||
// critical section api
|
||||
CRITSEC_COOKIE ClrCreateCriticalSection(CrstType type, CrstFlags flags);
|
||||
HRESULT ClrDeleteCriticalSection(CRITSEC_COOKIE cookie);
|
||||
void ClrDeleteCriticalSection(CRITSEC_COOKIE cookie);
|
||||
void ClrEnterCriticalSection(CRITSEC_COOKIE cookie);
|
||||
void ClrLeaveCriticalSection(CRITSEC_COOKIE cookie);
|
||||
|
||||
// event api
|
||||
EVENT_COOKIE ClrCreateAutoEvent(BOOL bInitialState);
|
||||
EVENT_COOKIE ClrCreateManualEvent(BOOL bInitialState);
|
||||
void ClrCloseEvent(EVENT_COOKIE event);
|
||||
BOOL ClrSetEvent(EVENT_COOKIE event);
|
||||
BOOL ClrResetEvent(EVENT_COOKIE event);
|
||||
DWORD ClrWaitEvent(EVENT_COOKIE event, DWORD dwMilliseconds, BOOL bAlertable);
|
||||
|
||||
// semaphore api
|
||||
SEMAPHORE_COOKIE ClrCreateSemaphore(DWORD dwInitial, DWORD dwMax);
|
||||
void ClrCloseSemaphore(SEMAPHORE_COOKIE semaphore);
|
||||
BOOL ClrReleaseSemaphore(SEMAPHORE_COOKIE semaphore, LONG lReleaseCount, LONG *lpPreviousCount);
|
||||
DWORD ClrWaitSemaphore(SEMAPHORE_COOKIE semaphore, DWORD dwMilliseconds, BOOL bAlertable);
|
||||
|
||||
// mutex api
|
||||
MUTEX_COOKIE ClrCreateMutex(LPSECURITY_ATTRIBUTES lpMutexAttributes,BOOL bInitialOwner,LPCTSTR lpName);
|
||||
void ClrCloseMutex(MUTEX_COOKIE mutex);
|
||||
BOOL ClrReleaseMutex(MUTEX_COOKIE mutex);
|
||||
DWORD ClrWaitForMutex(MUTEX_COOKIE mutex,DWORD dwMilliseconds,BOOL bAlertable);
|
||||
DWORD ClrSleepEx(DWORD dwMilliseconds, BOOL bAlertable);
|
||||
|
||||
// Rather than use the above APIs directly, it is recommended that holder classes
|
||||
|
@ -268,98 +93,19 @@ typedef Holder<CRITSEC_COOKIE, ClrEnterCriticalSection, ClrLeaveCriticalSection,
|
|||
FORCEINLINE void VoidClrDeleteCriticalSection(CRITSEC_COOKIE cs) { if (cs != NULL) ClrDeleteCriticalSection(cs); }
|
||||
typedef Wrapper<CRITSEC_COOKIE, DoNothing<CRITSEC_COOKIE>, VoidClrDeleteCriticalSection, NULL> CRITSEC_AllocationHolder;
|
||||
|
||||
class Event {
|
||||
public:
|
||||
Event ()
|
||||
: m_event(NULL)
|
||||
{STATIC_CONTRACT_LEAF;}
|
||||
~Event ()
|
||||
{
|
||||
STATIC_CONTRACT_WRAPPER;
|
||||
CloseEvent();
|
||||
}
|
||||
|
||||
void CreateAutoEvent(BOOL bInitialState)
|
||||
{
|
||||
STATIC_CONTRACT_WRAPPER;
|
||||
m_event = ClrCreateAutoEvent(bInitialState);
|
||||
}
|
||||
void CreateManualEvent(BOOL bInitialState)
|
||||
{
|
||||
STATIC_CONTRACT_WRAPPER;
|
||||
m_event = ClrCreateManualEvent(bInitialState);
|
||||
}
|
||||
void CloseEvent()
|
||||
{
|
||||
STATIC_CONTRACT_WRAPPER;
|
||||
if (m_event != NULL)
|
||||
ClrCloseEvent(m_event);
|
||||
m_event = NULL;
|
||||
}
|
||||
|
||||
BOOL Set()
|
||||
{
|
||||
STATIC_CONTRACT_WRAPPER;
|
||||
return ClrSetEvent(m_event);
|
||||
}
|
||||
BOOL Reset()
|
||||
{
|
||||
STATIC_CONTRACT_WRAPPER;
|
||||
return ClrResetEvent(m_event);
|
||||
}
|
||||
DWORD Wait(DWORD dwMilliseconds, BOOL bAlertable)
|
||||
{
|
||||
STATIC_CONTRACT_WRAPPER;
|
||||
return ClrWaitEvent(m_event, dwMilliseconds, bAlertable);
|
||||
}
|
||||
|
||||
private:
|
||||
EVENT_COOKIE m_event;
|
||||
};
|
||||
|
||||
class Semaphore {
|
||||
public:
|
||||
Semaphore ()
|
||||
: m_semaphore(NULL)
|
||||
{STATIC_CONTRACT_LEAF;}
|
||||
~Semaphore ()
|
||||
{
|
||||
STATIC_CONTRACT_WRAPPER;
|
||||
Close();
|
||||
}
|
||||
|
||||
void Create(DWORD dwInitial, DWORD dwMax)
|
||||
{
|
||||
STATIC_CONTRACT_WRAPPER;
|
||||
m_semaphore = ClrCreateSemaphore(dwInitial, dwMax);
|
||||
}
|
||||
void Close()
|
||||
{
|
||||
STATIC_CONTRACT_WRAPPER;
|
||||
if (m_semaphore != NULL)
|
||||
ClrCloseSemaphore(m_semaphore);
|
||||
m_semaphore = NULL;
|
||||
}
|
||||
|
||||
BOOL Release(LONG lReleaseCount, LONG* lpPreviousCount)
|
||||
{
|
||||
STATIC_CONTRACT_WRAPPER;
|
||||
return ClrReleaseSemaphore(m_semaphore, lReleaseCount, lpPreviousCount);
|
||||
}
|
||||
DWORD Wait(DWORD dwMilliseconds, BOOL bAlertable)
|
||||
{
|
||||
STATIC_CONTRACT_WRAPPER;
|
||||
return ClrWaitSemaphore(m_semaphore, dwMilliseconds, bAlertable);
|
||||
}
|
||||
|
||||
private:
|
||||
SEMAPHORE_COOKIE m_semaphore;
|
||||
};
|
||||
|
||||
HMODULE GetCLRModule ();
|
||||
|
||||
extern void IncCantAllocCount();
|
||||
extern void DecCantAllocCount();
|
||||
extern thread_local int t_CantAllocCount;
|
||||
|
||||
inline void IncCantAllocCount()
|
||||
{
|
||||
t_CantAllocCount++;
|
||||
}
|
||||
|
||||
inline void DecCantAllocCount()
|
||||
{
|
||||
t_CantAllocCount--;
|
||||
}
|
||||
|
||||
class CantAllocHolder
|
||||
{
|
||||
|
@ -375,18 +121,13 @@ public:
|
|||
};
|
||||
|
||||
// At places where want to allocate stress log, we need to first check if we are allowed to do so.
|
||||
// If ClrTlsInfo doesn't exist for this thread, we take it as can alloc
|
||||
inline bool IsInCantAllocRegion ()
|
||||
{
|
||||
size_t count = 0;
|
||||
if (ClrFlsCheckValue(TlsIdx_CantAllocCount, (LPVOID *)&count))
|
||||
{
|
||||
_ASSERTE (count >= 0);
|
||||
return count > 0;
|
||||
}
|
||||
return false;
|
||||
return t_CantAllocCount != 0;
|
||||
}
|
||||
inline BOOL IsInCantAllocStressLogRegion()
|
||||
{
|
||||
return t_CantAllocCount != 0;
|
||||
}
|
||||
// for stress log the rule is more restrict, we have to check the global counter too
|
||||
extern BOOL IsInCantAllocStressLogRegion();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -16,45 +16,6 @@ import "unknwn.idl";
|
|||
// import mscoree.idl for BucketParameters definition
|
||||
import "mscoree.idl";
|
||||
|
||||
|
||||
|
||||
cpp_quote("#if 0")
|
||||
|
||||
typedef struct _OSVERSIONINFOA {
|
||||
DWORD dwOSVersionInfoSize;
|
||||
DWORD dwMajorVersion;
|
||||
DWORD dwMinorVersion;
|
||||
DWORD dwBuildNumber;
|
||||
DWORD dwPlatformId;
|
||||
CHAR szCSDVersion[ 128 ]; // Maintenance string for PSS usage
|
||||
} OSVERSIONINFOA, *POSVERSIONINFOA, *LPOSVERSIONINFOA;
|
||||
|
||||
typedef struct _OSVERSIONINFOW {
|
||||
DWORD dwOSVersionInfoSize;
|
||||
DWORD dwMajorVersion;
|
||||
DWORD dwMinorVersion;
|
||||
DWORD dwBuildNumber;
|
||||
DWORD dwPlatformId;
|
||||
WCHAR szCSDVersion[ 128 ]; // Maintenance string for PSS usage
|
||||
} OSVERSIONINFOW, *POSVERSIONINFOW, *LPOSVERSIONINFOW, RTL_OSVERSIONINFOW, *PRTL_OSVERSIONINFOW;
|
||||
#ifdef UNICODE
|
||||
typedef OSVERSIONINFOW OSVERSIONINFO;
|
||||
typedef POSVERSIONINFOW POSVERSIONINFO;
|
||||
typedef LPOSVERSIONINFOW LPOSVERSIONINFO;
|
||||
#else
|
||||
typedef OSVERSIONINFOA OSVERSIONINFO;
|
||||
typedef POSVERSIONINFOA POSVERSIONINFO;
|
||||
typedef LPOSVERSIONINFOA LPOSVERSIONINFO;
|
||||
#endif // UNICODE
|
||||
|
||||
cpp_quote("#endif")
|
||||
|
||||
// IID IExecutionEngine : uuid(7AF02DAC-2A33-494b-A09F-25E00A93C6F8)
|
||||
cpp_quote("EXTERN_GUID(IID_IExecutionEngine, 0x7AF02DAC, 0x2A33, 0x494b, 0xA0, 0x9F, 0x25, 0xE0, 0x0A, 0x93, 0xC6, 0xF8);")
|
||||
|
||||
// IID IEEMemoryManager : uuid{17713B61-B59F-4e13-BAAF-91623DC8ADC0}
|
||||
cpp_quote("EXTERN_GUID(IID_IEEMemoryManager, 0x17713b61, 0xb59f, 0x4e13, 0xba, 0xaf, 0x91, 0x62, 0x3d, 0xc8, 0xad, 0xc0);")
|
||||
|
||||
// This ID is embedded in the CLRDEBUGINFO resource so that the shim can differentiate dlls which happen to be named
|
||||
// clr.dll from official Microsoft clr.dll implementations. This is not intended to authenticate a CLR in a strong
|
||||
// security sense but short of deliberate 3rd party spoofing it should provide a good identity.
|
||||
|
@ -62,8 +23,8 @@ cpp_quote("EXTERN_GUID(IID_IEEMemoryManager, 0x17713b61, 0xb59f, 0x4e13, 0xba, 0
|
|||
// Using a different ID allows us to completely hide different CLR SKUs from each other. The recommendation is to keep
|
||||
// the ID contant between different versions of the same SKU and use mscordbi's logic to determine whether a given
|
||||
// version is compatible. This allows debuggers to give different errors for 'future version of the CLR I don't
|
||||
// support' vs. 'No CLR is loaded at all.'
|
||||
//
|
||||
// support' vs. 'No CLR is loaded at all.'
|
||||
//
|
||||
// This guid first appears in version 4.0 of CLR on x86 and amd64 - earlier versions had no resource
|
||||
// GUID CLR_ID_V4_DESKTOP : uuid{267F3989-D786-4b9a-9AF6-D19E42D557EC}
|
||||
cpp_quote("EXTERN_GUID(CLR_ID_V4_DESKTOP, 0x267f3989, 0xd786, 0x4b9a, 0x9a, 0xf6, 0xd1, 0x9e, 0x42, 0xd5, 0x57, 0xec);")
|
||||
|
@ -92,9 +53,6 @@ cpp_quote("EXTERN_GUID(IID_IPrivateManagedExceptionReporting, 0xad76a023, 0x332d
|
|||
// Interface for exposing services from the EE to other DLLs of the CLR.
|
||||
//*****************************************************************************
|
||||
typedef void * CRITSEC_COOKIE;
|
||||
typedef void * EVENT_COOKIE;
|
||||
typedef void * SEMAPHORE_COOKIE;
|
||||
typedef void * MUTEX_COOKIE;
|
||||
|
||||
typedef enum {
|
||||
CRST_DEFAULT = 0x0,
|
||||
|
@ -107,178 +65,15 @@ typedef enum {
|
|||
CRST_HOST_BREAKABLE = 0x20, // This lock is held while running managed code. It can be terminated by a host.
|
||||
// CRST_UNUSED = 0x40,
|
||||
CRST_TAKEN_DURING_SHUTDOWN = 0x80, // This lock is taken during the shutdown sequence in EEShutdown(helper)
|
||||
CRST_GC_NOTRIGGER_WHEN_TAKEN = 0x100,
|
||||
CRST_GC_NOTRIGGER_WHEN_TAKEN = 0x100,
|
||||
// User of this lock cannot trigger GC, while it is locked.
|
||||
// Note that Enter on this lock can trigger GC if called from COOPERATIVE mode.
|
||||
// It is useful for locks which can be taken on GC or debugger threads.
|
||||
CRST_DEBUG_ONLY_CHECK_FORBID_SUSPEND_THREAD = 0x200,
|
||||
// Some rare locks should be taken only in ForbidSuspend region (i.e. profiler cannot walk the stack),
|
||||
// Some rare locks should be taken only in ForbidSuspend region (i.e. profiler cannot walk the stack),
|
||||
// this option will assert it in debug mode.
|
||||
} CrstFlags;
|
||||
|
||||
// Callback function for cleaning up TLS
|
||||
typedef VOID (__stdcall *PTLS_CALLBACK_FUNCTION)(PVOID);
|
||||
|
||||
|
||||
[
|
||||
uuid(7AF02DAC-2A33-494b-A09F-25E00A93C6F8),
|
||||
helpstring("CLR Coordination Interface"),
|
||||
pointer_default(unique),
|
||||
local
|
||||
]
|
||||
interface IExecutionEngine : IUnknown
|
||||
{
|
||||
// Thread Local Storage is based on logical threads. The underlying
|
||||
// implementation could be threads, fibers, or something more exotic.
|
||||
// Slot numbers are predefined. This is not a general extensibility
|
||||
// mechanism.
|
||||
|
||||
// Associate a callback function for releasing TLS on thread/fiber death.
|
||||
// This can be NULL.
|
||||
void TLS_AssociateCallback([in] DWORD slot, [in] PTLS_CALLBACK_FUNCTION callback);
|
||||
|
||||
// Get the TLS block for fast Get/Set operations
|
||||
PVOID* TLS_GetDataBlock();
|
||||
|
||||
// Get the value at a slot
|
||||
PVOID TLS_GetValue([in] DWORD slot);
|
||||
|
||||
// Get the value at a slot, return FALSE if TLS info block doesn't exist
|
||||
BOOL TLS_CheckValue([in] DWORD slot, [out] PVOID * pValue);
|
||||
|
||||
// Set the value at a slot
|
||||
void TLS_SetValue([in] DWORD slot, [in] PVOID pData);
|
||||
|
||||
// Free TLS memory block and make callback
|
||||
void TLS_ThreadDetaching();
|
||||
|
||||
// Critical Sections are sometimes exposed to the host and therefore need to be
|
||||
// reflected from all CLR DLLs to the EE.
|
||||
//
|
||||
// In addition, we always monitor interactions between the lock & the GC, based
|
||||
// on the GC mode in which the lock is acquired and we restrict what operations
|
||||
// are permitted while holding the lock based on this.
|
||||
//
|
||||
// Finally, we we rank all our locks to prevent deadlock across all the DLLs of
|
||||
// the CLR. This is the level argument to CreateLock.
|
||||
//
|
||||
// All usage of these locks must be exception-safe. To achieve this, we suggest
|
||||
// using Holders (see holder.h & crst.h). In fact, within the EE code cannot
|
||||
// hold locks except by using exception-safe holders.
|
||||
|
||||
CRITSEC_COOKIE CreateLock([in] LPCSTR szTag, [in] LPCSTR level, [in] CrstFlags flags);
|
||||
|
||||
void DestroyLock([in] CRITSEC_COOKIE lock);
|
||||
|
||||
void AcquireLock([in] CRITSEC_COOKIE lock);
|
||||
|
||||
void ReleaseLock([in] CRITSEC_COOKIE lock);
|
||||
|
||||
EVENT_COOKIE CreateAutoEvent([in] BOOL bInitialState);
|
||||
EVENT_COOKIE CreateManualEvent([in] BOOL bInitialState);
|
||||
void CloseEvent([in] EVENT_COOKIE event);
|
||||
BOOL ClrSetEvent([in] EVENT_COOKIE event);
|
||||
BOOL ClrResetEvent([in] EVENT_COOKIE event);
|
||||
DWORD WaitForEvent([in] EVENT_COOKIE event, [in] DWORD dwMilliseconds, [in] BOOL bAlertable);
|
||||
DWORD WaitForSingleObject([in] HANDLE handle, [in] DWORD dwMilliseconds);
|
||||
|
||||
// OS header file defines CreateSemaphore.
|
||||
SEMAPHORE_COOKIE ClrCreateSemaphore([in] DWORD dwInitial, [in] DWORD dwMax);
|
||||
void ClrCloseSemaphore([in] SEMAPHORE_COOKIE semaphore);
|
||||
DWORD ClrWaitForSemaphore([in] SEMAPHORE_COOKIE semaphore, [in] DWORD dwMilliseconds, [in] BOOL bAlertable);
|
||||
BOOL ClrReleaseSemaphore([in] SEMAPHORE_COOKIE semaphore, [in] LONG lReleaseCount, [in] LONG *lpPreviousCount);
|
||||
|
||||
MUTEX_COOKIE ClrCreateMutex([in]LPSECURITY_ATTRIBUTES lpMutexAttributes, [in]BOOL bInitialOwner, [in]LPCTSTR lpName);
|
||||
DWORD ClrWaitForMutex([in] MUTEX_COOKIE mutex, [in] DWORD dwMilliseconds, [in] BOOL bAlertable);
|
||||
BOOL ClrReleaseMutex([in] MUTEX_COOKIE mutex);
|
||||
void ClrCloseMutex([in] MUTEX_COOKIE mutex);
|
||||
|
||||
DWORD ClrSleepEx([in] DWORD dwMilliseconds, [in] BOOL bAlertable);
|
||||
|
||||
BOOL ClrAllocationDisallowed();
|
||||
|
||||
void GetLastThrownObjectExceptionFromThread([out] void **ppvException);
|
||||
|
||||
}; // interface IExecutionEngine
|
||||
|
||||
|
||||
//*****************************************************************************
|
||||
// Interface for exposing memory services from the EE to other DLLs of the CLR.
|
||||
//*****************************************************************************
|
||||
|
||||
cpp_quote("#if !defined(_WINNT_) && !defined(_NTMMAPI_)")
|
||||
typedef void* PMEMORY_BASIC_INFORMATION;
|
||||
cpp_quote("#endif")
|
||||
|
||||
|
||||
[
|
||||
uuid(17713B61-B59F-4e13-BAAF-91623DC8ADC0),
|
||||
helpstring("CLR Memory Manager Interface"),
|
||||
pointer_default(unique),
|
||||
local
|
||||
]
|
||||
interface IEEMemoryManager : IUnknown
|
||||
{
|
||||
LPVOID ClrVirtualAlloc(
|
||||
[in] LPVOID lpAddress, // region to reserve or commit
|
||||
[in] SIZE_T dwSize, // size of region
|
||||
[in] DWORD flAllocationType, // type of allocation
|
||||
[in] DWORD flProtect // type of access protection
|
||||
);
|
||||
|
||||
BOOL ClrVirtualFree(
|
||||
[in] LPVOID lpAddress, // address of region
|
||||
[in] SIZE_T dwSize, // size of region
|
||||
[in] DWORD dwFreeType // operation type
|
||||
);
|
||||
|
||||
SIZE_T ClrVirtualQuery(
|
||||
[in] const void* lpAddress, // address of region
|
||||
[in] PMEMORY_BASIC_INFORMATION lpBuffer, // information buffer
|
||||
[in] SIZE_T dwLength // size of buffer
|
||||
);
|
||||
|
||||
BOOL ClrVirtualProtect(
|
||||
[in] LPVOID lpAddress, // region of committed pages
|
||||
[in] SIZE_T dwSize, // size of the region
|
||||
[in] DWORD flNewProtect, // desired access protection
|
||||
[in] DWORD* lpflOldProtect // old protection
|
||||
);
|
||||
|
||||
HANDLE ClrGetProcessHeap();
|
||||
|
||||
HANDLE ClrHeapCreate(
|
||||
[in] DWORD flOptions, // heap allocation attributes
|
||||
[in] SIZE_T dwInitialSize, // initial heap size
|
||||
[in] SIZE_T dwMaximumSize // maximum heap size
|
||||
);
|
||||
|
||||
BOOL ClrHeapDestroy(
|
||||
[in] HANDLE hHeap // handle to heap
|
||||
);
|
||||
|
||||
LPVOID ClrHeapAlloc(
|
||||
[in] HANDLE hHeap, // handle to private heap block
|
||||
[in] DWORD dwFlags, // heap allocation control
|
||||
[in] SIZE_T dwBytes // number of bytes to allocate
|
||||
);
|
||||
|
||||
BOOL ClrHeapFree(
|
||||
[in] HANDLE hHeap, // handle to heap
|
||||
[in] DWORD dwFlags, // heap free options
|
||||
[in] LPVOID lpMem // pointer to memory
|
||||
);
|
||||
|
||||
BOOL ClrHeapValidate(
|
||||
[in] HANDLE hHeap, // handle to heap
|
||||
[in] DWORD dwFlags, // heap access options
|
||||
[in] const void* lpMem // optional pointer to memory block
|
||||
);
|
||||
|
||||
HANDLE ClrGetProcessExecutableHeap();
|
||||
|
||||
}; // interface IEEMemoryManager
|
||||
|
||||
//********************************************************************************************
|
||||
// Interface for exposing GetBucketParametersForCurrentException to Watson testing harness.
|
||||
//********************************************************************************************
|
||||
|
@ -292,5 +87,3 @@ interface IPrivateManagedExceptionReporting : IUnknown
|
|||
{
|
||||
HRESULT GetBucketParametersForCurrentException([out]BucketParameters *pParams);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#define STATUS_UNWIND ((NTSTATUS)0x80000027L)
|
||||
#endif
|
||||
|
||||
#ifndef DBG_PRINTEXCEPTION_C
|
||||
#ifndef DBG_PRINTEXCEPTION_C
|
||||
#define DBG_PRINTEXCEPTION_C ((DWORD)0x40010006L)
|
||||
#endif
|
||||
|
||||
|
@ -58,22 +58,22 @@
|
|||
|
||||
#ifndef __out_xcount_opt
|
||||
#define __out_xcount_opt(var) __out
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __encoded_pointer
|
||||
#define __encoded_pointer
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __range
|
||||
#define __range(min, man)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __field_bcount
|
||||
#define __field_bcount(size)
|
||||
#endif
|
||||
|
||||
#ifndef __field_ecount_opt
|
||||
#define __field_ecount_opt(nFields)
|
||||
#define __field_ecount_opt(nFields)
|
||||
#endif
|
||||
|
||||
#ifndef __field_ecount
|
||||
|
@ -81,7 +81,7 @@
|
|||
#endif
|
||||
|
||||
#undef _Ret_bytecap_
|
||||
#define _Ret_bytecap_(_Size)
|
||||
#define _Ret_bytecap_(_Size)
|
||||
|
||||
#ifndef NT_SUCCESS
|
||||
#define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)
|
||||
|
@ -96,7 +96,7 @@ typedef signed char SCHAR;
|
|||
typedef SCHAR *PSCHAR;
|
||||
typedef LONG NTSTATUS;
|
||||
|
||||
#ifndef FEATURE_PAL
|
||||
#ifndef HOST_UNIX
|
||||
|
||||
#define TLS_MINIMUM_AVAILABLE 64 // winnt
|
||||
#define TLS_EXPANSION_SLOTS 1024
|
||||
|
@ -284,7 +284,7 @@ typedef ANSI_STRING64 *PANSI_STRING64;
|
|||
#define GDI_HANDLE_BUFFER_SIZE32 34
|
||||
#define GDI_HANDLE_BUFFER_SIZE64 60
|
||||
|
||||
#if !defined(_TARGET_AMD64_)
|
||||
#if !defined(TARGET_AMD64)
|
||||
#define GDI_HANDLE_BUFFER_SIZE GDI_HANDLE_BUFFER_SIZE32
|
||||
#else
|
||||
#define GDI_HANDLE_BUFFER_SIZE GDI_HANDLE_BUFFER_SIZE64
|
||||
|
@ -587,7 +587,7 @@ typedef struct _TEB {
|
|||
PVOID SystemReserved1[54]; // Used by FP emulator
|
||||
NTSTATUS ExceptionCode; // for RaiseUserException
|
||||
ACTIVATION_CONTEXT_STACK ActivationContextStack; // Fusion activation stack
|
||||
// sizeof(PVOID) is a way to express processor-dependence, more generally than #ifdef _WIN64
|
||||
// sizeof(PVOID) is a way to express processor-dependence, more generally than #ifdef HOST_64BIT
|
||||
UCHAR SpareBytes1[48 - sizeof(PVOID) - sizeof(ACTIVATION_CONTEXT_STACK)];
|
||||
GDI_TEB_BATCH GdiTebBatch; // Gdi batching
|
||||
CLIENT_ID RealClientId;
|
||||
|
@ -748,9 +748,9 @@ typedef VM_COUNTERS *PVM_COUNTERS;
|
|||
|
||||
#undef TYPE3
|
||||
|
||||
#endif // !defined(FEATURE_PAL)
|
||||
#endif // !defined(HOST_UNIX)
|
||||
|
||||
#if !defined(_TARGET_X86_)
|
||||
#if !defined(TARGET_X86)
|
||||
|
||||
typedef enum _FUNCTION_TABLE_TYPE {
|
||||
RF_SORTED,
|
||||
|
@ -762,8 +762,8 @@ typedef struct _DYNAMIC_FUNCTION_TABLE {
|
|||
LIST_ENTRY Links;
|
||||
PT_RUNTIME_FUNCTION FunctionTable;
|
||||
LARGE_INTEGER TimeStamp;
|
||||
|
||||
#ifdef _TARGET_ARM_
|
||||
|
||||
#ifdef TARGET_ARM
|
||||
ULONG MinimumAddress;
|
||||
ULONG MaximumAddress;
|
||||
ULONG BaseAddress;
|
||||
|
@ -780,12 +780,12 @@ typedef struct _DYNAMIC_FUNCTION_TABLE {
|
|||
ULONG EntryCount;
|
||||
} DYNAMIC_FUNCTION_TABLE, *PDYNAMIC_FUNCTION_TABLE;
|
||||
|
||||
#endif // !_TARGET_X86_
|
||||
#endif // !TARGET_X86
|
||||
|
||||
//
|
||||
// AMD64
|
||||
//
|
||||
#ifdef _TARGET_AMD64_
|
||||
#ifdef TARGET_AMD64
|
||||
|
||||
#define RUNTIME_FUNCTION__BeginAddress(prf) (prf)->BeginAddress
|
||||
#define RUNTIME_FUNCTION__SetBeginAddress(prf,address) ((prf)->BeginAddress = (address))
|
||||
|
@ -811,9 +811,9 @@ PEXCEPTION_ROUTINE
|
|||
IN OUT PKNONVOLATILE_CONTEXT_POINTERS ContextPointers OPTIONAL
|
||||
);
|
||||
|
||||
#ifndef FEATURE_PAL
|
||||
#ifndef HOST_UNIX
|
||||
extern RtlVirtualUnwindFn* RtlVirtualUnwind_Unsafe;
|
||||
#else // !FEATURE_PAL
|
||||
#else // !HOST_UNIX
|
||||
PEXCEPTION_ROUTINE
|
||||
RtlVirtualUnwind_Unsafe(
|
||||
IN ULONG HandlerType,
|
||||
|
@ -825,16 +825,16 @@ RtlVirtualUnwind_Unsafe(
|
|||
OUT PULONG64 EstablisherFrame,
|
||||
IN OUT PKNONVOLATILE_CONTEXT_POINTERS ContextPointers OPTIONAL
|
||||
);
|
||||
#endif // !FEATURE_PAL
|
||||
#endif // !HOST_UNIX
|
||||
|
||||
#endif // _TARGET_AMD64_
|
||||
#endif // TARGET_AMD64
|
||||
|
||||
//
|
||||
// X86
|
||||
//
|
||||
|
||||
#ifdef _TARGET_X86_
|
||||
#ifndef FEATURE_PAL
|
||||
#ifdef TARGET_X86
|
||||
#ifndef TARGET_UNIX
|
||||
//
|
||||
// x86 ABI does not define RUNTIME_FUNCTION. Define our own to allow unification between x86 and other platforms.
|
||||
//
|
||||
|
@ -847,13 +847,14 @@ typedef struct _DISPATCHER_CONTEXT {
|
|||
_EXCEPTION_REGISTRATION_RECORD* RegistrationPointer;
|
||||
} DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT;
|
||||
|
||||
#endif // !FEATURE_PAL
|
||||
#endif // !TARGET_UNIX
|
||||
|
||||
#define RUNTIME_FUNCTION__BeginAddress(prf) (prf)->BeginAddress
|
||||
#define RUNTIME_FUNCTION__SetBeginAddress(prf,addr) ((prf)->BeginAddress = (addr))
|
||||
|
||||
#ifdef WIN64EXCEPTIONS
|
||||
#ifdef FEATURE_EH_FUNCLETS
|
||||
#include "win64unwind.h"
|
||||
#include "daccess.h"
|
||||
|
||||
FORCEINLINE
|
||||
DWORD
|
||||
|
@ -886,11 +887,11 @@ RtlVirtualUnwind (
|
|||
__out PDWORD EstablisherFrame,
|
||||
__inout_opt PT_KNONVOLATILE_CONTEXT_POINTERS ContextPointers
|
||||
);
|
||||
#endif // WIN64EXCEPTIONS
|
||||
#endif // FEATURE_EH_FUNCLETS
|
||||
|
||||
#endif // _TARGET_X86_
|
||||
#endif // TARGET_X86
|
||||
|
||||
#ifdef _TARGET_ARM_
|
||||
#ifdef TARGET_ARM
|
||||
#include "daccess.h"
|
||||
|
||||
//
|
||||
|
@ -900,7 +901,7 @@ RtlVirtualUnwind (
|
|||
#define UNW_FLAG_NHANDLER 0x0 /* any handler */
|
||||
#define UNW_FLAG_EHANDLER 0x1 /* filter handler */
|
||||
#define UNW_FLAG_UHANDLER 0x2 /* unwind handler */
|
||||
|
||||
|
||||
// This function returns the length of a function using the new unwind info on arm.
|
||||
// Taken from minkernel\ntos\rtl\arm\ntrtlarm.h.
|
||||
FORCEINLINE
|
||||
|
@ -911,14 +912,14 @@ RtlpGetFunctionEndAddress (
|
|||
)
|
||||
{
|
||||
ULONG FunctionLength;
|
||||
|
||||
|
||||
FunctionLength = FunctionEntry->UnwindData;
|
||||
if ((FunctionLength & 3) != 0) {
|
||||
FunctionLength = (FunctionLength >> 2) & 0x7ff;
|
||||
} else {
|
||||
FunctionLength = *(PTR_ULONG)(ImageBase + FunctionLength) & 0x3ffff;
|
||||
}
|
||||
|
||||
|
||||
return FunctionEntry->BeginAddress + 2 * FunctionLength;
|
||||
}
|
||||
|
||||
|
@ -933,19 +934,7 @@ typedef struct _UNWIND_INFO {
|
|||
// dummy
|
||||
} UNWIND_INFO, *PUNWIND_INFO;
|
||||
|
||||
#if defined(FEATURE_PAL) || defined(_X86_)
|
||||
EXTERN_C
|
||||
NTSYSAPI
|
||||
VOID
|
||||
NTAPI
|
||||
RtlUnwindEx (
|
||||
__in_opt PVOID TargetFrame,
|
||||
__in_opt PVOID TargetIp,
|
||||
__in_opt PEXCEPTION_RECORD ExceptionRecord,
|
||||
__in PVOID ReturnValue,
|
||||
__in PT_CONTEXT ContextRecord,
|
||||
__in_opt PUNWIND_HISTORY_TABLE HistoryTable
|
||||
);
|
||||
#if defined(TARGET_UNIX) || defined(HOST_X86)
|
||||
|
||||
EXTERN_C
|
||||
NTSYSAPI
|
||||
|
@ -955,19 +944,19 @@ RtlVirtualUnwind (
|
|||
__in DWORD HandlerType,
|
||||
__in DWORD ImageBase,
|
||||
__in DWORD ControlPc,
|
||||
__in PRUNTIME_FUNCTION FunctionEntry,
|
||||
__in PT_RUNTIME_FUNCTION FunctionEntry,
|
||||
__inout PT_CONTEXT ContextRecord,
|
||||
__out PVOID *HandlerData,
|
||||
__out PDWORD EstablisherFrame,
|
||||
__inout_opt PT_KNONVOLATILE_CONTEXT_POINTERS ContextPointers
|
||||
);
|
||||
#endif // FEATURE_PAL || _X86_
|
||||
#endif // TARGET_UNIX || HOST_X86
|
||||
|
||||
#define UNW_FLAG_NHANDLER 0x0
|
||||
|
||||
#endif // _TARGET_ARM_
|
||||
#endif // TARGET_ARM
|
||||
|
||||
#ifdef _TARGET_ARM64_
|
||||
#ifdef TARGET_ARM64
|
||||
#include "daccess.h"
|
||||
|
||||
#define UNW_FLAG_NHANDLER 0x0 /* any handler */
|
||||
|
@ -984,14 +973,14 @@ RtlpGetFunctionEndAddress (
|
|||
)
|
||||
{
|
||||
ULONG64 FunctionLength;
|
||||
|
||||
|
||||
FunctionLength = FunctionEntry->UnwindData;
|
||||
if ((FunctionLength & 3) != 0) {
|
||||
FunctionLength = (FunctionLength >> 2) & 0x7ff;
|
||||
} else {
|
||||
FunctionLength = *(PTR_ULONG64)(ImageBase + FunctionLength) & 0x3ffff;
|
||||
}
|
||||
|
||||
|
||||
return FunctionEntry->BeginAddress + 4 * FunctionLength;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
import "unknwn.idl";
|
||||
|
||||
// Forward declarations
|
||||
interface ICLRPrivAppXDomain;
|
||||
interface ICLRPrivAppXRuntime;
|
||||
|
||||
/**************************************************************************************
|
||||
** ICLRPrivAppXRuntime
|
||||
**************************************************************************************/
|
||||
[
|
||||
uuid(6D2DF5A4-FA3A-4481-8BA0-0422FD21720F),
|
||||
version(1.0),
|
||||
local
|
||||
]
|
||||
interface ICLRPrivAppXRuntime : IUnknown
|
||||
{
|
||||
/**********************************************************************************
|
||||
** Use to create and initialize the AppX domain. Should only be called once; all
|
||||
** subsequent calls will fail. Thread safe.
|
||||
**
|
||||
** wzFriendlyName - the domain friendly name.
|
||||
**********************************************************************************/
|
||||
HRESULT InitializeAppXDomain(
|
||||
[in] LPCWSTR wzFriendlyName);
|
||||
|
||||
/**********************************************************************************
|
||||
** Use to retrieve the AppX domain. InitializeAppXDomain must have been
|
||||
** successfully called previously. May be called multiple times. Thread safe.
|
||||
**
|
||||
** riidDomain - the IID of the interface to be returned in ppvDomain.
|
||||
** ppIAppXDomain - receives the ICLRPrivAppXDomain interface.
|
||||
**********************************************************************************/
|
||||
HRESULT GetAppXDomain(
|
||||
[in] REFIID riidDomain,
|
||||
[out] LPVOID * ppvDomain);
|
||||
}
|
||||
|
||||
/**************************************************************************************
|
||||
** ICLRPrivAppXDomain
|
||||
**************************************************************************************/
|
||||
[
|
||||
uuid(6633398E-823D-4361-B30E-824043BD4686),
|
||||
version(1.0),
|
||||
local
|
||||
]
|
||||
interface ICLRPrivAppXDomain : IUnknown
|
||||
{
|
||||
/**********************************************************************************
|
||||
** Use to create a delegate to a static method.
|
||||
**
|
||||
** wzAssemblyName - the name of the assembly that contains the target type.
|
||||
** wzTypeName - the name of the type that contains the target method.
|
||||
** wzMethodName - the static method for which to create a delegate.
|
||||
** ppvDelegate - receives the native-callable function pointer corresponding to
|
||||
** the specified static method.
|
||||
**********************************************************************************/
|
||||
HRESULT CreateDelegate(
|
||||
[in] LPCWSTR wzAssemblyName,
|
||||
[in] LPCWSTR wzTypeName,
|
||||
[in] LPCWSTR wzMethodName,
|
||||
[out] LPVOID * ppvDelegate);
|
||||
};
|
|
@ -31,8 +31,6 @@
|
|||
interface ICLRPrivAssembly;
|
||||
typedef DPTR(ICLRPrivAssembly) PTR_ICLRPrivAssembly;
|
||||
typedef DPTR(ICLRPrivBinder) PTR_ICLRPrivBinder;
|
||||
class PEAssembly;
|
||||
class AssemblySpec;
|
||||
|
||||
//=====================================================================================================================
|
||||
#define VALIDATE_CONDITION(condition, fail_op) \
|
||||
|
@ -42,407 +40,17 @@ class AssemblySpec;
|
|||
fail_op; \
|
||||
} while (false)
|
||||
|
||||
#define VALIDATE_PTR_RET(val) VALIDATE_CONDITION(val != nullptr, return E_POINTER)
|
||||
#define VALIDATE_PTR_THROW(val) VALIDATE_CONDITION(val != nullptr, ThrowHR(E_POINTER))
|
||||
#define VALIDATE_PTR_RET(val) VALIDATE_CONDITION((val) != nullptr, return E_POINTER)
|
||||
#define VALIDATE_PTR_THROW(val) VALIDATE_CONDITION((val) != nullptr, ThrowHR(E_POINTER))
|
||||
#define VALIDATE_ARG_RET(condition) VALIDATE_CONDITION(condition, return E_INVALIDARG)
|
||||
#define VALIDATE_ARG_THROW(condition) VALIDATE_CONDITION(condition, ThrowHR(E_INVALIDARG))
|
||||
|
||||
//=====================================================================================================================
|
||||
namespace CLRPrivBinderUtil
|
||||
{
|
||||
//=================================================================================================================
|
||||
enum BindFlags
|
||||
{
|
||||
BF_BindIL = 1,
|
||||
BF_BindNI = 2,
|
||||
BF_Default = BF_BindIL | BF_BindNI,
|
||||
};
|
||||
|
||||
//=================================================================================================================
|
||||
template <typename ItfT, typename ObjT>
|
||||
inline ItfT * ToInterface(
|
||||
ObjT * && pObj)
|
||||
{
|
||||
STATIC_CONTRACT_THROWS;
|
||||
|
||||
ItfT * pItf = nullptr;
|
||||
IfFailThrow(pObj->QueryInterface(__uuidof(ItfT), (void **)&pItf));
|
||||
return pItf;
|
||||
}
|
||||
|
||||
//=================================================================================================================
|
||||
template <typename ItfT, typename ObjT>
|
||||
inline ItfT * ToInterface_NoThrow(
|
||||
ObjT * && pObj)
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
|
||||
ItfT * pItf = nullptr;
|
||||
if (FAILED(pObj->QueryInterface(__uuidof(ItfT), (void **)&pItf)))
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
return pItf;
|
||||
}
|
||||
|
||||
//=====================================================================================================================
|
||||
|
||||
//=================================================================================================================
|
||||
// Used to create an identity-only ICLRPrivAssembly from an ICLRPrivBinder. This is currently used when
|
||||
// creating dynamic assemblies as these use the parent assembly's ICLRPrivBinder object to provide binding
|
||||
// functionaltiy.
|
||||
|
||||
class CLRPrivBinderAsAssemblyWrapper :
|
||||
public IUnknownCommon<ICLRPrivAssembly>
|
||||
{
|
||||
public:
|
||||
//-----------------------------------------------------------------------------------------------------------------
|
||||
CLRPrivBinderAsAssemblyWrapper(
|
||||
ICLRPrivBinder *pWrapped)
|
||||
: _pWrapped(clr::SafeAddRef(pWrapped))
|
||||
{
|
||||
STANDARD_VM_CONTRACT;
|
||||
VALIDATE_ARG_THROW(pWrapped);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------
|
||||
// Forwards to wrapped binder.
|
||||
STDMETHOD(BindAssemblyByName)(
|
||||
IAssemblyName * pAssemblyName,
|
||||
ICLRPrivAssembly ** ppAssembly)
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
return _pWrapped->BindAssemblyByName(pAssemblyName, ppAssembly);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------
|
||||
// Forwards to wrapped binder.
|
||||
STDMETHOD(GetBinderID)(
|
||||
UINT_PTR *pBinderId)
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
return _pWrapped->GetBinderID(pBinderId);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------
|
||||
// Forwards to wrapped binder.
|
||||
STDMETHOD(GetLoaderAllocator)(
|
||||
LPVOID * pLoaderAllocator)
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
return _pWrapped->GetLoaderAllocator(pLoaderAllocator);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------
|
||||
// ICLRPrivAssembly method is unsupported.
|
||||
STDMETHOD(IsShareable)(
|
||||
BOOL * pbIsShareable)
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
_ASSERTE_MSG(false, "CLRPrivBinderAsAssemblyWrapper does not support ICLRPrivAssembly methods (just ICLRPrivBinder ones)!");
|
||||
VALIDATE_ARG_RET(pbIsShareable);
|
||||
*pbIsShareable = FALSE;
|
||||
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------
|
||||
// ICLRPrivAssembly method is unsupported.
|
||||
STDMETHOD(GetAvailableImageTypes)(
|
||||
LPDWORD pdwImageTypes)
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
_ASSERTE_MSG(false, "CLRPrivBinderAsAssemblyWrapper does not support ICLRPrivAssembly methods (just ICLRPrivBinder ones)!");
|
||||
VALIDATE_ARG_RET(pdwImageTypes);
|
||||
*pdwImageTypes = 0;
|
||||
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------
|
||||
// ICLRPrivAssembly method is unsupported.
|
||||
STDMETHOD(GetImageResource)(
|
||||
DWORD dwImageType,
|
||||
DWORD* pdwImageType,
|
||||
ICLRPrivResource ** ppIResource)
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
_ASSERTE_MSG(false, "CLRPrivBinderAsAssemblyWrapper does not support ICLRPrivAssembly methods (just ICLRPrivBinder ones)!");
|
||||
VALIDATE_ARG_RET(pdwImageType);
|
||||
*pdwImageType = 0;
|
||||
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
private:
|
||||
ReleaseHolder<ICLRPrivBinder> _pWrapped;
|
||||
};
|
||||
|
||||
//=================================================================================================================
|
||||
// Provides a struct that can be accessed at the QWORD, DWORD, or WORD level, and is structured
|
||||
|
||||
struct AssemblyVersion
|
||||
{
|
||||
#if BIGENDIAN
|
||||
union
|
||||
{
|
||||
UINT64 qwMajorMinorBuildRevision;
|
||||
struct
|
||||
{
|
||||
union
|
||||
{
|
||||
DWORD dwMajorMinor;
|
||||
struct
|
||||
{
|
||||
WORD wMajor;
|
||||
WORD wMinor;
|
||||
};
|
||||
};
|
||||
union
|
||||
{
|
||||
DWORD dwBuildRevision;
|
||||
struct
|
||||
{
|
||||
WORD wBuild;
|
||||
WORD wRevision;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
#else
|
||||
union
|
||||
{
|
||||
UINT64 qwMajorMinorBuildRevision;
|
||||
struct
|
||||
{
|
||||
union
|
||||
{
|
||||
DWORD dwBuildRevision;
|
||||
struct
|
||||
{
|
||||
WORD wRevision;
|
||||
WORD wBuild;
|
||||
};
|
||||
};
|
||||
union
|
||||
{
|
||||
DWORD dwMajorMinor;
|
||||
struct
|
||||
{
|
||||
WORD wMinor;
|
||||
WORD wMajor;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
// Default value is 0.0.0.0
|
||||
AssemblyVersion()
|
||||
: qwMajorMinorBuildRevision(static_cast<UINT64>(0))
|
||||
{ LIMITED_METHOD_CONTRACT; }
|
||||
|
||||
// Copy constructor
|
||||
AssemblyVersion(AssemblyVersion const & other)
|
||||
: qwMajorMinorBuildRevision(other.qwMajorMinorBuildRevision)
|
||||
{ LIMITED_METHOD_CONTRACT; }
|
||||
|
||||
// Initialize version using an IAssemblyName object.
|
||||
HRESULT Initialize(IAssemblyName * pName);
|
||||
|
||||
// Initialize version using an ICLRPrivAssemblyInfo object.
|
||||
HRESULT Initialize(ICLRPrivAssemblyInfo * pInfo);
|
||||
|
||||
// Relative ordering of versions.
|
||||
static inline int Compare(
|
||||
AssemblyVersion const & left,
|
||||
AssemblyVersion const & right)
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
|
||||
if (left.qwMajorMinorBuildRevision < right.qwMajorMinorBuildRevision)
|
||||
return -1;
|
||||
else if (left.qwMajorMinorBuildRevision == right.qwMajorMinorBuildRevision)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
}; // struct AssemblyVersion
|
||||
|
||||
inline bool operator ==(AssemblyVersion const & lhs, AssemblyVersion const & rhs)
|
||||
{ LIMITED_METHOD_CONTRACT; return lhs.qwMajorMinorBuildRevision == rhs.qwMajorMinorBuildRevision; }
|
||||
|
||||
inline bool operator !=(AssemblyVersion const & lhs, AssemblyVersion const & rhs)
|
||||
{ LIMITED_METHOD_CONTRACT; return lhs.qwMajorMinorBuildRevision != rhs.qwMajorMinorBuildRevision; }
|
||||
|
||||
inline bool operator <(AssemblyVersion const & lhs, AssemblyVersion const & rhs)
|
||||
{ LIMITED_METHOD_CONTRACT; return lhs.qwMajorMinorBuildRevision < rhs.qwMajorMinorBuildRevision; }
|
||||
|
||||
inline bool operator <=(AssemblyVersion const & lhs, AssemblyVersion const & rhs)
|
||||
{ LIMITED_METHOD_CONTRACT; return lhs.qwMajorMinorBuildRevision <= rhs.qwMajorMinorBuildRevision; }
|
||||
|
||||
inline bool operator >(AssemblyVersion const & lhs, AssemblyVersion const & rhs)
|
||||
{ LIMITED_METHOD_CONTRACT; return lhs.qwMajorMinorBuildRevision > rhs.qwMajorMinorBuildRevision; }
|
||||
|
||||
inline bool operator >=(AssemblyVersion const & lhs, AssemblyVersion const & rhs)
|
||||
{ LIMITED_METHOD_CONTRACT; return lhs.qwMajorMinorBuildRevision >= rhs.qwMajorMinorBuildRevision; }
|
||||
|
||||
//=================================================================================================================
|
||||
// Encapsulates PublicKey value, can be initialized using a variety of data sources.
|
||||
|
||||
struct PublicKey
|
||||
{
|
||||
// Defaults to empty value.
|
||||
PublicKey()
|
||||
: m_key(nullptr)
|
||||
, m_key_owned(false)
|
||||
, m_size((DWORD)-1)
|
||||
{ LIMITED_METHOD_CONTRACT; }
|
||||
|
||||
// Construct directly from existing public key data.
|
||||
PublicKey(PBYTE pbKey, DWORD cbKey)
|
||||
: m_key(pbKey)
|
||||
, m_key_owned(false)
|
||||
, m_size(cbKey)
|
||||
{ LIMITED_METHOD_CONTRACT; }
|
||||
|
||||
~PublicKey()
|
||||
{ WRAPPER_NO_CONTRACT; Uninitialize(); }
|
||||
|
||||
// Frees any public key data and resets to default value.
|
||||
void Uninitialize()
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
|
||||
if (m_key_owned)
|
||||
{
|
||||
delete [] m_key;
|
||||
m_key_owned = false;
|
||||
}
|
||||
m_key = nullptr;
|
||||
m_size = 0;
|
||||
}
|
||||
|
||||
// Initialize PK data form an ICLRPrivAssemblyInfo object.
|
||||
HRESULT Initialize(ICLRPrivAssemblyInfo * pAssemblyInfo);
|
||||
|
||||
// Returns PK data pointer.
|
||||
inline BYTE const * GetKey() const
|
||||
{ LIMITED_METHOD_CONTRACT; return m_key; }
|
||||
|
||||
// Returns size in bytes of the PK data.
|
||||
inline DWORD GetSize() const
|
||||
{ LIMITED_METHOD_CONTRACT; return m_size; }
|
||||
|
||||
private:
|
||||
PBYTE m_key;
|
||||
bool m_key_owned;
|
||||
DWORD m_size;
|
||||
};
|
||||
|
||||
//=================================================================================================================
|
||||
// Encapsulates PublicKeyToken value, can be initialized using a variety of data sources.
|
||||
//
|
||||
// Constraints: assumes that non-empty PKT data will always be 8 bytes long.
|
||||
//
|
||||
|
||||
struct PublicKeyToken
|
||||
{
|
||||
PublicKeyToken()
|
||||
: m_cbKeyToken(0)
|
||||
{ LIMITED_METHOD_CONTRACT; ZeroMemory(&m_rbKeyToken, sizeof(m_rbKeyToken)); }
|
||||
|
||||
PublicKeyToken(PublicKeyToken const & other)
|
||||
: m_cbKeyToken(other.m_cbKeyToken)
|
||||
{ LIMITED_METHOD_CONTRACT; CopyMemory(m_rbKeyToken, other.m_rbKeyToken, sizeof(m_rbKeyToken)); }
|
||||
|
||||
// Initialize directly from PKT data.
|
||||
HRESULT Initialize(BYTE * pbKeyToken, DWORD cbKeyToken);
|
||||
|
||||
// Converts PK data to PKT data.
|
||||
HRESULT Initialize(PublicKey const & pk);
|
||||
|
||||
// Initialize using the PKT value contained by pName; returns S_FALSE if there is no associated PKT.
|
||||
HRESULT Initialize(IAssemblyName * pName);
|
||||
|
||||
// Initialize using the PK data contained by pInfo; returns S_FALSE if there is no associated PK.
|
||||
HRESULT Initialize(ICLRPrivAssemblyInfo * pInfo);
|
||||
|
||||
// PKT data.
|
||||
BYTE const * GetToken() const
|
||||
{ LIMITED_METHOD_CONTRACT; return m_rbKeyToken; }
|
||||
|
||||
// Size in bytes of the PKT (should always be 0 or 8).
|
||||
DWORD GetSize() const
|
||||
{ LIMITED_METHOD_CONTRACT; return m_cbKeyToken; }
|
||||
|
||||
private:
|
||||
static const DWORD PUBLIC_KEY_TOKEN_LEN1 = 8;
|
||||
BYTE m_rbKeyToken[PUBLIC_KEY_TOKEN_LEN1];
|
||||
DWORD m_cbKeyToken;
|
||||
};
|
||||
|
||||
bool operator==(PublicKeyToken const & lhs, PublicKeyToken const & rhs);
|
||||
|
||||
inline bool operator!=(PublicKeyToken const & lhs, PublicKeyToken const & rhs)
|
||||
{ WRAPPER_NO_CONTRACT; return !(lhs == rhs); }
|
||||
|
||||
//=================================================================================================================
|
||||
// Encapsulates data required for packaged assembly identity: simple name, version, and public key token.
|
||||
//
|
||||
// Constraints: assumes that the assembly simple name is no longer than _MAX_PATH
|
||||
//
|
||||
|
||||
struct AssemblyIdentity
|
||||
{
|
||||
AssemblyIdentity()
|
||||
{ LIMITED_METHOD_CONTRACT; Name[0] = W('\0'); }
|
||||
|
||||
AssemblyIdentity(AssemblyIdentity const & other)
|
||||
: Version(other.Version)
|
||||
, KeyToken(other.KeyToken)
|
||||
{ LIMITED_METHOD_CONTRACT; CopyMemory(Name, other.Name, sizeof(Name)); }
|
||||
|
||||
// Initialize from assembly simple name; default version and empty PKT values are used.
|
||||
HRESULT Initialize(LPCWSTR wzName);
|
||||
|
||||
// Initialize from an ICLRPrivAssemblyInfo object.
|
||||
HRESULT Initialize(ICLRPrivAssemblyInfo * pAssemblyInfo);
|
||||
|
||||
// Initialize from an IAssemblyName object.
|
||||
HRESULT Initialize(IAssemblyName * pAssemblyName);
|
||||
|
||||
// Initialize from an AssemblySpec object.
|
||||
HRESULT Initialize(AssemblySpec * pSpec);
|
||||
|
||||
// Assembly simple name
|
||||
WCHAR Name[_MAX_PATH];
|
||||
|
||||
// Assembly version; defaults to 0.0.0.0.
|
||||
CLRPrivBinderUtil::AssemblyVersion Version;
|
||||
|
||||
// Assembly public key token; defaults to none.
|
||||
CLRPrivBinderUtil::PublicKeyToken KeyToken;
|
||||
};
|
||||
|
||||
//=================================================================================================
|
||||
template <typename ItfT>
|
||||
struct CLRPrivResourceBase :
|
||||
public IUnknownCommon<ICLRPrivResource>
|
||||
{
|
||||
//---------------------------------------------------------------------------------------------
|
||||
STDMETHOD(GetResourceType)(
|
||||
IID *pIID)
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
if (pIID == nullptr)
|
||||
return E_INVALIDARG;
|
||||
*pIID = __uuidof(ItfT);
|
||||
return S_OK;
|
||||
}
|
||||
};
|
||||
|
||||
//=================================================================================================================
|
||||
class CLRPrivResourcePathImpl :
|
||||
public IUnknownCommon< ItfBase< CLRPrivResourceBase< ICLRPrivResourcePath > >,
|
||||
ICLRPrivResourcePath >
|
||||
public IUnknownCommon2<ICLRPrivResource, IID_ICLRPrivResource, ICLRPrivResourcePath, IID_ICLRPrivResourcePath>
|
||||
{
|
||||
public:
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
@ -452,9 +60,16 @@ namespace CLRPrivBinderUtil
|
|||
LPCWSTR GetPath()
|
||||
{ return m_wzPath; }
|
||||
|
||||
//
|
||||
// ICLRPrivResourcePath methods
|
||||
//
|
||||
//---------------------------------------------------------------------------------------------
|
||||
STDMETHOD(GetResourceType)(
|
||||
IID* pIID)
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
if (pIID == nullptr)
|
||||
return E_INVALIDARG;
|
||||
*pIID = __uuidof(ICLRPrivResourcePath);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
STDMETHOD(GetPath)(
|
||||
|
@ -467,77 +82,17 @@ namespace CLRPrivBinderUtil
|
|||
NewArrayHolder<WCHAR> m_wzPath;
|
||||
};
|
||||
|
||||
//=================================================================================================================
|
||||
class CLRPrivResourceStreamImpl :
|
||||
public IUnknownCommon< ItfBase< CLRPrivResourceBase<ICLRPrivResourceStream > >,
|
||||
ICLRPrivResourceStream>
|
||||
{
|
||||
public:
|
||||
//---------------------------------------------------------------------------------------------
|
||||
CLRPrivResourceStreamImpl(IStream * pStream);
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
STDMETHOD(GetStream)(
|
||||
REFIID riid,
|
||||
LPVOID * ppvStream);
|
||||
|
||||
private:
|
||||
//---------------------------------------------------------------------------------------------
|
||||
ReleaseHolder<IStream> m_pStream;
|
||||
};
|
||||
|
||||
//=================================================================================================================
|
||||
// Helper to prioritize binder errors. This class will ensure that all other errors have priority over
|
||||
// CLR_E_BIND_UNRECOGNIZED_IDENTITY_FORMAT. This class should be used just like an HRESULT variable.
|
||||
class BinderHRESULT
|
||||
{
|
||||
public:
|
||||
BinderHRESULT()
|
||||
: m_hr(S_OK)
|
||||
{}
|
||||
|
||||
BinderHRESULT(HRESULT hr)
|
||||
: m_hr(hr)
|
||||
{}
|
||||
|
||||
operator HRESULT() const
|
||||
{ return m_hr; }
|
||||
|
||||
BinderHRESULT & operator=(HRESULT hr)
|
||||
{
|
||||
// Always record change in success/failure status.
|
||||
if (FAILED(hr) != FAILED(m_hr))
|
||||
m_hr = hr;
|
||||
|
||||
if (FAILED(hr))
|
||||
{
|
||||
if (SUCCEEDED(m_hr))
|
||||
m_hr = hr;
|
||||
else if (m_hr == CLR_E_BIND_UNRECOGNIZED_IDENTITY_FORMAT)
|
||||
m_hr = hr;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_hr = hr;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
HRESULT m_hr;
|
||||
}; // class BinderHRESULT
|
||||
|
||||
//=================================================================================================================
|
||||
// Types for WStringList (used in WinRT binders)
|
||||
|
||||
|
||||
typedef SListElem< PTR_WSTR > WStringListElem;
|
||||
typedef DPTR(WStringListElem) PTR_WStringListElem;
|
||||
typedef SList< WStringListElem, false /* = fHead default value */, PTR_WStringListElem > WStringList;
|
||||
typedef DPTR(WStringList) PTR_WStringList;
|
||||
|
||||
|
||||
// Destroys list of strings (code:WStringList).
|
||||
void WStringList_Delete(WStringList * pList);
|
||||
|
||||
|
||||
#ifndef DACCESS_COMPILE
|
||||
//=====================================================================================================================
|
||||
// Holder of allocated code:WStringList (helper class for WinRT binders - e.g. code:CLRPrivBinderWinRT::GetFileNameListForNamespace).
|
||||
|
@ -554,7 +109,7 @@ namespace CLRPrivBinderUtil
|
|||
LIMITED_METHOD_CONTRACT;
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
||||
void InsertTail(LPCWSTR wszValue)
|
||||
{
|
||||
CONTRACTL
|
||||
|
@ -564,52 +119,52 @@ namespace CLRPrivBinderUtil
|
|||
MODE_ANY;
|
||||
}
|
||||
CONTRACTL_END;
|
||||
|
||||
|
||||
NewArrayHolder<WCHAR> wszElemValue = DuplicateStringThrowing(wszValue);
|
||||
NewHolder<WStringListElem> pElem = new WStringListElem(wszElemValue);
|
||||
|
||||
|
||||
if (m_pList == nullptr)
|
||||
{
|
||||
m_pList = new WStringList();
|
||||
}
|
||||
|
||||
|
||||
m_pList->InsertTail(pElem.Extract());
|
||||
// The string is now owned by the list
|
||||
wszElemValue.SuppressRelease();
|
||||
}
|
||||
|
||||
|
||||
WStringList * GetValue()
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
return m_pList;
|
||||
}
|
||||
|
||||
|
||||
WStringList * Extract()
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
|
||||
|
||||
WStringList * pList = m_pList;
|
||||
m_pList = nullptr;
|
||||
return pList;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
void Destroy()
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
|
||||
|
||||
if (m_pList != nullptr)
|
||||
{
|
||||
WStringList_Delete(m_pList);
|
||||
m_pList = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
WStringList * m_pList;
|
||||
}; // class WStringListHolder
|
||||
#endif //!DACCESS_COMPILE
|
||||
|
||||
|
||||
#ifdef FEATURE_COMINTEROP
|
||||
//=====================================================================================================================
|
||||
// Holder of allocated array of HSTRINGs (helper class for WinRT binders - e.g. code:CLRPrivBinderWinRT::m_rgAltPaths).
|
||||
|
@ -619,7 +174,7 @@ namespace CLRPrivBinderUtil
|
|||
HSTRINGArrayHolder()
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
|
||||
|
||||
m_cValues = 0;
|
||||
m_rgValues = nullptr;
|
||||
}
|
||||
|
@ -629,20 +184,20 @@ namespace CLRPrivBinderUtil
|
|||
LIMITED_METHOD_CONTRACT;
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
||||
// Destroys current array and allocates a new one with cValues elements.
|
||||
void Allocate(DWORD cValues)
|
||||
{
|
||||
STANDARD_VM_CONTRACT;
|
||||
|
||||
|
||||
Destroy();
|
||||
_ASSERTE(m_cValues == 0);
|
||||
|
||||
|
||||
if (cValues > 0)
|
||||
{
|
||||
m_rgValues = new HSTRING[cValues];
|
||||
m_cValues = cValues;
|
||||
|
||||
|
||||
// Initialize the array values
|
||||
for (DWORD i = 0; i < cValues; i++)
|
||||
{
|
||||
|
@ -657,25 +212,25 @@ namespace CLRPrivBinderUtil
|
|||
LIMITED_METHOD_CONTRACT;
|
||||
return m_rgValues[index];
|
||||
}
|
||||
|
||||
|
||||
HSTRING * GetRawArray()
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
return m_rgValues;
|
||||
}
|
||||
|
||||
|
||||
DWORD GetCount()
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
return m_cValues;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
#ifndef DACCESS_COMPILE
|
||||
void Destroy()
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
|
||||
|
||||
for (DWORD i = 0; i < m_cValues; i++)
|
||||
{
|
||||
if (m_rgValues[i] != nullptr)
|
||||
|
@ -684,7 +239,7 @@ namespace CLRPrivBinderUtil
|
|||
}
|
||||
}
|
||||
m_cValues = 0;
|
||||
|
||||
|
||||
if (m_rgValues != nullptr)
|
||||
{
|
||||
delete [] m_rgValues;
|
||||
|
@ -692,26 +247,13 @@ namespace CLRPrivBinderUtil
|
|||
}
|
||||
}
|
||||
#endif //!DACCESS_COMPILE
|
||||
|
||||
|
||||
private:
|
||||
DWORD m_cValues;
|
||||
HSTRING * m_rgValues;
|
||||
}; // class HSTRINGArrayHolder
|
||||
|
||||
|
||||
#endif // FEATURE_COMINTEROP
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
///// ----------------------------- Questionable stuff -------------------------------------------
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/** probably should be exposed on an instance (of something) method rather that magically calling GetAppDomain() **/
|
||||
ICLRPrivAssembly* RaiseAssemblyResolveEvent(IAssemblyName *pAssemblyName, ICLRPrivAssembly* pRequestingAssembly);
|
||||
|
||||
/** Ultimately, only the binder can do ref-def matching, and it should be opaque to CLR.
|
||||
This is not trivial to do, however, since we cannot do data conversion as the function is nofault **/
|
||||
BOOL CompareHostBinderSpecs(AssemblySpec* a1, AssemblySpec* a2);
|
||||
|
||||
/** PLACEHOLDER - the same issue as CompareHostBinderSpecs applies to hashing assemblyspecs **/
|
||||
} // namespace CLRPrivBinderUtil
|
||||
|
||||
#endif // __CLRPRIVBINDERUTIL_H__
|
||||
|
|
|
@ -12,8 +12,6 @@ interface ICLRPrivAssembly;
|
|||
|
||||
interface ICLRPrivResource;
|
||||
interface ICLRPrivResourcePath;
|
||||
interface ICLRPrivResourceStream;
|
||||
interface ICLRPrivResourceHMODULE;
|
||||
|
||||
interface ICLRPrivAssemblyInfo;
|
||||
|
||||
|
@ -54,7 +52,7 @@ interface ICLRPrivBinder : IUnknown
|
|||
** GetBinderID
|
||||
** pBinderId, pointer to binder id. The binder id has the following properties
|
||||
** It is a pointer that does not change over the lifetime of a binder object
|
||||
** It points at an object in memory that will remain allocated for the lifetime of the binder.
|
||||
** It points at an object in memory that will remain allocated for the lifetime of the binder.
|
||||
** This value should be the same for a set of binder objects that represent the same binder behavior.
|
||||
**********************************************************************************/
|
||||
HRESULT GetBinderID(
|
||||
|
@ -97,19 +95,6 @@ enum ASSEMBLY_IMAGE_TYPES
|
|||
]
|
||||
interface ICLRPrivAssembly : ICLRPrivBinder
|
||||
{
|
||||
/**********************************************************************************
|
||||
** IsShareable - Use to determine if the assembly should be shared.
|
||||
** NOTE: This method is required to be idempotent. See general comment above.
|
||||
**
|
||||
** A binder must adhere to the following contract when marking an assembly as
|
||||
** shareable:
|
||||
** - all assemblies in the full static binding closure must also be shareable.
|
||||
**
|
||||
** pbIsShareable - set to TRUE if the assembly can be shared; FALSE otherwise.
|
||||
**********************************************************************************/
|
||||
HRESULT IsShareable(
|
||||
[out, retval] BOOL * pbIsShareable);
|
||||
|
||||
/**********************************************************************************
|
||||
** GetAvailableImageTypes - Use to retrieve the set of images available for an
|
||||
** assembly.
|
||||
|
@ -177,48 +162,6 @@ interface ICLRPrivResourcePath : IUnknown
|
|||
[out, size_is(cchBuffer), length_is(*pcchBuffer), string, optional] LPWSTR wzBuffer);
|
||||
};
|
||||
|
||||
/**************************************************************************************
|
||||
** ICLRPrivResourceStream - Encapsulates a resource identified by IStream.
|
||||
**************************************************************************************/
|
||||
[
|
||||
uuid(2601F621-E462-404C-B299-3E1DE72F8545),
|
||||
version(1.0),
|
||||
local
|
||||
]
|
||||
interface ICLRPrivResourceStream : IUnknown
|
||||
{
|
||||
/**********************************************************************************
|
||||
** GetStream - Use to retrieve IStream instance corresponding to the resource.
|
||||
** NOTE: This method is required to be idempotent. See general comment above.
|
||||
**
|
||||
** riid - the IID of the interface to return. Typically IID_IStream.
|
||||
** ppvStream - contains the returned interface.
|
||||
**********************************************************************************/
|
||||
HRESULT GetStream(
|
||||
[in] REFIID riid,
|
||||
[out, iid_is(riid), retval] LPVOID * ppvStream);
|
||||
};
|
||||
|
||||
/**************************************************************************************
|
||||
** ICLRPrivResourceHMODULE - Encapsulates a resource identified by HMODULE.
|
||||
**************************************************************************************/
|
||||
[
|
||||
uuid(2601F621-E462-404C-B299-3E1DE72F8546),
|
||||
version(1.0),
|
||||
local
|
||||
]
|
||||
interface ICLRPrivResourceHMODULE : IUnknown
|
||||
{
|
||||
/**********************************************************************************
|
||||
** GetStream - Use to retrieve the resource's HMODULE value. The HMODULE's
|
||||
** reference count is not changed; the ICLRPrivResourceHMODULE instance must be
|
||||
** kept until the HMODULE is either reference counted or no longer used.
|
||||
** NOTE: This method is required to be idempotent. See general comment above.
|
||||
**********************************************************************************/
|
||||
HRESULT GetHMODULE(
|
||||
[out, retval] HMODULE * phModule);
|
||||
};
|
||||
|
||||
[
|
||||
uuid(8d2d3cc9-1249-4ad4-977d-b772bd4e8a94),
|
||||
version(1.0),
|
||||
|
@ -227,7 +170,7 @@ interface ICLRPrivResourceHMODULE : IUnknown
|
|||
interface ICLRPrivResourceAssembly : IUnknown
|
||||
{
|
||||
/**********************************************************************************
|
||||
** GetAssembly - Use to retrieve the resource's BINDER_SPACE::Assembly value.
|
||||
** GetAssembly - Use to retrieve the resource's BINDER_SPACE::Assembly value.
|
||||
** NOTE: This method is required to be idempotent. See general comment above.
|
||||
**********************************************************************************/
|
||||
HRESULT GetAssembly(
|
||||
|
@ -265,31 +208,10 @@ interface ICLRPrivAssemblyInfo : IUnknown
|
|||
** ICLRPrivAssemblyID_WinRT - Provides identification for WinRT assembly - allows dynamic casting inside code:CLRPrivAssemblyWinRT.
|
||||
**************************************************************************************/
|
||||
[
|
||||
uuid(4372D277-9906-4FED-BF53-30C0B4010896),
|
||||
version(1.0),
|
||||
uuid(4372D277-9906-4FED-BF53-30C0B4010896),
|
||||
version(1.0),
|
||||
local
|
||||
]
|
||||
interface ICLRPrivAssemblyID_WinRT : IUnknown
|
||||
{
|
||||
};
|
||||
|
||||
/**************************************************************************************
|
||||
** ICLRPrivWinRtTypeBinder - Provides binding to WinRT types that are already loaded.
|
||||
**************************************************************************************/
|
||||
[
|
||||
uuid(6DE2A085-EFF4-4078-9F60-B9D366736398),
|
||||
version(1.0),
|
||||
local
|
||||
]
|
||||
interface ICLRPrivWinRtTypeBinder : IUnknown
|
||||
{
|
||||
/**********************************************************************************
|
||||
** FindAssemblyForWinRtTypeIfLoaded
|
||||
** Finds Assembly * for type in AppDomain * if it is loaded.
|
||||
** Returns NULL if assembly is not loaded or type is not found.
|
||||
**********************************************************************************/
|
||||
void * FindAssemblyForWinRtTypeIfLoaded(
|
||||
void * pAppDomain,
|
||||
LPCUTF8 szNamespace,
|
||||
LPCUTF8 szClassName);
|
||||
};
|
||||
|
|
|
@ -1,92 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
import "unknwn.idl";
|
||||
import "CLRPrivBinding.idl";
|
||||
|
||||
//=====================================================================================================================
|
||||
// Forward declarations
|
||||
interface ICLRPrivRuntime;
|
||||
|
||||
//=====================================================================================================================
|
||||
// CLRPrivHosting coclass
|
||||
//=====================================================================================================================
|
||||
[
|
||||
uuid("EDA73987-E6C0-42BF-A6B7-073F7B24D8C7")
|
||||
]
|
||||
library CLRPrivHosting
|
||||
{
|
||||
//=================================================================================================================
|
||||
// CLRPrivRuntime
|
||||
//=================================================================================================================
|
||||
[
|
||||
uuid(BC1B53A8-DCBC-43B2-BB17-1E4061447AE8)
|
||||
]
|
||||
coclass CLRPrivRuntime
|
||||
{
|
||||
[default] interface ICLRPrivRuntime;
|
||||
};
|
||||
};
|
||||
|
||||
//=====================================================================================================================
|
||||
// ICLRPrivRuntime
|
||||
//=====================================================================================================================
|
||||
[
|
||||
uuid(BC1B53A8-DCBC-43B2-BB17-1E4061447AE9),
|
||||
version(1.0),
|
||||
local
|
||||
]
|
||||
interface ICLRPrivRuntime : IUnknown
|
||||
{
|
||||
/**********************************************************************************
|
||||
** Used for accessing additional hosting functionality.
|
||||
**
|
||||
** rclsid - the CoClass from which to request the interface.
|
||||
** riid - the IID of the interface being requested.
|
||||
** ppUnk - receives the interface pointer value.
|
||||
**********************************************************************************/
|
||||
HRESULT GetInterface(
|
||||
[in] REFCLSID rclsid,
|
||||
[in] REFIID riid,
|
||||
[out, iid_is(riid), retval] LPVOID *ppUnk);
|
||||
|
||||
/**********************************************************************************
|
||||
** Creates a domain using the provided binder for the root default bind context.
|
||||
**
|
||||
** pwzFriendlyName - the name to associate with the domain.
|
||||
** pBinder - the binder to use for root-level binds in the default context.
|
||||
** pdwAppDomainId - receives the ID of the created domain.
|
||||
**********************************************************************************/
|
||||
HRESULT CreateAppDomain(
|
||||
[in, string] LPCWSTR pwzFriendlyName,
|
||||
[in] ICLRPrivBinder * pBinder,
|
||||
[out, retval] LPDWORD pdwAppDomainId);
|
||||
|
||||
/**********************************************************************************
|
||||
** Creates a native-callable function pointer to the specified method.
|
||||
**
|
||||
** appDomainID - the domain in which to create the delegate.
|
||||
** wszAssemblyName - the name of the assembly in which the method is defined.
|
||||
** wszClassName - the name of the class (including namespace) in which the method
|
||||
** is defined.
|
||||
** wszMethodName - the name of the method for which to create a delegate.
|
||||
** ppvDelegate - receives the delegate pointer value.
|
||||
**********************************************************************************/
|
||||
HRESULT CreateDelegate(
|
||||
[in] DWORD appDomainID,
|
||||
[in, string] LPCWSTR wszAssemblyName,
|
||||
[in, string] LPCWSTR wszClassName,
|
||||
[in, string] LPCWSTR wszMethodName,
|
||||
[out, retval] LPVOID * ppvDelegate);
|
||||
|
||||
/**********************************************************************************
|
||||
** Creates an AppX appdomain and executes entrypoint method of an executable there
|
||||
**
|
||||
**********************************************************************************/
|
||||
HRESULT ExecuteMain(
|
||||
[in] ICLRPrivBinder * pBinder,
|
||||
[out, retval] int * pRetVal
|
||||
);
|
||||
};
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
import "CLRPrivBinding.idl";
|
||||
|
||||
//=====================================================================================================================
|
||||
// CLRPrivRuntime
|
||||
//=====================================================================================================================
|
||||
[
|
||||
uuid("EA6A2170-8F6A-4007-87A9-02429F615958")
|
||||
]
|
||||
library CLRPrivRuntimeBinders
|
||||
{
|
||||
//=================================================================================================================
|
||||
// CLRPrivAppXBinder
|
||||
//=================================================================================================================
|
||||
[
|
||||
uuid(E990F732-2D0A-48AC-87FC-EF12B618981A),
|
||||
helpstring("Runtime-provided package-based assembly binder for AppX."),
|
||||
]
|
||||
coclass CLRPrivAppXBinder
|
||||
{
|
||||
[default] interface ICLRPrivBinder;
|
||||
};
|
||||
|
||||
//=================================================================================================================
|
||||
// CLRPrivFusionBinder
|
||||
//=================================================================================================================
|
||||
[
|
||||
uuid(E990F732-2D0A-48AC-87FC-EF12B618981C),
|
||||
helpstring("Runtime-provided binder for wrapping ICLRPrivBinder-compatible subset of fusion functionality."),
|
||||
]
|
||||
coclass CLRPrivFusionBinder
|
||||
{
|
||||
[default] interface ICLRPrivBinder;
|
||||
};
|
||||
};
|
||||
|
|
@ -23,10 +23,10 @@
|
|||
#include "staticcontract.h"
|
||||
#include "static_assert.h"
|
||||
|
||||
#if _WIN64
|
||||
#define POINTER_BITS 64
|
||||
#if HOST_64BIT
|
||||
#define POINTER_BITS (64)
|
||||
#else
|
||||
#define POINTER_BITS 32
|
||||
#define POINTER_BITS (32)
|
||||
#endif
|
||||
|
||||
// ================================================================================
|
||||
|
@ -60,7 +60,7 @@
|
|||
#define INT16_MAX 32767i16
|
||||
#define INT32_MAX 2147483647i32
|
||||
#define INT64_MAX 9223372036854775807i64
|
||||
|
||||
|
||||
#define UINT8_MAX 0xffui8
|
||||
#define UINT16_MAX 0xffffui16
|
||||
#define UINT32_MAX 0xffffffffui32
|
||||
|
@ -117,13 +117,13 @@
|
|||
#if POINTER_BITS == 64
|
||||
#define SIZE_T_MAX UINT64_MAX
|
||||
#define SIZE_T_MIN UINT64_MIN
|
||||
|
||||
|
||||
#define SSIZE_T_MAX INT64_MAX
|
||||
#define SSIZE_T_MIN INT64_MIN
|
||||
#else
|
||||
#define SIZE_T_MAX UINT32_MAX
|
||||
#define SIZE_T_MIN UINT32_MIN
|
||||
|
||||
|
||||
#define SSIZE_T_MAX INT32_MAX
|
||||
#define SSIZE_T_MIN INT32_MIN
|
||||
#endif
|
||||
|
@ -142,10 +142,10 @@
|
|||
#ifndef COUNT_T_MAX
|
||||
typedef UINT32 COUNT_T;
|
||||
typedef INT32 SCOUNT_T;
|
||||
|
||||
|
||||
#define COUNT_T_MAX UINT32_MAX
|
||||
#define COUNT_T_MIN UINT32_MIN
|
||||
|
||||
|
||||
#define SCOUNT_T_MAX INT32_MAX
|
||||
#define SCOUNT_T_MIN INT32_MIN
|
||||
#endif
|
||||
|
@ -159,15 +159,15 @@
|
|||
#if NEED_BOOL_TYPEDEF
|
||||
typedef bool BOOL;
|
||||
#endif
|
||||
|
||||
|
||||
#define BOOL_MAX 1
|
||||
#define BOOL_MIN 0
|
||||
|
||||
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
|
||||
typedef UINT8 BYTE;
|
||||
|
||||
|
||||
#define BYTE_MAX UINT8_MAX
|
||||
#define BYTE_MIN UINT8_MIN
|
||||
#endif
|
||||
|
@ -180,7 +180,6 @@
|
|||
typedef char CHAR;
|
||||
typedef signed char SCHAR;
|
||||
typedef unsigned char UCHAR;
|
||||
typedef wchar_t WCHAR;
|
||||
|
||||
typedef CHAR ASCII;
|
||||
typedef CHAR ANSI;
|
||||
|
@ -307,7 +306,7 @@ T Max(T v1, T v2)
|
|||
|
||||
// --------------------------------------------------------------------------------
|
||||
// Alignment bit twiddling macros - "alignment" must be power of 2
|
||||
//
|
||||
//
|
||||
// AlignUp - align value to given increment, rounding up
|
||||
// AlignmentPad - amount adjusted by AlignUp
|
||||
// AlignUp(value, x) == value + AlignmentPad(value, x)
|
||||
|
@ -390,7 +389,7 @@ inline UINT AlignmentTrim(UINT value, UINT alignment)
|
|||
return value&(alignment-1);
|
||||
}
|
||||
|
||||
#ifndef PLATFORM_UNIX
|
||||
#ifndef HOST_UNIX
|
||||
// For Unix this and the previous function get the same types.
|
||||
// So, exclude this one.
|
||||
inline UINT AlignmentTrim(ULONG value, UINT alignment)
|
||||
|
@ -399,7 +398,7 @@ inline UINT AlignmentTrim(ULONG value, UINT alignment)
|
|||
STATIC_CONTRACT_SUPPORTS_DAC;
|
||||
return value&(alignment-1);
|
||||
}
|
||||
#endif // PLATFORM_UNIX
|
||||
#endif // HOST_UNIX
|
||||
|
||||
inline UINT AlignmentTrim(UINT64 value, UINT alignment)
|
||||
{
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
#include "runtime_version.h"
|
||||
|
||||
#ifndef QUOTE_MACRO
|
||||
#define QUOTE_MACRO_HELPER(x) #x
|
||||
#define QUOTE_MACRO(x) QUOTE_MACRO_HELPER(x)
|
||||
#endif
|
||||
|
||||
#ifndef QUOTE_MACRO_L
|
||||
#define QUOTE_MACRO_L_HELPER(x) L###x
|
||||
#define QUOTE_MACRO_L(x) QUOTE_MACRO_L_HELPER(x)
|
||||
#endif
|
||||
|
||||
#define CLR_METADATA_VERSION "v4.0.30319"
|
||||
#define CLR_METADATA_VERSION_L W("v4.0.30319")
|
||||
|
||||
#define CLR_PRODUCT_VERSION QUOTE_MACRO(RuntimeProductVersion)
|
||||
#define CLR_PRODUCT_VERSION_L QUOTE_MACRO_L(RuntimeProductVersion)
|
||||
|
||||
#define VER_ASSEMBLYVERSION_STR QUOTE_MACRO(RuntimeAssemblyMajorVersion.RuntimeAssemblyMinorVersion.0.0)
|
||||
#define VER_ASSEMBLYVERSION_STR_L QUOTE_MACRO_L(RuntimeAssemblyMajorVersion.RuntimeAssemblyMinorVersion.0.0)
|
||||
|
||||
#define VER_FILEVERSION_STR QUOTE_MACRO(RuntimeFileMajorVersion.RuntimeFileMinorVersion.RuntimeFileBuildVersion.RuntimeFileRevisionVersion)
|
||||
#define VER_FILEVERSION_STR_L QUOTE_MACRO_L(RuntimeFileMajorVersion.RuntimeFileMinorVersion.RuntimeFileBuildVersion.RuntimeFileRevisionVersion)
|
||||
|
||||
#define VER_LEGALCOPYRIGHT_LOGO_STR "Copyright (c) Microsoft Corporation. All rights reserved."
|
||||
#define VER_LEGALCOPYRIGHT_LOGO_STR_L L"Copyright (c) Microsoft Corporation. All rights reserved."
|
|
@ -3,9 +3,9 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
//
|
||||
// complex.h
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
//
|
||||
// Defines a basic complex number data type. We cannot use the standard C++ library's
|
||||
// complex implementation, because the CLR links to the wrong CRT.
|
||||
//
|
||||
|
@ -17,7 +17,7 @@
|
|||
|
||||
//
|
||||
// Default compilation mode is /fp:precise, which disables fp intrinsics. This causes us to pull in FP stuff (sqrt,etc.) from
|
||||
// The CRT, and increases our download size. We don't need the extra precision this gets us, so let's switch to
|
||||
// The CRT, and increases our download size. We don't need the extra precision this gets us, so let's switch to
|
||||
// the intrinsic versions.
|
||||
//
|
||||
#ifdef _MSC_VER
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------------------------------------
|
||||
// configuration.h
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// Access and update configuration values, falling back on legacy CLRConfig methods where necessary.
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------------------------------------
|
||||
|
||||
#include "clrconfig.h"
|
||||
|
@ -35,7 +35,7 @@ public:
|
|||
// in the traditional way separately if you need to.
|
||||
//
|
||||
// Returns value for name if found in config.
|
||||
static ULONGLONG GetKnobULONGLONGValue(LPCWSTR name);
|
||||
static ULONGLONG GetKnobULONGLONGValue(LPCWSTR name, ULONGLONG defaultValue);
|
||||
|
||||
// Returns (in priority order):
|
||||
// - The value of the ConfigStringInfo if it's set
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
// Contract.h
|
||||
//
|
||||
|
||||
// ! I am the owner for issues in the contract *infrastructure*, not for every
|
||||
// ! I am the owner for issues in the contract *infrastructure*, not for every
|
||||
// ! CONTRACT_VIOLATION dialog that comes up. If you interrupt my work for a routine
|
||||
// ! CONTRACT_VIOLATION, you will become the new owner of this file.
|
||||
//--------------------------------------------------------------------------------
|
||||
|
@ -30,7 +30,7 @@
|
|||
//
|
||||
//
|
||||
//
|
||||
// INJECT_FAULT(statement) function might require its caller to handle an OOM
|
||||
// INJECT_FAULT(statement) function might require its caller to handle an OOM
|
||||
// -or- FAULT_FORBID function will NOT require its caller to handle an OOM
|
||||
//
|
||||
//
|
||||
|
@ -48,8 +48,8 @@
|
|||
//
|
||||
// CAN_TAKE_LOCK the function has a code path that takes a lock
|
||||
// _or_ (CAN_TAKE_LOCK and CANNOT_RETAKE_LOCK)
|
||||
// the function has a code path that takes a lock, but never tries to reenter
|
||||
// locks held at the time this function was called.
|
||||
// the function has a code path that takes a lock, but never tries to reenter
|
||||
// locks held at the time this function was called.
|
||||
// -or- CANNOT_TAKE_LOCK the function will never allow a lock to be taken
|
||||
// -or- the default is WRAPPER(CAN_TAKE_LOCK). i.e., if any callees take locks,
|
||||
// then it's ok for this function to as well. If LIMITED_METHOD_CONTRACT is specified,
|
||||
|
@ -75,10 +75,10 @@
|
|||
// SUPPORTS_DAC The function has been written to be callable from out-of-process using DAC.
|
||||
// In builds where DACCESS_COMPILE is defined, such functions can only call
|
||||
// other such functions (and a few primitives like new). Functions that support
|
||||
// DAC must be carefully written to conform to the rules in daccess.h.
|
||||
// DAC must be carefully written to conform to the rules in daccess.h.
|
||||
//
|
||||
// SUPPORTS_DAC_HOST_ONLY The function and its call graph has been written to be callable from out of process
|
||||
// using DAC, but it differs from SUPPORTS_DAC in that these functions won't perform
|
||||
// SUPPORTS_DAC_HOST_ONLY The function and its call graph has been written to be callable from out of process
|
||||
// using DAC, but it differs from SUPPORTS_DAC in that these functions won't perform
|
||||
// any marshalling. Because it does no marshalling, SUPPORTS_DAC_HOST_ONLY functions
|
||||
// and their call graph won't be checked by DacCop. This should only be used by utility
|
||||
// functions which will never marshal anything.
|
||||
|
@ -121,7 +121,7 @@
|
|||
// instead.
|
||||
//
|
||||
// Static:
|
||||
// LIMITED_METHOD_CONTRACT
|
||||
// LIMITED_METHOD_CONTRACT
|
||||
// A static contract equivalent to NOTHROW/GC_NOTRIGGER/FORBID_FAULT/MODE_ANY.
|
||||
// Use only for trivial functions that call only functions with LIMITED_METHOD_CONTRACTs
|
||||
// (as long as there is no cycle that may introduce infinite recursion).
|
||||
|
@ -144,7 +144,7 @@
|
|||
//
|
||||
//
|
||||
// CONTRACT_VIOLATION(violationmask):
|
||||
//
|
||||
//
|
||||
// A bandaid used to suppress contract assertions. A contract violation
|
||||
// is always a bug and you're expected to remove it before shipping.
|
||||
// If a violation cannot be fixed immediately, however, it's better
|
||||
|
@ -156,10 +156,10 @@
|
|||
// GCViolation
|
||||
// ModeViolation
|
||||
// FaultViolation
|
||||
// FaultNotFatal
|
||||
// HostViolation
|
||||
// LoadsTypeViolation
|
||||
// TakesLockViolation
|
||||
// FaultNotFatal
|
||||
// HostViolation
|
||||
// LoadsTypeViolation
|
||||
// TakesLockViolation
|
||||
//
|
||||
// The associated assertion will be suppressed until you leave the scope
|
||||
// containing the CONTRACT_VIOLATION. Note, however, that any called
|
||||
|
@ -171,14 +171,14 @@
|
|||
// PERMANENT_CONTRACT_VIOLATION(violationmask, permanentContractViolationReason):
|
||||
//
|
||||
// Like a CONTRACT_VIOLATION but also indicates that the violation was a deliberate decision
|
||||
// and we don't plan on removing the violation in the next release. The reason
|
||||
// and we don't plan on removing the violation in the next release. The reason
|
||||
// for the violation should be given as the second parameter to the macro. Reasons
|
||||
// are currently for documentation purposes only and do not have an effect on the binary.
|
||||
// Valid values are listed below in the definition of PermanentContractViolationReason.
|
||||
//
|
||||
//
|
||||
//
|
||||
// CONDITIONAL_CONTRACT_VIOLATION(violationmask, condition):
|
||||
//
|
||||
//
|
||||
// Similar to CONTRACT_VIOLATION, but only suppresses the contract if the
|
||||
// condition evaluates to non-zero. The need for this macro should be very
|
||||
// rare, but it can be useful if a contract should be suppressed based on a
|
||||
|
@ -190,7 +190,7 @@
|
|||
//
|
||||
// A do-nothing contract used by functions that trivially wrap another.
|
||||
//
|
||||
//
|
||||
//
|
||||
// "LEGACY" stuff - these features have been mostly superceded by better solutions
|
||||
// so their use should be discouraged.
|
||||
//
|
||||
|
@ -361,23 +361,23 @@ struct DbgStateLockData
|
|||
|
||||
void SetStartingValues();
|
||||
void LockTaken(DbgStateLockType dbgStateLockType,
|
||||
UINT cEntrances,
|
||||
void * pvLock,
|
||||
__in_z const char * szFunction,
|
||||
__in_z const char * szFile,
|
||||
UINT cEntrances,
|
||||
void * pvLock,
|
||||
__in_z const char * szFunction,
|
||||
__in_z const char * szFile,
|
||||
int lineNum);
|
||||
void LockReleased(DbgStateLockType dbgStateLockType, UINT cExits, void * pvLock);
|
||||
UINT GetLockCount(DbgStateLockType dbgStateLockType);
|
||||
UINT GetCombinedLockCount();
|
||||
};
|
||||
|
||||
// This struct contains all lock contract information. It is created and destroyed along with
|
||||
// ClrDebugState. m_pLockData points to a DbgStateLockData object that is allocated per thread
|
||||
// This struct contains all lock contract information. It is created and destroyed along with
|
||||
// ClrDebugState. m_pLockData points to a DbgStateLockData object that is allocated per thread
|
||||
// and persists across function enters and exists.
|
||||
struct DbgStateLockState
|
||||
{
|
||||
private:
|
||||
// Count of locks taken at the time the function with CANNOT_RETAKE_LOCK contract
|
||||
private:
|
||||
// Count of locks taken at the time the function with CANNOT_RETAKE_LOCK contract
|
||||
// was called
|
||||
UINT m_cLocksEnteringCannotRetakeLock;
|
||||
|
||||
|
@ -409,8 +409,6 @@ public:
|
|||
#define CONTRACT_BITMASK_RESET(whichbit) (m_flags &= ~(whichbit))
|
||||
#define CONTRACT_BITMASK_UPDATE(whichbit, value) ((value)?CONTRACT_BITMASK_SET(whichbit):CONTRACT_BITMASK_RESET(whichbit))
|
||||
|
||||
|
||||
// Stored in the FLS under TlsIdx_ClrDebugState.
|
||||
struct ClrDebugState
|
||||
{
|
||||
private:
|
||||
|
@ -421,7 +419,7 @@ private:
|
|||
UINT m_GCForbidCount;
|
||||
UINT m_maxLoadTypeLevel; // taken from enum ClassLoadLevel
|
||||
BOOL m_allowGetThread; // TRUE if GetThread() is ok in this scope
|
||||
DbgStateLockState m_LockState;
|
||||
DbgStateLockState m_LockState;
|
||||
|
||||
public:
|
||||
// Use an explicit Init rather than ctor as we don't want automatic
|
||||
|
@ -429,7 +427,7 @@ public:
|
|||
void SetStartingValues()
|
||||
{
|
||||
m_violationmask = 0; // No violations allowed
|
||||
|
||||
|
||||
// Default is we're in a THROWS scope. This is not ideal, but there are
|
||||
// just too many places that I'd have to go clean up right now
|
||||
// (hundreds) in order to make this FALSE by default.
|
||||
|
@ -469,7 +467,7 @@ public:
|
|||
{
|
||||
return &m_violationmask;
|
||||
}
|
||||
|
||||
|
||||
UINT_PTR ViolationMask()
|
||||
{
|
||||
return m_violationmask;
|
||||
|
@ -503,7 +501,7 @@ public:
|
|||
CONTRACT_BITMASK_UPDATE(CONTRACT_BITMASK_OK_TO_THROW, value);
|
||||
return prevState;
|
||||
}
|
||||
|
||||
|
||||
void ResetOkToThrow()
|
||||
{
|
||||
CONTRACT_BITMASK_RESET(CONTRACT_BITMASK_OK_TO_THROW);
|
||||
|
@ -525,7 +523,7 @@ public:
|
|||
{
|
||||
BOOL prevState = CONTRACT_BITMASK_IS_SET(CONTRACT_BITMASK_FAULT_FORBID);
|
||||
CONTRACT_BITMASK_UPDATE(CONTRACT_BITMASK_FAULT_FORBID, value);
|
||||
return prevState;
|
||||
return prevState;
|
||||
}
|
||||
|
||||
void ResetFaultForbid()
|
||||
|
@ -625,22 +623,22 @@ public:
|
|||
CONTRACT_BITMASK_UPDATE(CONTRACT_BITMASK_OK_TO_LOCK, value);
|
||||
return prevState;
|
||||
}
|
||||
|
||||
|
||||
void ResetOkToLock()
|
||||
{
|
||||
CONTRACT_BITMASK_RESET(CONTRACT_BITMASK_OK_TO_LOCK);
|
||||
}
|
||||
}
|
||||
|
||||
//--//
|
||||
BOOL IsOkToRetakeLock()
|
||||
{
|
||||
return CONTRACT_BITMASK_IS_SET(CONTRACT_BITMASK_OK_TO_RETAKE_LOCK);
|
||||
}
|
||||
|
||||
|
||||
void ResetOkToRetakeLock()
|
||||
{
|
||||
CONTRACT_BITMASK_RESET(CONTRACT_BITMASK_OK_TO_RETAKE_LOCK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--//
|
||||
|
@ -672,7 +670,7 @@ public:
|
|||
{
|
||||
m_GCNoTriggerCount--;
|
||||
}
|
||||
|
||||
|
||||
void IncrementGCNoTriggerCount()
|
||||
{
|
||||
m_GCNoTriggerCount++;
|
||||
|
@ -688,12 +686,12 @@ public:
|
|||
{
|
||||
m_GCForbidCount--;
|
||||
}
|
||||
|
||||
|
||||
void IncrementGCForbidCount()
|
||||
{
|
||||
m_GCForbidCount++;
|
||||
}
|
||||
|
||||
|
||||
UINT GetMaxLoadTypeLevel()
|
||||
{
|
||||
return m_maxLoadTypeLevel;
|
||||
|
@ -705,7 +703,7 @@ public:
|
|||
}
|
||||
|
||||
//--//
|
||||
|
||||
|
||||
void SetDbgStateLockData(DbgStateLockData * pDbgStateLockData)
|
||||
{
|
||||
m_LockState.SetDbgStateLockData(pDbgStateLockData);
|
||||
|
@ -724,10 +722,10 @@ public:
|
|||
void CheckOkayToLock(__in_z const char *szFunction, __in_z const char *szFile, int lineNum); // Asserts if its not okay to lock
|
||||
BOOL CheckOkayToLockNoAssert(); // Returns if OK to lock
|
||||
void LockTaken(DbgStateLockType dbgStateLockType,
|
||||
UINT cEntrances,
|
||||
void * pvLock,
|
||||
__in_z const char * szFunction,
|
||||
__in_z const char * szFile,
|
||||
UINT cEntrances,
|
||||
void * pvLock,
|
||||
__in_z const char * szFunction,
|
||||
__in_z const char * szFile,
|
||||
int lineNum);
|
||||
void LockReleased(DbgStateLockType dbgStateLockType, UINT cExits, void * pvLock);
|
||||
UINT GetLockCount(DbgStateLockType dbgStateLockType);
|
||||
|
@ -744,13 +742,13 @@ public:
|
|||
ClrDebugState *CLRInitDebugState();
|
||||
ClrDebugState *GetClrDebugState(BOOL fAlloc = TRUE);
|
||||
|
||||
extern thread_local ClrDebugState* t_pClrDebugState;
|
||||
|
||||
// This function returns a ClrDebugState if one has been created, but will not create one itself.
|
||||
inline ClrDebugState *CheckClrDebugState()
|
||||
{
|
||||
STATIC_CONTRACT_LIMITED_METHOD;
|
||||
ClrDebugState *ret = (ClrDebugState*)ClrFlsGetValue(TlsIdx_ClrDebugState);
|
||||
return ret;
|
||||
return t_pClrDebugState;
|
||||
}
|
||||
|
||||
void CONTRACT_ASSERT(const char *szElaboration,
|
||||
|
@ -828,7 +826,7 @@ public:
|
|||
|
||||
Enter();
|
||||
};
|
||||
|
||||
|
||||
DEBUG_NOINLINE ~AutoCleanupDebugOnlyCodeHolder()
|
||||
{
|
||||
SCAN_SCOPE_END;
|
||||
|
@ -854,7 +852,7 @@ public:
|
|||
|
||||
#else // ENABLE_CONTRACTS_IMPL
|
||||
#define DEBUG_ONLY_FUNCTION STATIC_CONTRACT_DEBUG_ONLY
|
||||
#define DEBUG_ONLY_REGION()
|
||||
#define DEBUG_ONLY_REGION()
|
||||
#define BEGIN_DEBUG_ONLY_CODE
|
||||
#define END_DEBUG_ONLY_CODE
|
||||
#define ENTER_DEBUG_ONLY_CODE
|
||||
|
@ -862,7 +860,7 @@ public:
|
|||
#endif
|
||||
|
||||
#else // _DEBUG
|
||||
#define DEBUG_ONLY_REGION()
|
||||
#define DEBUG_ONLY_REGION()
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -903,7 +901,7 @@ class ___maybetemplate
|
|||
class BaseContract
|
||||
{
|
||||
// Really private, but used by macros
|
||||
public:
|
||||
public:
|
||||
|
||||
// We use a single integer to specify all the settings for intrinsic tests
|
||||
// such as THROWS and GC_TRIGGERS. The compiler should be able to fold all
|
||||
|
@ -1308,7 +1306,7 @@ typedef __SafeToUsePostCondition __PostConditionOK;
|
|||
UINT ___testmask = 0; \
|
||||
|
||||
#else // #ifndef __FORCE_NORUNTIME_CONTRACTS__
|
||||
|
||||
|
||||
#define CONTRACT_SETUP(_contracttype, _returntype, _returnexp) \
|
||||
_returntype RETVAL; \
|
||||
Contract::Returner<_returntype> ___returner(RETVAL); \
|
||||
|
@ -1375,7 +1373,7 @@ typedef __SafeToUsePostCondition __PostConditionOK;
|
|||
#define CUSTOM_CONTRACT(_contracttype, _returntype) \
|
||||
typedef Contract::PseudoTemplate<_returntype> ___maybetemplate; \
|
||||
CONTRACT_SETUP(_contracttype, _returntype, RETVAL)
|
||||
|
||||
|
||||
#define CUSTOM_CONTRACT_VOID(_contracttype) \
|
||||
CONTRACT_SETUP(_contracttype, int, ;)
|
||||
|
||||
|
@ -1529,7 +1527,7 @@ typedef __SafeToUsePostCondition __PostConditionOK;
|
|||
___CheckMustBeInside_CONTRACT; \
|
||||
}
|
||||
|
||||
#else
|
||||
#else
|
||||
|
||||
#define CONTRACTL_END \
|
||||
if (___op & Contract::Setup) \
|
||||
|
@ -1719,7 +1717,7 @@ public:
|
|||
};
|
||||
|
||||
protected:
|
||||
// We require that violationMask is passed as a parameter here to hopefully defeat the
|
||||
// We require that violationMask is passed as a parameter here to hopefully defeat the
|
||||
// compiler's desire to fold all the Enter and Ctor implementations together.
|
||||
FORCEINLINE void EnterInternal(UINT_PTR violationMask)
|
||||
{
|
||||
|
@ -1784,7 +1782,7 @@ public:
|
|||
AutoCleanupContractViolationHolder<violationMask> __violationHolder_onlyOneAllowedPerScope;
|
||||
|
||||
|
||||
// Reasons for having the violation. Use one of these values as an additional parameter to
|
||||
// Reasons for having the violation. Use one of these values as an additional parameter to
|
||||
// E.g. PERMANENT_CONTRACT_VIOLATION(ThrowsViolation, ReasonContractInfrastructure)
|
||||
// New values and explanations can be added when needed.
|
||||
enum PermanentContractViolationReason
|
||||
|
@ -1999,26 +1997,13 @@ class LoadsTypeHolder
|
|||
#define TRIGGERS_TYPE_LOAD(newLevel)
|
||||
#define MAYBE_TRIGGERS_TYPE_LOAD(newLevel, fEnable)
|
||||
#define OVERRIDE_TYPE_LOAD_LEVEL_LIMIT(newLevel)
|
||||
#define MAYBE_OVERRIDE_TYPE_LOAD_LEVEL_LIMIT(newLevel, fEnable)
|
||||
#define MAYBE_OVERRIDE_TYPE_LOAD_LEVEL_LIMIT(newLevel, fEnable)
|
||||
|
||||
#endif // ENABLE_CONTRACTS_IMPL
|
||||
|
||||
|
||||
|
||||
#ifdef ENABLE_CONTRACTS_IMPL
|
||||
class PAL_TryMarker
|
||||
{
|
||||
public:
|
||||
DEBUG_NOINLINE void Enter();
|
||||
DEBUG_NOINLINE void Leave();
|
||||
};
|
||||
|
||||
#define PAL_ENTER_THROWS_REGION \
|
||||
PAL_TryMarker __throwsHolder_onlyOneAllowedPerScope; \
|
||||
__throwsHolder_onlyOneAllowedPerScope.Enter();
|
||||
|
||||
#define PAL_LEAVE_THROWS_REGION \
|
||||
__throwsHolder_onlyOneAllowedPerScope.Leave();
|
||||
|
||||
// This sets up a marker that says its okay to throw on this thread. This is not a public macro, and should only be
|
||||
// used from within the implementation of various try/catch macros.
|
||||
|
@ -2052,8 +2037,6 @@ private:
|
|||
#else // ENABLE_CONTRACTS_IMPL
|
||||
|
||||
#define CLR_TRY_MARKER()
|
||||
#define PAL_ENTER_THROWS_REGION
|
||||
#define PAL_LEAVE_THROWS_REGION
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -2093,7 +2076,7 @@ class HostNoCallHolder
|
|||
m_clrDebugState = GetClrDebugState();
|
||||
m_previousState = m_clrDebugState->SetHostCaller(FALSE);
|
||||
}
|
||||
|
||||
|
||||
DEBUG_NOINLINE ~HostNoCallHolder()
|
||||
{
|
||||
SCAN_SCOPE_END;
|
||||
|
@ -2104,7 +2087,7 @@ class HostNoCallHolder
|
|||
private:
|
||||
BOOL m_previousState;
|
||||
ClrDebugState* m_clrDebugState;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#define BEGIN_HOST_NOCALL_CODE \
|
||||
|
@ -2114,7 +2097,7 @@ class HostNoCallHolder
|
|||
|
||||
#define END_HOST_NOCALL_CODE \
|
||||
}
|
||||
|
||||
|
||||
#else // ENABLE_CONTRACTS_IMPL
|
||||
#define BEGIN_HOST_NOCALL_CODE \
|
||||
{ \
|
||||
|
@ -2134,7 +2117,7 @@ class GetThreadAllowedHolder
|
|||
m_clrDebugState = ::GetClrDebugState();
|
||||
m_previousState = m_clrDebugState->SetGetThreadAllowed(newState);
|
||||
}
|
||||
|
||||
|
||||
~GetThreadAllowedHolder()
|
||||
{
|
||||
m_clrDebugState->SetGetThreadAllowed(m_previousState);
|
||||
|
@ -2167,7 +2150,7 @@ private:
|
|||
|
||||
#define END_GETTHREAD_ALLOWED \
|
||||
}
|
||||
|
||||
|
||||
// These are lighter-weight versions of BEGIN_GETTHREAD_ALLOWED /
|
||||
// END_GETTHREAD_ALLOWED. These don't use holders, so be sure only to
|
||||
// use these to bracket code that won't throw exceptions
|
||||
|
@ -2230,18 +2213,18 @@ private:
|
|||
|
||||
#define LOCK_TAKEN_MULTIPLE(dbgStateLockType, cEntrances, pvLock)
|
||||
#define LOCK_RELEASED_MULTIPLE(dbgStateLockType, cExits, pvLock)
|
||||
#define EE_LOCK_TAKEN_MULTIPLE(cEntrances, pvLock)
|
||||
#define EE_LOCK_RELEASED_MULTIPLE(cExits, pvLock)
|
||||
#define HOST_BREAKABLE_CRST_TAKEN_MULTIPLE(cEntrances, pvLock)
|
||||
#define EE_LOCK_TAKEN_MULTIPLE(cEntrances, pvLock)
|
||||
#define EE_LOCK_RELEASED_MULTIPLE(cExits, pvLock)
|
||||
#define HOST_BREAKABLE_CRST_TAKEN_MULTIPLE(cEntrances, pvLock)
|
||||
#define HOST_BREAKABLE_CRST_RELEASED_MULTIPLE(cExits, pvLock)
|
||||
#define USER_LOCK_TAKEN_MULTIPLE(cEntrances, pvLock)
|
||||
#define USER_LOCK_RELEASED_MULTIPLE(cExits, pvLock)
|
||||
#define EE_LOCK_TAKEN(pvLock)
|
||||
#define EE_LOCK_RELEASED(pvLock)
|
||||
#define USER_LOCK_TAKEN_MULTIPLE(cEntrances, pvLock)
|
||||
#define USER_LOCK_RELEASED_MULTIPLE(cExits, pvLock)
|
||||
#define EE_LOCK_TAKEN(pvLock)
|
||||
#define EE_LOCK_RELEASED(pvLock)
|
||||
#define HOST_BREAKABLE_CRST_TAKEN(pvLock)
|
||||
#define HOST_BREAKABLE_CRST_RELEASED(pvLock)
|
||||
#define USER_LOCK_TAKEN(pvLock)
|
||||
#define USER_LOCK_RELEASED(pvLock)
|
||||
#define USER_LOCK_TAKEN(pvLock)
|
||||
#define USER_LOCK_RELEASED(pvLock)
|
||||
|
||||
#endif // defined(ENABLE_CONTRACTS_IMPL)
|
||||
|
||||
|
@ -2300,22 +2283,22 @@ extern Volatile<LONG> g_DbgSuppressAllocationAsserts;
|
|||
// analysis tools that run on mscordacwks.dll like DacCop.
|
||||
// Note that we want these static contracts in both DEBUG and retail builds.
|
||||
// We also already get simple static contracts like WRAPPER and LEAF.
|
||||
//
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
#if defined(DACCESS_COMPILE)
|
||||
|
||||
// SUPPORTS_DAC is an annotation that says the function is designed to be used in DAC builds.
|
||||
// This enables full DacCop analysis on the function, including verifying that all functions that are
|
||||
// This enables full DacCop analysis on the function, including verifying that all functions that are
|
||||
// called also support DAC.
|
||||
#define SUPPORTS_DAC do { STATIC_CONTRACT_SUPPORTS_DAC; } while(0)
|
||||
|
||||
// Normally a function can be annotated just with WRAPPER_NO_CONTRACT, which (in addition to the normal
|
||||
// contract meaning) indicates to DacCop that the function should be considered to support DAC when
|
||||
// it is called from a supports-dac function. This is to avoid having to add a DAC-specific contract
|
||||
// to all the trivial one-line wrapper functions we have.
|
||||
// to all the trivial one-line wrapper functions we have.
|
||||
// However, we occasionally want these semantics even for functions which are not appropriate to label
|
||||
// as WRAPPER_NO_CONTRACT. For example, a template function may support DAC for certain template arguments,
|
||||
// but not others (due to the functions it calls). We want to ensure that when such a function is called
|
||||
// but not others (due to the functions it calls). We want to ensure that when such a function is called
|
||||
// in a DAC code path, analysis is enabled on that particular instantiation including checking all of the
|
||||
// call targets specific to this template instantiation. But we don't want to require that the call targets
|
||||
// for ALL instantiations support dac, since we may not even be using them in DAC code paths. Ideally we'd
|
||||
|
@ -2325,17 +2308,17 @@ extern Volatile<LONG> g_DbgSuppressAllocationAsserts;
|
|||
// SUPPORTS_DAC_HOST_ONLY indicates that a function is allowed to be called in DAC builds, but rather
|
||||
// than being a normal DAC function which operates on marshalled data, it is a host-only utility function
|
||||
// that knows nothing about DAC and operates solely on the host. For example, DbgAssertDialog is a utility
|
||||
// function for popping assert dialogs - there is nothing DAC-specific about this. Ideally such utility
|
||||
// function for popping assert dialogs - there is nothing DAC-specific about this. Ideally such utility
|
||||
// functions would be confined to their own library which had no access to DAC functionality, and which
|
||||
// is not analyzed by DacCop. At the moment splitting utilcode into two variations like this is too
|
||||
// is not analyzed by DacCop. At the moment splitting utilcode into two variations like this is too
|
||||
// painful, but we hope to do it in the future (primarily to support functions which can be used in either
|
||||
// DAC or host-only mode).
|
||||
// WARNING: This contract disables DacCop analysis on the function and any functions it calls, so it
|
||||
// should be used very carefully.
|
||||
// WARNING: This contract disables DacCop analysis on the function and any functions it calls, so it
|
||||
// should be used very carefully.
|
||||
#define SUPPORTS_DAC_HOST_ONLY do { STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY; } while(0)
|
||||
|
||||
#else
|
||||
#define SUPPORTS_DAC
|
||||
#define SUPPORTS_DAC
|
||||
#define SUPPORTS_DAC_HOST_ONLY
|
||||
#define SUPPORTS_DAC_WRAPPER
|
||||
#endif // DACCESS_COMPILE
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
// Contract.inl
|
||||
//
|
||||
|
||||
// ! I am the owner for issues in the contract *infrastructure*, not for every
|
||||
// ! I am the owner for issues in the contract *infrastructure*, not for every
|
||||
// ! CONTRACT_VIOLATION dialog that comes up. If you interrupt my work for a routine
|
||||
// ! CONTRACT_VIOLATION, you will become the new owner of this file.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@ -129,7 +129,7 @@ inline void BaseContract::DoChecks(UINT testmask, __in_z const char *szFunction,
|
|||
}
|
||||
m_pClrDebugState->SetMaxLoadTypeLevel(newTypeLoadLevel);
|
||||
m_pClrDebugState->ViolationMaskReset(LoadsTypeViolation);
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ inline void BaseContract::DoChecks(UINT testmask, __in_z const char *szFunction,
|
|||
|
||||
switch (testmask & CAN_TAKE_LOCK_Mask)
|
||||
{
|
||||
case CAN_TAKE_LOCK_Yes:
|
||||
case CAN_TAKE_LOCK_Yes:
|
||||
m_pClrDebugState->CheckOkayToLock(m_contractStackRecord.m_szFunction,
|
||||
m_contractStackRecord.m_szFile,
|
||||
m_contractStackRecord.m_lineNum);
|
||||
|
@ -223,16 +223,16 @@ inline void ClrDebugState::CheckOkayToLock(__in_z const char *szFunction, __in_z
|
|||
szFunction,
|
||||
szFile,
|
||||
lineNum);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline void ClrDebugState::LockTaken(DbgStateLockType dbgStateLockType,
|
||||
UINT cTakes,
|
||||
void * pvLock,
|
||||
__in_z const char * szFunction,
|
||||
__in_z const char * szFile,
|
||||
UINT cTakes,
|
||||
void * pvLock,
|
||||
__in_z const char * szFunction,
|
||||
__in_z const char * szFile,
|
||||
int lineNum)
|
||||
{
|
||||
STATIC_CONTRACT_DEBUG_ONLY;
|
||||
|
@ -281,7 +281,7 @@ inline void ClrDebugState::LockReleased(DbgStateLockType dbgStateLockType, UINT
|
|||
|
||||
if (!IsOkToRetakeLock())
|
||||
{
|
||||
// It is very suspicious to release any locks being hold at the time this function was
|
||||
// It is very suspicious to release any locks being hold at the time this function was
|
||||
// called in a CANNOT_RETAKE_LOCK scope
|
||||
_ASSERTE(m_LockState.IsSafeToRelease(cReleases));
|
||||
}
|
||||
|
@ -321,9 +321,9 @@ inline UINT ClrDebugState::GetCombinedLockCount()
|
|||
|
||||
inline void DbgStateLockData::LockTaken(DbgStateLockType dbgStateLockType,
|
||||
UINT cTakes, // # times we're taking this lock (usually 1)
|
||||
void * pvLock,
|
||||
__in_z const char * szFunction,
|
||||
__in_z const char * szFile,
|
||||
void * pvLock,
|
||||
__in_z const char * szFunction,
|
||||
__in_z const char * szFile,
|
||||
int lineNum)
|
||||
{
|
||||
STATIC_CONTRACT_NOTHROW;
|
||||
|
@ -399,7 +399,7 @@ inline void DbgStateLockData::LockReleased(DbgStateLockType dbgStateLockType, UI
|
|||
// were released out of order. However, it will eventually correct itself once all
|
||||
// the out-of-order locks have been released. And our count
|
||||
// (i.e., m_rgcLocksTaken[dbgStateLockType]) will always be accurate
|
||||
memset(&(m_rgTakenLockInfos[i]),
|
||||
memset(&(m_rgTakenLockInfos[i]),
|
||||
0,
|
||||
sizeof(m_rgTakenLockInfos[i]));
|
||||
}
|
||||
|
@ -415,7 +415,7 @@ inline void DbgStateLockData::SetStartingValues()
|
|||
inline UINT DbgStateLockData::GetLockCount(DbgStateLockType dbgStateLockType)
|
||||
{
|
||||
_ASSERTE(UINT(dbgStateLockType) < kDbgStateLockType_Count);
|
||||
return m_rgcLocksTaken[dbgStateLockType];
|
||||
return m_rgcLocksTaken[dbgStateLockType];
|
||||
}
|
||||
|
||||
inline UINT DbgStateLockData::GetCombinedLockCount()
|
||||
|
@ -433,7 +433,7 @@ inline void DbgStateLockState::SetStartingValues()
|
|||
m_pLockData = NULL; // Will get filled in by CLRInitDebugState()
|
||||
}
|
||||
|
||||
// We set a marker to record the number of locks that have been taken when
|
||||
// We set a marker to record the number of locks that have been taken when
|
||||
// CANNOT_RETAKE_LOCK contract is constructed.
|
||||
inline void DbgStateLockState::OnEnterCannotRetakeLockFunction()
|
||||
{
|
||||
|
@ -447,8 +447,8 @@ inline BOOL DbgStateLockState::IsLockRetaken(void * pvLock)
|
|||
|
||||
// m_cLocksEnteringCannotRetakeLock records the number of locks that were taken
|
||||
// when CANNOT_RETAKE_LOCK contract was constructed.
|
||||
for (UINT i = 0;
|
||||
i < min(_countof(m_pLockData->m_rgTakenLockInfos), m_cLocksEnteringCannotRetakeLock);
|
||||
for (UINT i = 0;
|
||||
i < min(_countof(m_pLockData->m_rgTakenLockInfos), m_cLocksEnteringCannotRetakeLock);
|
||||
++i)
|
||||
{
|
||||
if (m_pLockData->m_rgTakenLockInfos[i].m_pvLock == pvLock)
|
||||
|
@ -476,7 +476,7 @@ inline DbgStateLockData * DbgStateLockState::GetDbgStateLockData()
|
|||
|
||||
inline
|
||||
void CONTRACT_ASSERT(const char *szElaboration,
|
||||
UINT whichTest,
|
||||
UINT whichTest,
|
||||
UINT whichTestMask,
|
||||
const char *szFunction,
|
||||
const char *szFile,
|
||||
|
@ -542,7 +542,7 @@ void CONTRACT_ASSERT(const char *szElaboration,
|
|||
pRec->m_szFile,
|
||||
pRec->m_lineNum
|
||||
);
|
||||
|
||||
|
||||
strcat_s(Buf, _countof(Buf), tmpbuf);
|
||||
}
|
||||
|
||||
|
@ -579,7 +579,7 @@ void CONTRACT_ASSERT(const char *szElaboration,
|
|||
"\n"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
strcat_s(Buf,_countof(Buf), "\n\n");
|
||||
|
||||
if (!foundconflict && count != 0)
|
||||
|
@ -604,7 +604,7 @@ FORCEINLINE BOOL BaseContract::EnforceContract()
|
|||
{
|
||||
if (s_alwaysEnforceContracts)
|
||||
return TRUE;
|
||||
else
|
||||
else
|
||||
return CHECK::EnforceAssert();
|
||||
}
|
||||
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -131,7 +131,7 @@ typedef UNALIGNED void const *UVCP_CONSTANT;
|
|||
|
||||
// Constant for connection id and task id
|
||||
#define INVALID_CONNECTION_ID 0x0
|
||||
#define INVALID_TASK_ID 0x0
|
||||
#define INVALID_TASK_ID 0x0
|
||||
#define MAX_CONNECTION_NAME MAX_PATH
|
||||
|
||||
|
||||
|
@ -141,22 +141,11 @@ typedef UNALIGNED void const *UVCP_CONSTANT;
|
|||
#define MAIN_CLR_DLL_NAME_W MAKEDLLNAME_W(MAIN_CLR_MODULE_NAME_W)
|
||||
#define MAIN_CLR_DLL_NAME_A MAKEDLLNAME_A(MAIN_CLR_MODULE_NAME_A)
|
||||
|
||||
|
||||
#define MSCOREE_SHIM_W MAIN_CLR_DLL_NAME_W
|
||||
#define MSCOREE_SHIM_A MAIN_CLR_DLL_NAME_A
|
||||
#define TARGET_MAIN_CLR_DLL_NAME_W MAKE_TARGET_DLLNAME_W(MAIN_CLR_MODULE_NAME_W)
|
||||
#define TARGET_MAIN_CLR_DLL_NAME_A MAKE_TARGET_DLLNAME_A(MAIN_CLR_MODULE_NAME_A)
|
||||
|
||||
#define SWITCHOUT_HANDLE_VALUE ((HANDLE)(LONG_PTR)-2)
|
||||
|
||||
//
|
||||
// CoInitializeEE flags.
|
||||
//
|
||||
typedef enum tagCOINITEE
|
||||
{
|
||||
COINITEE_DEFAULT = 0x0, // Default initialization mode.
|
||||
COINITEE_DLL = 0x1, // Initialization mode for loading DLL.
|
||||
COINITEE_MAIN = 0x2 // Initialize prior to entering the main routine
|
||||
} COINITIEE;
|
||||
|
||||
//*****************************************************************************
|
||||
//*****************************************************************************
|
||||
//
|
||||
|
@ -166,7 +155,7 @@ typedef enum tagCOINITEE
|
|||
//*****************************************************************************
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
#ifndef _WINDOWS_UPDATES_
|
||||
#include <corhdr.h>
|
||||
#endif // <windows.h> updates
|
||||
|
@ -284,14 +273,14 @@ DECLARE_INTERFACE_(IMetaDataEmit, IUnknown)
|
|||
STDMETHOD(DefineTypeDef)( // S_OK or error.
|
||||
LPCWSTR szTypeDef, // [IN] Name of TypeDef
|
||||
DWORD dwTypeDefFlags, // [IN] CustomAttribute flags
|
||||
mdToken tkExtends, // [IN] extends this TypeDef or typeref
|
||||
mdToken tkExtends, // [IN] extends this TypeDef or typeref
|
||||
mdToken rtkImplements[], // [IN] Implements interfaces
|
||||
mdTypeDef *ptd) PURE; // [OUT] Put TypeDef token here
|
||||
|
||||
STDMETHOD(DefineNestedType)( // S_OK or error.
|
||||
LPCWSTR szTypeDef, // [IN] Name of TypeDef
|
||||
DWORD dwTypeDefFlags, // [IN] CustomAttribute flags
|
||||
mdToken tkExtends, // [IN] extends this TypeDef or typeref
|
||||
mdToken tkExtends, // [IN] extends this TypeDef or typeref
|
||||
mdToken rtkImplements[], // [IN] Implements interfaces
|
||||
mdTypeDef tdEncloser, // [IN] TypeDef token of the enclosing type.
|
||||
mdTypeDef *ptd) PURE; // [OUT] Put TypeDef token here
|
||||
|
@ -299,11 +288,11 @@ DECLARE_INTERFACE_(IMetaDataEmit, IUnknown)
|
|||
STDMETHOD(SetHandler)( // S_OK.
|
||||
IUnknown *pUnk) PURE; // [IN] The new error handler.
|
||||
|
||||
STDMETHOD(DefineMethod)( // S_OK or error.
|
||||
STDMETHOD(DefineMethod)( // S_OK or error.
|
||||
mdTypeDef td, // Parent TypeDef
|
||||
LPCWSTR szName, // Name of member
|
||||
DWORD dwMethodFlags, // Member attributes
|
||||
PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of CLR signature
|
||||
PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of CLR signature
|
||||
ULONG cbSigBlob, // [IN] count of bytes in the signature blob
|
||||
ULONG ulCodeRVA,
|
||||
DWORD dwImplFlags,
|
||||
|
@ -331,7 +320,7 @@ DECLARE_INTERFACE_(IMetaDataEmit, IUnknown)
|
|||
STDMETHOD(DefineMemberRef)( // S_OK or error
|
||||
mdToken tkImport, // [IN] ClassRef or ClassDef importing a member.
|
||||
LPCWSTR szName, // [IN] member's name
|
||||
PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of CLR signature
|
||||
PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of CLR signature
|
||||
ULONG cbSigBlob, // [IN] count of bytes in the signature blob
|
||||
mdMemberRef *pmr) PURE; // [OUT] memberref token
|
||||
|
||||
|
@ -346,19 +335,19 @@ DECLARE_INTERFACE_(IMetaDataEmit, IUnknown)
|
|||
mdMemberRef *pmr) PURE; // [OUT] Put member ref here.
|
||||
|
||||
STDMETHOD(DefineEvent) (
|
||||
mdTypeDef td, // [IN] the class/interface on which the event is being defined
|
||||
mdTypeDef td, // [IN] the class/interface on which the event is being defined
|
||||
LPCWSTR szEvent, // [IN] Name of the event
|
||||
DWORD dwEventFlags, // [IN] CorEventAttr
|
||||
mdToken tkEventType, // [IN] a reference (mdTypeRef or mdTypeRef) to the Event class
|
||||
mdMethodDef mdAddOn, // [IN] required add method
|
||||
mdToken tkEventType, // [IN] a reference (mdTypeRef or mdTypeRef) to the Event class
|
||||
mdMethodDef mdAddOn, // [IN] required add method
|
||||
mdMethodDef mdRemoveOn, // [IN] required remove method
|
||||
mdMethodDef mdFire, // [IN] optional fire method
|
||||
mdMethodDef rmdOtherMethods[], // [IN] optional array of other methods associate with the event
|
||||
mdEvent *pmdEvent) PURE; // [OUT] output event token
|
||||
mdEvent *pmdEvent) PURE; // [OUT] output event token
|
||||
|
||||
STDMETHOD(SetClassLayout) (
|
||||
mdTypeDef td, // [IN] typedef
|
||||
DWORD dwPackSize, // [IN] packing size specified as 1, 2, 4, 8, or 16
|
||||
mdTypeDef td, // [IN] typedef
|
||||
DWORD dwPackSize, // [IN] packing size specified as 1, 2, 4, 8, or 16
|
||||
COR_FIELD_OFFSET rFieldOffsets[], // [IN] array of layout specification
|
||||
ULONG ulClassSize) PURE; // [IN] size of the class
|
||||
|
||||
|
@ -374,11 +363,11 @@ DECLARE_INTERFACE_(IMetaDataEmit, IUnknown)
|
|||
mdToken tk) PURE; // [IN] given a fieldDef or paramDef token
|
||||
|
||||
STDMETHOD(DefinePermissionSet) (
|
||||
mdToken tk, // [IN] the object to be decorated.
|
||||
mdToken tk, // [IN] the object to be decorated.
|
||||
DWORD dwAction, // [IN] CorDeclSecurity.
|
||||
void const *pvPermission, // [IN] permission blob.
|
||||
ULONG cbPermission, // [IN] count of bytes of pvPermission.
|
||||
mdPermission *ppm) PURE; // [OUT] returned permission token.
|
||||
ULONG cbPermission, // [IN] count of bytes of pvPermission.
|
||||
mdPermission *ppm) PURE; // [OUT] returned permission token.
|
||||
|
||||
STDMETHOD(SetRVA)( // S_OK or error.
|
||||
mdMethodDef md, // [IN] Method for which to set offset
|
||||
|
@ -386,7 +375,7 @@ DECLARE_INTERFACE_(IMetaDataEmit, IUnknown)
|
|||
|
||||
STDMETHOD(GetTokenFromSig)( // S_OK or error.
|
||||
PCCOR_SIGNATURE pvSig, // [IN] Signature to define.
|
||||
ULONG cbSig, // [IN] Size of signature data.
|
||||
ULONG cbSig, // [IN] Size of signature data.
|
||||
mdSignature *pmsig) PURE; // [OUT] returned signature token.
|
||||
|
||||
STDMETHOD(DefineModuleRef)( // S_OK or error.
|
||||
|
@ -396,11 +385,11 @@ DECLARE_INTERFACE_(IMetaDataEmit, IUnknown)
|
|||
// <TODO>@FUTURE: This should go away once everyone starts using SetMemberRefProps.</TODO>
|
||||
STDMETHOD(SetParent)( // S_OK or error.
|
||||
mdMemberRef mr, // [IN] Token for the ref to be fixed up.
|
||||
mdToken tk) PURE; // [IN] The ref parent.
|
||||
mdToken tk) PURE; // [IN] The ref parent.
|
||||
|
||||
STDMETHOD(GetTokenFromTypeSpec)( // S_OK or error.
|
||||
PCCOR_SIGNATURE pvSig, // [IN] TypeSpec Signature to define.
|
||||
ULONG cbSig, // [IN] Size of signature data.
|
||||
ULONG cbSig, // [IN] Size of signature data.
|
||||
mdTypeSpec *ptypespec) PURE; // [OUT] returned TypeSpec token.
|
||||
|
||||
STDMETHOD(SaveToMemory)( // S_OK or error.
|
||||
|
@ -471,35 +460,35 @@ DECLARE_INTERFACE_(IMetaDataEmit, IUnknown)
|
|||
void const *pCustomAttribute, // [IN] The custom value data.
|
||||
ULONG cbCustomAttribute) PURE;// [IN] The custom value data length.
|
||||
|
||||
STDMETHOD(DefineField)( // S_OK or error.
|
||||
STDMETHOD(DefineField)( // S_OK or error.
|
||||
mdTypeDef td, // Parent TypeDef
|
||||
LPCWSTR szName, // Name of member
|
||||
DWORD dwFieldFlags, // Member attributes
|
||||
PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of CLR signature
|
||||
PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of CLR signature
|
||||
ULONG cbSigBlob, // [IN] count of bytes in the signature blob
|
||||
DWORD dwCPlusTypeFlag, // [IN] flag for value type. selected ELEMENT_TYPE_*
|
||||
void const *pValue, // [IN] constant value
|
||||
ULONG cchValue, // [IN] size of constant value (string, in wide chars).
|
||||
mdFieldDef *pmd) PURE; // [OUT] Put member token here
|
||||
|
||||
STDMETHOD(DefineProperty)(
|
||||
STDMETHOD(DefineProperty)(
|
||||
mdTypeDef td, // [IN] the class/interface on which the property is being defined
|
||||
LPCWSTR szProperty, // [IN] Name of the property
|
||||
DWORD dwPropFlags, // [IN] CorPropertyAttr
|
||||
PCCOR_SIGNATURE pvSig, // [IN] the required type signature
|
||||
ULONG cbSig, // [IN] the size of the type signature blob
|
||||
DWORD dwPropFlags, // [IN] CorPropertyAttr
|
||||
PCCOR_SIGNATURE pvSig, // [IN] the required type signature
|
||||
ULONG cbSig, // [IN] the size of the type signature blob
|
||||
DWORD dwCPlusTypeFlag, // [IN] flag for value type. selected ELEMENT_TYPE_*
|
||||
void const *pValue, // [IN] constant value
|
||||
ULONG cchValue, // [IN] size of constant value (string, in wide chars).
|
||||
mdMethodDef mdSetter, // [IN] optional setter of the property
|
||||
mdMethodDef mdGetter, // [IN] optional getter of the property
|
||||
mdMethodDef mdSetter, // [IN] optional setter of the property
|
||||
mdMethodDef mdGetter, // [IN] optional getter of the property
|
||||
mdMethodDef rmdOtherMethods[], // [IN] an optional array of other methods
|
||||
mdProperty *pmdProp) PURE; // [OUT] output property token
|
||||
|
||||
STDMETHOD(DefineParam)(
|
||||
mdMethodDef md, // [IN] Owning method
|
||||
ULONG ulParamSeq, // [IN] Which param
|
||||
LPCWSTR szName, // [IN] Optional param name
|
||||
ULONG ulParamSeq, // [IN] Which param
|
||||
LPCWSTR szName, // [IN] Optional param name
|
||||
DWORD dwParamFlags, // [IN] Optional param flags
|
||||
DWORD dwCPlusTypeFlag, // [IN] flag for value type. selected ELEMENT_TYPE_*
|
||||
void const *pValue, // [IN] constant value
|
||||
|
@ -555,7 +544,7 @@ DECLARE_INTERFACE_(IMetaDataEmit, IUnknown)
|
|||
ULONG *pcbTranslatedSig) PURE;// [OUT] count of bytes in the translated signature
|
||||
|
||||
STDMETHOD(SetMethodImplFlags)( // [IN] S_OK or error.
|
||||
mdMethodDef md, // [IN] Method for which to set ImplFlags
|
||||
mdMethodDef md, // [IN] Method for which to set ImplFlags
|
||||
DWORD dwImplFlags) PURE;
|
||||
|
||||
STDMETHOD(SetFieldRVA)( // [IN] S_OK or error.
|
||||
|
@ -586,7 +575,7 @@ DECLARE_INTERFACE_(IMetaDataEmit2, IMetaDataEmit)
|
|||
{
|
||||
STDMETHOD(DefineMethodSpec)(
|
||||
mdToken tkParent, // [IN] MethodDef or MemberRef
|
||||
PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of COM+ signature
|
||||
PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of COM+ signature
|
||||
ULONG cbSigBlob, // [IN] count of bytes in the signature blob
|
||||
mdMethodSpec *pmi) PURE; // [OUT] method instantiation token
|
||||
|
||||
|
@ -621,7 +610,7 @@ DECLARE_INTERFACE_(IMetaDataEmit2, IMetaDataEmit)
|
|||
LPCWSTR szName, // [IN] Optional name
|
||||
DWORD reserved, // [IN] For future use (e.g. non-type parameters)
|
||||
mdToken rtkConstraints[]) PURE;// [IN] Array of type constraints (TypeDef,TypeRef,TypeSpec)
|
||||
|
||||
|
||||
STDMETHOD(ResetENCLog)() PURE; // S_OK or error.
|
||||
|
||||
};
|
||||
|
@ -676,7 +665,7 @@ DECLARE_INTERFACE_(IMetaDataImport, IUnknown)
|
|||
mdInterfaceImpl iiImpl, // [IN] InterfaceImpl token.
|
||||
mdTypeDef *pClass, // [OUT] Put implementing class token here.
|
||||
mdToken *ptkIface) PURE; // [OUT] Put implemented interface token here.
|
||||
|
||||
|
||||
STDMETHOD(GetTypeRefProps)( // S_OK or error.
|
||||
mdTypeRef tr, // [IN] TypeRef token.
|
||||
mdToken *ptkResolutionScope, // [OUT] Resolution scope, ModuleRef or AssemblyRef.
|
||||
|
@ -687,7 +676,7 @@ DECLARE_INTERFACE_(IMetaDataImport, IUnknown)
|
|||
|
||||
STDMETHOD(ResolveTypeRef)(mdTypeRef tr, REFIID riid, IUnknown **ppIScope, mdTypeDef *ptd) PURE;
|
||||
|
||||
STDMETHOD(EnumMembers)( // S_OK, S_FALSE, or error.
|
||||
STDMETHOD(EnumMembers)( // S_OK, S_FALSE, or error.
|
||||
HCORENUM *phEnum, // [IN|OUT] Pointer to the enum.
|
||||
mdTypeDef cl, // [IN] TypeDef to scope the enumeration.
|
||||
mdToken rMembers[], // [OUT] Put MemberDefs here.
|
||||
|
@ -702,7 +691,7 @@ DECLARE_INTERFACE_(IMetaDataImport, IUnknown)
|
|||
ULONG cMax, // [IN] Max MemberDefs to put.
|
||||
ULONG *pcTokens) PURE; // [OUT] Put # put here.
|
||||
|
||||
STDMETHOD(EnumMethods)( // S_OK, S_FALSE, or error.
|
||||
STDMETHOD(EnumMethods)( // S_OK, S_FALSE, or error.
|
||||
HCORENUM *phEnum, // [IN|OUT] Pointer to the enum.
|
||||
mdTypeDef cl, // [IN] TypeDef to scope the enumeration.
|
||||
mdMethodDef rMethods[], // [OUT] Put MethodDefs here.
|
||||
|
@ -733,14 +722,14 @@ DECLARE_INTERFACE_(IMetaDataImport, IUnknown)
|
|||
ULONG *pcTokens) PURE; // [OUT] Put # put here.
|
||||
|
||||
|
||||
STDMETHOD(EnumParams)( // S_OK, S_FALSE, or error.
|
||||
STDMETHOD(EnumParams)( // S_OK, S_FALSE, or error.
|
||||
HCORENUM *phEnum, // [IN|OUT] Pointer to the enum.
|
||||
mdMethodDef mb, // [IN] MethodDef to scope the enumeration.
|
||||
mdMethodDef mb, // [IN] MethodDef to scope the enumeration.
|
||||
mdParamDef rParams[], // [OUT] Put ParamDefs here.
|
||||
ULONG cMax, // [IN] Max ParamDefs to put.
|
||||
ULONG *pcTokens) PURE; // [OUT] Put # put here.
|
||||
|
||||
STDMETHOD(EnumMemberRefs)( // S_OK, S_FALSE, or error.
|
||||
STDMETHOD(EnumMemberRefs)( // S_OK, S_FALSE, or error.
|
||||
HCORENUM *phEnum, // [IN|OUT] Pointer to the enum.
|
||||
mdToken tkParent, // [IN] Parent token to scope the enumeration.
|
||||
mdMemberRef rMemberRefs[], // [OUT] Put MemberRefs here.
|
||||
|
@ -755,49 +744,49 @@ DECLARE_INTERFACE_(IMetaDataImport, IUnknown)
|
|||
ULONG cMax, // [IN] Max tokens to put.
|
||||
ULONG *pcTokens) PURE; // [OUT] Put # put here.
|
||||
|
||||
STDMETHOD(EnumPermissionSets)( // S_OK, S_FALSE, or error.
|
||||
STDMETHOD(EnumPermissionSets)( // S_OK, S_FALSE, or error.
|
||||
HCORENUM *phEnum, // [IN|OUT] Pointer to the enum.
|
||||
mdToken tk, // [IN] if !NIL, token to scope the enumeration.
|
||||
DWORD dwActions, // [IN] if !0, return only these actions.
|
||||
mdPermission rPermission[], // [OUT] Put Permissions here.
|
||||
ULONG cMax, // [IN] Max Permissions to put.
|
||||
ULONG cMax, // [IN] Max Permissions to put.
|
||||
ULONG *pcTokens) PURE; // [OUT] Put # put here.
|
||||
|
||||
STDMETHOD(FindMember)(
|
||||
mdTypeDef td, // [IN] given typedef
|
||||
LPCWSTR szName, // [IN] member name
|
||||
PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of CLR signature
|
||||
LPCWSTR szName, // [IN] member name
|
||||
PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of CLR signature
|
||||
ULONG cbSigBlob, // [IN] count of bytes in the signature blob
|
||||
mdToken *pmb) PURE; // [OUT] matching memberdef
|
||||
mdToken *pmb) PURE; // [OUT] matching memberdef
|
||||
|
||||
STDMETHOD(FindMethod)(
|
||||
mdTypeDef td, // [IN] given typedef
|
||||
LPCWSTR szName, // [IN] member name
|
||||
PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of CLR signature
|
||||
LPCWSTR szName, // [IN] member name
|
||||
PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of CLR signature
|
||||
ULONG cbSigBlob, // [IN] count of bytes in the signature blob
|
||||
mdMethodDef *pmb) PURE; // [OUT] matching memberdef
|
||||
mdMethodDef *pmb) PURE; // [OUT] matching memberdef
|
||||
|
||||
STDMETHOD(FindField)(
|
||||
mdTypeDef td, // [IN] given typedef
|
||||
LPCWSTR szName, // [IN] member name
|
||||
PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of CLR signature
|
||||
LPCWSTR szName, // [IN] member name
|
||||
PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of CLR signature
|
||||
ULONG cbSigBlob, // [IN] count of bytes in the signature blob
|
||||
mdFieldDef *pmb) PURE; // [OUT] matching memberdef
|
||||
mdFieldDef *pmb) PURE; // [OUT] matching memberdef
|
||||
|
||||
STDMETHOD(FindMemberRef)(
|
||||
mdTypeRef td, // [IN] given typeRef
|
||||
LPCWSTR szName, // [IN] member name
|
||||
PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of CLR signature
|
||||
LPCWSTR szName, // [IN] member name
|
||||
PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of CLR signature
|
||||
ULONG cbSigBlob, // [IN] count of bytes in the signature blob
|
||||
mdMemberRef *pmr) PURE; // [OUT] matching memberref
|
||||
mdMemberRef *pmr) PURE; // [OUT] matching memberref
|
||||
|
||||
STDMETHOD (GetMethodProps)(
|
||||
STDMETHOD (GetMethodProps)(
|
||||
mdMethodDef mb, // The method for which to get props.
|
||||
mdTypeDef *pClass, // Put method's class here.
|
||||
mdTypeDef *pClass, // Put method's class here.
|
||||
_Out_writes_to_opt_(cchMethod, *pchMethod)
|
||||
LPWSTR szMethod, // Put method's name here.
|
||||
ULONG cchMethod, // Size of szMethod buffer in wide chars.
|
||||
ULONG *pchMethod, // Put actual size here
|
||||
ULONG *pchMethod, // Put actual size here
|
||||
DWORD *pdwAttr, // Put flags here.
|
||||
PCCOR_SIGNATURE *ppvSigBlob, // [OUT] point to the blob value of meta data
|
||||
ULONG *pcbSigBlob, // [OUT] actual size of signature blob
|
||||
|
@ -805,8 +794,8 @@ DECLARE_INTERFACE_(IMetaDataImport, IUnknown)
|
|||
DWORD *pdwImplFlags) PURE; // [OUT] Impl. Flags
|
||||
|
||||
STDMETHOD(GetMemberRefProps)( // S_OK or error.
|
||||
mdMemberRef mr, // [IN] given memberref
|
||||
mdToken *ptk, // [OUT] Put classref or classdef here.
|
||||
mdMemberRef mr, // [IN] given memberref
|
||||
mdToken *ptk, // [OUT] Put classref or classdef here.
|
||||
_Out_writes_to_opt_(cchMember, *pchMember)
|
||||
LPWSTR szMember, // [OUT] buffer to fill for member's name
|
||||
ULONG cchMember, // [IN] the count of char of szMember
|
||||
|
@ -814,26 +803,26 @@ DECLARE_INTERFACE_(IMetaDataImport, IUnknown)
|
|||
PCCOR_SIGNATURE *ppvSigBlob, // [OUT] point to meta data blob value
|
||||
ULONG *pbSig) PURE; // [OUT] actual size of signature blob
|
||||
|
||||
STDMETHOD(EnumProperties)( // S_OK, S_FALSE, or error.
|
||||
STDMETHOD(EnumProperties)( // S_OK, S_FALSE, or error.
|
||||
HCORENUM *phEnum, // [IN|OUT] Pointer to the enum.
|
||||
mdTypeDef td, // [IN] TypeDef to scope the enumeration.
|
||||
mdProperty rProperties[], // [OUT] Put Properties here.
|
||||
ULONG cMax, // [IN] Max properties to put.
|
||||
ULONG *pcProperties) PURE; // [OUT] Put # put here.
|
||||
|
||||
STDMETHOD(EnumEvents)( // S_OK, S_FALSE, or error.
|
||||
STDMETHOD(EnumEvents)( // S_OK, S_FALSE, or error.
|
||||
HCORENUM *phEnum, // [IN|OUT] Pointer to the enum.
|
||||
mdTypeDef td, // [IN] TypeDef to scope the enumeration.
|
||||
mdEvent rEvents[], // [OUT] Put events here.
|
||||
ULONG cMax, // [IN] Max events to put.
|
||||
ULONG *pcEvents) PURE; // [OUT] Put # put here.
|
||||
|
||||
STDMETHOD(GetEventProps)( // S_OK, S_FALSE, or error.
|
||||
mdEvent ev, // [IN] event token
|
||||
STDMETHOD(GetEventProps)( // S_OK, S_FALSE, or error.
|
||||
mdEvent ev, // [IN] event token
|
||||
mdTypeDef *pClass, // [OUT] typedef containing the event declarion.
|
||||
LPCWSTR szEvent, // [OUT] Event name
|
||||
LPCWSTR szEvent, // [OUT] Event name
|
||||
ULONG cchEvent, // [IN] the count of wchar of szEvent
|
||||
ULONG *pchEvent, // [OUT] actual count of wchar for event's name
|
||||
ULONG *pchEvent, // [OUT] actual count of wchar for event's name
|
||||
DWORD *pdwEventFlags, // [OUT] Event flags.
|
||||
mdToken *ptkEventType, // [OUT] EventType class
|
||||
mdMethodDef *pmdAddOn, // [OUT] AddOn method of the event
|
||||
|
@ -841,24 +830,24 @@ DECLARE_INTERFACE_(IMetaDataImport, IUnknown)
|
|||
mdMethodDef *pmdFire, // [OUT] Fire method of the event
|
||||
mdMethodDef rmdOtherMethod[], // [OUT] other method of the event
|
||||
ULONG cMax, // [IN] size of rmdOtherMethod
|
||||
ULONG *pcOtherMethod) PURE; // [OUT] total number of other method of this event
|
||||
ULONG *pcOtherMethod) PURE; // [OUT] total number of other method of this event
|
||||
|
||||
STDMETHOD(EnumMethodSemantics)( // S_OK, S_FALSE, or error.
|
||||
STDMETHOD(EnumMethodSemantics)( // S_OK, S_FALSE, or error.
|
||||
HCORENUM *phEnum, // [IN|OUT] Pointer to the enum.
|
||||
mdMethodDef mb, // [IN] MethodDef to scope the enumeration.
|
||||
mdMethodDef mb, // [IN] MethodDef to scope the enumeration.
|
||||
mdToken rEventProp[], // [OUT] Put Event/Property here.
|
||||
ULONG cMax, // [IN] Max properties to put.
|
||||
ULONG *pcEventProp) PURE; // [OUT] Put # put here.
|
||||
|
||||
STDMETHOD(GetMethodSemantics)( // S_OK, S_FALSE, or error.
|
||||
STDMETHOD(GetMethodSemantics)( // S_OK, S_FALSE, or error.
|
||||
mdMethodDef mb, // [IN] method token
|
||||
mdToken tkEventProp, // [IN] event/property token.
|
||||
DWORD *pdwSemanticsFlags) PURE; // [OUT] the role flags for the method/propevent pair
|
||||
DWORD *pdwSemanticsFlags) PURE; // [OUT] the role flags for the method/propevent pair
|
||||
|
||||
STDMETHOD(GetClassLayout) (
|
||||
STDMETHOD(GetClassLayout) (
|
||||
mdTypeDef td, // [IN] give typedef
|
||||
DWORD *pdwPackSize, // [OUT] 1, 2, 4, 8, or 16
|
||||
COR_FIELD_OFFSET rFieldOffset[], // [OUT] field offset array
|
||||
COR_FIELD_OFFSET rFieldOffset[], // [OUT] field offset array
|
||||
ULONG cMax, // [IN] size of the array
|
||||
ULONG *pcFieldOffset, // [OUT] needed array size
|
||||
ULONG *pulClassSize) PURE; // [OUT] the size of the class
|
||||
|
@ -871,7 +860,7 @@ DECLARE_INTERFACE_(IMetaDataImport, IUnknown)
|
|||
STDMETHOD(GetRVA)( // S_OK or error.
|
||||
mdToken tk, // Member for which to set offset
|
||||
ULONG *pulCodeRVA, // The offset
|
||||
DWORD *pdwImplFlags) PURE; // the implementation flags
|
||||
DWORD *pdwImplFlags) PURE; // the implementation flags
|
||||
|
||||
STDMETHOD(GetPermissionSetProps) (
|
||||
mdPermission pm, // [IN] the permission token.
|
||||
|
@ -906,7 +895,7 @@ DECLARE_INTERFACE_(IMetaDataImport, IUnknown)
|
|||
mdToken tk, // [IN] Token to get name from. Must have a name.
|
||||
MDUTF8CSTR *pszUtf8NamePtr) PURE; // [OUT] Return pointer to UTF8 name in heap.
|
||||
|
||||
STDMETHOD(EnumUnresolvedMethods)( // S_OK, S_FALSE, or error.
|
||||
STDMETHOD(EnumUnresolvedMethods)( // S_OK, S_FALSE, or error.
|
||||
HCORENUM *phEnum, // [IN|OUT] Pointer to the enum.
|
||||
mdToken rMethods[], // [OUT] Put MemberDefs here.
|
||||
ULONG cMax, // [IN] Max MemberDefs to put.
|
||||
|
@ -973,18 +962,18 @@ DECLARE_INTERFACE_(IMetaDataImport, IUnknown)
|
|||
|
||||
STDMETHOD(GetMemberProps)(
|
||||
mdToken mb, // The member for which to get props.
|
||||
mdTypeDef *pClass, // Put member's class here.
|
||||
mdTypeDef *pClass, // Put member's class here.
|
||||
_Out_writes_to_opt_(cchMember, *pchMember)
|
||||
LPWSTR szMember, // Put member's name here.
|
||||
ULONG cchMember, // Size of szMember buffer in wide chars.
|
||||
ULONG *pchMember, // Put actual size here
|
||||
ULONG *pchMember, // Put actual size here
|
||||
DWORD *pdwAttr, // Put flags here.
|
||||
PCCOR_SIGNATURE *ppvSigBlob, // [OUT] point to the blob value of meta data
|
||||
ULONG *pcbSigBlob, // [OUT] actual size of signature blob
|
||||
ULONG *pulCodeRVA, // [OUT] codeRVA
|
||||
DWORD *pdwImplFlags, // [OUT] Impl. Flags
|
||||
DWORD *pdwCPlusTypeFlag, // [OUT] flag for value type. selected ELEMENT_TYPE_*
|
||||
UVCP_CONSTANT *ppValue, // [OUT] constant value
|
||||
UVCP_CONSTANT *ppValue, // [OUT] constant value
|
||||
ULONG *pcchValue) PURE; // [OUT] size of constant string in chars, 0 for non-strings.
|
||||
|
||||
STDMETHOD(GetFieldProps)(
|
||||
|
@ -993,25 +982,25 @@ DECLARE_INTERFACE_(IMetaDataImport, IUnknown)
|
|||
_Out_writes_to_opt_(cchField, *pchField)
|
||||
LPWSTR szField, // Put field's name here.
|
||||
ULONG cchField, // Size of szField buffer in wide chars.
|
||||
ULONG *pchField, // Put actual size here
|
||||
ULONG *pchField, // Put actual size here
|
||||
DWORD *pdwAttr, // Put flags here.
|
||||
PCCOR_SIGNATURE *ppvSigBlob, // [OUT] point to the blob value of meta data
|
||||
ULONG *pcbSigBlob, // [OUT] actual size of signature blob
|
||||
DWORD *pdwCPlusTypeFlag, // [OUT] flag for value type. selected ELEMENT_TYPE_*
|
||||
UVCP_CONSTANT *ppValue, // [OUT] constant value
|
||||
UVCP_CONSTANT *ppValue, // [OUT] constant value
|
||||
ULONG *pcchValue) PURE; // [OUT] size of constant string in chars, 0 for non-strings.
|
||||
|
||||
STDMETHOD(GetPropertyProps)( // S_OK, S_FALSE, or error.
|
||||
STDMETHOD(GetPropertyProps)( // S_OK, S_FALSE, or error.
|
||||
mdProperty prop, // [IN] property token
|
||||
mdTypeDef *pClass, // [OUT] typedef containing the property declarion.
|
||||
mdTypeDef *pClass, // [OUT] typedef containing the property declarion.
|
||||
LPCWSTR szProperty, // [OUT] Property name
|
||||
ULONG cchProperty, // [IN] the count of wchar of szProperty
|
||||
ULONG *pchProperty, // [OUT] actual count of wchar for property name
|
||||
DWORD *pdwPropFlags, // [OUT] property flags.
|
||||
PCCOR_SIGNATURE *ppvSig, // [OUT] property type. pointing to meta data internal blob
|
||||
PCCOR_SIGNATURE *ppvSig, // [OUT] property type. pointing to meta data internal blob
|
||||
ULONG *pbSig, // [OUT] count of bytes in *ppvSig
|
||||
DWORD *pdwCPlusTypeFlag, // [OUT] flag for value type. selected ELEMENT_TYPE_*
|
||||
UVCP_CONSTANT *ppDefaultValue, // [OUT] constant value
|
||||
UVCP_CONSTANT *ppDefaultValue, // [OUT] constant value
|
||||
ULONG *pcchDefaultValue, // [OUT] size of constant string in chars, 0 for non-strings.
|
||||
mdMethodDef *pmdSetter, // [OUT] setter method of the property
|
||||
mdMethodDef *pmdGetter, // [OUT] getter method of the property
|
||||
|
@ -1455,7 +1444,7 @@ DECLARE_INTERFACE_(IMetaDataDispenserEx, IMetaDataDispenser)
|
|||
LPCWSTR szPrivateBin, // [IN] optional - can be NULL
|
||||
LPCWSTR szGlobalBin, // [IN] optional - can be NULL
|
||||
LPCWSTR szAssemblyName, // [IN] required - this is the assembly you are requesting
|
||||
LPCWSTR szName, // [OUT] buffer - to hold name
|
||||
LPCWSTR szName, // [OUT] buffer - to hold name
|
||||
ULONG cchName, // [IN] the name buffer's size
|
||||
ULONG *pcName) PURE; // [OUT] the number of characters returend in the buffer
|
||||
|
||||
|
@ -1466,7 +1455,7 @@ DECLARE_INTERFACE_(IMetaDataDispenserEx, IMetaDataDispenser)
|
|||
LPCWSTR szAssemblyName, // [IN] required - this is the assembly you are requesting
|
||||
LPCWSTR szModuleName, // [IN] required - the name of the module
|
||||
_Out_writes_to_opt_(cchName, *pcName)
|
||||
LPWSTR szName, // [OUT] buffer - to hold name
|
||||
LPWSTR szName, // [OUT] buffer - to hold name
|
||||
ULONG cchName, // [IN] the name buffer's size
|
||||
ULONG *pcName) PURE; // [OUT] the number of characters returend in the buffer
|
||||
|
||||
|
@ -1476,16 +1465,16 @@ DECLARE_INTERFACE_(IMetaDataDispenserEx, IMetaDataDispenser)
|
|||
//*****************************************************************************
|
||||
//
|
||||
// Registration declarations. Will be replace by Services' Registration
|
||||
// implementation.
|
||||
// implementation.
|
||||
//
|
||||
//*****************************************************************************
|
||||
//*****************************************************************************
|
||||
// Various flags for use in installing a module or a composite
|
||||
typedef enum
|
||||
typedef enum
|
||||
{
|
||||
regNoCopy = 0x00000001, // Don't copy files into destination
|
||||
regConfig = 0x00000002, // Is a configuration
|
||||
regHasRefs = 0x00000004 // Has class references
|
||||
regHasRefs = 0x00000004 // Has class references
|
||||
} CorRegFlags;
|
||||
|
||||
typedef GUID CVID;
|
||||
|
@ -1523,7 +1512,7 @@ typedef enum {
|
|||
// generate only a section-relative reloc, nothing into .reloc section
|
||||
srRelocAbsolute,
|
||||
|
||||
// generate a .reloc for a pointer sized location,
|
||||
// generate a .reloc for a pointer sized location,
|
||||
// This is transformed into BASED_HIGHLOW or BASED_DIR64 based on the platform
|
||||
srRelocHighLow = 3,
|
||||
|
||||
|
@ -1531,7 +1520,7 @@ typedef enum {
|
|||
// bottom 16 bits are included in the next word in the .reloc table
|
||||
srRelocHighAdj, // Never Used
|
||||
|
||||
// generate a token map relocation, nothing into .reloc section
|
||||
// generate a token map relocation, nothing into .reloc section
|
||||
srRelocMapToken,
|
||||
|
||||
// relative address fixup
|
||||
|
@ -1545,23 +1534,23 @@ typedef enum {
|
|||
// code relative address fixup
|
||||
srRelocCodeRelative,
|
||||
|
||||
// generate a .reloc for a 64 bit address in an ia64 movl instruction
|
||||
// generate a .reloc for a 64 bit address in an ia64 movl instruction
|
||||
srRelocIA64Imm64,
|
||||
|
||||
// generate a .reloc for a 64 bit address
|
||||
srRelocDir64,
|
||||
|
||||
// generate a .reloc for a 25-bit PC relative address in an ia64 br.call instruction
|
||||
// generate a .reloc for a 25-bit PC relative address in an ia64 br.call instruction
|
||||
srRelocIA64PcRel25,
|
||||
|
||||
// generate a .reloc for a 64-bit PC relative address in an ia64 brl.call instruction
|
||||
// generate a .reloc for a 64-bit PC relative address in an ia64 brl.call instruction
|
||||
srRelocIA64PcRel64,
|
||||
|
||||
// generate a 30-bit section-relative reloc, used for tagged pointer values
|
||||
srRelocAbsoluteTagged,
|
||||
|
||||
|
||||
// A sentinel value to help ensure any additions to this enum are reflected
|
||||
// A sentinel value to help ensure any additions to this enum are reflected
|
||||
// in PEWriter.cpp's RelocName array.
|
||||
srRelocSentinel,
|
||||
|
||||
|
@ -1569,7 +1558,7 @@ typedef enum {
|
|||
|
||||
// do not emit base reloc
|
||||
srNoBaseReloc = 0x4000,
|
||||
|
||||
|
||||
// pre-fixup contents of memory are ptr rather than a section offset
|
||||
srRelocPtr = 0x8000,
|
||||
|
||||
|
@ -1607,7 +1596,7 @@ DECLARE_INTERFACE_(ICeeGen, IUnknown)
|
|||
STDMETHOD (AllocateMethodBuffer) (
|
||||
ULONG cchBuffer, // [IN] Length of buffer to create
|
||||
UCHAR **lpBuffer, // [OUT] Returned buffer
|
||||
ULONG *RVA) PURE; // [OUT] RVA for method
|
||||
ULONG *RVA) PURE; // [OUT] RVA for method
|
||||
|
||||
STDMETHOD (GetMethodBuffer) (
|
||||
ULONG RVA, // [IN] RVA for method to return
|
||||
|
@ -1619,43 +1608,43 @@ DECLARE_INTERFACE_(ICeeGen, IUnknown)
|
|||
STDMETHOD (GenerateCeeFile) () PURE;
|
||||
|
||||
STDMETHOD (GetIlSection) (
|
||||
HCEESECTION *section) PURE;
|
||||
HCEESECTION *section) PURE;
|
||||
|
||||
STDMETHOD (GetStringSection) (
|
||||
HCEESECTION *section) PURE;
|
||||
HCEESECTION *section) PURE;
|
||||
|
||||
STDMETHOD (AddSectionReloc) (
|
||||
HCEESECTION section,
|
||||
ULONG offset,
|
||||
HCEESECTION relativeTo,
|
||||
HCEESECTION section,
|
||||
ULONG offset,
|
||||
HCEESECTION relativeTo,
|
||||
CeeSectionRelocType relocType) PURE;
|
||||
|
||||
// use these only if you have special section requirements not handled
|
||||
// by other APIs
|
||||
STDMETHOD (GetSectionCreate) (
|
||||
const char *name,
|
||||
DWORD flags,
|
||||
HCEESECTION *section) PURE;
|
||||
const char *name,
|
||||
DWORD flags,
|
||||
HCEESECTION *section) PURE;
|
||||
|
||||
STDMETHOD (GetSectionDataLen) (
|
||||
HCEESECTION section,
|
||||
HCEESECTION section,
|
||||
ULONG *dataLen) PURE;
|
||||
|
||||
STDMETHOD (GetSectionBlock) (
|
||||
HCEESECTION section,
|
||||
ULONG len,
|
||||
ULONG align=1,
|
||||
void **ppBytes=0) PURE;
|
||||
HCEESECTION section,
|
||||
ULONG len,
|
||||
ULONG align=1,
|
||||
void **ppBytes=0) PURE;
|
||||
|
||||
STDMETHOD (TruncateSection) (
|
||||
HCEESECTION section,
|
||||
HCEESECTION section,
|
||||
ULONG len) PURE;
|
||||
|
||||
STDMETHOD (GenerateCeeMemoryImage) (
|
||||
void **ppImage) PURE;
|
||||
|
||||
STDMETHOD (ComputePointer) (
|
||||
HCEESECTION section,
|
||||
HCEESECTION section,
|
||||
ULONG RVA, // [IN] RVA for method to return
|
||||
UCHAR **lpBuffer) PURE; // [OUT] Returned buffer
|
||||
|
||||
|
@ -1827,7 +1816,7 @@ DECLARE_INTERFACE_(IMetaDataInfo, IUnknown)
|
|||
{
|
||||
// Return Values:
|
||||
// S_OK - All parameters are filled.
|
||||
// COR_E_NOTSUPPORTED - The API is not supported for this particular scope (e.g. .obj files, scope
|
||||
// COR_E_NOTSUPPORTED - The API is not supported for this particular scope (e.g. .obj files, scope
|
||||
// opened without whole file via code:IMetaDataDispenser::OpenScopeOnMemory, etc.).
|
||||
// E_INVALIDARG - If NULL is passed as parameter.
|
||||
STDMETHOD(GetFileMapping)(
|
||||
|
@ -1874,7 +1863,7 @@ DECLARE_INTERFACE_(IMetaDataWinMDImport, IUnknown)
|
|||
#define COR_NATIVE_LINK_CUSTOM_VALUE_CC 18
|
||||
|
||||
#include <pshpack1.h>
|
||||
typedef struct
|
||||
typedef struct
|
||||
{
|
||||
BYTE m_linkType; // see CorNativeLinkType below
|
||||
BYTE m_flags; // see CorNativeLinkFlags below
|
||||
|
@ -1882,7 +1871,7 @@ typedef struct
|
|||
} COR_NATIVE_LINK;
|
||||
#include <poppack.h>
|
||||
|
||||
typedef enum
|
||||
typedef enum
|
||||
{
|
||||
nltNone = 1, // none of the keywords are specified
|
||||
nltAnsi = 2, // ansi keyword specified
|
||||
|
@ -1891,9 +1880,9 @@ typedef enum
|
|||
nltMaxValue = 7, // used so we can assert how many bits are required for this enum
|
||||
} CorNativeLinkType;
|
||||
|
||||
typedef enum
|
||||
typedef enum
|
||||
{
|
||||
nlfNone = 0x00, // no flags
|
||||
nlfNone = 0x00, // no flags
|
||||
nlfLastError = 0x01, // setLastError keyword specified
|
||||
nlfNoMangle = 0x02, // nomangle keyword specified
|
||||
nlfMaxValue = 0x03, // used so we can assert how many bits are required for this enum
|
||||
|
@ -1981,9 +1970,9 @@ FORCEINLINE int CorIsPrimitiveType(CorElementType elementtype)
|
|||
}
|
||||
|
||||
|
||||
// Return true if element type is a modifier, i.e. ELEMENT_TYPE_MODIFIER bits are
|
||||
// Return true if element type is a modifier, i.e. ELEMENT_TYPE_MODIFIER bits are
|
||||
// turned on. For now, it is checking for ELEMENT_TYPE_PTR and ELEMENT_TYPE_BYREF
|
||||
// as well. This will be removed when we turn on ELEMENT_TYPE_MODIFIER bits for
|
||||
// as well. This will be removed when we turn on ELEMENT_TYPE_MODIFIER bits for
|
||||
// these two enum members.
|
||||
//
|
||||
FORCEINLINE int CorIsModifierElementType(CorElementType elementtype)
|
||||
|
@ -2015,7 +2004,7 @@ inline ULONG CorSigUncompressedDataSize(
|
|||
// (*pBytes & 0xE0) == 0XE0.
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
inline ULONG CorSigUncompressBigData(
|
||||
PCCOR_SIGNATURE & pData) // [IN,OUT] compressed data
|
||||
PCCOR_SIGNATURE & pData) // [IN,OUT] compressed data
|
||||
{
|
||||
ULONG res;
|
||||
|
||||
|
@ -2028,32 +2017,32 @@ inline ULONG CorSigUncompressBigData(
|
|||
res = (ULONG)((*pData++ & 0x3f) << 8);
|
||||
res |= *pData++;
|
||||
}
|
||||
else // 110? ????
|
||||
else // 110? ????
|
||||
{
|
||||
res = (*pData++ & 0x1f) << 24;
|
||||
res |= *pData++ << 16;
|
||||
res |= *pData++ << 8;
|
||||
res |= *pData++;
|
||||
}
|
||||
return res;
|
||||
return res;
|
||||
}
|
||||
FORCEINLINE ULONG CorSigUncompressData(
|
||||
PCCOR_SIGNATURE & pData) // [IN,OUT] compressed data
|
||||
PCCOR_SIGNATURE & pData) // [IN,OUT] compressed data
|
||||
{
|
||||
// Handle smallest data inline.
|
||||
// Handle smallest data inline.
|
||||
if ((*pData & 0x80) == 0x00) // 0??? ????
|
||||
return *pData++;
|
||||
return CorSigUncompressBigData(pData);
|
||||
}
|
||||
|
||||
inline HRESULT CorSigUncompressData(// return S_OK or E_BADIMAGEFORMAT if the signature is bad
|
||||
inline HRESULT CorSigUncompressData(// return S_OK or E_BADIMAGEFORMAT if the signature is bad
|
||||
PCCOR_SIGNATURE pData, // [IN] compressed data
|
||||
DWORD len, // [IN] length of the signature
|
||||
ULONG * pDataOut, // [OUT] the expanded *pData
|
||||
ULONG * pDataLen) // [OUT] length of the expanded *pData
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
BYTE const *pBytes = reinterpret_cast<BYTE const*>(pData);
|
||||
BYTE const *pBytes = reinterpret_cast<BYTE const*>(pData);
|
||||
|
||||
// Smallest.
|
||||
if ((*pBytes & 0x80) == 0x00) // 0??? ????
|
||||
|
@ -2067,7 +2056,7 @@ inline HRESULT CorSigUncompressData(// return S_OK or E_BADIMAGEFORMAT if the si
|
|||
else
|
||||
{
|
||||
*pDataOut = *pBytes;
|
||||
*pDataLen = 1;
|
||||
*pDataLen = 1;
|
||||
}
|
||||
}
|
||||
// Medium.
|
||||
|
@ -2082,7 +2071,7 @@ inline HRESULT CorSigUncompressData(// return S_OK or E_BADIMAGEFORMAT if the si
|
|||
else
|
||||
{
|
||||
*pDataOut = (ULONG)(((*pBytes & 0x3f) << 8 | *(pBytes+1)));
|
||||
*pDataLen = 2;
|
||||
*pDataLen = 2;
|
||||
}
|
||||
}
|
||||
else if ((*pBytes & 0xE0) == 0xC0) // 110? ????
|
||||
|
@ -2096,7 +2085,7 @@ inline HRESULT CorSigUncompressData(// return S_OK or E_BADIMAGEFORMAT if the si
|
|||
else
|
||||
{
|
||||
*pDataOut = (ULONG)(((*pBytes & 0x1f) << 24 | *(pBytes+1) << 16 | *(pBytes+2) << 8 | *(pBytes+3)));
|
||||
*pDataLen = 4;
|
||||
*pDataLen = 4;
|
||||
}
|
||||
}
|
||||
else // We don't recognize this encoding
|
||||
|
@ -2105,23 +2094,23 @@ inline HRESULT CorSigUncompressData(// return S_OK or E_BADIMAGEFORMAT if the si
|
|||
*pDataLen = 0;
|
||||
hr = META_E_BAD_SIGNATURE;
|
||||
}
|
||||
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
inline ULONG CorSigUncompressData( // return number of bytes of that compressed data occupied in pData
|
||||
PCCOR_SIGNATURE pData, // [IN] compressed data
|
||||
inline ULONG CorSigUncompressData( // return number of bytes of that compressed data occupied in pData
|
||||
PCCOR_SIGNATURE pData, // [IN] compressed data
|
||||
ULONG *pDataOut) // [OUT] the expanded *pData
|
||||
{
|
||||
ULONG dwSizeOfData = 0;
|
||||
|
||||
|
||||
// We don't know how big the signature is, so we'll just say that it's big enough
|
||||
if (FAILED(CorSigUncompressData(pData, 0xff, pDataOut, &dwSizeOfData)))
|
||||
{
|
||||
*pDataOut = 0;
|
||||
return (ULONG)-1;
|
||||
}
|
||||
|
||||
|
||||
return dwSizeOfData;
|
||||
}
|
||||
|
||||
|
@ -2138,35 +2127,35 @@ SELECTANY const mdToken g_tkCorEncodeToken[4] ={mdtTypeDef, mdtTypeRef, mdtTypeS
|
|||
|
||||
// uncompress a token
|
||||
inline mdToken CorSigUncompressToken( // return the token.
|
||||
PCCOR_SIGNATURE &pData) // [IN,OUT] compressed data
|
||||
PCCOR_SIGNATURE &pData) // [IN,OUT] compressed data
|
||||
{
|
||||
mdToken tk;
|
||||
mdToken tkType;
|
||||
|
||||
tk = CorSigUncompressData(pData);
|
||||
tkType = g_tkCorEncodeToken[tk & 0x3];
|
||||
tk = TokenFromRid(tk >> 2, tkType);
|
||||
tk = TokenFromRid(tk >> 2, tkType);
|
||||
return tk;
|
||||
}
|
||||
|
||||
|
||||
inline ULONG CorSigUncompressToken( // return number of bytes of that compressed data occupied in pData
|
||||
PCCOR_SIGNATURE pData, // [IN] compressed data
|
||||
inline ULONG CorSigUncompressToken( // return number of bytes of that compressed data occupied in pData
|
||||
PCCOR_SIGNATURE pData, // [IN] compressed data
|
||||
mdToken * pToken) // [OUT] the expanded *pData
|
||||
{
|
||||
ULONG cb;
|
||||
mdToken tk;
|
||||
mdToken tkType;
|
||||
|
||||
cb = CorSigUncompressData(pData, (ULONG *)&tk);
|
||||
cb = CorSigUncompressData(pData, (ULONG *)&tk);
|
||||
tkType = g_tkCorEncodeToken[tk & 0x3];
|
||||
tk = TokenFromRid(tk >> 2, tkType);
|
||||
tk = TokenFromRid(tk >> 2, tkType);
|
||||
*pToken = tk;
|
||||
return cb;
|
||||
}
|
||||
|
||||
inline HRESULT CorSigUncompressToken(
|
||||
PCCOR_SIGNATURE pData, // [IN] compressed data
|
||||
PCCOR_SIGNATURE pData, // [IN] compressed data
|
||||
DWORD dwLen, // [IN] Remaining length of sigature
|
||||
mdToken * pToken, // [OUT] the expanded *pData
|
||||
DWORD * dwTokenLength) // [OUT] The length of the token in the sigature
|
||||
|
@ -2179,7 +2168,7 @@ inline HRESULT CorSigUncompressToken(
|
|||
if (SUCCEEDED(hr))
|
||||
{
|
||||
tkType = g_tkCorEncodeToken[tk & 0x3];
|
||||
tk = TokenFromRid(tk >> 2, tkType);
|
||||
tk = TokenFromRid(tk >> 2, tkType);
|
||||
*pToken = tk;
|
||||
}
|
||||
else
|
||||
|
@ -2223,8 +2212,8 @@ enum {
|
|||
|
||||
// uncompress a signed integer
|
||||
inline ULONG CorSigUncompressSignedInt( // return number of bytes of that compressed data occupied in pData
|
||||
PCCOR_SIGNATURE pData, // [IN] compressed data
|
||||
int * pInt) // [OUT] the expanded *pInt
|
||||
PCCOR_SIGNATURE pData, // [IN] compressed data
|
||||
int * pInt) // [OUT] the expanded *pInt
|
||||
{
|
||||
ULONG cb;
|
||||
ULONG ulSigned;
|
||||
|
@ -2232,17 +2221,17 @@ inline ULONG CorSigUncompressSignedInt( // return number of bytes of that compre
|
|||
|
||||
cb = CorSigUncompressData(pData, &iData);
|
||||
if (cb == (ULONG) -1) return cb;
|
||||
ulSigned = iData & 0x1;
|
||||
iData = iData >> 1;
|
||||
ulSigned = iData & 0x1;
|
||||
iData = iData >> 1;
|
||||
if (ulSigned)
|
||||
{
|
||||
if (cb == 1)
|
||||
{
|
||||
iData |= SIGN_MASK_ONEBYTE;
|
||||
iData |= SIGN_MASK_ONEBYTE;
|
||||
}
|
||||
else if (cb == 2)
|
||||
{
|
||||
iData |= SIGN_MASK_TWOBYTE;
|
||||
iData |= SIGN_MASK_TWOBYTE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2256,13 +2245,13 @@ inline ULONG CorSigUncompressSignedInt( // return number of bytes of that compre
|
|||
|
||||
// uncompress encoded element type
|
||||
FORCEINLINE CorElementType CorSigUncompressElementType( // Element type
|
||||
PCCOR_SIGNATURE & pData) // [IN,OUT] Compressed data
|
||||
PCCOR_SIGNATURE & pData) // [IN,OUT] Compressed data
|
||||
{
|
||||
return (CorElementType)*pData++;
|
||||
}
|
||||
|
||||
inline ULONG CorSigUncompressElementType( // Return number of bytes of that compressed data occupied in pData
|
||||
PCCOR_SIGNATURE pData, // [IN] Compressed data
|
||||
PCCOR_SIGNATURE pData, // [IN] Compressed data
|
||||
CorElementType * pElementType) // [OUT] The expanded *pData
|
||||
{
|
||||
*pElementType = (CorElementType)(*pData & 0x7f);
|
||||
|
@ -2285,20 +2274,20 @@ inline ULONG CorSigCompressData( // return number of bytes that compressed fo
|
|||
void * pDataOut) // [OUT] buffer where iLen will be compressed and stored.
|
||||
{
|
||||
BYTE *pBytes = reinterpret_cast<BYTE *>(pDataOut);
|
||||
|
||||
|
||||
if (iLen <= 0x7F)
|
||||
{
|
||||
*pBytes = BYTE(iLen);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
if (iLen <= 0x3FFF)
|
||||
{
|
||||
*pBytes = BYTE((iLen >> 8) | 0x80);
|
||||
*(pBytes+1) = BYTE(iLen & 0xff);
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
||||
if (iLen <= 0x1FFFFFFF)
|
||||
{
|
||||
*pBytes = BYTE((iLen >> 24) | 0xC0);
|
||||
|
@ -2317,15 +2306,15 @@ inline ULONG CorSigCompressToken( // return number of bytes that compressed fo
|
|||
mdToken tk, // [IN] given token
|
||||
void * pDataOut) // [OUT] buffer where the token will be compressed and stored.
|
||||
{
|
||||
RID rid = RidFromToken(tk);
|
||||
RID rid = RidFromToken(tk);
|
||||
ULONG32 ulTyp = TypeFromToken(tk);
|
||||
|
||||
|
||||
if (rid > 0x3FFFFFF)
|
||||
// token is too big to be compressed
|
||||
return (ULONG) -1;
|
||||
|
||||
|
||||
rid = (rid << 2);
|
||||
|
||||
|
||||
// TypeDef is encoded with low bits 00
|
||||
// TypeRef is encoded with low bits 01
|
||||
// TypeSpec is encoded with low bits 10
|
||||
|
@ -2357,11 +2346,11 @@ inline ULONG CorSigCompressSignedInt( // return number of bytes that compresse
|
|||
{
|
||||
ULONG isSigned = 0;
|
||||
BYTE *pBytes = reinterpret_cast<BYTE *>(pDataOut);
|
||||
|
||||
|
||||
if (iData < 0)
|
||||
isSigned = 0x1;
|
||||
|
||||
// Note that we cannot use code:CorSigCompressData to pack the iData value, because of negative values
|
||||
|
||||
// Note that we cannot use code:CorSigCompressData to pack the iData value, because of negative values
|
||||
// like: 0xffffe000 (-8192) which has to be encoded as 1 in 2 bytes, i.e. 0x81 0x00
|
||||
// However CorSigCompressedData would store value 1 as 1 byte: 0x01
|
||||
if ((iData & SIGN_MASK_ONEBYTE) == 0 || (iData & SIGN_MASK_ONEBYTE) == SIGN_MASK_ONEBYTE)
|
||||
|
@ -2396,11 +2385,11 @@ inline ULONG CorSigCompressSignedInt( // return number of bytes that compresse
|
|||
|
||||
// uncompress encoded element type
|
||||
inline ULONG CorSigCompressElementType( // return number of bytes of that compressed data occupied in pData
|
||||
CorElementType et, // [OUT] the expanded *pData
|
||||
CorElementType et, // [OUT] the expanded *pData
|
||||
void * pData) // [IN] compressed data
|
||||
{
|
||||
BYTE *pBytes = (BYTE *)(pData);
|
||||
|
||||
|
||||
*pBytes = BYTE(et);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -47,13 +47,13 @@ typedef mdToken idMethodSpec; // MethodSpec token in the IBC data
|
|||
// File format:
|
||||
//
|
||||
// CORBBTPROF_FILE_HEADER
|
||||
// CORBBTPROF_SECTION_TABLE_HEADER
|
||||
// CORBBTPROF_SECTION_TABLE_HEADER
|
||||
// CORBBTPROF_SECTION_TABLE_ENTRY
|
||||
// ... (can be multiple entries)
|
||||
//
|
||||
// Method block counts section:
|
||||
// CORBBTPROF_METHOD_BLOCK_COUNTS_SECTION_HEADER
|
||||
// CORBBTPROF_METHOD_HEADER
|
||||
// CORBBTPROF_METHOD_BLOCK_COUNTS_SECTION_HEADER
|
||||
// CORBBTPROF_METHOD_HEADER
|
||||
// CORBBTPROF_BLOCK_DATA
|
||||
// ... (can be multiple method header/block data entries)
|
||||
//
|
||||
|
@ -147,7 +147,7 @@ enum TypeProfilingDataFlags
|
|||
ReadDispatchMap = 7, // 0x00080
|
||||
ReadDispatchTable = 8, // 0x00100
|
||||
ReadMethodTableWriteableData = 9, // 0x00200
|
||||
ReadFieldMarshalers = 10, // 0x00400
|
||||
// ReadFieldMarshalers = 10, // 0x00400 // obsolete
|
||||
// WriteDispatchTable = 11, // 0x00800 // obsolete
|
||||
// WriteMethodTable = 12, // 0x01000 // obsolete
|
||||
WriteMethodTableWriteableData = 13, // 0x02000
|
||||
|
@ -198,7 +198,7 @@ enum GeneralProfilingDataFlags
|
|||
enum BlobType
|
||||
{
|
||||
/* IMPORTANT: Keep the first four enums together in the same order and at
|
||||
the very begining of this enum. See MetaModelPub.h for the order */
|
||||
the very beginning of this enum. See MetaModelPub.h for the order */
|
||||
MetadataStringPool = 0,
|
||||
MetadataGuidPool = 1,
|
||||
MetadataBlobPool = 2,
|
||||
|
@ -208,13 +208,13 @@ enum BlobType
|
|||
LastMetadataPool = 3,
|
||||
|
||||
// SectionFormat only supports tokens, which have to already exist in the module.
|
||||
// For instantiated paramterized types, there may be no corresponding token
|
||||
// For instantiated parameterized types, there may be no corresponding token
|
||||
// in the module, if a dependent module caused the type to be instantiated.
|
||||
// For such instantiated types, we save a blob/signature to identify the type.
|
||||
//
|
||||
//
|
||||
ParamTypeSpec = 4, // Instantiated Type Signature
|
||||
ParamMethodSpec = 5, // Instantiated Method Signature
|
||||
ExternalNamespaceDef = 6, // External Namespace Token Definition
|
||||
ExternalNamespaceDef = 6, // External Namespace Token Definition
|
||||
ExternalTypeDef = 7, // External Type Token Definition
|
||||
ExternalSignatureDef = 8, // External Signature Definition
|
||||
ExternalMethodDef = 9, // External Method Token Definition
|
||||
|
@ -262,7 +262,7 @@ enum SectionFormat
|
|||
BlobPoolProfilingData,
|
||||
UserStringPoolProfilingData,
|
||||
|
||||
FirstMetadataPoolSection = StringPoolProfilingData,
|
||||
FirstMetadataPoolSection = StringPoolProfilingData,
|
||||
LastMetadataPoolSection = UserStringPoolProfilingData,
|
||||
LastTokenFlagSection = LastMetadataPoolSection,
|
||||
|
||||
|
@ -295,11 +295,11 @@ struct CORBBTPROF_SECTION_TABLE_HEADER
|
|||
|
||||
struct CORBBTPROF_SCENARIO_RUN
|
||||
{
|
||||
FILETIME runTime; // the FILETIME when the scenario was cnt
|
||||
FILETIME runTime; // the FILETIME when the scenario was cnt
|
||||
GUID mvid; // The GUID of this assembly when the scenario was run (useful for incremental ibcdata)
|
||||
DWORD cCmdLine; // the count of WCHAR's in the cmdLine for this run of the scenario
|
||||
DWORD cSystemInfo; // the count of WCHAR's in the systemInfo string for this run of the scenario
|
||||
WCHAR cmdLine[0]; // the command line used, the array is 'cName' in length
|
||||
DWORD cSystemInfo; // the count of WCHAR's in the systemInfo string for this run of the scenario
|
||||
WCHAR cmdLine[0]; // the command line used, the array is 'cName' in length
|
||||
// WCHAR systemInfo[]; // the system information, the array is 'cSystemInfo' in length
|
||||
|
||||
DWORD sizeofCmdLine()
|
||||
|
@ -328,7 +328,7 @@ struct CORBBTPROF_SCENARIO_INFO
|
|||
{
|
||||
DWORD ordinal; // the id number for this scenario
|
||||
DWORD mask; // the one-bit mask use to identify this scenario
|
||||
DWORD priority; // the priority of this scenario
|
||||
DWORD priority; // the priority of this scenario
|
||||
DWORD numRuns; // the number of times this scenario was run
|
||||
DWORD cName; // the count of WCHAR's in name[]
|
||||
WCHAR name[0]; // the name of this scenario, the array is 'cName' in length
|
||||
|
@ -412,12 +412,12 @@ struct CORBBTPROF_BLOCK_DATA // This struct is also defined by: ICorJitInfo.
|
|||
|
||||
struct CORBBTPROF_METHOD_DETAIL_HEADER
|
||||
{
|
||||
DWORD size; // Size to skip to get to the next CORBBTPROF_METHOD_DETAIL_HEADER at this level
|
||||
DWORD size; // Size to skip to get to the next CORBBTPROF_METHOD_DETAIL_HEADER at this level
|
||||
DWORD kind; // Identifier that specifies what kind this CORBBTPROF_METHOD_DETAIL_HEADER actually represents
|
||||
|
||||
size_t Size()
|
||||
{
|
||||
return size;
|
||||
return size;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -429,16 +429,16 @@ struct CORBBTPROF_METHOD_INFO
|
|||
DWORD token; // token for this method
|
||||
DWORD ILSize; // IL size for this method
|
||||
DWORD cBlock; // count for block[]
|
||||
CORBBTPROF_BLOCK_DATA block[0]; // actually 'cBlock' in length
|
||||
CORBBTPROF_BLOCK_DATA block[0]; // actually 'cBlock' in length
|
||||
|
||||
size_t Size()
|
||||
{
|
||||
return sizeof(CORBBTPROF_METHOD_INFO) + sizeofBlock();
|
||||
{
|
||||
return sizeof(CORBBTPROF_METHOD_INFO) + sizeofBlock();
|
||||
}
|
||||
|
||||
size_t sizeofBlock()
|
||||
size_t sizeofBlock()
|
||||
{
|
||||
return cBlock * sizeof(CORBBTPROF_BLOCK_DATA);
|
||||
return cBlock * sizeof(CORBBTPROF_BLOCK_DATA);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -452,13 +452,13 @@ struct CORBBTPROF_METHOD_HEADER_V1
|
|||
struct CORBBTPROF_METHOD_HEADER
|
||||
{
|
||||
DWORD size; // Size to skip to get to the next CORBBTPROF_METHOD_HEADER
|
||||
DWORD cDetail; // the count of CORBBTPROF_METHOD_DETAIL_HEADER records that folow this record
|
||||
DWORD cDetail; // the count of CORBBTPROF_METHOD_DETAIL_HEADER records that follow this record
|
||||
CORBBTPROF_METHOD_INFO method; // Basic block execution counts for a method
|
||||
// ... followed by 'cDetail' occurances of CORBBTPROF_METHOD_DETAIL_HEADER
|
||||
// ... followed by 'cDetail' occurrences of CORBBTPROF_METHOD_DETAIL_HEADER
|
||||
|
||||
size_t Size()
|
||||
{
|
||||
return sizeof(CORBBTPROF_METHOD_HEADER) + method.sizeofBlock();
|
||||
return sizeof(CORBBTPROF_METHOD_HEADER) + method.sizeofBlock();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -485,7 +485,7 @@ struct CORBBTPROF_TOKEN_INFO // Was CORBBTPROF_TOKEN_LIST_ENTR
|
|||
, flags(0)
|
||||
, scenarios(0)
|
||||
{}
|
||||
|
||||
|
||||
CORBBTPROF_TOKEN_INFO( mdToken t, DWORD f = 0, DWORD s = 0)
|
||||
: token(t)
|
||||
, flags(f)
|
||||
|
|
|
@ -18,12 +18,6 @@
|
|||
#ifndef _COR_COMPILE_H_
|
||||
#define _COR_COMPILE_H_
|
||||
|
||||
#if !defined(_TARGET_X86_) || defined(FEATURE_PAL)
|
||||
#ifndef WIN64EXCEPTIONS
|
||||
#define WIN64EXCEPTIONS
|
||||
#endif
|
||||
#endif // !_TARGET_X86_ || FEATURE_PAL
|
||||
|
||||
#include <cor.h>
|
||||
#include <corhdr.h>
|
||||
#include <corinfo.h>
|
||||
|
@ -60,7 +54,7 @@ typedef DPTR(struct CORCOMPILE_VIRTUAL_SECTION_INFO)
|
|||
typedef DPTR(struct CORCOMPILE_IMPORT_SECTION)
|
||||
PTR_CORCOMPILE_IMPORT_SECTION;
|
||||
|
||||
#ifdef _TARGET_X86_
|
||||
#ifdef TARGET_X86
|
||||
|
||||
typedef DPTR(RUNTIME_FUNCTION) PTR_RUNTIME_FUNCTION;
|
||||
|
||||
|
@ -68,12 +62,12 @@ typedef DPTR(RUNTIME_FUNCTION) PTR_RUNTIME_FUNCTION;
|
|||
// Chained unwind info. Used for cold methods.
|
||||
#define RUNTIME_FUNCTION_INDIRECT 0x80000000
|
||||
|
||||
#endif // _TARGET_X86_
|
||||
#endif // TARGET_X86
|
||||
|
||||
// The stride is choosen as maximum value that still gives good page locality of RUNTIME_FUNCTION table touches (only one page of
|
||||
// The stride is choosen as maximum value that still gives good page locality of RUNTIME_FUNCTION table touches (only one page of
|
||||
// RUNTIME_FUNCTION table is going to be touched during most IP2MD lookups).
|
||||
//
|
||||
// Smaller stride values also improve speed of IP2MD lookups, but this improvement is not significant (5% when going
|
||||
// Smaller stride values also improve speed of IP2MD lookups, but this improvement is not significant (5% when going
|
||||
// from 8192 to 1024), so the working set / page locality was used as the metric to choose the optimum value.
|
||||
//
|
||||
#define RUNTIME_FUNCTION_LOOKUP_STRIDE 8192
|
||||
|
@ -94,7 +88,7 @@ typedef DPTR(struct COR_ILMETHOD) PTR_COR_ILMETHOD;
|
|||
//
|
||||
// CORCOMPILE_IMPORT_SECTION describes image range with references to other assemblies or runtime data structures
|
||||
//
|
||||
// There is number of different types of these ranges: eagerly initialized at image load vs. lazily initialized at method entry
|
||||
// There is number of different types of these ranges: eagerly initialized at image load vs. lazily initialized at method entry
|
||||
// vs. lazily initialized on first use; hot vs. cold, handles vs. code pointers, etc.
|
||||
//
|
||||
struct CORCOMPILE_IMPORT_SECTION
|
||||
|
@ -144,7 +138,7 @@ enum CorCompileImportFlags
|
|||
#define CORCOMPILE_TAG_TOKEN(token) ((SIZE_T)(((token)<<1)|CORCOMPILE_TOKEN_TAG))
|
||||
#define CORCOMPILE_UNTAG_TOKEN(token) ((((SIZE_T)(token))&~CORCOMPILE_TOKEN_TAG)>>1)
|
||||
|
||||
#ifdef _TARGET_ARM_
|
||||
#ifdef TARGET_ARM
|
||||
// Tagging of code pointers on ARM uses inverse logic because of the thumb bit.
|
||||
#define CORCOMPILE_IS_PCODE_TAGGED(token) ((((SIZE_T)(token)) & 0x00000001) == 0x00000000)
|
||||
#define CORCOMPILE_TAG_PCODE(token) ((SIZE_T)(((token)<<1)|0x80000000))
|
||||
|
@ -155,7 +149,7 @@ enum CorCompileImportFlags
|
|||
|
||||
inline BOOL CORCOMPILE_IS_FIXUP_TAGGED(SIZE_T fixup, PTR_CORCOMPILE_IMPORT_SECTION pSection)
|
||||
{
|
||||
#ifdef _TARGET_ARM_
|
||||
#ifdef TARGET_ARM
|
||||
// Tagging of code pointers on ARM has to use inverse logic because of the thumb bit
|
||||
if (pSection->Flags & CORCOMPILE_IMPORT_FLAGS_PCODE)
|
||||
{
|
||||
|
@ -211,7 +205,7 @@ enum CorCompileHeaderFlags
|
|||
CORCOMPILE_HEADER_IS_READY_TO_RUN = 0x00000004,
|
||||
};
|
||||
|
||||
//
|
||||
//
|
||||
// !!! INCREMENT THE MAJOR VERSION ANY TIME THERE IS CHANGE IN CORCOMPILE_HEADER STRUCTURE !!!
|
||||
//
|
||||
#define CORCOMPILE_SIGNATURE 0x0045474E // 'NGEN'
|
||||
|
@ -269,8 +263,8 @@ struct CORCOMPILE_HEADER
|
|||
IMAGE_DATA_DIRECTORY Dummy4;
|
||||
};
|
||||
|
||||
// CORCOMPILE_VIRTUAL_SECTION_INFO describes virtual section ranges. This data is used by nidump
|
||||
// and to fire ETW that are used for diagnostics and performance purposes. Some of the questions
|
||||
// CORCOMPILE_VIRTUAL_SECTION_INFO describes virtual section ranges. This data is used by nidump
|
||||
// and to fire ETW that are used for diagnostics and performance purposes. Some of the questions
|
||||
// these events help answer are like : how effective is IBC training data.
|
||||
struct CORCOMPILE_VIRTUAL_SECTION_INFO
|
||||
{
|
||||
|
@ -330,7 +324,7 @@ struct CORCOMPILE_VIRTUAL_SECTION_INFO
|
|||
// Hot: Items are frequently accessed ( Indicated by either IBC data, or
|
||||
// statically known )
|
||||
|
||||
// Warm : Items are less frequently accessed, or frequently accessed
|
||||
// Warm : Items are less frequently accessed, or frequently accessed
|
||||
// but were not touched during IBC profiling.
|
||||
|
||||
// Cold : Least frequently accessed /shouldn't not be accessed
|
||||
|
@ -338,7 +332,7 @@ struct CORCOMPILE_VIRTUAL_SECTION_INFO
|
|||
// training ( training scenario )
|
||||
|
||||
// HotColdSorted : Sections marked with this category means they contain both
|
||||
// Hot items and Cold items. The hot items are placed before
|
||||
// Hot items and Cold items. The hot items are placed before
|
||||
// the cold items (Sorted)
|
||||
|
||||
#define CORCOMPILE_SECTION_RANGE_TYPES() \
|
||||
|
@ -350,12 +344,12 @@ struct CORCOMPILE_VIRTUAL_SECTION_INFO
|
|||
|
||||
// IBCUnProfiled: Items in this VirtualSection are statically determined to be cold.
|
||||
// (IBC Profiling wouldn't have helped put these item in a hot section).
|
||||
// Items that currently doesn't have IBC probs, or are always put in a specific section
|
||||
// Items that currently doesn't have IBC probs, or are always put in a specific section
|
||||
// regardless of IBC data should fall in this category.
|
||||
|
||||
// IBCProfiled: IBC profiling placed items in this section, or
|
||||
// items are NOT placed into a hot section they didn't have IBC profiling data
|
||||
// ( IBC profiling would have helped put these items in a hot section )
|
||||
// ( IBC profiling would have helped put these items in a hot section )
|
||||
|
||||
#define CORCOMPILE_SECTION_IBCTYPES() \
|
||||
CORCOMPILE_SECTION_IBCTYPE(IBCUnProfiled, 0x01000000) \
|
||||
|
@ -370,42 +364,42 @@ struct CORCOMPILE_VIRTUAL_SECTION_INFO
|
|||
// 1 byte 1 byte 2 bytes --
|
||||
// <IBCType> <RangeType> <VirtualSectionType> --
|
||||
// ---------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// VirtualSections are a CLR concept to aggregate data
|
||||
// items that share common properties together (Hot/Cold/Warm, Writeable/
|
||||
// Readonly ...etc.). VirtualSections are tagged with some categories when they
|
||||
// are created (code:NewVirtualSection)
|
||||
// The VirtualSection categorize are described more in VirtualSectionType enum.
|
||||
// The categories describe 2 important aspects for each VirtualSection
|
||||
//
|
||||
//
|
||||
// ***********************************************
|
||||
// IBCProfiled v.s NonIBCProfiled Categories.
|
||||
// **********************************************
|
||||
//
|
||||
// IBCProfiled: Distinguish between sections that IBC profiling data has been used
|
||||
// to decide the layout of the data items in this section.
|
||||
//
|
||||
// IBCProfiled: Distinguish between sections that IBC profiling data has been used
|
||||
// to decide the layout of the data items in this section.
|
||||
// NonIBCProfiled: We don't have IBC data for all our datastructures.
|
||||
// The access pattern/frequency for some data structures
|
||||
// are statically determined. Sections that contain these data items
|
||||
// are marked as NonIBCProfiled.
|
||||
// are statically determined. Sections that contain these data items
|
||||
// are marked as NonIBCProfiled.
|
||||
//
|
||||
//***************************************************
|
||||
// Access Frequency categories
|
||||
// Access Frequency categories
|
||||
// **************************************************
|
||||
// Hot: Data is frequently accessed
|
||||
// Warm: Less frequently accessed than Hot
|
||||
// Cold: Should be rarely accessed.
|
||||
//
|
||||
// The combination of these 2 sub-categories gives us the following valid categories
|
||||
//
|
||||
// The combination of these 2 sub-categories gives us the following valid categories
|
||||
// 1-IBCProfiled | Hot: Hot based on IBC profiling data.
|
||||
// 2-IBCProfiled | Cold: IBC profiling could have helped make this section hot.
|
||||
// 3-NonIBCProfiled | Hot: Statically determined hot.
|
||||
// 4-NonIBCProfiled | Warm: Staticaly determined warm.
|
||||
// 5-NonIBCProfiled | Cold: Statically determined cold.
|
||||
//
|
||||
// We should try to place data items into the correct section based on
|
||||
// the above categorization, this could mean that we might split
|
||||
//
|
||||
// We should try to place data items into the correct section based on
|
||||
// the above categorization, this could mean that we might split
|
||||
// a virtual section into 2 sections if it contains multiple heterogeneous items.
|
||||
|
||||
enum ZapVirtualSectionType
|
||||
|
@ -415,7 +409,7 @@ enum ZapVirtualSectionType
|
|||
#define CORCOMPILE_SECTION_IBCTYPE(ibcType, flag) ibcType##Section = flag,
|
||||
CORCOMPILE_SECTION_IBCTYPES()
|
||||
#undef CORCOMPILE_SECTION_IBCTYPE
|
||||
|
||||
|
||||
// <RangeType>
|
||||
RangeTypeReservedFlag = 0x00FF0000,
|
||||
#define CORCOMPILE_SECTION_RANGE_TYPE(rangeType, flag) rangeType##Range = flag,
|
||||
|
@ -439,9 +433,9 @@ public :
|
|||
static UINT8 IBCType(DWORD sectionType) { return (UINT8) ((sectionType & IBCTypeReservedFlag) >> 24); }
|
||||
static UINT8 RangeType(DWORD sectionType) { return (UINT8) ((sectionType & RangeTypeReservedFlag) >> 16); }
|
||||
static UINT16 VirtualSectionType(DWORD sectionType) { return (UINT16) ((sectionType & VirtualSectionTypeReservedFlag)); }
|
||||
static BOOL IsIBCProfiledColdSection(DWORD sectionType)
|
||||
static BOOL IsIBCProfiledColdSection(DWORD sectionType)
|
||||
{
|
||||
return ((sectionType & ColdRange) == ColdRange) && ((sectionType & IBCProfiledSection) == IBCProfiledSection);
|
||||
return ((sectionType & ColdRange) == ColdRange) && ((sectionType & IBCProfiledSection) == IBCProfiledSection);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -534,7 +528,7 @@ struct CORCOMPILE_CODE_MANAGER_ENTRY
|
|||
ULONG ColdUntrainedMethodOffset;
|
||||
};
|
||||
|
||||
#if defined(_TARGET_X86_) || defined(_TARGET_AMD64_)
|
||||
#if defined(TARGET_X86) || defined(TARGET_AMD64)
|
||||
|
||||
#define _PRECODE_EXTERNAL_METHOD_THUNK 0x41
|
||||
#define _PRECODE_VIRTUAL_IMPORT_THUNK 0x42
|
||||
|
@ -553,7 +547,7 @@ struct CORCOMPILE_CODE_MANAGER_ENTRY
|
|||
WORD padding;
|
||||
};
|
||||
|
||||
#elif defined(_TARGET_ARM_)
|
||||
#elif defined(TARGET_ARM)
|
||||
|
||||
struct CORCOMPILE_VIRTUAL_IMPORT_THUNK
|
||||
{
|
||||
|
@ -587,14 +581,14 @@ struct CORCOMPILE_CODE_MANAGER_ENTRY
|
|||
// Post patchup by the stub, it will point to the actual method body.
|
||||
PCODE m_pTarget;
|
||||
};
|
||||
|
||||
#elif defined(_TARGET_ARM64_)
|
||||
|
||||
#elif defined(TARGET_ARM64)
|
||||
struct CORCOMPILE_VIRTUAL_IMPORT_THUNK
|
||||
{
|
||||
// Array of words to do the following:
|
||||
//
|
||||
// adr x12, #0 ; Save the current address relative to which we will get slot ID and address to patch.
|
||||
// ldr x10, [x12, #16] ; Load the target address.
|
||||
// ldr x10, [x12, #16] ; Load the target address.
|
||||
// br x10 ; Jump to the target
|
||||
DWORD m_rgCode[3];
|
||||
|
||||
|
@ -610,7 +604,7 @@ struct CORCOMPILE_CODE_MANAGER_ENTRY
|
|||
{
|
||||
// Array of words to do the following:
|
||||
// adr x12, #0 ; Save the current address relative to which we will get slot ID and address to patch.
|
||||
// ldr x10, [x12, #16] ; Load the target address.
|
||||
// ldr x10, [x12, #16] ; Load the target address.
|
||||
// br x10 ; Jump to the target
|
||||
DWORD m_rgCode[3];
|
||||
|
||||
|
@ -625,7 +619,7 @@ struct CORCOMPILE_CODE_MANAGER_ENTRY
|
|||
|
||||
//
|
||||
// GCRefMap blob starts with DWORDs lookup index of relative offsets into the blob. This lookup index is used to limit amount
|
||||
// of linear scanning required to find entry in the GCRefMap. The size of this lookup index is
|
||||
// of linear scanning required to find entry in the GCRefMap. The size of this lookup index is
|
||||
// <totalNumberOfEntries in the GCRefMap> / GCREFMAP_LOOKUP_STRIDE.
|
||||
//
|
||||
#define GCREFMAP_LOOKUP_STRIDE 1024
|
||||
|
@ -644,7 +638,7 @@ enum CORCOMPILE_GCREFMAP_TOKENS
|
|||
enum CORCOMPILE_FIXUP_BLOB_KIND
|
||||
{
|
||||
ENCODE_NONE = 0,
|
||||
|
||||
|
||||
ENCODE_MODULE_OVERRIDE = 0x80, /* When the high bit is set, override of the module immediately follows */
|
||||
|
||||
ENCODE_DICTIONARY_LOOKUP_THISOBJ = 0x07,
|
||||
|
@ -694,7 +688,10 @@ enum CORCOMPILE_FIXUP_BLOB_KIND
|
|||
|
||||
ENCODE_DECLARINGTYPE_HANDLE,
|
||||
|
||||
ENCODE_INDIRECT_PINVOKE_TARGET, /* For calling a pinvoke method ptr */
|
||||
ENCODE_INDIRECT_PINVOKE_TARGET, /* For calling a pinvoke method ptr indirectly */
|
||||
ENCODE_PINVOKE_TARGET, /* For calling a pinvoke method ptr */
|
||||
|
||||
ENCODE_CHECK_INSTRUCTION_SET_SUPPORT, /* Define the set of instruction sets that must be supported/unsupported to use the fixup */
|
||||
|
||||
ENCODE_MODULE_HANDLE = 0x50, /* Module token */
|
||||
ENCODE_STATIC_FIELD_ADDRESS, /* For accessing a static field */
|
||||
|
@ -707,7 +704,6 @@ enum CORCOMPILE_FIXUP_BLOB_KIND
|
|||
ENCODE_VARARGS_METHODREF,
|
||||
ENCODE_VARARGS_SIG,
|
||||
ENCODE_ACTIVE_DEPENDENCY, /* Conditional active dependency */
|
||||
ENCODE_METHOD_NATIVE_ENTRY, /* NativeCallable method token */
|
||||
};
|
||||
|
||||
enum EncodeMethodSigFlags
|
||||
|
@ -744,7 +740,7 @@ struct CORCOMPILE_EXCEPTION_LOOKUP_TABLE_ENTRY
|
|||
|
||||
struct CORCOMPILE_EXCEPTION_LOOKUP_TABLE
|
||||
{
|
||||
// pointer to the first element of m_numLookupEntries elements
|
||||
// pointer to the first element of m_numLookupEntries elements
|
||||
CORCOMPILE_EXCEPTION_LOOKUP_TABLE_ENTRY m_Entries[1];
|
||||
|
||||
CORCOMPILE_EXCEPTION_LOOKUP_TABLE_ENTRY* ExceptionLookupEntry(unsigned i)
|
||||
|
@ -759,12 +755,12 @@ struct CORCOMPILE_EXCEPTION_CLAUSE
|
|||
CorExceptionFlag Flags;
|
||||
DWORD TryStartPC;
|
||||
DWORD TryEndPC;
|
||||
DWORD HandlerStartPC;
|
||||
DWORD HandlerEndPC;
|
||||
DWORD HandlerStartPC;
|
||||
DWORD HandlerEndPC;
|
||||
union {
|
||||
mdToken ClassToken;
|
||||
DWORD FilterOffset;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
//lower order bit (HAS_EXCEPTION_INFO_MASK) used to determine if the method has any exception handling
|
||||
|
@ -772,7 +768,7 @@ struct CORCOMPILE_EXCEPTION_CLAUSE
|
|||
|
||||
struct CORCOMPILE_COLD_METHOD_ENTRY
|
||||
{
|
||||
#ifdef WIN64EXCEPTIONS
|
||||
#ifdef FEATURE_EH_FUNCLETS
|
||||
DWORD mainFunctionEntryRVA;
|
||||
#endif
|
||||
// TODO: hotCodeSize should be encoded in GC info
|
||||
|
@ -876,11 +872,11 @@ struct CORCOMPILE_DEPENDENCY
|
|||
|
||||
/*********************************************************************************/
|
||||
// Flags used to encode HelperTable
|
||||
#if defined(_TARGET_ARM64_)
|
||||
#if defined(TARGET_ARM64)
|
||||
#define HELPER_TABLE_ENTRY_LEN 16
|
||||
#else
|
||||
#define HELPER_TABLE_ENTRY_LEN 8
|
||||
#endif //defined(_TARGET_ARM64_)
|
||||
#endif //defined(TARGET_ARM64)
|
||||
|
||||
#define HELPER_TABLE_ALIGN 8
|
||||
#define CORCOMPILE_HELPER_PTR 0x80000000 // The entry is pointer to the helper (jump thunk otherwise)
|
||||
|
@ -905,22 +901,16 @@ public:
|
|||
|
||||
struct CORBBTPROF_TOKEN_INFO * GetTokenFlagsData(SectionFormat section)
|
||||
{
|
||||
if (this == NULL)
|
||||
return NULL;
|
||||
return this->profilingTokenFlagsData[section].data;
|
||||
}
|
||||
|
||||
DWORD GetTokenFlagsCount(SectionFormat section)
|
||||
{
|
||||
if (this == NULL)
|
||||
return 0;
|
||||
return this->profilingTokenFlagsData[section].count;
|
||||
}
|
||||
|
||||
CORBBTPROF_BLOB_ENTRY * GetBlobStream()
|
||||
{
|
||||
if (this == NULL)
|
||||
return NULL;
|
||||
return this->blobStream;
|
||||
}
|
||||
|
||||
|
@ -1186,6 +1176,8 @@ class ICorCompilePreloader
|
|||
|
||||
virtual BOOL IsUncompiledMethod(CORINFO_METHOD_HANDLE handle) = 0;
|
||||
|
||||
virtual BOOL ShouldSuppressGCTransition(CORINFO_METHOD_HANDLE handle) = 0;
|
||||
|
||||
// Return a method handle that was previously registered and
|
||||
// hasn't been compiled already, and remove it from the set
|
||||
// of uncompiled methods.
|
||||
|
@ -1281,11 +1273,11 @@ class ICorCompilePreloader
|
|||
) = 0;
|
||||
|
||||
virtual void NoteDeduplicatedCode(
|
||||
CORINFO_METHOD_HANDLE method,
|
||||
CORINFO_METHOD_HANDLE method,
|
||||
CORINFO_METHOD_HANDLE duplicateMethod) = 0;
|
||||
|
||||
#ifdef FEATURE_READYTORUN_COMPILER
|
||||
// Returns a compressed encoding of the inline tracking map
|
||||
// Returns a compressed encoding of the inline tracking map
|
||||
// for this compilation
|
||||
virtual void GetSerializedInlineTrackingMap(
|
||||
IN OUT SBuffer * pSerializedInlineTrackingMap
|
||||
|
@ -1468,7 +1460,7 @@ class ICorCompileInfo
|
|||
#ifdef FEATURE_COMINTEROP
|
||||
// Loads a WinRT typeref into the EE and returns
|
||||
// a handle to it. We have to load all typerefs
|
||||
// during dependency computation since assemblyrefs
|
||||
// during dependency computation since assemblyrefs
|
||||
// are meaningless to WinRT.
|
||||
virtual HRESULT LoadTypeRefWinRT(
|
||||
IMDInternalImport *pAssemblyImport,
|
||||
|
@ -1644,7 +1636,7 @@ class ICorCompileInfo
|
|||
|
||||
// Returns non-null methoddef or memberref token if it is sufficient to encode the method (no generic instantiations, etc.)
|
||||
virtual mdToken TryEncodeMethodAsToken(
|
||||
CORINFO_METHOD_HANDLE handle,
|
||||
CORINFO_METHOD_HANDLE handle,
|
||||
CORINFO_RESOLVED_TOKEN * pResolvedToken,
|
||||
CORINFO_MODULE_HANDLE * referencingModule) = 0;
|
||||
|
||||
|
@ -1736,15 +1728,15 @@ class ICorCompileInfo
|
|||
// to 1 on the clone. The buffer has to be large enough to hold the stub object and the code
|
||||
virtual HRESULT GetStubClone(void *pStub, BYTE *pBuffer, DWORD dwBufferSize) = 0;
|
||||
|
||||
// true if the method has [NativeCallableAttribute]
|
||||
virtual BOOL IsNativeCallableMethod(CORINFO_METHOD_HANDLE handle) = 0;
|
||||
// true if the method has [UnmanagedCallersOnlyAttribute]
|
||||
virtual BOOL IsUnmanagedCallersOnlyMethod(CORINFO_METHOD_HANDLE handle) = 0;
|
||||
|
||||
virtual BOOL GetIsGeneratingNgenPDB() = 0;
|
||||
virtual void SetIsGeneratingNgenPDB(BOOL fGeneratingNgenPDB) = 0;
|
||||
|
||||
#ifdef FEATURE_READYTORUN_COMPILER
|
||||
virtual CORCOMPILE_FIXUP_BLOB_KIND GetFieldBaseOffset(
|
||||
CORINFO_CLASS_HANDLE classHnd,
|
||||
CORINFO_CLASS_HANDLE classHnd,
|
||||
DWORD * pBaseOffset
|
||||
) = 0;
|
||||
|
||||
|
@ -1766,23 +1758,6 @@ class ICorCompileInfo
|
|||
virtual BOOL HasCustomAttribute(CORINFO_METHOD_HANDLE method, LPCSTR customAttributeName) = 0;
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
// This function determines the compile flags to use for a generic intatiation
|
||||
// since only the open instantiation can be verified.
|
||||
// See the comment associated with CORJIT_FLAG_SKIP_VERIFICATION for details.
|
||||
//
|
||||
// On return:
|
||||
// if *raiseVerificationException=TRUE, the caller should raise a VerificationException.
|
||||
// if *unverifiableGenericCode=TRUE, the method is a generic instantiation with
|
||||
// unverifiable code
|
||||
|
||||
CORJIT_FLAGS GetCompileFlagsIfGenericInstantiation(
|
||||
CORINFO_METHOD_HANDLE method,
|
||||
CORJIT_FLAGS compileFlags,
|
||||
ICorJitInfo * pCorJitInfo,
|
||||
BOOL * raiseVerificationException,
|
||||
BOOL * unverifiableGenericCode);
|
||||
|
||||
// Returns the global instance of JIT->EE interface for NGen
|
||||
|
||||
extern "C" ICorDynamicInfo * __stdcall GetZapJitInfo();
|
||||
|
|
|
@ -1361,10 +1361,10 @@ interface ICorDebugManagedCallback4 : IUnknown
|
|||
{
|
||||
//
|
||||
// Callback indicating a garbage collection is about to start.
|
||||
//
|
||||
//
|
||||
// Parameters
|
||||
// pProcess - the process that is going to perform garbage collection.
|
||||
//
|
||||
//
|
||||
// Returns
|
||||
// S_OK - on success
|
||||
//
|
||||
|
@ -1372,10 +1372,10 @@ interface ICorDebugManagedCallback4 : IUnknown
|
|||
|
||||
//
|
||||
// Callback indicating a garbage collection is about to complete.
|
||||
//
|
||||
//
|
||||
// Parameters
|
||||
// pProcess - the process that is going to complete garbage collection.
|
||||
//
|
||||
//
|
||||
// Returns
|
||||
// S_OK - on success
|
||||
//
|
||||
|
@ -1383,13 +1383,13 @@ interface ICorDebugManagedCallback4 : IUnknown
|
|||
|
||||
//
|
||||
// Callback indicating a data breakpoint is hit
|
||||
//
|
||||
//
|
||||
// Parameters
|
||||
// pProcess - the process that hits the data breakpoint
|
||||
// pThread - the thread that hits the data breakpoint
|
||||
// pContext - a pointer to the CONTEXT structure
|
||||
// contextSize - the size of the CONTEXT structure
|
||||
//
|
||||
//
|
||||
// Returns
|
||||
// S_OK - on success
|
||||
//
|
||||
|
@ -3302,13 +3302,13 @@ interface ICorDebugProcess10 : IUnknown
|
|||
//
|
||||
// Enable or disable the GC notification events. The GC notification events are turned off by default
|
||||
// They will be delivered through ICorDebugManagedCallback4
|
||||
//
|
||||
//
|
||||
// Parameters
|
||||
// fEnable - true to enable the events, false to disable
|
||||
//
|
||||
//
|
||||
// Returns
|
||||
// S_OK - on success
|
||||
//
|
||||
// S_OK - on success
|
||||
//
|
||||
HRESULT EnableGCNotificationEvents(BOOL fEnable);
|
||||
}
|
||||
|
||||
|
@ -6507,7 +6507,7 @@ interface ICorDebugDelegateObjectValue : IUnknown
|
|||
* - NULL if the delegate function is a static function or an open delegate
|
||||
* - HRESULT CORDBG_E_UNSUPPORTED_DELEGATE for curently unsupported delegates.
|
||||
* In this case, the value of ppObject should not be used. Some of these
|
||||
* include: Secure wrappers, Open Virual delegates.
|
||||
* include: Wrapper delegates, Open Virual delegates.
|
||||
*/
|
||||
HRESULT GetTarget([out] ICorDebugReferenceValue **ppObject);
|
||||
|
||||
|
@ -6516,10 +6516,10 @@ interface ICorDebugDelegateObjectValue : IUnknown
|
|||
* - S_OK:
|
||||
* - The ICorDebugFunction function for the function the delegate would invoke.
|
||||
* - There are a few cases where the ICorDebugFunction can be different from what's expected,
|
||||
* such as generic methods, which won't contain the instantiation.
|
||||
* such as generic methods, which won't contain the instantiation.
|
||||
* - HRESULT CORDBG_E_UNSUPPORTED_DELEGATE for curently unsupported delegates.
|
||||
* In this case, the value of ppObject should not be used. Some of these
|
||||
* include: Secure wrappers, Open Virual delegates.
|
||||
* include: Wrapper delegates, Open Virual delegates.
|
||||
*/
|
||||
HRESULT GetFunction([out] ICorDebugFunction **ppFunction);
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public:
|
|||
// contained in debug/inc/DbgIPCEvents.h.
|
||||
enum RegNum
|
||||
{
|
||||
#ifdef _TARGET_X86_
|
||||
#ifdef TARGET_X86
|
||||
REGNUM_EAX,
|
||||
REGNUM_ECX,
|
||||
REGNUM_EDX,
|
||||
|
@ -78,7 +78,7 @@ public:
|
|||
REGNUM_EBP,
|
||||
REGNUM_ESI,
|
||||
REGNUM_EDI,
|
||||
#elif _TARGET_ARM_
|
||||
#elif TARGET_ARM
|
||||
REGNUM_R0,
|
||||
REGNUM_R1,
|
||||
REGNUM_R2,
|
||||
|
@ -95,7 +95,7 @@ public:
|
|||
REGNUM_SP,
|
||||
REGNUM_LR,
|
||||
REGNUM_PC,
|
||||
#elif _TARGET_ARM64_
|
||||
#elif TARGET_ARM64
|
||||
REGNUM_X0,
|
||||
REGNUM_X1,
|
||||
REGNUM_X2,
|
||||
|
@ -129,7 +129,7 @@ public:
|
|||
REGNUM_LR,
|
||||
REGNUM_SP,
|
||||
REGNUM_PC,
|
||||
#elif _TARGET_AMD64_
|
||||
#elif TARGET_AMD64
|
||||
REGNUM_RAX,
|
||||
REGNUM_RCX,
|
||||
REGNUM_RDX,
|
||||
|
@ -153,18 +153,18 @@ public:
|
|||
REGNUM_AMBIENT_SP, // ambient SP support. Ambient SP is the original SP in the non-BP based frame.
|
||||
// Ambient SP should not change even if there are push/pop operations in the method.
|
||||
|
||||
#ifdef _TARGET_X86_
|
||||
#ifdef TARGET_X86
|
||||
REGNUM_FP = REGNUM_EBP,
|
||||
REGNUM_SP = REGNUM_ESP,
|
||||
#elif _TARGET_AMD64_
|
||||
#elif TARGET_AMD64
|
||||
REGNUM_SP = REGNUM_RSP,
|
||||
#elif _TARGET_ARM_
|
||||
#elif TARGET_ARM
|
||||
#ifdef REDHAWK
|
||||
REGNUM_FP = REGNUM_R7,
|
||||
#else
|
||||
REGNUM_FP = REGNUM_R11,
|
||||
#endif //REDHAWK
|
||||
#elif _TARGET_ARM64_
|
||||
#elif TARGET_ARM64
|
||||
//Nothing to do here. FP is already alloted.
|
||||
#else
|
||||
// RegNum values should be properly defined for this platform
|
||||
|
@ -174,7 +174,7 @@ public:
|
|||
|
||||
};
|
||||
|
||||
// VarLoc describes the location of a native variable. Note that currently, VLT_REG_BYREF and VLT_STK_BYREF
|
||||
// VarLoc describes the location of a native variable. Note that currently, VLT_REG_BYREF and VLT_STK_BYREF
|
||||
// are only used for value types on X64.
|
||||
|
||||
enum VarLocType
|
||||
|
|
|
@ -70,7 +70,7 @@ typedef bool(__cdecl *OffsetComparator)(const void *UserData, size_t BlockOffset
|
|||
uint64_t Offset2);
|
||||
|
||||
// The Export/Import definitions for CoreDistools library are defined below.
|
||||
// A typedef for each interface function's type is defined in order to aid
|
||||
// A typedef for each interface function's type is defined in order to aid
|
||||
// the importer.
|
||||
|
||||
// Initialize the disassembler, using default print controls
|
||||
|
|
|
@ -303,7 +303,7 @@
|
|||
<Message>"The native image could not be loaded, because it was generated for use by a different version of the runtime."</Message>
|
||||
<Comment> The native image could not be loaded, because it was generated for use by a different version of the runtime. </Comment>
|
||||
</HRESULT>
|
||||
|
||||
|
||||
<HRESULT NumericValue="0x80131069">
|
||||
<SymbolicName>COR_E_LOADING_WINMD_REFERENCE_ASSEMBLY</SymbolicName>
|
||||
<Message>"Contract Windows Runtime assemblies cannot be loaded for execution. Make sure your application only contains non-contract Windows Runtime assemblies."</Message>
|
||||
|
@ -845,13 +845,13 @@
|
|||
|
||||
<HRESULT NumericValue="0x8013131e">
|
||||
<SymbolicName>CORDBG_E_CANT_SET_IP_OUT_OF_FINALLY_ON_WIN64</SymbolicName>
|
||||
<Message>"SetIP is not possible because it would move EIP from within a finally clause to a point outside of one on WIN64 platforms."</Message>
|
||||
<Message>"SetIP is not possible because it would move EIP from within a finally clause to a point outside of one on this platforms."</Message>
|
||||
<Comment> SetIP isn't possible because it would move </Comment>
|
||||
</HRESULT>
|
||||
|
||||
<HRESULT NumericValue="0x8013131f">
|
||||
<SymbolicName>CORDBG_E_CANT_SET_IP_OUT_OF_CATCH_ON_WIN64</SymbolicName>
|
||||
<Message>"SetIP is not possible because it would move EIP from within a catch clause to a point outside of one on WIN64 platforms."</Message>
|
||||
<Message>"SetIP is not possible because it would move EIP from within a catch clause to a point outside of one on this platforms."</Message>
|
||||
<Comment> SetIP isn't possible because it would move </Comment>
|
||||
</HRESULT>
|
||||
|
||||
|
@ -876,11 +876,11 @@
|
|||
<HRESULT NumericValue="0x80131327">
|
||||
<SymbolicName>CORDBG_E_NON_MATCHING_CONTEXT</SymbolicName>
|
||||
<Message>"The provided CONTEXT does not match the specified thread."</Message>
|
||||
<Comment> The provided CONTEXT does not match the specified thread.
|
||||
The stack pointer in the provided CONTEXT must match the cached stack base and stack limit of the thread.
|
||||
<Comment> The provided CONTEXT does not match the specified thread.
|
||||
The stack pointer in the provided CONTEXT must match the cached stack base and stack limit of the thread.
|
||||
</Comment>
|
||||
</HRESULT>
|
||||
|
||||
|
||||
<HRESULT NumericValue="0x80131328">
|
||||
<SymbolicName>CORDBG_E_PAST_END_OF_STACK</SymbolicName>
|
||||
<Message>"The stackwalker is now past the end of stack. No information is available."</Message>
|
||||
|
@ -1018,7 +1018,7 @@
|
|||
<Message>"The debugger can only handle a finite number of debuggees."</Message>
|
||||
<Comment> The debugger can only handle a finite number of debuggees. </Comment>
|
||||
</HRESULT>
|
||||
|
||||
|
||||
<HRESULT NumericValue="0x8013134d">
|
||||
<SymbolicName>CORDBG_E_INTEROP_NOT_SUPPORTED</SymbolicName>
|
||||
<Message>"Interop debugging is not supported."</Message>
|
||||
|
@ -1175,7 +1175,7 @@
|
|||
<SymbolicName>CORPROF_E_UNSUPPORTED_FOR_ATTACHING_PROFILER</SymbolicName>
|
||||
<Comment> This call was attempted by a profiler that attached to the process after startup, but this call is only supported by profilers that are loaded into the process on startup.</Comment>
|
||||
</HRESULT>
|
||||
|
||||
|
||||
<HRESULT NumericValue="0x80131370">
|
||||
<SymbolicName>CORPROF_E_IRREVERSIBLE_INSTRUMENTATION_PRESENT</SymbolicName>
|
||||
<Comment> Detach is impossible because the profiler has either instrumented IL or inserted enter/leave hooks. Detach was not attempted; the profiler is still fully attached. </Comment>
|
||||
|
@ -1245,7 +1245,7 @@
|
|||
<SymbolicName>CORPROF_E_CALLBACK6_REQUIRED</SymbolicName>
|
||||
<Comment> Profiler must implement ICorProfilerCallback6 interface for this call to be supported. </Comment>
|
||||
</HRESULT>
|
||||
|
||||
|
||||
<!-- This HRESULT is used only internally by our rejit implementation right now. If it ever appears in
|
||||
a public API HRESULT it is a bug. It is included here to prevent anyone else from defining
|
||||
a new failure with the same value and causing confusion.
|
||||
|
@ -1254,7 +1254,7 @@
|
|||
<Comment> This call can't be completed safely because the runtime is not suspended </Comment>
|
||||
</HRESULT>
|
||||
-->
|
||||
|
||||
|
||||
<HRESULT NumericValue="0x80131382">
|
||||
<SymbolicName>CORPROF_E_CALLBACK7_REQUIRED</SymbolicName>
|
||||
<Comment> Profiler must implement ICorProfilerCallback7 interface for this call to be supported. </Comment>
|
||||
|
@ -2059,7 +2059,7 @@
|
|||
<HRESULT NumericValue="0x80131c37">
|
||||
<SymbolicName>CORDBG_E_DETACH_FAILED_OUTSTANDING_TARGET_RESOURCES</SymbolicName>
|
||||
<Message>"Detach failed because there are outstanding resources in the target."</Message>
|
||||
<Comment>The debugger is holding resource in the target (such as GC handles, function evaluations, etc).
|
||||
<Comment>The debugger is holding resource in the target (such as GC handles, function evaluations, etc).
|
||||
These resources must be released through the appropriate ICorDebug API before detach can succeed.</Comment>
|
||||
</HRESULT>
|
||||
|
||||
|
@ -2164,7 +2164,7 @@
|
|||
<Message>"The specified action is unsupported by this version of the runtime."</Message>
|
||||
<Comment>The specified action is unsupported by this version of the runtime.</Comment>
|
||||
</HRESULT>
|
||||
|
||||
|
||||
<HRESULT NumericValue="0x80131c4f">
|
||||
<SymbolicName>CORDBG_E_MISSING_DEBUGGER_EXPORTS</SymbolicName>
|
||||
<Message>"The debuggee memory space does not have the expected debugging export table."</Message>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#endif
|
||||
|
||||
// This is the exception code to report SetupThread failure to caller of reverse pinvoke
|
||||
// It is misleading to use our COM+ exception code, since this is not a managed exception.
|
||||
// It is misleading to use our COM+ exception code, since this is not a managed exception.
|
||||
// In the end, we picked e0455858 (EXX).
|
||||
#define EXCEPTION_EXX 0xe0455858 // 0xe0000000 | 'EXX'
|
||||
#endif // __COREXCEP_H__
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
/*****************************************************************************
|
||||
** **
|
||||
** CorHdr.h - contains definitions for the Runtime structures, **
|
||||
**
|
||||
**
|
||||
|
||||
** needed to work with metadata. **
|
||||
** **
|
||||
*****************************************************************************/
|
||||
//
|
||||
// The top most managed code structure in a EXE or DLL is the IMAGE_COR20_HEADER
|
||||
// see code:#ManagedHeader for more
|
||||
// The top most managed code structure in a EXE or DLL is the IMAGE_COR20_HEADER
|
||||
// see code:#ManagedHeader for more
|
||||
|
||||
#ifndef __CORHDR_H__
|
||||
#define __CORHDR_H__
|
||||
|
@ -21,7 +21,7 @@
|
|||
#define FRAMEWORK_REGISTRY_KEY_W W("Software\\Microsoft\\.NETFramework")
|
||||
|
||||
// keys for HKCU
|
||||
#ifdef _WIN64
|
||||
#ifdef HOST_64BIT
|
||||
#define USER_FRAMEWORK_REGISTRY_KEY "Software\\Microsoft\\.NETFramework64"
|
||||
#define USER_FRAMEWORK_REGISTRY_KEY_W W("Software\\Microsoft\\.NETFramework64")
|
||||
#else
|
||||
|
@ -145,7 +145,7 @@ typedef enum ReplacesCorHdrNumericDefines
|
|||
COMIMAGE_FLAGS_NATIVE_ENTRYPOINT =0x00000010,
|
||||
COMIMAGE_FLAGS_TRACKDEBUGDATA =0x00010000,
|
||||
COMIMAGE_FLAGS_32BITPREFERRED =0x00020000, // *** Do not manipulate this bit directly (see notes above)
|
||||
|
||||
|
||||
|
||||
// Version flags for image.
|
||||
COR_VERSION_MAJOR_V2 =2,
|
||||
|
@ -155,12 +155,12 @@ typedef enum ReplacesCorHdrNumericDefines
|
|||
COR_VTABLEGAP_NAME_LENGTH =8,
|
||||
|
||||
// Maximum size of a NativeType descriptor.
|
||||
NATIVE_TYPE_MAX_CB =1,
|
||||
NATIVE_TYPE_MAX_CB =1,
|
||||
COR_ILMETHOD_SECT_SMALL_MAX_DATASIZE=0xFF,
|
||||
|
||||
// V-table constants
|
||||
COR_VTABLE_32BIT =0x01, // V-table slots are 32-bits in size.
|
||||
COR_VTABLE_64BIT =0x02, // V-table slots are 64-bits in size.
|
||||
COR_VTABLE_32BIT =0x01, // V-table slots are 32-bits in size.
|
||||
COR_VTABLE_64BIT =0x02, // V-table slots are 64-bits in size.
|
||||
COR_VTABLE_FROM_UNMANAGED =0x04, // If set, transition from unmanaged.
|
||||
COR_VTABLE_FROM_UNMANAGED_RETAIN_APPDOMAIN=0x08, // NEW
|
||||
COR_VTABLE_CALL_MOST_DERIVED =0x10, // Call most derived method described by
|
||||
|
@ -168,73 +168,73 @@ typedef enum ReplacesCorHdrNumericDefines
|
|||
// EATJ constants
|
||||
IMAGE_COR_EATJ_THUNK_SIZE = 32, // Size of a jump thunk reserved range.
|
||||
|
||||
// Max name lengths
|
||||
// Max name lengths
|
||||
//@todo: Change to unlimited name lengths.
|
||||
MAX_CLASS_NAME =1024,
|
||||
MAX_PACKAGE_NAME =1024,
|
||||
} ReplacesCorHdrNumericDefines;
|
||||
|
||||
// #ManagedHeader
|
||||
//
|
||||
//
|
||||
// A managed code EXE or DLL uses the same basic format that unmanaged executables use call the Portable
|
||||
// Executable (PE) format. See http://en.wikipedia.org/wiki/Portable_Executable or
|
||||
// http://msdn.microsoft.com/msdnmag/issues/02/02/PE/default.aspx for more on this format and RVAs.
|
||||
//
|
||||
//
|
||||
// PE files define fixed table of well known entry pointers call Directory entries. Each entry holds the
|
||||
// relative virtual address (RVA) and length of a blob of data within the PE file. You can see these using
|
||||
// the command
|
||||
//
|
||||
//
|
||||
// link /dump /headers <EXENAME>
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// Managed code has defined one of these entries (the 14th see code:IMAGE_DIRECTORY_ENTRY_COMHEADER) and the RVA points
|
||||
// that the IMAGE_COR20_HEADER. This header shows up in the previous dump as the following line
|
||||
//
|
||||
//
|
||||
// // Managed code is identified by is following line
|
||||
//
|
||||
//
|
||||
// 2008 [ 48] RVA [size] of COM Descriptor Directory
|
||||
//
|
||||
// The IMAGE_COR20_HEADER is mostly just RVA:Length pairs (pointers) to other interesting data structures.
|
||||
// The IMAGE_COR20_HEADER is mostly just RVA:Length pairs (pointers) to other interesting data structures.
|
||||
// The most important of these is the MetaData tables. The easiest way of looking at meta-data is using
|
||||
// the IlDasm.exe tool.
|
||||
//
|
||||
// the IlDasm.exe tool.
|
||||
//
|
||||
// MetaData holds most of the information in the IL image. The exceptions are resource blobs and the IL
|
||||
// instructions streams for individual methods. Instead the Meta-data for a method holds an RVA to a
|
||||
// code:IMAGE_COR_ILMETHOD which holds all the IL stream (and exception handling information).
|
||||
//
|
||||
// code:IMAGE_COR_ILMETHOD which holds all the IL stream (and exception handling information).
|
||||
//
|
||||
// Precompiled (NGEN) images use the same IMAGE_COR20_HEADER but also use the ManagedNativeHeader field to
|
||||
// point at structures that only exist in precompiled images.
|
||||
//
|
||||
// point at structures that only exist in precompiled images.
|
||||
//
|
||||
typedef struct IMAGE_COR20_HEADER
|
||||
{
|
||||
// Header versioning
|
||||
DWORD cb;
|
||||
DWORD cb;
|
||||
WORD MajorRuntimeVersion;
|
||||
WORD MinorRuntimeVersion;
|
||||
|
||||
|
||||
// Symbol table and startup information
|
||||
IMAGE_DATA_DIRECTORY MetaData;
|
||||
DWORD Flags;
|
||||
|
||||
IMAGE_DATA_DIRECTORY MetaData;
|
||||
DWORD Flags;
|
||||
|
||||
// The main program if it is an EXE (not used if a DLL?)
|
||||
// If COMIMAGE_FLAGS_NATIVE_ENTRYPOINT is not set, EntryPointToken represents a managed entrypoint.
|
||||
// If COMIMAGE_FLAGS_NATIVE_ENTRYPOINT is set, EntryPointRVA represents an RVA to a native entrypoint
|
||||
// (depricated for DLLs, use modules constructors intead).
|
||||
// (depricated for DLLs, use modules constructors intead).
|
||||
union {
|
||||
DWORD EntryPointToken;
|
||||
DWORD EntryPointRVA;
|
||||
};
|
||||
|
||||
|
||||
// This is the blob of managed resources. Fetched using code:AssemblyNative.GetResource and
|
||||
// code:PEFile.GetResource and accessible from managed code from
|
||||
// System.Assembly.GetManifestResourceStream. The meta data has a table that maps names to offsets into
|
||||
// this blob, so logically the blob is a set of resources.
|
||||
// this blob, so logically the blob is a set of resources.
|
||||
IMAGE_DATA_DIRECTORY Resources;
|
||||
// IL assemblies can be signed with a public-private key to validate who created it. The signature goes
|
||||
// here if this feature is used.
|
||||
// here if this feature is used.
|
||||
IMAGE_DATA_DIRECTORY StrongNameSignature;
|
||||
|
||||
IMAGE_DATA_DIRECTORY CodeManagerTable; // Depricated, not used
|
||||
IMAGE_DATA_DIRECTORY CodeManagerTable; // Depricated, not used
|
||||
// Used for manged codee that has unmaanaged code inside it (or exports methods as unmanaged entry points)
|
||||
IMAGE_DATA_DIRECTORY VTableFixups;
|
||||
IMAGE_DATA_DIRECTORY ExportAddressTableJumps;
|
||||
|
@ -242,14 +242,14 @@ typedef struct IMAGE_COR20_HEADER
|
|||
// null for ordinary IL images. In NGEN images it points at a code:CORCOMPILE_HEADER structure.
|
||||
// In Ready2Run images it points to a READYTORUN_HEADER.
|
||||
IMAGE_DATA_DIRECTORY ManagedNativeHeader;
|
||||
|
||||
|
||||
} IMAGE_COR20_HEADER, *PIMAGE_COR20_HEADER;
|
||||
|
||||
#else // !__IMAGE_COR20_HEADER_DEFINED__
|
||||
|
||||
// <TODO>@TODO: This is required because we pull in the COM+ 2.0 PE header
|
||||
// definition from WinNT.h, and these constants have not yet propogated to there.</TODO>
|
||||
//
|
||||
//
|
||||
#define COR_VTABLE_FROM_UNMANAGED_RETAIN_APPDOMAIN 0x08
|
||||
#define COMIMAGE_FLAGS_32BITPREFERRED 0x00020000
|
||||
|
||||
|
@ -742,7 +742,7 @@ typedef enum CorPinvokeMap
|
|||
typedef enum CorAssemblyFlags
|
||||
{
|
||||
afPublicKey = 0x0001, // The assembly ref holds the full (unhashed) public key.
|
||||
|
||||
|
||||
afPA_None = 0x0000, // Processor Architecture unspecified
|
||||
afPA_MSIL = 0x0010, // Processor Architecture: neutral (PE32)
|
||||
afPA_x86 = 0x0020, // Processor Architecture: x86 (PE32)
|
||||
|
@ -763,8 +763,8 @@ typedef enum CorAssemblyFlags
|
|||
afRetargetable = 0x0100, // The assembly can be retargeted (at runtime) to an
|
||||
// assembly from a different publisher.
|
||||
|
||||
afContentType_Default = 0x0000,
|
||||
afContentType_WindowsRuntime = 0x0200,
|
||||
afContentType_Default = 0x0000,
|
||||
afContentType_WindowsRuntime = 0x0200,
|
||||
afContentType_Mask = 0x0E00, // Bits describing ContentType
|
||||
} CorAssemblyFlags;
|
||||
|
||||
|
@ -833,16 +833,16 @@ typedef enum CorPEKind
|
|||
// GenericParam bits, used by DefineGenericParam.
|
||||
typedef enum CorGenericParamAttr
|
||||
{
|
||||
// Variance of type parameters, only applicable to generic parameters
|
||||
// Variance of type parameters, only applicable to generic parameters
|
||||
// for generic interfaces and delegates
|
||||
gpVarianceMask = 0x0003,
|
||||
gpNonVariant = 0x0000,
|
||||
gpNonVariant = 0x0000,
|
||||
gpCovariant = 0x0001,
|
||||
gpContravariant = 0x0002,
|
||||
|
||||
// Special constraints, applicable to any type parameters
|
||||
gpSpecialConstraintMask = 0x001C,
|
||||
gpNoSpecialConstraint = 0x0000,
|
||||
gpNoSpecialConstraint = 0x0000,
|
||||
gpReferenceTypeConstraint = 0x0004, // type argument must be a reference type
|
||||
gpNotNullableValueTypeConstraint = 0x0008, // type argument must be a value type but not Nullable
|
||||
gpDefaultConstructorConstraint = 0x0010, // type argument must have a public default constructor
|
||||
|
@ -1176,9 +1176,9 @@ typedef struct IMAGE_COR_ILMETHOD_SECT_EH_FAT
|
|||
/***********************************/
|
||||
typedef struct IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_SMALL
|
||||
{
|
||||
#ifdef _WIN64
|
||||
#ifdef HOST_64BIT
|
||||
unsigned Flags : 16;
|
||||
#else // !_WIN64
|
||||
#else // !HOST_64BIT
|
||||
CorExceptionFlag Flags : 16;
|
||||
#endif
|
||||
unsigned TryOffset : 16;
|
||||
|
@ -1209,17 +1209,17 @@ typedef union IMAGE_COR_ILMETHOD_SECT_EH
|
|||
|
||||
|
||||
/***********************************************************************************/
|
||||
// Legal values for
|
||||
// * code:IMAGE_COR_ILMETHOD_FAT::Flags or
|
||||
// * code:IMAGE_COR_ILMETHOD_TINY::Flags_CodeSize fields.
|
||||
//
|
||||
// Legal values for
|
||||
// * code:IMAGE_COR_ILMETHOD_FAT::Flags or
|
||||
// * code:IMAGE_COR_ILMETHOD_TINY::Flags_CodeSize fields.
|
||||
//
|
||||
// The only semantic flag at present is CorILMethod_InitLocals
|
||||
typedef enum CorILMethodFlags
|
||||
{
|
||||
CorILMethod_InitLocals = 0x0010, // call default constructor on all local vars
|
||||
CorILMethod_MoreSects = 0x0008, // there is another attribute after this one
|
||||
|
||||
CorILMethod_CompressedIL = 0x0040, // Not used.
|
||||
CorILMethod_CompressedIL = 0x0040, // Not used.
|
||||
|
||||
// Indicates the format for the COR_ILMETHOD header
|
||||
CorILMethod_FormatShift = 3,
|
||||
|
@ -1253,7 +1253,7 @@ typedef struct IMAGE_COR_ILMETHOD_FAT
|
|||
// an IMAGE_COR_ILMETHOD holds the IL instructions for a individual method. To save space they come in two
|
||||
// flavors Fat and Tiny. Conceptually Tiny is just a compressed version of Fat, so code:IMAGE_COR_ILMETHOD_FAT
|
||||
// is the logical structure for all headers. Conceptually this blob holds the IL, the Exception Handling
|
||||
// Tables, the local variable information and some flags.
|
||||
// Tables, the local variable information and some flags.
|
||||
typedef union IMAGE_COR_ILMETHOD
|
||||
{
|
||||
IMAGE_COR_ILMETHOD_TINY Tiny;
|
||||
|
@ -1444,7 +1444,7 @@ typedef enum CorLinkerOptions
|
|||
typedef enum MergeFlags
|
||||
{
|
||||
MergeFlagsNone = 0,
|
||||
MergeManifest = 0x00000001,
|
||||
MergeManifest = 0x00000001,
|
||||
DropMemberRefCAs = 0x00000002,
|
||||
NoDupCheck = 0x00000004,
|
||||
MergeExportedTypes = 0x00000008
|
||||
|
@ -1563,7 +1563,7 @@ typedef enum CorOpenFlags
|
|||
|
||||
ofReadOnly = 0x00000010, // Open scope for read. Will be unable to QI for a IMetadataEmit* interface
|
||||
ofTakeOwnership = 0x00000020, // The memory was allocated with CoTaskMemAlloc and will be freed by the metadata
|
||||
|
||||
|
||||
// These are obsolete and are ignored.
|
||||
// ofCacheImage = 0x00000004, // EE maps but does not do relocations or verify image
|
||||
// ofManifestMetadata = 0x00000008, // Open scope on ngen image, return the manifest metadata instead of the IL metadata
|
||||
|
@ -1588,14 +1588,14 @@ typedef enum CorOpenFlags
|
|||
|
||||
#define IsOfReserved(x) (((x) & ofReserved) != 0)
|
||||
|
||||
//
|
||||
//
|
||||
// Type of file mapping returned by code:IMetaDataInfo::GetFileMapping.
|
||||
//
|
||||
//
|
||||
typedef enum CorFileMapping
|
||||
{
|
||||
fmFlat = 0, // Flat file mapping - file is mapped as data file (code:SEC_IMAGE flag was not
|
||||
fmFlat = 0, // Flat file mapping - file is mapped as data file (code:SEC_IMAGE flag was not
|
||||
// passed to code:CreateFileMapping).
|
||||
fmExecutableImage = 1, // Executable image file mapping - file is mapped for execution
|
||||
fmExecutableImage = 1, // Executable image file mapping - file is mapped for execution
|
||||
// (either via code:LoadLibrary or code:CreateFileMapping with code:SEC_IMAGE flag).
|
||||
} CorFileMapping;
|
||||
|
||||
|
@ -1827,7 +1827,7 @@ typedef enum CorAttributeTargets
|
|||
typedef enum CompilationRelaxationsEnum
|
||||
{
|
||||
CompilationRelaxations_NoStringInterning = 0x0008,
|
||||
|
||||
|
||||
} CompilationRelaxationEnum;
|
||||
|
||||
#define COMPILATIONRELAXATIONS_TYPE_W W("System.Runtime.CompilerServices.CompilationRelaxationsAttribute")
|
||||
|
@ -1842,12 +1842,12 @@ typedef enum CompilationRelaxationsEnum
|
|||
// Keep in sync with AssemblySettingAttributes.cs
|
||||
|
||||
typedef enum NGenHintEnum
|
||||
{
|
||||
{
|
||||
NGenDefault = 0x0000, // No preference specified
|
||||
|
||||
NGenEager = 0x0001, // NGen at install time
|
||||
NGenLazy = 0x0002, // NGen after install time
|
||||
NGenNever = 0x0003 // Assembly should not be ngened
|
||||
NGenNever = 0x0003 // Assembly should not be ngened
|
||||
} NGenHintEnum;
|
||||
|
||||
typedef enum LoadHintEnum
|
||||
|
@ -1894,10 +1894,10 @@ typedef enum CorSaveSize
|
|||
} CorSaveSize;
|
||||
#endif
|
||||
|
||||
#define COR_IS_METHOD_MANAGED_IL(flags) ((flags & 0xf) == (miIL | miManaged))
|
||||
#define COR_IS_METHOD_MANAGED_OPTIL(flags) ((flags & 0xf) == (miOPTIL | miManaged))
|
||||
#define COR_IS_METHOD_MANAGED_NATIVE(flags) ((flags & 0xf) == (miNative | miManaged))
|
||||
#define COR_IS_METHOD_UNMANAGED_NATIVE(flags) ((flags & 0xf) == (miNative | miUnmanaged))
|
||||
#define COR_IS_METHOD_MANAGED_IL(flags) (((flags) & 0xf) == (miIL | miManaged))
|
||||
#define COR_IS_METHOD_MANAGED_OPTIL(flags) (((flags) & 0xf) == (miOPTIL | miManaged))
|
||||
#define COR_IS_METHOD_MANAGED_NATIVE(flags) (((flags) & 0xf) == (miNative | miManaged))
|
||||
#define COR_IS_METHOD_UNMANAGED_NATIVE(flags) (((flags) & 0xf) == (miNative | miUnmanaged))
|
||||
|
||||
//
|
||||
// Enum used with NATIVE_TYPE_ARRAY.
|
||||
|
|
|
@ -34,7 +34,7 @@ extern "C" {
|
|||
void __stdcall DecoderInit(void *pThis, COR_ILMETHOD *header)
|
||||
{
|
||||
COR_ILMETHOD_DECODER *decoder = (COR_ILMETHOD_DECODER *)pThis;
|
||||
|
||||
|
||||
memset(decoder, 0, sizeof(COR_ILMETHOD_DECODER));
|
||||
if (header->Tiny.IsTiny())
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ void __stdcall DecoderInit(void *pThis, COR_ILMETHOD *header)
|
|||
}
|
||||
if (header->Fat.IsFat())
|
||||
{
|
||||
#ifdef _WIN64
|
||||
#ifdef HOST_64BIT
|
||||
if((((size_t) header) & 3) == 0) // header is aligned
|
||||
#else
|
||||
_ASSERTE((((size_t) header) & 3) == 0); // header is aligned
|
||||
|
@ -75,10 +75,10 @@ void __stdcall DecoderInit(void *pThis, COR_ILMETHOD *header)
|
|||
int __stdcall DecoderGetOnDiskSize(void * pThis, COR_ILMETHOD* header)
|
||||
{
|
||||
COR_ILMETHOD_DECODER* decoder = (COR_ILMETHOD_DECODER*)pThis;
|
||||
|
||||
|
||||
if (decoder->Code == NULL)
|
||||
return 0;
|
||||
|
||||
|
||||
BYTE *lastAddr = (BYTE*)decoder->Code + decoder->GetCodeSize(); // addr of end of code
|
||||
const COR_ILMETHOD_SECT *sect = decoder->EH;
|
||||
if (sect != 0 && sect->Next() == 0)
|
||||
|
@ -119,7 +119,7 @@ unsigned __stdcall IlmethodSize(COR_ILMETHOD_FAT* header, BOOL moreSections)
|
|||
unsigned __stdcall IlmethodEmit(unsigned size, COR_ILMETHOD_FAT* header,
|
||||
BOOL moreSections, BYTE* outBuff)
|
||||
{
|
||||
#ifndef SOS_INCLUDE
|
||||
#ifndef SOS_INCLUDE
|
||||
#ifdef _DEBUG
|
||||
BYTE* origBuff = outBuff;
|
||||
#endif
|
||||
|
@ -140,7 +140,7 @@ unsigned __stdcall IlmethodEmit(unsigned size, COR_ILMETHOD_FAT* header,
|
|||
fatHeader->SetFlags(fatHeader->GetFlags() | CorILMethod_MoreSects);
|
||||
fatHeader->SetSize(sizeof(COR_ILMETHOD_FAT) / 4);
|
||||
}
|
||||
#ifndef SOS_INCLUDE
|
||||
#ifndef SOS_INCLUDE
|
||||
_ASSERTE(&origBuff[size] == outBuff);
|
||||
#endif // !SOS_INCLUDE
|
||||
return(size);
|
||||
|
@ -254,7 +254,7 @@ unsigned __stdcall SectEH_Emit(unsigned size, unsigned ehCount,
|
|||
EHSect->Kind = CorILMethod_Sect_EHTable;
|
||||
if (moreSections)
|
||||
EHSect->Kind |= CorILMethod_Sect_MoreSects;
|
||||
#ifndef SOS_INCLUDE
|
||||
#ifndef SOS_INCLUDE
|
||||
EHSect->DataSize = EHSect->Size(ehCount);
|
||||
#else
|
||||
EHSect->DataSize = (BYTE) EHSect->Size(ehCount);
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
#ifndef __CORHLPR_H__
|
||||
#define __CORHLPR_H__
|
||||
|
||||
#if defined(_MSC_VER) && defined(_X86_) && !defined(FPO_ON)
|
||||
#pragma optimize("y", on) // Small critical routines, don't put in EBP frame
|
||||
#if defined(_MSC_VER) && defined(HOST_X86) && !defined(FPO_ON)
|
||||
#pragma optimize("y", on) // Small critical routines, don't put in EBP frame
|
||||
#define FPO_ON 1
|
||||
#define CORHLPR_TURNED_FPO_ON 1
|
||||
#endif
|
||||
|
@ -21,6 +21,7 @@
|
|||
#include "cor.h"
|
||||
#include "corhdr.h"
|
||||
#include "corerror.h"
|
||||
#include "unreachable.h"
|
||||
|
||||
// This header is consumed both within the runtime and externally. In the former
|
||||
// case we need to wrap memory allocations, in the latter there is no
|
||||
|
@ -43,6 +44,7 @@ inline void DECLSPEC_NORETURN THROW_OUT_OF_MEMORY()
|
|||
static inline void DECLSPEC_NORETURN __CorHlprThrowOOM()
|
||||
{
|
||||
RaiseException(STATUS_NO_MEMORY, 0, 0, NULL);
|
||||
__UNREACHABLE();
|
||||
}
|
||||
static inline BYTE *__CorHlprNewThrows(size_t bytes)
|
||||
{
|
||||
|
@ -135,13 +137,13 @@ inline bool isCallConv(unsigned sigByte, CorCallingConvention conv)
|
|||
//*****************************************************************************
|
||||
typedef struct tagCOR_ILMETHOD_SECT_SMALL : IMAGE_COR_ILMETHOD_SECT_SMALL {
|
||||
//Data follows
|
||||
const BYTE* Data() const
|
||||
{
|
||||
return(((const BYTE*) this) + sizeof(struct tagCOR_ILMETHOD_SECT_SMALL));
|
||||
const BYTE* Data() const
|
||||
{
|
||||
return(((const BYTE*) this) + sizeof(struct tagCOR_ILMETHOD_SECT_SMALL));
|
||||
}
|
||||
|
||||
bool IsSmall() const
|
||||
{
|
||||
{
|
||||
return (Kind & CorILMethod_Sect_FatFormat) == 0;
|
||||
}
|
||||
|
||||
|
@ -156,9 +158,9 @@ typedef struct tagCOR_ILMETHOD_SECT_SMALL : IMAGE_COR_ILMETHOD_SECT_SMALL {
|
|||
/* NOTE this structure must be DWORD aligned!! */
|
||||
typedef struct tagCOR_ILMETHOD_SECT_FAT : IMAGE_COR_ILMETHOD_SECT_FAT {
|
||||
//Data follows
|
||||
const BYTE* Data() const
|
||||
{
|
||||
return(((const BYTE*) this) + sizeof(struct tagCOR_ILMETHOD_SECT_FAT));
|
||||
const BYTE* Data() const
|
||||
{
|
||||
return(((const BYTE*) this) + sizeof(struct tagCOR_ILMETHOD_SECT_FAT));
|
||||
}
|
||||
|
||||
//Endian-safe wrappers
|
||||
|
@ -322,23 +324,23 @@ struct COR_ILMETHOD_SECT_EH_SMALL : public COR_ILMETHOD_SECT_SMALL {
|
|||
/* NOTE this structure must be DWORD aligned!! */
|
||||
struct COR_ILMETHOD_SECT
|
||||
{
|
||||
bool More() const
|
||||
{
|
||||
return((AsSmall()->Kind & CorILMethod_Sect_MoreSects) != 0);
|
||||
bool More() const
|
||||
{
|
||||
return((AsSmall()->Kind & CorILMethod_Sect_MoreSects) != 0);
|
||||
}
|
||||
|
||||
CorILMethodSect Kind() const
|
||||
{
|
||||
return((CorILMethodSect) (AsSmall()->Kind & CorILMethod_Sect_KindMask));
|
||||
{
|
||||
return((CorILMethodSect) (AsSmall()->Kind & CorILMethod_Sect_KindMask));
|
||||
}
|
||||
|
||||
const COR_ILMETHOD_SECT* Next() const
|
||||
const COR_ILMETHOD_SECT* Next() const
|
||||
{
|
||||
if (!More()) return(0);
|
||||
return ((COR_ILMETHOD_SECT*)(((BYTE *)this) + DataSize()))->Align();
|
||||
}
|
||||
|
||||
const BYTE* Data() const
|
||||
const BYTE* Data() const
|
||||
{
|
||||
if (IsFat()) return(AsFat()->Data());
|
||||
return(AsSmall()->Data());
|
||||
|
@ -346,11 +348,11 @@ struct COR_ILMETHOD_SECT
|
|||
|
||||
unsigned DataSize() const
|
||||
{
|
||||
if (Kind() == CorILMethod_Sect_EHTable)
|
||||
if (Kind() == CorILMethod_Sect_EHTable)
|
||||
{
|
||||
// VB and MC++ shipped with bug where they have not accounted for size of COR_ILMETHOD_SECT_EH_XXX
|
||||
// in DataSize. To avoid breaking these images, we will align the size of EH sections up. This works
|
||||
// because IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_XXX is bigger than COR_ILMETHOD_SECT_EH_XXX
|
||||
// because IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_XXX is bigger than COR_ILMETHOD_SECT_EH_XXX
|
||||
// (see VSWhidbey #99031 and related bugs for details).
|
||||
|
||||
if (IsFat())
|
||||
|
@ -368,25 +370,25 @@ struct COR_ILMETHOD_SECT
|
|||
friend struct COR_ILMETHOD;
|
||||
friend struct tagCOR_ILMETHOD_FAT;
|
||||
friend struct tagCOR_ILMETHOD_TINY;
|
||||
bool IsFat() const
|
||||
{
|
||||
return((AsSmall()->Kind & CorILMethod_Sect_FatFormat) != 0);
|
||||
bool IsFat() const
|
||||
{
|
||||
return((AsSmall()->Kind & CorILMethod_Sect_FatFormat) != 0);
|
||||
}
|
||||
|
||||
const COR_ILMETHOD_SECT* Align() const
|
||||
{
|
||||
return((COR_ILMETHOD_SECT*) ((((UINT_PTR) this) + 3) & ~3));
|
||||
const COR_ILMETHOD_SECT* Align() const
|
||||
{
|
||||
return((COR_ILMETHOD_SECT*) ((((UINT_PTR) this) + 3) & ~3));
|
||||
}
|
||||
|
||||
protected:
|
||||
const COR_ILMETHOD_SECT_FAT* AsFat() const
|
||||
{
|
||||
return((COR_ILMETHOD_SECT_FAT*) this);
|
||||
const COR_ILMETHOD_SECT_FAT* AsFat() const
|
||||
{
|
||||
return((COR_ILMETHOD_SECT_FAT*) this);
|
||||
}
|
||||
|
||||
const COR_ILMETHOD_SECT_SMALL* AsSmall() const
|
||||
{
|
||||
return((COR_ILMETHOD_SECT_SMALL*) this);
|
||||
{
|
||||
return((COR_ILMETHOD_SECT_SMALL*) this);
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -424,7 +426,7 @@ unsigned __stdcall SectEH_Emit(unsigned size, unsigned ehCount,
|
|||
|
||||
struct COR_ILMETHOD_SECT_EH : public COR_ILMETHOD_SECT
|
||||
{
|
||||
unsigned EHCount() const
|
||||
unsigned EHCount() const
|
||||
{
|
||||
return (unsigned)(IsFat() ? (Fat.GetDataSize() / sizeof(IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT)) :
|
||||
(Small.DataSize / sizeof(IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_SMALL)));
|
||||
|
@ -432,27 +434,27 @@ struct COR_ILMETHOD_SECT_EH : public COR_ILMETHOD_SECT
|
|||
|
||||
// return one clause in its fat form. Use 'buff' if needed
|
||||
const IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT* EHClause(unsigned idx, IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT* buff) const
|
||||
{
|
||||
return SectEH_EHClause((void *)this, idx, buff);
|
||||
{
|
||||
return SectEH_EHClause((void *)this, idx, buff);
|
||||
};
|
||||
// compute the size of the section (best format)
|
||||
// codeSize is the size of the method
|
||||
// deprecated
|
||||
unsigned static Size(unsigned ehCount, unsigned codeSize)
|
||||
{
|
||||
return SectEH_SizeWithCode(ehCount, codeSize);
|
||||
{
|
||||
return SectEH_SizeWithCode(ehCount, codeSize);
|
||||
};
|
||||
|
||||
// will return worse-case size and then Emit will return actual size
|
||||
unsigned static Size(unsigned ehCount)
|
||||
{
|
||||
return SectEH_SizeWorst(ehCount);
|
||||
{
|
||||
return SectEH_SizeWorst(ehCount);
|
||||
};
|
||||
|
||||
// will return exact size which will match the size returned by Emit
|
||||
unsigned static Size(unsigned ehCount, const IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT* clauses)
|
||||
{
|
||||
return SectEH_SizeExact(ehCount, (IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT*)clauses);
|
||||
{
|
||||
return SectEH_SizeExact(ehCount, (IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT*)clauses);
|
||||
};
|
||||
|
||||
// emit the section (best format);
|
||||
|
@ -460,10 +462,10 @@ struct COR_ILMETHOD_SECT_EH : public COR_ILMETHOD_SECT
|
|||
const IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT* clauses,
|
||||
bool moreSections, BYTE* outBuff,
|
||||
ULONG* ehTypeOffsets = 0)
|
||||
{
|
||||
{
|
||||
return SectEH_Emit(size, ehCount,
|
||||
(IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT*)clauses,
|
||||
moreSections, outBuff, ehTypeOffsets);
|
||||
moreSections, outBuff, ehTypeOffsets);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -472,34 +474,34 @@ struct COR_ILMETHOD_SECT_EH : public COR_ILMETHOD_SECT
|
|||
/* Used when the method is tiny (< 64 bytes), and there are no local vars */
|
||||
typedef struct tagCOR_ILMETHOD_TINY : IMAGE_COR_ILMETHOD_TINY
|
||||
{
|
||||
bool IsTiny() const
|
||||
{
|
||||
return((Flags_CodeSize & (CorILMethod_FormatMask >> 1)) == CorILMethod_TinyFormat);
|
||||
bool IsTiny() const
|
||||
{
|
||||
return((Flags_CodeSize & (CorILMethod_FormatMask >> 1)) == CorILMethod_TinyFormat);
|
||||
}
|
||||
|
||||
unsigned GetCodeSize() const
|
||||
{
|
||||
return(((unsigned) Flags_CodeSize) >> (CorILMethod_FormatShift-1));
|
||||
unsigned GetCodeSize() const
|
||||
{
|
||||
return(((unsigned) Flags_CodeSize) >> (CorILMethod_FormatShift-1));
|
||||
}
|
||||
|
||||
unsigned GetMaxStack() const
|
||||
{
|
||||
return(8);
|
||||
unsigned GetMaxStack() const
|
||||
{
|
||||
return(8);
|
||||
}
|
||||
|
||||
BYTE* GetCode() const
|
||||
{
|
||||
return(((BYTE*) this) + sizeof(struct tagCOR_ILMETHOD_TINY));
|
||||
BYTE* GetCode() const
|
||||
{
|
||||
return(((BYTE*) this) + sizeof(struct tagCOR_ILMETHOD_TINY));
|
||||
}
|
||||
|
||||
DWORD GetLocalVarSigTok() const
|
||||
{
|
||||
return(0);
|
||||
DWORD GetLocalVarSigTok() const
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
|
||||
COR_ILMETHOD_SECT* GetSect() const
|
||||
{
|
||||
return(0);
|
||||
COR_ILMETHOD_SECT* GetSect() const
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
} COR_ILMETHOD_TINY;
|
||||
|
||||
|
@ -547,24 +549,24 @@ typedef struct tagCOR_ILMETHOD_FAT : IMAGE_COR_ILMETHOD_FAT
|
|||
*(USHORT*)((BYTE*)this+2) = VAL16((USHORT)maxStack);
|
||||
}
|
||||
|
||||
unsigned GetCodeSize() const
|
||||
{
|
||||
return VAL32(CodeSize);
|
||||
unsigned GetCodeSize() const
|
||||
{
|
||||
return VAL32(CodeSize);
|
||||
}
|
||||
|
||||
void SetCodeSize(DWORD Size)
|
||||
{
|
||||
CodeSize = VAL32(Size);
|
||||
void SetCodeSize(DWORD Size)
|
||||
{
|
||||
CodeSize = VAL32(Size);
|
||||
}
|
||||
|
||||
mdToken GetLocalVarSigTok() const
|
||||
{
|
||||
return VAL32(LocalVarSigTok);
|
||||
mdToken GetLocalVarSigTok() const
|
||||
{
|
||||
return VAL32(LocalVarSigTok);
|
||||
}
|
||||
|
||||
void SetLocalVarSigTok(mdSignature tok)
|
||||
{
|
||||
LocalVarSigTok = VAL32(tok);
|
||||
void SetLocalVarSigTok(mdSignature tok)
|
||||
{
|
||||
LocalVarSigTok = VAL32(tok);
|
||||
}
|
||||
|
||||
BYTE* GetCode() const {
|
||||
|
@ -600,14 +602,14 @@ struct COR_ILMETHOD
|
|||
|
||||
// compute the size of the header (best format)
|
||||
unsigned static Size(const COR_ILMETHOD_FAT* header, bool MoreSections)
|
||||
{
|
||||
return IlmethodSize((COR_ILMETHOD_FAT*)header,MoreSections);
|
||||
{
|
||||
return IlmethodSize((COR_ILMETHOD_FAT*)header,MoreSections);
|
||||
};
|
||||
// emit the header (bestFormat) return amount emitted
|
||||
unsigned static Emit(unsigned size, const COR_ILMETHOD_FAT* header,
|
||||
bool moreSections, BYTE* outBuff)
|
||||
{
|
||||
return IlmethodEmit(size, (COR_ILMETHOD_FAT*)header, moreSections, outBuff);
|
||||
{
|
||||
return IlmethodEmit(size, (COR_ILMETHOD_FAT*)header, moreSections, outBuff);
|
||||
};
|
||||
|
||||
//private:
|
||||
|
@ -639,9 +641,9 @@ public:
|
|||
|
||||
// Typically the ONLY way you should access COR_ILMETHOD is through
|
||||
// this constructor so format changes are easier.
|
||||
COR_ILMETHOD_DECODER(const COR_ILMETHOD* header)
|
||||
{
|
||||
DecoderInit(this,(COR_ILMETHOD*)header);
|
||||
COR_ILMETHOD_DECODER(const COR_ILMETHOD* header)
|
||||
{
|
||||
DecoderInit(this,(COR_ILMETHOD*)header);
|
||||
};
|
||||
|
||||
// The above variant of the constructor can not do a 'complete' job, because
|
||||
|
@ -659,11 +661,11 @@ public:
|
|||
// Because we may be able to demand SkipVerification and thus it was OK
|
||||
// to have had a verification error.
|
||||
|
||||
COR_ILMETHOD_DECODER(COR_ILMETHOD* header,
|
||||
COR_ILMETHOD_DECODER(COR_ILMETHOD* header,
|
||||
void *pInternalImport,
|
||||
DecoderStatus* wbStatus);
|
||||
|
||||
unsigned EHCount() const
|
||||
unsigned EHCount() const
|
||||
{
|
||||
return (EH != 0) ? EH->EHCount() : 0;
|
||||
}
|
||||
|
@ -674,9 +676,9 @@ public:
|
|||
}
|
||||
|
||||
// returns total size of method for use in copying
|
||||
int GetOnDiskSize(const COR_ILMETHOD* header)
|
||||
{
|
||||
return DecoderGetOnDiskSize(this,(COR_ILMETHOD*)header);
|
||||
int GetOnDiskSize(const COR_ILMETHOD* header)
|
||||
{
|
||||
return DecoderGetOnDiskSize(this,(COR_ILMETHOD*)header);
|
||||
}
|
||||
|
||||
// Flags these are available because we inherit COR_ILMETHOD_FAT
|
||||
|
|
|
@ -47,7 +47,7 @@ HRESULT CQuickMemoryBase<SIZE, INCREMENT>::ReSizeNoThrow(SIZE_T iItems)
|
|||
iSize = iItems;
|
||||
return NOERROR;
|
||||
}
|
||||
|
||||
|
||||
#ifdef _BLD_CLR
|
||||
#ifndef DACCESS_COMPILE
|
||||
// not allowed to do allocation if current thread suspends EE
|
||||
|
@ -259,7 +259,7 @@ HRESULT _GetFixedSigOfVarArg( // S_OK or error.
|
|||
{
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
|
||||
cbCur += cbArgsNumber;
|
||||
|
||||
// how many bytes to represent the return type
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "corhlpr.h"
|
||||
#include "fstring.h"
|
||||
|
||||
#if defined(_MSC_VER) && defined(_TARGET_X86_)
|
||||
#if defined(_MSC_VER) && defined(TARGET_X86)
|
||||
#pragma optimize("y", on) // If routines don't get inlined, don't pay the EBP frame penalty
|
||||
#endif
|
||||
|
||||
|
@ -226,7 +226,7 @@ public:
|
|||
iSize = cbTotal;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Convert UTF8 string to UNICODE string, optimized for speed
|
||||
HRESULT ConvertUtf8_UnicodeNoThrow(const char * utf8str)
|
||||
{
|
||||
|
@ -309,7 +309,7 @@ public:
|
|||
}
|
||||
|
||||
#ifdef DACCESS_COMPILE
|
||||
void
|
||||
void
|
||||
EnumMemoryRegions(CLRDataEnumMemoryFlags flags)
|
||||
{
|
||||
// Assume that 'this' is enumerated, either explicitly
|
||||
|
@ -317,7 +317,7 @@ public:
|
|||
DacEnumMemoryRegion(dac_cast<TADDR>(pbBuff), iSize);
|
||||
}
|
||||
#endif // DACCESS_COMPILE
|
||||
|
||||
|
||||
BYTE *pbBuff;
|
||||
SIZE_T iSize; // number of bytes used
|
||||
SIZE_T cbTotal; // total bytes allocated in the buffer
|
||||
|
@ -385,68 +385,68 @@ template <class T> class CQuickArrayBase : public CQuickBytesBase
|
|||
{
|
||||
public:
|
||||
T* AllocThrows(SIZE_T iItems)
|
||||
{
|
||||
{
|
||||
CheckOverflowThrows(iItems);
|
||||
return (T*)CQuickBytesBase::AllocThrows(iItems * sizeof(T));
|
||||
return (T*)CQuickBytesBase::AllocThrows(iItems * sizeof(T));
|
||||
}
|
||||
|
||||
void ReSizeThrows(SIZE_T iItems)
|
||||
{
|
||||
{
|
||||
CheckOverflowThrows(iItems);
|
||||
CQuickBytesBase::ReSizeThrows(iItems * sizeof(T));
|
||||
}
|
||||
|
||||
T* AllocNoThrow(SIZE_T iItems)
|
||||
{
|
||||
{
|
||||
if (!CheckOverflowNoThrow(iItems))
|
||||
{
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return (T*)CQuickBytesBase::AllocNoThrow(iItems * sizeof(T));
|
||||
return (T*)CQuickBytesBase::AllocNoThrow(iItems * sizeof(T));
|
||||
}
|
||||
|
||||
HRESULT ReSizeNoThrow(SIZE_T iItems)
|
||||
{
|
||||
{
|
||||
if (!CheckOverflowNoThrow(iItems))
|
||||
{
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
return CQuickBytesBase::ReSizeNoThrow(iItems * sizeof(T));
|
||||
return CQuickBytesBase::ReSizeNoThrow(iItems * sizeof(T));
|
||||
}
|
||||
|
||||
void Shrink(SIZE_T iItems)
|
||||
{
|
||||
CQuickBytesBase::Shrink(iItems * sizeof(T));
|
||||
|
||||
void Shrink(SIZE_T iItems)
|
||||
{
|
||||
CQuickBytesBase::Shrink(iItems * sizeof(T));
|
||||
}
|
||||
|
||||
T* Ptr()
|
||||
{
|
||||
return (T*) CQuickBytesBase::Ptr();
|
||||
{
|
||||
return (T*) CQuickBytesBase::Ptr();
|
||||
}
|
||||
|
||||
const T* Ptr() const
|
||||
{
|
||||
return (T*) CQuickBytesBase::Ptr();
|
||||
{
|
||||
return (T*) CQuickBytesBase::Ptr();
|
||||
}
|
||||
|
||||
SIZE_T Size() const
|
||||
{
|
||||
return CQuickBytesBase::Size() / sizeof(T);
|
||||
{
|
||||
return CQuickBytesBase::Size() / sizeof(T);
|
||||
}
|
||||
|
||||
SIZE_T MaxSize() const
|
||||
{
|
||||
return CQuickBytesBase::cbTotal / sizeof(T);
|
||||
{
|
||||
return CQuickBytesBase::cbTotal / sizeof(T);
|
||||
}
|
||||
|
||||
T& operator[] (SIZE_T ix)
|
||||
{
|
||||
{
|
||||
_ASSERTE(ix < Size());
|
||||
return *(Ptr() + ix);
|
||||
}
|
||||
|
||||
const T& operator[] (SIZE_T ix) const
|
||||
{
|
||||
{
|
||||
_ASSERTE(ix < Size());
|
||||
return *(Ptr() + ix);
|
||||
}
|
||||
|
@ -521,14 +521,14 @@ public:
|
|||
|
||||
// Can only access values that have been pushed.
|
||||
T& operator[] (SIZE_T ix)
|
||||
{
|
||||
{
|
||||
_ASSERTE(ix < m_curSize);
|
||||
return CQuickArray<T>::operator[](ix);
|
||||
}
|
||||
|
||||
// Can only access values that have been pushed.
|
||||
const T& operator[] (SIZE_T ix) const
|
||||
{
|
||||
{
|
||||
_ASSERTE(ix < m_curSize);
|
||||
return CQuickArray<T>::operator[](ix);
|
||||
}
|
||||
|
@ -614,7 +614,7 @@ public:
|
|||
|
||||
void Reset()
|
||||
{
|
||||
if (buffer.Size())
|
||||
if (buffer.Size())
|
||||
{
|
||||
memset(&buffer[0], 0, buffer.Size());
|
||||
}
|
||||
|
@ -642,19 +642,19 @@ HRESULT _GetFixedSigOfVarArg( // S_OK or error.
|
|||
|
||||
#endif //!SOS_INCLUDE
|
||||
|
||||
#if defined(_MSC_VER) && defined(_TARGET_X86_)
|
||||
#if defined(_MSC_VER) && defined(TARGET_X86)
|
||||
#pragma optimize("", on) // restore command line default optimizations
|
||||
#endif
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
// Reads compressed integer from buffer pData, fills the result to *pnDataOut. Advances buffer pointer.
|
||||
// Doesn't read behind the end of the buffer (the end starts at pDataEnd).
|
||||
//
|
||||
inline
|
||||
__checkReturn
|
||||
HRESULT
|
||||
//
|
||||
inline
|
||||
__checkReturn
|
||||
HRESULT
|
||||
CorSigUncompressData_EndPtr(
|
||||
PCCOR_SIGNATURE & pData, // [IN,OUT] Buffer
|
||||
PCCOR_SIGNATURE pDataEnd, // End of buffer
|
||||
|
@ -662,40 +662,40 @@ CorSigUncompressData_EndPtr(
|
|||
{
|
||||
_ASSERTE(pData <= pDataEnd);
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
|
||||
INT_PTR cbDataSize = pDataEnd - pData;
|
||||
if (cbDataSize > 4)
|
||||
{ // Compressed integer cannot be bigger than 4 bytes
|
||||
cbDataSize = 4;
|
||||
}
|
||||
DWORD dwDataSize = (DWORD)cbDataSize;
|
||||
|
||||
|
||||
ULONG cbDataOutLength;
|
||||
IfFailRet(CorSigUncompressData(
|
||||
pData,
|
||||
dwDataSize,
|
||||
pnDataOut,
|
||||
pData,
|
||||
dwDataSize,
|
||||
pnDataOut,
|
||||
&cbDataOutLength));
|
||||
pData += cbDataOutLength;
|
||||
|
||||
|
||||
return hr;
|
||||
} // CorSigUncompressData_EndPtr
|
||||
|
||||
//---------------------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
// Reads CorElementType (1 byte) from buffer pData, fills the result to *pTypeOut. Advances buffer pointer.
|
||||
// Doesn't read behind the end of the buffer (the end starts at pDataEnd).
|
||||
//
|
||||
inline
|
||||
__checkReturn
|
||||
HRESULT
|
||||
//
|
||||
inline
|
||||
__checkReturn
|
||||
HRESULT
|
||||
CorSigUncompressElementType_EndPtr(
|
||||
PCCOR_SIGNATURE & pData, // [IN,OUT] Buffer
|
||||
PCCOR_SIGNATURE pDataEnd, // End of buffer
|
||||
CorElementType * pTypeOut) // [OUT] ELEMENT_TYPE_* value read from the buffer
|
||||
{
|
||||
_ASSERTE(pData <= pDataEnd);
|
||||
// We don't expect pData > pDataEnd, but the runtime check doesn't cost much and it is more secure in
|
||||
// We don't expect pData > pDataEnd, but the runtime check doesn't cost much and it is more secure in
|
||||
// case caller has a bug
|
||||
if (pData >= pDataEnd)
|
||||
{ // No data
|
||||
|
@ -704,26 +704,26 @@ CorSigUncompressElementType_EndPtr(
|
|||
// Read 'type' as 1 byte
|
||||
*pTypeOut = (CorElementType)*pData;
|
||||
pData++;
|
||||
|
||||
|
||||
return S_OK;
|
||||
} // CorSigUncompressElementType_EndPtr
|
||||
|
||||
//---------------------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
// Reads pointer (4/8 bytes) from buffer pData, fills the result to *ppvPointerOut. Advances buffer pointer.
|
||||
// Doesn't read behind the end of the buffer (the end starts at pDataEnd).
|
||||
//
|
||||
inline
|
||||
__checkReturn
|
||||
HRESULT
|
||||
//
|
||||
inline
|
||||
__checkReturn
|
||||
HRESULT
|
||||
CorSigUncompressPointer_EndPtr(
|
||||
PCCOR_SIGNATURE & pData, // [IN,OUT] Buffer
|
||||
PCCOR_SIGNATURE pDataEnd, // End of buffer
|
||||
void ** ppvPointerOut) // [OUT] Pointer value read from the buffer
|
||||
{
|
||||
_ASSERTE(pData <= pDataEnd);
|
||||
// We could just skip this check as pointers should be only in trusted (and therefore correct)
|
||||
// signatures and we check for that on the caller side, but it won't hurt to have this check and it will
|
||||
// We could just skip this check as pointers should be only in trusted (and therefore correct)
|
||||
// signatures and we check for that on the caller side, but it won't hurt to have this check and it will
|
||||
// make it easier to catch invalid signatures in trusted code (e.g. IL stubs, NGEN images, etc.)
|
||||
if (pData + sizeof(void *) > pDataEnd)
|
||||
{ // Not enough data in the buffer
|
||||
|
@ -732,18 +732,18 @@ CorSigUncompressPointer_EndPtr(
|
|||
}
|
||||
*ppvPointerOut = *(void * UNALIGNED *)pData;
|
||||
pData += sizeof(void *);
|
||||
|
||||
|
||||
return S_OK;
|
||||
} // CorSigUncompressPointer_EndPtr
|
||||
|
||||
//---------------------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
// Reads compressed TypeDef/TypeRef/TypeSpec token, fills the result to *pnDataOut. Advances buffer pointer.
|
||||
// Doesn't read behind the end of the buffer (the end starts at pDataEnd).
|
||||
//
|
||||
inline
|
||||
__checkReturn
|
||||
HRESULT
|
||||
//
|
||||
inline
|
||||
__checkReturn
|
||||
HRESULT
|
||||
CorSigUncompressToken_EndPtr(
|
||||
PCCOR_SIGNATURE & pData, // [IN,OUT] Buffer
|
||||
PCCOR_SIGNATURE pDataEnd, // End of buffer
|
||||
|
@ -751,22 +751,22 @@ CorSigUncompressToken_EndPtr(
|
|||
{
|
||||
_ASSERTE(pData <= pDataEnd);
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
|
||||
INT_PTR cbDataSize = pDataEnd - pData;
|
||||
if (cbDataSize > 4)
|
||||
{ // Compressed token cannot be bigger than 4 bytes
|
||||
cbDataSize = 4;
|
||||
}
|
||||
DWORD dwDataSize = (DWORD)cbDataSize;
|
||||
|
||||
|
||||
ULONG cbTokenOutLength;
|
||||
IfFailRet(CorSigUncompressToken(
|
||||
pData,
|
||||
dwDataSize,
|
||||
ptkTokenOut,
|
||||
pData,
|
||||
dwDataSize,
|
||||
ptkTokenOut,
|
||||
&cbTokenOutLength));
|
||||
pData += cbTokenOutLength;
|
||||
|
||||
|
||||
return hr;
|
||||
} // CorSigUncompressToken_EndPtr
|
||||
|
||||
|
|
|
@ -28,85 +28,19 @@
|
|||
|
||||
#include "holder.h"
|
||||
|
||||
#include "clrprivhosting.h"
|
||||
#include "clrprivbinding.h"
|
||||
|
||||
#ifdef FEATURE_COMINTEROP
|
||||
#include "activation.h" // WinRT activation.
|
||||
#endif
|
||||
|
||||
class DangerousNonHostedSpinLock;
|
||||
|
||||
#define INVALID_STACK_BASE_MARKER_FOR_CHECK_STATE 2
|
||||
|
||||
class AppDomain;
|
||||
class Assembly;
|
||||
|
||||
|
||||
class CorRuntimeHostBase
|
||||
{
|
||||
protected:
|
||||
CorRuntimeHostBase()
|
||||
:m_Started(FALSE),
|
||||
m_cRef(0)
|
||||
{LIMITED_METHOD_CONTRACT;}
|
||||
|
||||
STDMETHODIMP_(ULONG) AddRef(void);
|
||||
|
||||
// Starts the runtime. This is equivalent to CoInitializeCor()
|
||||
STDMETHODIMP Start();
|
||||
|
||||
STDMETHODIMP MapFile( // Return code.
|
||||
HANDLE hFile, // [in] Handle for file
|
||||
HMODULE *hMapAddress // [out] HINSTANCE for mapped file
|
||||
);
|
||||
|
||||
STDMETHODIMP LocksHeldByLogicalThread( // Return code.
|
||||
DWORD *pCount // [out] Number of locks that the current thread holds.
|
||||
);
|
||||
|
||||
protected:
|
||||
BOOL m_Started; // Has START been called?
|
||||
|
||||
LONG m_cRef; // Ref count.
|
||||
|
||||
static ULONG m_Version; // Version of ICorRuntimeHost.
|
||||
// Some functions are only available in ICLRRuntimeHost.
|
||||
// Some functions are no-op in ICLRRuntimeHost.
|
||||
|
||||
STDMETHODIMP UnloadAppDomain(DWORD dwDomainId, BOOL fWaitUntilDone);
|
||||
|
||||
STDMETHODIMP UnloadAppDomain2(DWORD dwDomainId, BOOL fWaitUntilDone, int *pLatchedExitCode);
|
||||
public:
|
||||
static ULONG GetHostVersion()
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
_ASSERTE (m_Version != 0);
|
||||
return m_Version;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
class ConnectionNameTable;
|
||||
typedef DPTR(class ConnectionNameTable) PTR_ConnectionNameTable;
|
||||
|
||||
class CrstStatic;
|
||||
|
||||
// Defines the precedence (in increading oder) of the two symbol reading knobs
|
||||
enum ESymbolReadingSetBy
|
||||
{
|
||||
eSymbolReadingSetByDefault,
|
||||
eSymbolReadingSetByConfig, // EEConfig - config file, env var, etc.
|
||||
eSymbolReadingSetByHost, // Hosting API - highest precedence
|
||||
eSymbolReadingSetBy_COUNT
|
||||
};
|
||||
|
||||
class CorHost2 :
|
||||
public CorRuntimeHostBase
|
||||
#ifndef FEATURE_PAL
|
||||
class CorHost2 : ICLRRuntimeHost4
|
||||
#ifndef TARGET_UNIX
|
||||
, public IPrivateManagedExceptionReporting /* This interface is for internal Watson testing only*/
|
||||
#endif // FEATURE_PAL
|
||||
, public ICLRRuntimeHost4
|
||||
#endif // TARGET_UNIX
|
||||
{
|
||||
friend struct _DacGlobals;
|
||||
|
||||
|
@ -116,20 +50,16 @@ public:
|
|||
|
||||
// *** IUnknown methods ***
|
||||
STDMETHODIMP QueryInterface(REFIID riid, void** ppv);
|
||||
STDMETHODIMP_(ULONG) AddRef(void)
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
return CorRuntimeHostBase::AddRef();
|
||||
}
|
||||
STDMETHODIMP_(ULONG) AddRef(void);
|
||||
STDMETHODIMP_(ULONG) Release(void);
|
||||
|
||||
|
||||
// *** ICorRuntimeHost methods ***
|
||||
|
||||
#ifndef FEATURE_PAL
|
||||
#ifndef TARGET_UNIX
|
||||
// defined in IPrivateManagedExceptionReporting interface for internal Watson testing only
|
||||
STDMETHODIMP GetBucketParametersForCurrentException(BucketParameters *pParams);
|
||||
#endif // FEATURE_PAL
|
||||
#endif // TARGET_UNIX
|
||||
|
||||
// Starts the runtime. This is equivalent to CoInitializeCor().
|
||||
STDMETHODIMP Start();
|
||||
|
@ -139,26 +69,9 @@ public:
|
|||
FExecuteInAppDomainCallback pCallback,
|
||||
void * cookie);
|
||||
|
||||
STDMETHODIMP LocksHeldByLogicalThread( // Return code.
|
||||
DWORD *pCount // [out] Number of locks that the current thread holds.
|
||||
)
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
return CorRuntimeHostBase::LocksHeldByLogicalThread(pCount);
|
||||
}
|
||||
|
||||
// Class factory hook-up.
|
||||
static HRESULT CreateObject(REFIID riid, void **ppUnk);
|
||||
|
||||
STDMETHODIMP MapFile( // Return code.
|
||||
HANDLE hFile, // [in] Handle for file
|
||||
HMODULE *hMapAddress // [out] HINSTANCE for mapped file
|
||||
)
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
return CorRuntimeHostBase::MapFile(hFile,hMapAddress);
|
||||
}
|
||||
|
||||
STDMETHODIMP STDMETHODCALLTYPE SetHostControl(
|
||||
IHostControl* pHostControl);
|
||||
|
||||
|
@ -188,17 +101,17 @@ public:
|
|||
STDMETHODIMP CreateAppDomainWithManager(
|
||||
LPCWSTR wszFriendlyName,
|
||||
DWORD dwSecurityFlags,
|
||||
LPCWSTR wszAppDomainManagerAssemblyName,
|
||||
LPCWSTR wszAppDomainManagerTypeName,
|
||||
int nProperties,
|
||||
LPCWSTR* pPropertyNames,
|
||||
LPCWSTR* pPropertyValues,
|
||||
LPCWSTR wszAppDomainManagerAssemblyName,
|
||||
LPCWSTR wszAppDomainManagerTypeName,
|
||||
int nProperties,
|
||||
LPCWSTR* pPropertyNames,
|
||||
LPCWSTR* pPropertyValues,
|
||||
DWORD* pAppDomainID);
|
||||
|
||||
STDMETHODIMP CreateDelegate(
|
||||
DWORD appDomainID,
|
||||
LPCWSTR wszAssemblyName,
|
||||
LPCWSTR wszClassName,
|
||||
LPCWSTR wszAssemblyName,
|
||||
LPCWSTR wszClassName,
|
||||
LPCWSTR wszMethodName,
|
||||
INT_PTR* fnPtr);
|
||||
|
||||
|
@ -207,7 +120,7 @@ public:
|
|||
STDMETHODIMP RegisterMacEHPort();
|
||||
STDMETHODIMP SetStartupFlags(STARTUP_FLAGS flag);
|
||||
STDMETHODIMP DllGetActivationFactory(
|
||||
DWORD appDomainID,
|
||||
DWORD appDomainID,
|
||||
LPCWSTR wszTypeName,
|
||||
IActivationFactory ** factory);
|
||||
|
||||
|
@ -226,6 +139,8 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
LONG m_cRef; // COM ref count.
|
||||
|
||||
// This flag indicates if this instance was the first to load and start CoreCLR
|
||||
BOOL m_fFirstToLoadCLR;
|
||||
|
||||
|
@ -233,24 +148,6 @@ private:
|
|||
BOOL m_fStarted;
|
||||
BOOL m_fAppDomainCreated; // this flag is used when an appdomain can only create a single appdomain
|
||||
|
||||
// Helpers for both ICLRRuntimeHost2 and ICLRPrivRuntime
|
||||
HRESULT _CreateAppDomain(
|
||||
LPCWSTR wszFriendlyName,
|
||||
DWORD dwFlags,
|
||||
LPCWSTR wszAppDomainManagerAssemblyName,
|
||||
LPCWSTR wszAppDomainManagerTypeName,
|
||||
int nProperties,
|
||||
LPCWSTR* pPropertyNames,
|
||||
LPCWSTR* pPropertyValues,
|
||||
DWORD* pAppDomainID);
|
||||
|
||||
HRESULT _CreateDelegate(
|
||||
DWORD appDomainID,
|
||||
LPCWSTR wszAssemblyName,
|
||||
LPCWSTR wszClassName,
|
||||
LPCWSTR wszMethodName,
|
||||
INT_PTR* fnPtr);
|
||||
|
||||
// entrypoint helper to be wrapped in a filter to process unhandled exceptions
|
||||
VOID ExecuteMainInner(Assembly* pRootAssembly);
|
||||
|
||||
|
@ -262,17 +159,11 @@ private:
|
|||
#ifdef FEATURE_COMINTEROP
|
||||
extern "C"
|
||||
HRESULT STDMETHODCALLTYPE DllGetActivationFactoryImpl(
|
||||
LPCWSTR wszAssemblyName,
|
||||
LPCWSTR wszTypeName,
|
||||
LPCWSTR wszAssemblyName,
|
||||
LPCWSTR wszTypeName,
|
||||
LPCWSTR wszCodeBase,
|
||||
IActivationFactory ** factory);
|
||||
|
||||
#endif // defined(FEATURE_COMINTEROP)
|
||||
|
||||
extern SIZE_T Host_SegmentSize;
|
||||
extern SIZE_T Host_MaxGen0Size;
|
||||
extern BOOL Host_fSegmentSizeSet;
|
||||
extern BOOL Host_fMaxGen0SizeSet;
|
||||
|
||||
#define PARTIAL_TRUST_VISIBLE_ASSEMBLIES_PROPERTY W("PARTIAL_TRUST_VISIBLE_ASSEMBLIES")
|
||||
#endif // __CorHost__h__
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
|
||||
/*============================================================
|
||||
**
|
||||
|
@ -29,7 +29,7 @@ PIMAGE_SECTION_HEADER
|
|||
Cor_RtlImageRvaToSection(PTR_IMAGE_NT_HEADERS NtHeaders,
|
||||
ULONG Rva,
|
||||
ULONG FileLength);
|
||||
|
||||
|
||||
PIMAGE_SECTION_HEADER
|
||||
Cor_RtlImageRvaRangeToSection(PTR_IMAGE_NT_HEADERS NtHeaders,
|
||||
ULONG Rva,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
//
|
||||
//
|
||||
|
||||
/*****************************************************************************\
|
||||
* *
|
||||
|
@ -22,7 +22,7 @@
|
|||
// The JIT/EE interface is versioned. By "interface", we mean mean any and all communication between the
|
||||
// JIT and the EE. Any time a change is made to the interface, the JIT/EE interface version identifier
|
||||
// must be updated. See code:JITEEVersionIdentifier for more information.
|
||||
//
|
||||
//
|
||||
// NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -38,9 +38,9 @@ code:EEStartup#TableOfContents for information on the runtime as a whole.
|
|||
-------------------------------------------------------------------------------
|
||||
#Tokens
|
||||
|
||||
The tokens in IL stream needs to be resolved to EE handles (CORINFO_CLASS/METHOD/FIELD_HANDLE) that
|
||||
the runtime operates with. ICorStaticInfo::resolveToken is the method that resolves the found in IL stream
|
||||
to set of EE handles (CORINFO_RESOLVED_TOKEN). All other APIs take resolved token as input. This design
|
||||
The tokens in IL stream needs to be resolved to EE handles (CORINFO_CLASS/METHOD/FIELD_HANDLE) that
|
||||
the runtime operates with. ICorStaticInfo::resolveToken is the method that resolves the found in IL stream
|
||||
to set of EE handles (CORINFO_RESOLVED_TOKEN). All other APIs take resolved token as input. This design
|
||||
avoids redundant token resolutions.
|
||||
|
||||
The token validation is done as part of token resolution. The JIT is not required to do explicit upfront
|
||||
|
@ -51,19 +51,19 @@ token validation.
|
|||
|
||||
First of all class contruction comes in two flavors precise and 'beforeFieldInit'. In C# you get the former
|
||||
if you declare an explicit class constructor method and the later if you declaratively initialize static
|
||||
fields. Precise class construction guarentees that the .cctor is run precisely before the first access to any
|
||||
method or field of the class. 'beforeFieldInit' semantics guarentees only that the .cctor will be run some
|
||||
time before the first static field access (note that calling methods (static or insance) or accessing
|
||||
fields. Precise class construction guarantees that the .cctor is run precisely before the first access to any
|
||||
method or field of the class. 'beforeFieldInit' semantics guarantees only that the .cctor will be run some
|
||||
time before the first static field access (note that calling methods (static or instance) or accessing
|
||||
instance fields does not cause .cctors to be run).
|
||||
|
||||
Next you need to know that there are two kinds of code generation that can happen in the JIT: appdomain
|
||||
neutral and appdomain specialized. The difference between these two kinds of code is how statics are handled.
|
||||
For appdomain specific code, the address of a particular static variable is embeded in the code. This makes
|
||||
For appdomain specific code, the address of a particular static variable is embedded in the code. This makes
|
||||
it usable only for one appdomain (since every appdomain gets a own copy of its statics). Appdomain neutral
|
||||
code calls a helper that looks up static variables off of a thread local variable. Thus the same code can be
|
||||
used by mulitple appdomains in the same process.
|
||||
used by multiple appdomains in the same process.
|
||||
|
||||
Generics also introduce a similar issue. Code for generic classes might be specialised for a particular set
|
||||
Generics also introduce a similar issue. Code for generic classes might be specialized for a particular set
|
||||
of type arguments, or it could use helpers to access data that depends on type parameters and thus be shared
|
||||
across several instantiations of the generic type.
|
||||
|
||||
|
@ -98,7 +98,7 @@ Nevertheless, the cost of plugging these holes is considered to high and the ben
|
|||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
#ClassConstructionFlags
|
||||
#ClassConstructionFlags
|
||||
|
||||
Thus the JIT's cctor responsibilities require it to check with the EE on every static field access using
|
||||
initClass and before jitting any method to see if a .cctor check must be placed in the prolog.
|
||||
|
@ -109,20 +109,20 @@ initClass and before jitting any method to see if a .cctor check must be placed
|
|||
classes with precise .cctor semantics do not allow this optimization.
|
||||
|
||||
Inlining also complicates things. Because the class could have precise semantics it is also required that the
|
||||
inlining of any constructor or static method must also do the initClass check. The inliner has the option of
|
||||
inlining of any constructor or static method must also do the initClass check. The inliner has the option of
|
||||
inserting any required runtime check or simply not inlining the function.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
#StaticFields
|
||||
|
||||
The first 4 options are mutially exclusive
|
||||
The first 4 options are mutually exclusive
|
||||
|
||||
* CORINFO_FLG_HELPER If the field has this set, then the JIT must call getFieldHelper and call the
|
||||
returned helper with the object ref (for an instance field) and a fieldDesc. Note that this should be
|
||||
able to handle ANY field so to get a JIT up quickly, it has the option of using helper calls for all
|
||||
field access (and skip the complexity below). Note that for statics it is assumed that you will
|
||||
alwasy ask for the ADDRESSS helper and to the fetch in the JIT.
|
||||
always ask for the ADDRESS helper and to the fetch in the JIT.
|
||||
|
||||
* CORINFO_FLG_SHARED_HELPER This is currently only used for static fields. If this bit is set it means
|
||||
that the field is feched by a helper call that takes a module identifier (see getModuleDomainID) and
|
||||
|
@ -156,11 +156,11 @@ by addr = (*addr+sizeof(OBJECTREF))
|
|||
Instance fields
|
||||
|
||||
* CORINFO_FLG_HELPER This is used if the class is MarshalByRef, which means that the object might be a
|
||||
proxyt to the real object in some other appdomain or process. If the field has this set, then the JIT
|
||||
proxy to the real object in some other appdomain or process. If the field has this set, then the JIT
|
||||
must call getFieldHelper and call the returned helper with the object ref. If the helper returned is
|
||||
helpers that are for structures the args are as follows
|
||||
|
||||
* CORINFO_HELP_GETFIELDSTRUCT - args are: retBuff, object, fieldDesc
|
||||
* CORINFO_HELP_GETFIELDSTRUCT - args are: retBuff, object, fieldDesc
|
||||
* CORINFO_HELP_SETFIELDSTRUCT - args are object fieldDesc value
|
||||
|
||||
The other GET helpers take an object fieldDesc and return the value The other SET helpers take an object
|
||||
|
@ -172,11 +172,11 @@ fieldDesc and value
|
|||
CORINFO_FLG_EnC This is to support adding new field for edit and continue. This field also indicates that
|
||||
a helper is needed to access this field. However this helper is always CORINFO_HELP_GETFIELDADDR, and
|
||||
this helper always takes the object and field handle and returns the address of the field. It is the
|
||||
JIT's responcibility to do the fetch or set.
|
||||
JIT's responsibility to do the fetch or set.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
TODO: Talk about initializing strutures before use
|
||||
TODO: Talk about initializing strutures before use
|
||||
|
||||
|
||||
*******************************************************************************
|
||||
|
@ -217,11 +217,11 @@ TODO: Talk about initializing strutures before use
|
|||
#endif
|
||||
#endif
|
||||
|
||||
SELECTANY const GUID JITEEVersionIdentifier = { /* d609bed1-7831-49fc-bd49-b6f054dd4d46 */
|
||||
0xd609bed1,
|
||||
0x7831,
|
||||
0x49fc,
|
||||
{0xbd, 0x49, 0xb6, 0xf0, 0x54, 0xdd, 0x4d, 0x46}
|
||||
SELECTANY const GUID JITEEVersionIdentifier = { /* 8b2226a2-ac30-4f5c-ae5c-926c792ecdb9 */
|
||||
0x8b2226a2,
|
||||
0xac30,
|
||||
0x4f5c,
|
||||
{ 0xae, 0x5c, 0x92, 0x6c, 0x79, 0x2e, 0xcd, 0xb9 }
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -232,12 +232,12 @@ SELECTANY const GUID JITEEVersionIdentifier = { /* d609bed1-7831-49fc-bd49-b6f05
|
|||
|
||||
// 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
|
||||
#define CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS 2
|
||||
#define CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_RETURN_IN_REGISTERS 2
|
||||
#define CLR_SYSTEMV_MAX_STRUCT_BYTES_TO_PASS_IN_REGISTERS 16
|
||||
|
||||
// System V struct passing
|
||||
// The Classification types are described in the ABI spec at http://www.x86-64.org/documentation/abi.pdf
|
||||
// The Classification types are described in the ABI spec at https://software.intel.com/sites/default/files/article/402129/mpx-linux64-abi.pdf
|
||||
enum SystemVClassificationType : unsigned __int8
|
||||
{
|
||||
SystemVClassificationTypeUnknown = 0,
|
||||
|
@ -252,20 +252,6 @@ enum SystemVClassificationType : unsigned __int8
|
|||
// SystemVClassificationTypeX87 = Unused, // Not supported by the CLR.
|
||||
// SystemVClassificationTypeX87Up = Unused, // Not supported by the CLR.
|
||||
// SystemVClassificationTypeComplexX87 = Unused, // Not supported by the CLR.
|
||||
|
||||
// Internal flags - never returned outside of the classification implementation.
|
||||
|
||||
// This value represents a very special type with two eightbytes.
|
||||
// First ByRef, second Integer (platform int).
|
||||
// The VM has a special Elem type for this type - ELEMENT_TYPE_TYPEDBYREF.
|
||||
// This is the classification counterpart for that element type. It is used to detect
|
||||
// the special TypedReference type and specialize its classification.
|
||||
// This type is represented as a struct with two fields. The classification needs to do
|
||||
// special handling of it since the source/methadata type of the fieds is IntPtr.
|
||||
// The VM changes the first to ByRef. The second is left as IntPtr (TYP_I_IMPL really). The classification needs to match this and
|
||||
// special handling is warranted (similar thing is done in the getGCLayout function for this type).
|
||||
SystemVClassificationTypeTypedReference = 8,
|
||||
SystemVClassificationTypeMAX = 9,
|
||||
};
|
||||
|
||||
// Represents classification information for a struct.
|
||||
|
@ -311,7 +297,7 @@ struct SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR
|
|||
//
|
||||
// Return value:
|
||||
// returns true if we the eightbyte at index slotIndex is of integral type.
|
||||
//
|
||||
//
|
||||
|
||||
bool IsIntegralSlot(unsigned slotIndex) const
|
||||
{
|
||||
|
@ -328,8 +314,8 @@ struct SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR
|
|||
//
|
||||
// Return value:
|
||||
// returns true if we the eightbyte at index slotIndex is of SSE type.
|
||||
//
|
||||
// Follows the rules of the AMD64 System V ABI specification at www.x86-64.org/documentation/abi.pdf.
|
||||
//
|
||||
// Follows the rules of the AMD64 System V ABI specification at https://software.intel.com/sites/default/files/article/402129/mpx-linux64-abi.pdf.
|
||||
// Please refer to it for definitions/examples.
|
||||
//
|
||||
bool IsSseSlot(unsigned slotIndex) const
|
||||
|
@ -352,6 +338,8 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
#include "corinfoinstructionset.h"
|
||||
|
||||
// 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.
|
||||
|
@ -394,10 +382,9 @@ enum CorInfoHelpFunc
|
|||
CORINFO_HELP_FLTROUND,
|
||||
CORINFO_HELP_DBLROUND,
|
||||
|
||||
/* Allocating a new object. Always use ICorClassInfo::getNewHelper() to decide
|
||||
/* Allocating a new object. Always use ICorClassInfo::getNewHelper() to decide
|
||||
which is the right helper to use to allocate an object of a given type. */
|
||||
|
||||
CORINFO_HELP_NEW_CROSSCONTEXT, // cross context new object
|
||||
CORINFO_HELP_NEWFAST,
|
||||
CORINFO_HELP_NEWSFAST, // allocator for small, non-finalizer, non-array object
|
||||
CORINFO_HELP_NEWSFAST_FINALIZE, // allocator for small, finalizable, non-array object
|
||||
|
@ -407,7 +394,6 @@ enum CorInfoHelpFunc
|
|||
CORINFO_HELP_NEW_MDARR, // multi-dim array helper (with or without lower bounds - dimensions passed in as vararg)
|
||||
CORINFO_HELP_NEW_MDARR_NONVARARG,// multi-dim array helper (with or without lower bounds - dimensions passed in as unmanaged array)
|
||||
CORINFO_HELP_NEWARR_1_DIRECT, // helper for any one dimensional array creation
|
||||
CORINFO_HELP_NEWARR_1_R2R_DIRECT, // wrapper for R2R direct call, which extracts method table from ArrayTypeDesc
|
||||
CORINFO_HELP_NEWARR_1_OBJ, // optimized 1-D object arrays
|
||||
CORINFO_HELP_NEWARR_1_VC, // optimized 1-D value class arrays
|
||||
CORINFO_HELP_NEWARR_1_ALIGN8, // like VC, but aligns the array start
|
||||
|
@ -432,7 +418,7 @@ enum CorInfoHelpFunc
|
|||
CORINFO_HELP_CHKCASTARRAY,
|
||||
CORINFO_HELP_CHKCASTCLASS,
|
||||
CORINFO_HELP_CHKCASTANY,
|
||||
CORINFO_HELP_CHKCASTCLASS_SPECIAL, // Optimized helper for classes. Assumes that the trivial cases
|
||||
CORINFO_HELP_CHKCASTCLASS_SPECIAL, // Optimized helper for classes. Assumes that the trivial cases
|
||||
// has been taken care of by the inlined check
|
||||
|
||||
CORINFO_HELP_BOX,
|
||||
|
@ -473,24 +459,9 @@ enum CorInfoHelpFunc
|
|||
CORINFO_HELP_MON_EXIT_STATIC,
|
||||
|
||||
CORINFO_HELP_GETCLASSFROMMETHODPARAM, // Given a generics method handle, returns a class handle
|
||||
CORINFO_HELP_GETSYNCFROMCLASSHANDLE, // Given a generics class handle, returns the sync monitor
|
||||
CORINFO_HELP_GETSYNCFROMCLASSHANDLE, // Given a generics class handle, returns the sync monitor
|
||||
// in its ManagedClassObject
|
||||
|
||||
/* Security callout support */
|
||||
|
||||
CORINFO_HELP_SECURITY_PROLOG, // Required if CORINFO_FLG_SECURITYCHECK is set, or CORINFO_FLG_NOSECURITYWRAP is not set
|
||||
CORINFO_HELP_SECURITY_PROLOG_FRAMED, // Slow version of CORINFO_HELP_SECURITY_PROLOG. Used for instrumentation.
|
||||
|
||||
CORINFO_HELP_METHOD_ACCESS_CHECK, // Callouts to runtime security access checks
|
||||
CORINFO_HELP_FIELD_ACCESS_CHECK,
|
||||
CORINFO_HELP_CLASS_ACCESS_CHECK,
|
||||
|
||||
CORINFO_HELP_DELEGATE_SECURITY_CHECK, // Callout to delegate security transparency check
|
||||
|
||||
/* Verification runtime callout support */
|
||||
|
||||
CORINFO_HELP_VERIFICATION_RUNTIME_CHECK, // Do a Demand for UnmanagedCode permission at runtime
|
||||
|
||||
/* GC support */
|
||||
|
||||
CORINFO_HELP_STOP_FOR_GC, // Call GC (force a GC)
|
||||
|
@ -535,7 +506,7 @@ enum CorInfoHelpFunc
|
|||
CORINFO_HELP_GETSTATICFIELDADDR_CONTEXT, // Helper for context-static fields
|
||||
CORINFO_HELP_GETSTATICFIELDADDR_TLS, // Helper for PE TLS fields
|
||||
|
||||
// There are a variety of specialized helpers for accessing static fields. The JIT should use
|
||||
// There are a variety of specialized helpers for accessing static fields. The JIT should use
|
||||
// ICorClassInfo::getSharedStaticsOrCCtorHelper to determine which helper to use
|
||||
|
||||
// Helpers for regular statics
|
||||
|
@ -567,7 +538,7 @@ enum CorInfoHelpFunc
|
|||
/* Profiling enter/leave probe addresses */
|
||||
CORINFO_HELP_PROF_FCN_ENTER, // record the entry to a method (caller)
|
||||
CORINFO_HELP_PROF_FCN_LEAVE, // record the completion of current method (caller)
|
||||
CORINFO_HELP_PROF_FCN_TAILCALL, // record the completionof current method through tailcall (caller)
|
||||
CORINFO_HELP_PROF_FCN_TAILCALL, // record the completion of current method through tailcall (caller)
|
||||
|
||||
/* Miscellaneous */
|
||||
|
||||
|
@ -575,7 +546,7 @@ enum CorInfoHelpFunc
|
|||
|
||||
CORINFO_HELP_PINVOKE_CALLI, // Indirect pinvoke call
|
||||
CORINFO_HELP_TAILCALL, // Perform a tail call
|
||||
|
||||
|
||||
CORINFO_HELP_GETCURRENTMANAGEDTHREADID,
|
||||
|
||||
CORINFO_HELP_INIT_PINVOKE_FRAME, // initialize an inlined PInvoke Frame for the JIT-compiler
|
||||
|
@ -658,7 +629,11 @@ enum CorInfoHelpFunc
|
|||
CORINFO_HELP_JIT_REVERSE_PINVOKE_ENTER, // Transition to cooperative mode in reverse P/Invoke prolog, frame is the first argument
|
||||
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
|
||||
CORINFO_HELP_GVMLOOKUP_FOR_SLOT, // Resolve a generic virtual method target from this pointer and runtime method handle
|
||||
|
||||
CORINFO_HELP_STACK_PROBE, // Probes each page of the allocated stack frame
|
||||
|
||||
CORINFO_HELP_PATCHPOINT, // Notify runtime that code has reached a patchpoint
|
||||
|
||||
CORINFO_HELP_COUNT,
|
||||
};
|
||||
|
@ -725,7 +700,7 @@ enum CorInfoType
|
|||
enum CorInfoTypeWithMod
|
||||
{
|
||||
CORINFO_TYPE_MASK = 0x3F, // lower 6 bits are type mask
|
||||
CORINFO_TYPE_MOD_PINNED = 0x40, // can be applied to CLASS, or BYREF to indiate pinned
|
||||
CORINFO_TYPE_MOD_PINNED = 0x40, // can be applied to CLASS, or BYREF to indicate pinned
|
||||
};
|
||||
|
||||
inline CorInfoType strip(CorInfoTypeWithMod val) {
|
||||
|
@ -827,13 +802,14 @@ enum CorInfoFlag
|
|||
CORINFO_FLG_SHAREDINST = 0x00020000, // the code for this method is shared between different generic instantiations (also set on classes/types)
|
||||
CORINFO_FLG_DELEGATE_INVOKE = 0x00040000, // "Delegate
|
||||
CORINFO_FLG_PINVOKE = 0x00080000, // Is a P/Invoke call
|
||||
CORINFO_FLG_SECURITYCHECK = 0x00100000, // Is one of the security routines that does a stackwalk (e.g. Assert, Demand)
|
||||
// CORINFO_FLG_UNUSED = 0x00100000,
|
||||
CORINFO_FLG_NOGCCHECK = 0x00200000, // This method is FCALL that has no GC check. Don't put alone in loops
|
||||
CORINFO_FLG_INTRINSIC = 0x00400000, // This method MAY have an intrinsic ID
|
||||
CORINFO_FLG_CONSTRUCTOR = 0x00800000, // This method is an instance or type initializer
|
||||
CORINFO_FLG_AGGRESSIVE_OPT = 0x01000000, // The method may contain hot code and should be aggressively optimized if possible
|
||||
CORINFO_FLG_DISABLE_TIER0_FOR_LOOPS = 0x02000000, // Indicates that tier 0 JIT should not be used for a method that contains a loop
|
||||
CORINFO_FLG_NOSECURITYWRAP = 0x04000000, // The method requires no security checks
|
||||
// CORINFO_FLG_UNUSED = 0x04000000,
|
||||
// CORINFO_FLG_UNUSED = 0x08000000,
|
||||
CORINFO_FLG_DONT_INLINE = 0x10000000, // The method should not be inlined
|
||||
CORINFO_FLG_DONT_INLINE_CALLER = 0x20000000, // The method should not be inlined, nor should its callers. It cannot be tail called.
|
||||
CORINFO_FLG_JIT_INTRINSIC = 0x40000000, // Method is a potential jit intrinsic; verify identity by name check
|
||||
|
@ -846,11 +822,11 @@ enum CorInfoFlag
|
|||
CORINFO_FLG_ARRAY = 0x00080000, // class is an array class (initialized differently)
|
||||
CORINFO_FLG_OVERLAPPING_FIELDS = 0x00100000, // struct or class has fields that overlap (aka union)
|
||||
CORINFO_FLG_INTERFACE = 0x00200000, // it is an interface
|
||||
CORINFO_FLG_CONTEXTFUL = 0x00400000, // is this a contextful class?
|
||||
// unused = 0x00400000,
|
||||
CORINFO_FLG_CUSTOMLAYOUT = 0x00800000, // does this struct have custom layout?
|
||||
CORINFO_FLG_CONTAINS_GC_PTR = 0x01000000, // does the class contain a gc ptr ?
|
||||
CORINFO_FLG_DELEGATE = 0x02000000, // is this a subclass of delegate or multicast delegate ?
|
||||
CORINFO_FLG_MARSHAL_BYREF = 0x04000000, // is this a subclass of MarshalByRef ?
|
||||
// CORINFO_FLG_UNUSED = 0x04000000,
|
||||
CORINFO_FLG_CONTAINS_STACK_PTR = 0x08000000, // This class has a stack pointer inside it
|
||||
CORINFO_FLG_VARIANCE = 0x10000000, // MethodTable::HasVariance (sealed does *not* mean uncast-able)
|
||||
CORINFO_FLG_BEFOREFIELDINIT = 0x20000000, // Additional flexibility for when to run .cctor (see code:#ClassConstructionFlags)
|
||||
|
@ -862,8 +838,8 @@ enum CorInfoFlag
|
|||
enum CorInfoMethodRuntimeFlags
|
||||
{
|
||||
CORINFO_FLG_BAD_INLINEE = 0x00000001, // The method is not suitable for inlining
|
||||
CORINFO_FLG_VERIFIABLE = 0x00000002, // The method has verifiable code
|
||||
CORINFO_FLG_UNVERIFIABLE = 0x00000004, // The method has unverifiable code
|
||||
// unused = 0x00000002,
|
||||
// unused = 0x00000004,
|
||||
CORINFO_FLG_SWITCHED_TO_MIN_OPT = 0x00000008, // The JIT decided to switch to MinOpt for this method, when it was not requested
|
||||
CORINFO_FLG_SWITCHED_TO_OPTIMIZED = 0x00000010, // The JIT decided to switch to tier 1 for this method, when a different tier was requested
|
||||
};
|
||||
|
@ -873,7 +849,7 @@ enum CORINFO_ACCESS_FLAGS
|
|||
{
|
||||
CORINFO_ACCESS_ANY = 0x0000, // Normal access
|
||||
CORINFO_ACCESS_THIS = 0x0001, // Accessed via the this reference
|
||||
CORINFO_ACCESS_UNWRAP = 0x0002, // Accessed via an unwrap reference
|
||||
// UNUSED = 0x0002,
|
||||
|
||||
CORINFO_ACCESS_NONNULL = 0x0004, // Instance is guaranteed non-null
|
||||
|
||||
|
@ -961,6 +937,7 @@ enum CorInfoIntrinsics
|
|||
CORINFO_INTRINSIC_StubHelpers_GetStubContext,
|
||||
CORINFO_INTRINSIC_StubHelpers_GetStubContextAddr,
|
||||
CORINFO_INTRINSIC_StubHelpers_GetNDirectTarget,
|
||||
CORINFO_INTRINSIC_StubHelpers_NextCallReturnAddress,
|
||||
CORINFO_INTRINSIC_InterlockedAdd32,
|
||||
CORINFO_INTRINSIC_InterlockedAdd64,
|
||||
CORINFO_INTRINSIC_InterlockedXAdd32,
|
||||
|
@ -970,6 +947,7 @@ enum CorInfoIntrinsics
|
|||
CORINFO_INTRINSIC_InterlockedCmpXchg32,
|
||||
CORINFO_INTRINSIC_InterlockedCmpXchg64,
|
||||
CORINFO_INTRINSIC_MemoryBarrier,
|
||||
CORINFO_INTRINSIC_MemoryBarrierLoad,
|
||||
CORINFO_INTRINSIC_GetCurrentManagedThread,
|
||||
CORINFO_INTRINSIC_GetManagedThreadId,
|
||||
CORINFO_INTRINSIC_ByReference_Ctor,
|
||||
|
@ -1055,26 +1033,15 @@ enum CorInfoTailCall
|
|||
TAILCALL_FAIL = -1, // Couldn't do a tail call
|
||||
};
|
||||
|
||||
enum CorInfoCanSkipVerificationResult
|
||||
{
|
||||
CORINFO_VERIFICATION_CANNOT_SKIP = 0, // Cannot skip verification during jit time.
|
||||
CORINFO_VERIFICATION_CAN_SKIP = 1, // Can skip verification during jit time.
|
||||
CORINFO_VERIFICATION_RUNTIME_CHECK = 2, // Cannot skip verification during jit time,
|
||||
// but need to insert a callout to the VM to ask during runtime
|
||||
// whether to raise a verification or not (if the method is unverifiable).
|
||||
CORINFO_VERIFICATION_DONT_JIT = 3, // Cannot skip verification during jit time,
|
||||
// but do not jit the method if is is unverifiable.
|
||||
};
|
||||
|
||||
enum CorInfoInitClassResult
|
||||
{
|
||||
CORINFO_INITCLASS_NOT_REQUIRED = 0x00, // No class initialization required, but the class is not actually initialized yet
|
||||
CORINFO_INITCLASS_NOT_REQUIRED = 0x00, // No class initialization required, but the class is not actually initialized yet
|
||||
// (e.g. we are guaranteed to run the static constructor in method prolog)
|
||||
CORINFO_INITCLASS_INITIALIZED = 0x01, // Class initialized
|
||||
CORINFO_INITCLASS_SPECULATIVE = 0x02, // Class may be initialized speculatively
|
||||
CORINFO_INITCLASS_USE_HELPER = 0x04, // The JIT must insert class initialization helper call.
|
||||
CORINFO_INITCLASS_DONT_INLINE = 0x08, // The JIT should not inline the method requesting the class initialization. The class
|
||||
// initialization requires helper class now, but will not require initialization
|
||||
CORINFO_INITCLASS_DONT_INLINE = 0x08, // The JIT should not inline the method requesting the class initialization. The class
|
||||
// initialization requires helper class now, but will not require initialization
|
||||
// if the method is compiled standalone. Or the method cannot be inlined due to some
|
||||
// requirement around class initialization such as shared generics.
|
||||
};
|
||||
|
@ -1109,39 +1076,15 @@ enum CorInfoIndirectCallReason
|
|||
CORINFO_INDIRECT_CALL_COUNT
|
||||
};
|
||||
|
||||
// This is for use when the JIT is compiling an instantiation
|
||||
// of generic code. The JIT needs to know if the generic code itself
|
||||
// (which can be verified once and for all independently of the
|
||||
// instantiations) passed verification.
|
||||
enum CorInfoInstantiationVerification
|
||||
{
|
||||
// The method is NOT a concrete instantiation (eg. List<int>.Add()) of a method
|
||||
// in a generic class or a generic method. It is either the typical instantiation
|
||||
// (eg. List<T>.Add()) or entirely non-generic.
|
||||
INSTVER_NOT_INSTANTIATION = 0,
|
||||
|
||||
// The method is an instantiation of a method in a generic class or a generic method,
|
||||
// and the generic class was successfully verified
|
||||
INSTVER_GENERIC_PASSED_VERIFICATION = 1,
|
||||
|
||||
// The method is an instantiation of a method in a generic class or a generic method,
|
||||
// and the generic class failed verification
|
||||
INSTVER_GENERIC_FAILED_VERIFICATION = 2,
|
||||
};
|
||||
|
||||
// When using CORINFO_HELPER_TAILCALL, the JIT needs to pass certain special
|
||||
// calling convention/argument passing/handling details to the helper
|
||||
enum CorInfoHelperTailCallSpecialHandling
|
||||
{
|
||||
CORINFO_TAILCALL_NORMAL = 0x00000000,
|
||||
CORINFO_TAILCALL_STUB_DISPATCH_ARG = 0x00000001,
|
||||
};
|
||||
|
||||
|
||||
inline bool dontInline(CorInfoInline val) {
|
||||
return(val < 0);
|
||||
}
|
||||
|
||||
// Patchpoint info is passed back and forth across the interface
|
||||
// but is opaque.
|
||||
|
||||
struct PatchpointInfo;
|
||||
|
||||
// Cookie types consumed by the code generator (these are opaque values
|
||||
// not inspected by the code generator):
|
||||
|
||||
|
@ -1162,14 +1105,14 @@ typedef struct CORINFO_VarArgInfo * CORINFO_VARARGS_HANDLE;
|
|||
// Generic tokens are resolved with respect to a context, which is usually the method
|
||||
// being compiled. The CORINFO_CONTEXT_HANDLE indicates which exact instantiation
|
||||
// (or the open instantiation) is being referred to.
|
||||
// CORINFO_CONTEXT_HANDLE is more tightly scoped than CORINFO_MODULE_HANDLE. For cases
|
||||
// CORINFO_CONTEXT_HANDLE is more tightly scoped than CORINFO_MODULE_HANDLE. For cases
|
||||
// where the exact instantiation does not matter, CORINFO_MODULE_HANDLE is used.
|
||||
typedef CORINFO_METHOD_HANDLE CORINFO_CONTEXT_HANDLE;
|
||||
|
||||
typedef struct CORINFO_DEPENDENCY_STRUCT_
|
||||
{
|
||||
CORINFO_MODULE_HANDLE moduleFrom;
|
||||
CORINFO_MODULE_HANDLE moduleTo;
|
||||
CORINFO_MODULE_HANDLE moduleTo;
|
||||
} CORINFO_DEPENDENCY;
|
||||
|
||||
// Bit-twiddling of contexts assumes word-alignment of method handles and type handles
|
||||
|
@ -1186,8 +1129,10 @@ enum CorInfoContextFlags
|
|||
|
||||
enum CorInfoSigInfoFlags
|
||||
{
|
||||
CORINFO_SIGFLAG_IS_LOCAL_SIG = 0x01,
|
||||
CORINFO_SIGFLAG_IL_STUB = 0x02,
|
||||
CORINFO_SIGFLAG_IS_LOCAL_SIG = 0x01,
|
||||
CORINFO_SIGFLAG_IL_STUB = 0x02,
|
||||
CORINFO_SIGFLAG_SUPPRESS_GC_TRANSITION = 0x04,
|
||||
CORINFO_SIGFLAG_FAT_CALL = 0x08,
|
||||
};
|
||||
|
||||
struct CORINFO_SIG_INST
|
||||
|
@ -1289,7 +1234,7 @@ struct CORINFO_METHOD_INFO
|
|||
struct CORINFO_CONST_LOOKUP
|
||||
{
|
||||
// If the handle is obtained at compile-time, then this handle is the "exact" handle (class, method, or field)
|
||||
// Otherwise, it's a representative...
|
||||
// Otherwise, it's a representative...
|
||||
// If accessType is
|
||||
// IAT_VALUE --> "handle" stores the real handle or "addr " stores the computed address
|
||||
// IAT_PVALUE --> "addr" stores a pointer to a location which will hold the real handle
|
||||
|
@ -1332,6 +1277,7 @@ struct CORINFO_LOOKUP_KIND
|
|||
//
|
||||
#define CORINFO_MAXINDIRECTIONS 4
|
||||
#define CORINFO_USEHELPER ((WORD) 0xffff)
|
||||
#define CORINFO_NO_SIZE_CHECK ((WORD) 0xffff)
|
||||
|
||||
struct CORINFO_RUNTIME_LOOKUP
|
||||
{
|
||||
|
@ -1354,6 +1300,7 @@ struct CORINFO_RUNTIME_LOOKUP
|
|||
// If set, test the lowest bit and dereference if set (see code:FixupPointer)
|
||||
bool testForFixup;
|
||||
|
||||
WORD sizeOffset;
|
||||
SIZE_T offsets[CORINFO_MAXINDIRECTIONS];
|
||||
|
||||
// If set, first offset is indirect.
|
||||
|
@ -1525,7 +1472,7 @@ struct CORINFO_HELPER_DESC
|
|||
// thisTransform and constraint calls
|
||||
// ----------------------------------
|
||||
//
|
||||
// For evertyhing besides "constrained." calls "thisTransform" is set to
|
||||
// For everything besides "constrained." calls "thisTransform" is set to
|
||||
// CORINFO_NO_THIS_TRANSFORM.
|
||||
//
|
||||
// For "constrained." calls the EE attempts to resolve the call at compile
|
||||
|
@ -1586,12 +1533,11 @@ enum CorInfoIsAccessAllowedResult
|
|||
{
|
||||
CORINFO_ACCESS_ALLOWED = 0, // Call allowed
|
||||
CORINFO_ACCESS_ILLEGAL = 1, // Call not allowed
|
||||
CORINFO_ACCESS_RUNTIME_CHECK = 2, // Ask at runtime whether to allow the call or not
|
||||
};
|
||||
|
||||
|
||||
// This enum is used for JIT to tell EE where this token comes from.
|
||||
// E.g. Depending on different opcodes, we might allow/disallow certain types of tokens or
|
||||
// E.g. Depending on different opcodes, we might allow/disallow certain types of tokens or
|
||||
// return different types of handles (e.g. boxed vs. regular entrypoints)
|
||||
enum CorInfoTokenKind
|
||||
{
|
||||
|
@ -1633,10 +1579,10 @@ struct CORINFO_RESOLVED_TOKEN
|
|||
CorInfoTokenKind tokenType;
|
||||
|
||||
//
|
||||
// [Out] arguments of resolveToken.
|
||||
// [Out] arguments of resolveToken.
|
||||
// - Type handle is always non-NULL.
|
||||
// - At most one of method and field handles is non-NULL (according to the token type).
|
||||
// - Method handle is an instantiating stub only for generic methods. Type handle
|
||||
// - Method handle is an instantiating stub only for generic methods. Type handle
|
||||
// is required to provide the full context for methods in generic types.
|
||||
//
|
||||
CORINFO_CLASS_HANDLE hClass;
|
||||
|
@ -1659,7 +1605,7 @@ struct CORINFO_CALL_INFO
|
|||
|
||||
unsigned classFlags; //flags for CORINFO_RESOLVED_TOKEN::hClass
|
||||
|
||||
CORINFO_SIG_INFO sig;
|
||||
CORINFO_SIG_INFO sig;
|
||||
|
||||
//Verification information
|
||||
unsigned verMethodFlags; // flags for CORINFO_RESOLVED_TOKEN::hMethod
|
||||
|
@ -1673,8 +1619,6 @@ struct CORINFO_CALL_INFO
|
|||
// JIT may either insert the callsiteCalloutHelper into the code (as per a verification error) or
|
||||
// call throwExceptionFromHelper on the callsiteCalloutHelper. In this case callsiteCalloutHelper
|
||||
// is guaranteed not to return.
|
||||
// - CORINFO_ACCESS_RUNTIME_CHECK - The jit must insert the callsiteCalloutHelper at the call site.
|
||||
// the helper may return
|
||||
CorInfoIsAccessAllowedResult accessAllowed;
|
||||
CORINFO_HELPER_DESC callsiteCalloutHelper;
|
||||
|
||||
|
@ -1699,7 +1643,7 @@ struct CORINFO_CALL_INFO
|
|||
|
||||
CORINFO_CONST_LOOKUP instParamLookup; // Used by Ready-to-Run
|
||||
|
||||
BOOL secureDelegateInvoke;
|
||||
BOOL wrapperDelegateInvoke;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -1778,7 +1722,7 @@ struct CORINFO_EH_CLAUSE
|
|||
enum CORINFO_OS
|
||||
{
|
||||
CORINFO_WINNT,
|
||||
CORINFO_PAL,
|
||||
CORINFO_UNIX,
|
||||
};
|
||||
|
||||
struct CORINFO_CPU
|
||||
|
@ -1826,15 +1770,8 @@ struct CORINFO_EE_INFO
|
|||
unsigned offsetOfDelegateInstance;
|
||||
unsigned offsetOfDelegateFirstTarget;
|
||||
|
||||
// Secure delegate offsets
|
||||
unsigned offsetOfSecureDelegateIndirectCell;
|
||||
|
||||
// Remoting offsets
|
||||
unsigned offsetOfTransparentProxyRP;
|
||||
unsigned offsetOfRealProxyServer;
|
||||
|
||||
// Array offsets
|
||||
unsigned offsetOfObjArrayData;
|
||||
// Wrapper delegate offsets
|
||||
unsigned offsetOfWrapperDelegateIndirectCell;
|
||||
|
||||
// Reverse PInvoke offsets
|
||||
unsigned sizeOfReversePInvokeFrame;
|
||||
|
@ -1850,12 +1787,33 @@ struct CORINFO_EE_INFO
|
|||
CORINFO_RUNTIME_ABI targetAbi;
|
||||
|
||||
CORINFO_OS osType;
|
||||
unsigned osMajor;
|
||||
unsigned osMinor;
|
||||
unsigned osBuild;
|
||||
};
|
||||
|
||||
// This is used to indicate that a finally has been called
|
||||
// Flags passed from JIT to runtime.
|
||||
enum CORINFO_GET_TAILCALL_HELPERS_FLAGS
|
||||
{
|
||||
// The callsite is a callvirt instruction.
|
||||
CORINFO_TAILCALL_IS_CALLVIRT = 0x00000001,
|
||||
CORINFO_TAILCALL_THIS_ARG_IS_BYREF = 0x00000002,
|
||||
};
|
||||
|
||||
// Flags passed from runtime to JIT.
|
||||
enum CORINFO_TAILCALL_HELPERS_FLAGS
|
||||
{
|
||||
// The StoreArgs stub needs to be passed the target function pointer as the
|
||||
// first argument.
|
||||
CORINFO_TAILCALL_STORE_TARGET = 0x00000001,
|
||||
};
|
||||
|
||||
struct CORINFO_TAILCALL_HELPERS
|
||||
{
|
||||
CORINFO_TAILCALL_HELPERS_FLAGS flags;
|
||||
CORINFO_METHOD_HANDLE hStoreArgs;
|
||||
CORINFO_METHOD_HANDLE hCallTarget;
|
||||
CORINFO_METHOD_HANDLE hDispatcher;
|
||||
};
|
||||
|
||||
// This is used to indicate that a finally has been called
|
||||
// "locally" by the try block
|
||||
enum { LCL_FINALLY_MARK = 0xFC }; // FC = "Finally Call"
|
||||
|
||||
|
@ -1876,15 +1834,15 @@ struct CORINFO_Object
|
|||
struct CORINFO_String : public CORINFO_Object
|
||||
{
|
||||
unsigned stringLen;
|
||||
wchar_t chars[1]; // actually of variable size
|
||||
WCHAR chars[1]; // actually of variable size
|
||||
};
|
||||
|
||||
struct CORINFO_Array : public CORINFO_Object
|
||||
{
|
||||
unsigned length;
|
||||
#ifdef _WIN64
|
||||
#ifdef HOST_64BIT
|
||||
unsigned alignpad;
|
||||
#endif // _WIN64
|
||||
#endif // HOST_64BIT
|
||||
|
||||
#if 0
|
||||
/* Multi-dimensional arrays have the lengths and bounds here */
|
||||
|
@ -1908,9 +1866,9 @@ struct CORINFO_Array : public CORINFO_Object
|
|||
struct CORINFO_Array8 : public CORINFO_Object
|
||||
{
|
||||
unsigned length;
|
||||
#ifdef _WIN64
|
||||
#ifdef HOST_64BIT
|
||||
unsigned alignpad;
|
||||
#endif // _WIN64
|
||||
#endif // HOST_64BIT
|
||||
|
||||
union
|
||||
{
|
||||
|
@ -1925,9 +1883,9 @@ struct CORINFO_Array8 : public CORINFO_Object
|
|||
struct CORINFO_RefArray : public CORINFO_Object
|
||||
{
|
||||
unsigned length;
|
||||
#ifdef _WIN64
|
||||
#ifdef HOST_64BIT
|
||||
unsigned alignpad;
|
||||
#endif // _WIN64
|
||||
#endif // HOST_64BIT
|
||||
|
||||
#if 0
|
||||
/* Multi-dimensional arrays have the lengths and bounds here */
|
||||
|
@ -1956,7 +1914,7 @@ struct CORINFO_VarArgInfo
|
|||
#define SIZEOF__CORINFO_Object TARGET_POINTER_SIZE /* methTable */
|
||||
|
||||
#define OFFSETOF__CORINFO_Array__length SIZEOF__CORINFO_Object
|
||||
#ifdef _TARGET_64BIT_
|
||||
#ifdef TARGET_64BIT
|
||||
#define OFFSETOF__CORINFO_Array__data (OFFSETOF__CORINFO_Array__length + sizeof(unsigned __int32) /* length */ + sizeof(unsigned __int32) /* alignpad */)
|
||||
#else
|
||||
#define OFFSETOF__CORINFO_Array__data (OFFSETOF__CORINFO_Array__length + sizeof(unsigned __int32) /* length */)
|
||||
|
@ -1968,12 +1926,6 @@ struct CORINFO_VarArgInfo
|
|||
#define OFFSETOF__CORINFO_String__stringLen SIZEOF__CORINFO_Object
|
||||
#define OFFSETOF__CORINFO_String__chars (OFFSETOF__CORINFO_String__stringLen + sizeof(unsigned __int32) /* stringLen */)
|
||||
|
||||
enum CorInfoSecurityRuntimeChecks
|
||||
{
|
||||
CORINFO_ACCESS_SECURITY_NONE = 0,
|
||||
CORINFO_ACCESS_SECURITY_TRANSPARENCY = 0x0001 // check that transparency rules are enforced between the caller and callee
|
||||
};
|
||||
|
||||
|
||||
/* data to optimize delegate construction */
|
||||
struct DelegateCtorArgs
|
||||
|
@ -2008,9 +1960,9 @@ enum class TypeCompareState
|
|||
};
|
||||
|
||||
//
|
||||
// This interface is logically split into sections for each class of information
|
||||
// This interface is logically split into sections for each class of information
|
||||
// (ICorMethodInfo, ICorModuleInfo, etc.). This split used to exist physically as well
|
||||
// using virtual inheritance, but was eliminated to improve efficiency of the JIT-EE
|
||||
// using virtual inheritance, but was eliminated to improve efficiency of the JIT-EE
|
||||
// interface calls.
|
||||
//
|
||||
class ICorStaticInfo
|
||||
|
@ -2022,7 +1974,7 @@ public:
|
|||
//
|
||||
/**********************************************************************************/
|
||||
|
||||
// return flags (defined above, CORINFO_FLG_PUBLIC ...)
|
||||
// return flags (a bitfield of CorInfoFlags values)
|
||||
virtual DWORD getMethodAttribs (
|
||||
CORINFO_METHOD_HANDLE ftn /* IN */
|
||||
) = 0;
|
||||
|
@ -2152,8 +2104,8 @@ public:
|
|||
|
||||
// Given resolved token that corresponds to an intrinsic classified as
|
||||
// a CORINFO_INTRINSIC_GetRawHandle intrinsic, fetch the handle associated
|
||||
// with the token. If this is not possible at compile-time (because the current method's
|
||||
// code is shared and the token contains generic parameters) then indicate
|
||||
// with the token. If this is not possible at compile-time (because the current method's
|
||||
// code is shared and the token contains generic parameters) then indicate
|
||||
// how the handle should be looked up at runtime.
|
||||
virtual void expandRawHandleIntrinsic(
|
||||
CORINFO_RESOLVED_TOKEN * pResolvedToken,
|
||||
|
@ -2167,9 +2119,9 @@ public:
|
|||
bool* pMustExpand = NULL /* OUT */
|
||||
) = 0;
|
||||
|
||||
// Is the given module the System.Numerics.Vectors module?
|
||||
// Is the given type in System.Private.Corelib and marked with IntrinsicAttribute?
|
||||
// This defaults to false.
|
||||
virtual bool isInSIMDModule(
|
||||
virtual bool isIntrinsicType(
|
||||
CORINFO_CLASS_HANDLE classHnd
|
||||
) { return false; }
|
||||
|
||||
|
@ -2203,26 +2155,6 @@ public:
|
|||
BOOL *pfIsOpenDelegate /* is the delegate open */
|
||||
) = 0;
|
||||
|
||||
// Indicates if the method is an instance of the generic
|
||||
// method that passes (or has passed) verification
|
||||
virtual CorInfoInstantiationVerification isInstantiationOfVerifiedGeneric (
|
||||
CORINFO_METHOD_HANDLE method /* IN */
|
||||
) = 0;
|
||||
|
||||
// Loads the constraints on a typical method definition, detecting cycles;
|
||||
// for use in verification.
|
||||
virtual void initConstraintsForVerification(
|
||||
CORINFO_METHOD_HANDLE method, /* IN */
|
||||
BOOL *pfHasCircularClassConstraints, /* OUT */
|
||||
BOOL *pfHasCircularMethodConstraint /* OUT */
|
||||
) = 0;
|
||||
|
||||
// Returns enum whether the method does not require verification
|
||||
// Also see ICorModuleInfo::canSkipVerification
|
||||
virtual CorInfoCanSkipVerificationResult canSkipMethodVerification (
|
||||
CORINFO_METHOD_HANDLE ftnHandle
|
||||
) = 0;
|
||||
|
||||
// load and restore the method
|
||||
virtual void methodMustBeLoadedBeforeCodeIsRun(
|
||||
CORINFO_METHOD_HANDLE method
|
||||
|
@ -2239,6 +2171,16 @@ public:
|
|||
GSCookie ** ppCookieVal // OUT
|
||||
) = 0;
|
||||
|
||||
// Provide patchpoint info for the method currently being jitted.
|
||||
virtual void setPatchpointInfo(
|
||||
PatchpointInfo* patchpointInfo
|
||||
) = 0;
|
||||
|
||||
// Get patchpoint info and il offset for the method currently being jitted.
|
||||
virtual PatchpointInfo* getOSRInfo(
|
||||
unsigned *ilOffset // [OUT] il offset of OSR entry point
|
||||
) = 0;
|
||||
|
||||
/**********************************************************************************/
|
||||
//
|
||||
// ICorModuleInfo
|
||||
|
@ -2277,21 +2219,6 @@ public:
|
|||
virtual CORINFO_CLASS_HANDLE getTokenTypeAsHandle (
|
||||
CORINFO_RESOLVED_TOKEN * pResolvedToken /* IN */) = 0;
|
||||
|
||||
// Returns true if the module does not require verification
|
||||
//
|
||||
// If fQuickCheckOnlyWithoutCommit=TRUE, the function only checks that the
|
||||
// module does not currently require verification in the current AppDomain.
|
||||
// This decision could change in the future, and so should not be cached.
|
||||
// If it is cached, it should only be used as a hint.
|
||||
// This is only used by ngen for calculating certain hints.
|
||||
//
|
||||
|
||||
// Returns enum whether the module does not require verification
|
||||
// Also see ICorMethodInfo::canSkipMethodVerification();
|
||||
virtual CorInfoCanSkipVerificationResult canSkipVerification (
|
||||
CORINFO_MODULE_HANDLE module /* IN */
|
||||
) = 0;
|
||||
|
||||
// Checks if the given metadata token is valid
|
||||
virtual BOOL isValidToken (
|
||||
CORINFO_MODULE_HANDLE module, /* IN */
|
||||
|
@ -2304,8 +2231,12 @@ public:
|
|||
unsigned metaTOK /* IN */
|
||||
) = 0;
|
||||
|
||||
virtual BOOL shouldEnforceCallvirtRestriction(
|
||||
CORINFO_MODULE_HANDLE scope
|
||||
// Returns string length and content (can be null for dynamic context)
|
||||
// for given metaTOK and module, length `-1` means input is incorrect
|
||||
virtual LPCWSTR getStringLiteral (
|
||||
CORINFO_MODULE_HANDLE module, /* IN */
|
||||
unsigned metaTOK, /* IN */
|
||||
int* length /* OUT */
|
||||
) = 0;
|
||||
|
||||
/**********************************************************************************/
|
||||
|
@ -2335,10 +2266,10 @@ public:
|
|||
// Return the type argument of the instantiated generic class,
|
||||
// which is specified by the index
|
||||
virtual CORINFO_CLASS_HANDLE getTypeInstantiationArgument(
|
||||
CORINFO_CLASS_HANDLE cls,
|
||||
CORINFO_CLASS_HANDLE cls,
|
||||
unsigned index
|
||||
) = 0;
|
||||
|
||||
|
||||
|
||||
// Append a (possibly truncated) representation of the type cls to the preallocated buffer ppBuf of length pnBufLen
|
||||
// If fNamespace=TRUE, include the namespace/enclosing classes
|
||||
|
@ -2346,7 +2277,7 @@ public:
|
|||
// If fAssembly=TRUE, suffix with a comma and the full assembly qualification
|
||||
// return size of representation
|
||||
virtual int appendClassName(
|
||||
__deref_inout_ecount(*pnBufLen) WCHAR** ppBuf,
|
||||
__deref_inout_ecount(*pnBufLen) WCHAR** ppBuf,
|
||||
int* pnBufLen,
|
||||
CORINFO_CLASS_HANDLE cls,
|
||||
BOOL fNamespace,
|
||||
|
@ -2362,17 +2293,13 @@ public:
|
|||
// GetTypeFromHandle(X) == GetTypeFromHandle(Y) (for CORINFO_INLINE_TYPECHECK_SOURCE_TOKEN)
|
||||
virtual CorInfoInlineTypeCheck canInlineTypeCheck(CORINFO_CLASS_HANDLE cls, CorInfoInlineTypeCheckSource source) = 0;
|
||||
|
||||
// If this method returns true, JIT will do optimization to inline the check for
|
||||
// GetTypeFromHandle(handle) == obj.GetType()
|
||||
virtual BOOL canInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE cls) = 0;
|
||||
|
||||
// return flags (defined above, CORINFO_FLG_PUBLIC ...)
|
||||
// return flags (a bitfield of CorInfoFlags values)
|
||||
virtual DWORD getClassAttribs (
|
||||
CORINFO_CLASS_HANDLE cls
|
||||
) = 0;
|
||||
|
||||
// Returns "TRUE" iff "cls" is a struct type such that return buffers used for returning a value
|
||||
// of this type must be stack-allocated. This will generally be true only if the struct
|
||||
// of this type must be stack-allocated. This will generally be true only if the struct
|
||||
// contains GC pointers, and does not exceed some size limit. Maintaining this as an invariant allows
|
||||
// an optimization: the JIT may assume that return buffer pointers for return types for which this predicate
|
||||
// returns TRUE are always stack allocated, and thus, that stores to the GC-pointer fields of such return
|
||||
|
@ -2401,8 +2328,8 @@ public:
|
|||
virtual void LongLifetimeFree(void* obj) = 0;
|
||||
|
||||
virtual size_t getClassModuleIdForStatics (
|
||||
CORINFO_CLASS_HANDLE cls,
|
||||
CORINFO_MODULE_HANDLE *pModule,
|
||||
CORINFO_CLASS_HANDLE cls,
|
||||
CORINFO_MODULE_HANDLE *pModule,
|
||||
void **ppIndirection
|
||||
) = 0;
|
||||
|
||||
|
@ -2478,10 +2405,6 @@ public:
|
|||
CORINFO_CLASS_HANDLE clsHnd
|
||||
) = 0;
|
||||
|
||||
virtual CorInfoHelpFunc getSecurityPrologHelper(
|
||||
CORINFO_METHOD_HANDLE ftn
|
||||
) = 0;
|
||||
|
||||
// This is not pretty. Boxing nullable<T> actually returns
|
||||
// a boxed<T> not a boxed Nullable<T>. This call allows the verifier
|
||||
// to call back to the EE on the 'box' instruction and get the transformed
|
||||
|
@ -2491,23 +2414,23 @@ public:
|
|||
) = 0;
|
||||
|
||||
// returns the correct box helper for a particular class. Note
|
||||
// that if this returns CORINFO_HELP_BOX, the JIT can assume
|
||||
// that if this returns CORINFO_HELP_BOX, the JIT can assume
|
||||
// 'standard' boxing (allocate object and copy), and optimize
|
||||
virtual CorInfoHelpFunc getBoxHelper(
|
||||
CORINFO_CLASS_HANDLE cls
|
||||
) = 0;
|
||||
|
||||
// returns the unbox helper. If 'helperCopies' points to a true
|
||||
// returns the unbox helper. If 'helperCopies' points to a true
|
||||
// value it means the JIT is requesting a helper that unboxes the
|
||||
// value into a particular location and thus has the signature
|
||||
// void unboxHelper(void* dest, CORINFO_CLASS_HANDLE cls, Object* obj)
|
||||
// Otherwise (it is null or points at a FALSE value) it is requesting
|
||||
// a helper that returns a pointer to the unboxed data
|
||||
// Otherwise (it is null or points at a FALSE value) it is requesting
|
||||
// a helper that returns a pointer to the unboxed data
|
||||
// void* unboxHelper(CORINFO_CLASS_HANDLE cls, Object* obj)
|
||||
// The EE has the option of NOT returning the copy style helper
|
||||
// (But must be able to always honor the non-copy style helper)
|
||||
// The EE set 'helperCopies' on return to indicate what kind of
|
||||
// helper has been created.
|
||||
// helper has been created.
|
||||
|
||||
virtual CorInfoHelpFunc getUnBoxHelper(
|
||||
CORINFO_CLASS_HANDLE cls
|
||||
|
@ -2531,7 +2454,7 @@ public:
|
|||
) = 0;
|
||||
|
||||
// This function tries to initialize the class (run the class constructor).
|
||||
// this function returns whether the JIT must insert helper calls before
|
||||
// this function returns whether the JIT must insert helper calls before
|
||||
// accessing static field or method.
|
||||
//
|
||||
// See code:ICorClassInfo#ClassConstruction.
|
||||
|
@ -2642,7 +2565,7 @@ public:
|
|||
CORINFO_CLASS_HANDLE cls
|
||||
) = 0;
|
||||
|
||||
// Get the numbmer of dimensions in an array
|
||||
// Get the numbmer of dimensions in an array
|
||||
virtual unsigned getArrayRank(
|
||||
CORINFO_CLASS_HANDLE cls
|
||||
) = 0;
|
||||
|
@ -2697,12 +2620,6 @@ public:
|
|||
CORINFO_FIELD_HANDLE field
|
||||
) = 0;
|
||||
|
||||
// TODO: jit64 should be switched to the same plan as the i386 jits - use
|
||||
// getClassGClayout to figure out the need for writebarrier helper, and inline the copying.
|
||||
// The interpretted value class copy is slow. Once this happens, USE_WRITE_BARRIER_HELPERS
|
||||
virtual bool isWriteBarrierHelperRequired(
|
||||
CORINFO_FIELD_HANDLE field) = 0;
|
||||
|
||||
virtual void getFieldInfo (CORINFO_RESOLVED_TOKEN * pResolvedToken,
|
||||
CORINFO_METHOD_HANDLE callerHandle,
|
||||
CORINFO_ACCESS_FLAGS flags,
|
||||
|
@ -2781,7 +2698,7 @@ public:
|
|||
// For eg, use this to allocated memory for reporting debug info,
|
||||
// which will be handed to the EE by setVars() and setBoundaries()
|
||||
virtual void * allocateArray(
|
||||
ULONG cBytes
|
||||
size_t cBytes
|
||||
) = 0;
|
||||
|
||||
// JitCompiler will free arrays passed by the EE using this
|
||||
|
@ -2916,7 +2833,7 @@ public:
|
|||
) = 0;
|
||||
|
||||
// Return method name as in metadata, or nullptr if there is none,
|
||||
// and optionally return the class, enclosing class, and namespace names
|
||||
// and optionally return the class, enclosing class, and namespace names
|
||||
// as in metadata.
|
||||
// Suitable for non-debugging use.
|
||||
virtual const char* getMethodNameFromMetadata(
|
||||
|
@ -3020,7 +2937,7 @@ public:
|
|||
void **ppIndirection = NULL
|
||||
) = 0;
|
||||
|
||||
// get slow lazy string literal helper to use (CORINFO_HELP_STRCNS*).
|
||||
// get slow lazy string literal helper to use (CORINFO_HELP_STRCNS*).
|
||||
// Returns CORINFO_HELP_UNDEF if lazy string literal helper cannot be used.
|
||||
virtual CorInfoHelpFunc getLazyStringLiteralHelper(
|
||||
CORINFO_MODULE_HANDLE handle
|
||||
|
@ -3065,24 +2982,9 @@ public:
|
|||
// CORINFO_LOOKUP_THISOBJ use vtable pointer of 'this' param
|
||||
// CORINFO_LOOKUP_CLASSPARAM use vtable hidden param
|
||||
// CORINFO_LOOKUP_METHODPARAM use enclosing type of method-desc hidden param
|
||||
virtual CORINFO_LOOKUP_KIND getLocationOfThisType(
|
||||
CORINFO_METHOD_HANDLE context
|
||||
) = 0;
|
||||
|
||||
// NOTE: the two methods below--getPInvokeUnmanagedTarget and getAddressOfPInvokeFixup--are
|
||||
// deprecated. New code should instead use getAddressOfPInvokeTarget, which subsumes the
|
||||
// functionality of these methods.
|
||||
|
||||
// return the unmanaged target *if method has already been prelinked.*
|
||||
virtual void* getPInvokeUnmanagedTarget(
|
||||
CORINFO_METHOD_HANDLE method,
|
||||
void **ppIndirection = NULL
|
||||
) = 0;
|
||||
|
||||
// return address of fixup area for late-bound PInvoke calls.
|
||||
virtual void* getAddressOfPInvokeFixup(
|
||||
CORINFO_METHOD_HANDLE method,
|
||||
void **ppIndirection = NULL
|
||||
virtual void getLocationOfThisType(
|
||||
CORINFO_METHOD_HANDLE context,
|
||||
CORINFO_LOOKUP_KIND* pLookupKind
|
||||
) = 0;
|
||||
|
||||
// return the address of the PInvoke target. May be a fixup area in the
|
||||
|
@ -3162,7 +3064,7 @@ public:
|
|||
// If pIsSpeculative is NULL, return the class handle for the value of ref-class typed
|
||||
// static readonly fields, if there is a unique location for the static and the class
|
||||
// is already initialized.
|
||||
//
|
||||
//
|
||||
// If pIsSpeculative is not NULL, fetch the class handle for the value of all ref-class
|
||||
// typed static fields, if there is a unique location for the static and the field is
|
||||
// not null.
|
||||
|
@ -3199,7 +3101,7 @@ public:
|
|||
) = 0;
|
||||
|
||||
// (static fields only) given that 'field' refers to thread local store,
|
||||
// return the ID (TLS index), which is used to find the begining of the
|
||||
// return the ID (TLS index), which is used to find the beginning of the
|
||||
// TLS data area for the particular DLL 'field' is associated with.
|
||||
virtual DWORD getFieldThreadLocalStoreID (
|
||||
CORINFO_FIELD_HANDLE field,
|
||||
|
@ -3230,17 +3132,31 @@ public:
|
|||
CORINFO_METHOD_HANDLE methHnd
|
||||
) = 0;
|
||||
|
||||
// return a thunk that will copy the arguments for the given signature.
|
||||
virtual void* getTailCallCopyArgsThunk (
|
||||
CORINFO_SIG_INFO *pSig,
|
||||
CorInfoHelperTailCallSpecialHandling flags
|
||||
) = 0;
|
||||
// Obtain tailcall help for the specified call site.
|
||||
virtual bool getTailCallHelpers(
|
||||
|
||||
// The resolved token for the call. Can be null for calli.
|
||||
CORINFO_RESOLVED_TOKEN* callToken,
|
||||
|
||||
// The signature at the callsite.
|
||||
CORINFO_SIG_INFO* sig,
|
||||
|
||||
// Flags for the tailcall site.
|
||||
CORINFO_GET_TAILCALL_HELPERS_FLAGS flags,
|
||||
|
||||
// The resulting help.
|
||||
CORINFO_TAILCALL_HELPERS* pResult) = 0;
|
||||
|
||||
// Optionally, convert calli to regular method call. This is for PInvoke argument marshalling.
|
||||
virtual bool convertPInvokeCalliToCall(
|
||||
CORINFO_RESOLVED_TOKEN * pResolvedToken,
|
||||
bool fMustConvert
|
||||
) = 0;
|
||||
|
||||
virtual void notifyInstructionSetUsage(
|
||||
CORINFO_InstructionSet instructionSet,
|
||||
bool supportEnabled
|
||||
) = 0;
|
||||
};
|
||||
|
||||
/**********************************************************************************/
|
||||
|
|
|
@ -0,0 +1,514 @@
|
|||
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
// DO NOT EDIT THIS FILE! IT IS AUTOGENERATED
|
||||
// FROM /src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt
|
||||
// using /src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.bat
|
||||
|
||||
#ifndef CORINFOINSTRUCTIONSET_H
|
||||
#define CORINFOINSTRUCTIONSET_H
|
||||
|
||||
#include "readytoruninstructionset.h"
|
||||
#include <stdint.h>
|
||||
|
||||
enum CORINFO_InstructionSet
|
||||
{
|
||||
InstructionSet_ILLEGAL = 0,
|
||||
InstructionSet_NONE = 63,
|
||||
#ifdef TARGET_ARM64
|
||||
InstructionSet_ArmBase=1,
|
||||
InstructionSet_ArmBase_Arm64=2,
|
||||
InstructionSet_AdvSimd=3,
|
||||
InstructionSet_AdvSimd_Arm64=4,
|
||||
InstructionSet_Aes=5,
|
||||
InstructionSet_Crc32=6,
|
||||
InstructionSet_Crc32_Arm64=7,
|
||||
InstructionSet_Sha1=8,
|
||||
InstructionSet_Sha256=9,
|
||||
InstructionSet_Atomics=10,
|
||||
InstructionSet_Vector64=11,
|
||||
InstructionSet_Vector128=12,
|
||||
#endif // TARGET_ARM64
|
||||
#ifdef TARGET_AMD64
|
||||
InstructionSet_X86Base=1,
|
||||
InstructionSet_SSE=2,
|
||||
InstructionSet_SSE2=3,
|
||||
InstructionSet_SSE3=4,
|
||||
InstructionSet_SSSE3=5,
|
||||
InstructionSet_SSE41=6,
|
||||
InstructionSet_SSE42=7,
|
||||
InstructionSet_AVX=8,
|
||||
InstructionSet_AVX2=9,
|
||||
InstructionSet_AES=10,
|
||||
InstructionSet_BMI1=11,
|
||||
InstructionSet_BMI2=12,
|
||||
InstructionSet_FMA=13,
|
||||
InstructionSet_LZCNT=14,
|
||||
InstructionSet_PCLMULQDQ=15,
|
||||
InstructionSet_POPCNT=16,
|
||||
InstructionSet_Vector128=17,
|
||||
InstructionSet_Vector256=18,
|
||||
InstructionSet_X86Base_X64=19,
|
||||
InstructionSet_BMI1_X64=20,
|
||||
InstructionSet_BMI2_X64=21,
|
||||
InstructionSet_LZCNT_X64=22,
|
||||
InstructionSet_POPCNT_X64=23,
|
||||
InstructionSet_SSE_X64=24,
|
||||
InstructionSet_SSE2_X64=25,
|
||||
InstructionSet_SSE41_X64=26,
|
||||
InstructionSet_SSE42_X64=27,
|
||||
#endif // TARGET_AMD64
|
||||
#ifdef TARGET_X86
|
||||
InstructionSet_X86Base=1,
|
||||
InstructionSet_SSE=2,
|
||||
InstructionSet_SSE2=3,
|
||||
InstructionSet_SSE3=4,
|
||||
InstructionSet_SSSE3=5,
|
||||
InstructionSet_SSE41=6,
|
||||
InstructionSet_SSE42=7,
|
||||
InstructionSet_AVX=8,
|
||||
InstructionSet_AVX2=9,
|
||||
InstructionSet_AES=10,
|
||||
InstructionSet_BMI1=11,
|
||||
InstructionSet_BMI2=12,
|
||||
InstructionSet_FMA=13,
|
||||
InstructionSet_LZCNT=14,
|
||||
InstructionSet_PCLMULQDQ=15,
|
||||
InstructionSet_POPCNT=16,
|
||||
InstructionSet_Vector128=17,
|
||||
InstructionSet_Vector256=18,
|
||||
InstructionSet_X86Base_X64=19,
|
||||
InstructionSet_BMI1_X64=20,
|
||||
InstructionSet_BMI2_X64=21,
|
||||
InstructionSet_LZCNT_X64=22,
|
||||
InstructionSet_POPCNT_X64=23,
|
||||
InstructionSet_SSE_X64=24,
|
||||
InstructionSet_SSE2_X64=25,
|
||||
InstructionSet_SSE41_X64=26,
|
||||
InstructionSet_SSE42_X64=27,
|
||||
#endif // TARGET_X86
|
||||
|
||||
};
|
||||
|
||||
struct CORINFO_InstructionSetFlags
|
||||
{
|
||||
private:
|
||||
uint64_t _flags = 0;
|
||||
public:
|
||||
void AddInstructionSet(CORINFO_InstructionSet instructionSet)
|
||||
{
|
||||
_flags = _flags | (((uint64_t)1) << instructionSet);
|
||||
}
|
||||
|
||||
void RemoveInstructionSet(CORINFO_InstructionSet instructionSet)
|
||||
{
|
||||
_flags = _flags & ~(((uint64_t)1) << instructionSet);
|
||||
}
|
||||
|
||||
bool HasInstructionSet(CORINFO_InstructionSet instructionSet) const
|
||||
{
|
||||
return _flags & (((uint64_t)1) << instructionSet);
|
||||
}
|
||||
|
||||
bool Equals(CORINFO_InstructionSetFlags other) const
|
||||
{
|
||||
return _flags == other._flags;
|
||||
}
|
||||
|
||||
void Add(CORINFO_InstructionSetFlags other)
|
||||
{
|
||||
_flags |= other._flags;
|
||||
}
|
||||
|
||||
bool IsEmpty() const
|
||||
{
|
||||
return _flags == 0;
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_flags = 0;
|
||||
}
|
||||
|
||||
void Set64BitInstructionSetVariants()
|
||||
{
|
||||
#ifdef TARGET_ARM64
|
||||
if (HasInstructionSet(InstructionSet_ArmBase))
|
||||
AddInstructionSet(InstructionSet_ArmBase_Arm64);
|
||||
if (HasInstructionSet(InstructionSet_AdvSimd))
|
||||
AddInstructionSet(InstructionSet_AdvSimd_Arm64);
|
||||
if (HasInstructionSet(InstructionSet_Crc32))
|
||||
AddInstructionSet(InstructionSet_Crc32_Arm64);
|
||||
#endif // TARGET_ARM64
|
||||
#ifdef TARGET_AMD64
|
||||
if (HasInstructionSet(InstructionSet_X86Base))
|
||||
AddInstructionSet(InstructionSet_X86Base_X64);
|
||||
if (HasInstructionSet(InstructionSet_SSE))
|
||||
AddInstructionSet(InstructionSet_SSE_X64);
|
||||
if (HasInstructionSet(InstructionSet_SSE2))
|
||||
AddInstructionSet(InstructionSet_SSE2_X64);
|
||||
if (HasInstructionSet(InstructionSet_SSE41))
|
||||
AddInstructionSet(InstructionSet_SSE41_X64);
|
||||
if (HasInstructionSet(InstructionSet_SSE42))
|
||||
AddInstructionSet(InstructionSet_SSE42_X64);
|
||||
if (HasInstructionSet(InstructionSet_BMI1))
|
||||
AddInstructionSet(InstructionSet_BMI1_X64);
|
||||
if (HasInstructionSet(InstructionSet_BMI2))
|
||||
AddInstructionSet(InstructionSet_BMI2_X64);
|
||||
if (HasInstructionSet(InstructionSet_LZCNT))
|
||||
AddInstructionSet(InstructionSet_LZCNT_X64);
|
||||
if (HasInstructionSet(InstructionSet_POPCNT))
|
||||
AddInstructionSet(InstructionSet_POPCNT_X64);
|
||||
#endif // TARGET_AMD64
|
||||
#ifdef TARGET_X86
|
||||
#endif // TARGET_X86
|
||||
|
||||
}
|
||||
|
||||
uint64_t GetFlagsRaw()
|
||||
{
|
||||
return _flags;
|
||||
}
|
||||
|
||||
void SetFromFlagsRaw(uint64_t flags)
|
||||
{
|
||||
_flags = flags;
|
||||
}
|
||||
};
|
||||
|
||||
inline CORINFO_InstructionSetFlags EnsureInstructionSetFlagsAreValid(CORINFO_InstructionSetFlags input)
|
||||
{
|
||||
CORINFO_InstructionSetFlags oldflags = input;
|
||||
CORINFO_InstructionSetFlags resultflags = input;
|
||||
do
|
||||
{
|
||||
oldflags = resultflags;
|
||||
#ifdef TARGET_ARM64
|
||||
if (resultflags.HasInstructionSet(InstructionSet_ArmBase) && !resultflags.HasInstructionSet(InstructionSet_ArmBase_Arm64))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_ArmBase);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_ArmBase_Arm64) && !resultflags.HasInstructionSet(InstructionSet_ArmBase))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_ArmBase_Arm64);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_AdvSimd) && !resultflags.HasInstructionSet(InstructionSet_AdvSimd_Arm64))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_AdvSimd);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_AdvSimd_Arm64) && !resultflags.HasInstructionSet(InstructionSet_AdvSimd))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_AdvSimd_Arm64);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_Crc32) && !resultflags.HasInstructionSet(InstructionSet_Crc32_Arm64))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_Crc32);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_Crc32_Arm64) && !resultflags.HasInstructionSet(InstructionSet_Crc32))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_Crc32_Arm64);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_AdvSimd) && !resultflags.HasInstructionSet(InstructionSet_ArmBase))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_AdvSimd);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_Aes) && !resultflags.HasInstructionSet(InstructionSet_ArmBase))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_Aes);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_Crc32) && !resultflags.HasInstructionSet(InstructionSet_ArmBase))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_Crc32);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_Sha1) && !resultflags.HasInstructionSet(InstructionSet_ArmBase))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_Sha1);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_Sha256) && !resultflags.HasInstructionSet(InstructionSet_ArmBase))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_Sha256);
|
||||
#endif // TARGET_ARM64
|
||||
#ifdef TARGET_AMD64
|
||||
if (resultflags.HasInstructionSet(InstructionSet_X86Base) && !resultflags.HasInstructionSet(InstructionSet_X86Base_X64))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_X86Base);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_X86Base_X64) && !resultflags.HasInstructionSet(InstructionSet_X86Base))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_X86Base_X64);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_SSE) && !resultflags.HasInstructionSet(InstructionSet_SSE_X64))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_SSE);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_SSE_X64) && !resultflags.HasInstructionSet(InstructionSet_SSE))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_SSE_X64);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_SSE2) && !resultflags.HasInstructionSet(InstructionSet_SSE2_X64))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_SSE2);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_SSE2_X64) && !resultflags.HasInstructionSet(InstructionSet_SSE2))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_SSE2_X64);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_SSE41) && !resultflags.HasInstructionSet(InstructionSet_SSE41_X64))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_SSE41);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_SSE41_X64) && !resultflags.HasInstructionSet(InstructionSet_SSE41))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_SSE41_X64);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_SSE42) && !resultflags.HasInstructionSet(InstructionSet_SSE42_X64))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_SSE42);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_SSE42_X64) && !resultflags.HasInstructionSet(InstructionSet_SSE42))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_SSE42_X64);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_BMI1) && !resultflags.HasInstructionSet(InstructionSet_BMI1_X64))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_BMI1);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_BMI1_X64) && !resultflags.HasInstructionSet(InstructionSet_BMI1))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_BMI1_X64);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_BMI2) && !resultflags.HasInstructionSet(InstructionSet_BMI2_X64))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_BMI2);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_BMI2_X64) && !resultflags.HasInstructionSet(InstructionSet_BMI2))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_BMI2_X64);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_LZCNT) && !resultflags.HasInstructionSet(InstructionSet_LZCNT_X64))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_LZCNT);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_LZCNT_X64) && !resultflags.HasInstructionSet(InstructionSet_LZCNT))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_LZCNT_X64);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_POPCNT) && !resultflags.HasInstructionSet(InstructionSet_POPCNT_X64))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_POPCNT);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_POPCNT_X64) && !resultflags.HasInstructionSet(InstructionSet_POPCNT))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_POPCNT_X64);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_SSE) && !resultflags.HasInstructionSet(InstructionSet_X86Base))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_SSE);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_SSE2) && !resultflags.HasInstructionSet(InstructionSet_SSE))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_SSE2);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_SSE3) && !resultflags.HasInstructionSet(InstructionSet_SSE2))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_SSE3);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_SSSE3) && !resultflags.HasInstructionSet(InstructionSet_SSE3))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_SSSE3);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_SSE41) && !resultflags.HasInstructionSet(InstructionSet_SSSE3))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_SSE41);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_SSE42) && !resultflags.HasInstructionSet(InstructionSet_SSE41))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_SSE42);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_AVX) && !resultflags.HasInstructionSet(InstructionSet_SSE42))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_AVX);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_AVX2) && !resultflags.HasInstructionSet(InstructionSet_AVX))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_AVX2);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_AES) && !resultflags.HasInstructionSet(InstructionSet_SSE2))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_AES);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_BMI1) && !resultflags.HasInstructionSet(InstructionSet_AVX))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_BMI1);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_BMI2) && !resultflags.HasInstructionSet(InstructionSet_AVX))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_BMI2);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_FMA) && !resultflags.HasInstructionSet(InstructionSet_AVX))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_FMA);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_PCLMULQDQ) && !resultflags.HasInstructionSet(InstructionSet_SSE2))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_PCLMULQDQ);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_POPCNT) && !resultflags.HasInstructionSet(InstructionSet_SSE42))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_POPCNT);
|
||||
#endif // TARGET_AMD64
|
||||
#ifdef TARGET_X86
|
||||
if (resultflags.HasInstructionSet(InstructionSet_SSE) && !resultflags.HasInstructionSet(InstructionSet_X86Base))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_SSE);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_SSE2) && !resultflags.HasInstructionSet(InstructionSet_SSE))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_SSE2);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_SSE3) && !resultflags.HasInstructionSet(InstructionSet_SSE2))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_SSE3);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_SSSE3) && !resultflags.HasInstructionSet(InstructionSet_SSE3))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_SSSE3);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_SSE41) && !resultflags.HasInstructionSet(InstructionSet_SSSE3))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_SSE41);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_SSE42) && !resultflags.HasInstructionSet(InstructionSet_SSE41))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_SSE42);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_AVX) && !resultflags.HasInstructionSet(InstructionSet_SSE42))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_AVX);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_AVX2) && !resultflags.HasInstructionSet(InstructionSet_AVX))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_AVX2);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_AES) && !resultflags.HasInstructionSet(InstructionSet_SSE2))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_AES);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_BMI1) && !resultflags.HasInstructionSet(InstructionSet_AVX))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_BMI1);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_BMI2) && !resultflags.HasInstructionSet(InstructionSet_AVX))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_BMI2);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_FMA) && !resultflags.HasInstructionSet(InstructionSet_AVX))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_FMA);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_PCLMULQDQ) && !resultflags.HasInstructionSet(InstructionSet_SSE2))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_PCLMULQDQ);
|
||||
if (resultflags.HasInstructionSet(InstructionSet_POPCNT) && !resultflags.HasInstructionSet(InstructionSet_SSE42))
|
||||
resultflags.RemoveInstructionSet(InstructionSet_POPCNT);
|
||||
#endif // TARGET_X86
|
||||
|
||||
} while (!oldflags.Equals(resultflags));
|
||||
return resultflags;
|
||||
}
|
||||
|
||||
inline const char *InstructionSetToString(CORINFO_InstructionSet instructionSet)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4065) // disable warning for switch statement with only default label.
|
||||
#endif
|
||||
|
||||
switch (instructionSet)
|
||||
{
|
||||
#ifdef TARGET_ARM64
|
||||
case InstructionSet_ArmBase :
|
||||
return "ArmBase";
|
||||
case InstructionSet_ArmBase_Arm64 :
|
||||
return "ArmBase_Arm64";
|
||||
case InstructionSet_AdvSimd :
|
||||
return "AdvSimd";
|
||||
case InstructionSet_AdvSimd_Arm64 :
|
||||
return "AdvSimd_Arm64";
|
||||
case InstructionSet_Aes :
|
||||
return "Aes";
|
||||
case InstructionSet_Crc32 :
|
||||
return "Crc32";
|
||||
case InstructionSet_Crc32_Arm64 :
|
||||
return "Crc32_Arm64";
|
||||
case InstructionSet_Sha1 :
|
||||
return "Sha1";
|
||||
case InstructionSet_Sha256 :
|
||||
return "Sha256";
|
||||
case InstructionSet_Atomics :
|
||||
return "Atomics";
|
||||
case InstructionSet_Vector64 :
|
||||
return "Vector64";
|
||||
case InstructionSet_Vector128 :
|
||||
return "Vector128";
|
||||
#endif // TARGET_ARM64
|
||||
#ifdef TARGET_AMD64
|
||||
case InstructionSet_X86Base :
|
||||
return "X86Base";
|
||||
case InstructionSet_X86Base_X64 :
|
||||
return "X86Base_X64";
|
||||
case InstructionSet_SSE :
|
||||
return "SSE";
|
||||
case InstructionSet_SSE_X64 :
|
||||
return "SSE_X64";
|
||||
case InstructionSet_SSE2 :
|
||||
return "SSE2";
|
||||
case InstructionSet_SSE2_X64 :
|
||||
return "SSE2_X64";
|
||||
case InstructionSet_SSE3 :
|
||||
return "SSE3";
|
||||
case InstructionSet_SSSE3 :
|
||||
return "SSSE3";
|
||||
case InstructionSet_SSE41 :
|
||||
return "SSE41";
|
||||
case InstructionSet_SSE41_X64 :
|
||||
return "SSE41_X64";
|
||||
case InstructionSet_SSE42 :
|
||||
return "SSE42";
|
||||
case InstructionSet_SSE42_X64 :
|
||||
return "SSE42_X64";
|
||||
case InstructionSet_AVX :
|
||||
return "AVX";
|
||||
case InstructionSet_AVX2 :
|
||||
return "AVX2";
|
||||
case InstructionSet_AES :
|
||||
return "AES";
|
||||
case InstructionSet_BMI1 :
|
||||
return "BMI1";
|
||||
case InstructionSet_BMI1_X64 :
|
||||
return "BMI1_X64";
|
||||
case InstructionSet_BMI2 :
|
||||
return "BMI2";
|
||||
case InstructionSet_BMI2_X64 :
|
||||
return "BMI2_X64";
|
||||
case InstructionSet_FMA :
|
||||
return "FMA";
|
||||
case InstructionSet_LZCNT :
|
||||
return "LZCNT";
|
||||
case InstructionSet_LZCNT_X64 :
|
||||
return "LZCNT_X64";
|
||||
case InstructionSet_PCLMULQDQ :
|
||||
return "PCLMULQDQ";
|
||||
case InstructionSet_POPCNT :
|
||||
return "POPCNT";
|
||||
case InstructionSet_POPCNT_X64 :
|
||||
return "POPCNT_X64";
|
||||
case InstructionSet_Vector128 :
|
||||
return "Vector128";
|
||||
case InstructionSet_Vector256 :
|
||||
return "Vector256";
|
||||
#endif // TARGET_AMD64
|
||||
#ifdef TARGET_X86
|
||||
case InstructionSet_X86Base :
|
||||
return "X86Base";
|
||||
case InstructionSet_SSE :
|
||||
return "SSE";
|
||||
case InstructionSet_SSE2 :
|
||||
return "SSE2";
|
||||
case InstructionSet_SSE3 :
|
||||
return "SSE3";
|
||||
case InstructionSet_SSSE3 :
|
||||
return "SSSE3";
|
||||
case InstructionSet_SSE41 :
|
||||
return "SSE41";
|
||||
case InstructionSet_SSE42 :
|
||||
return "SSE42";
|
||||
case InstructionSet_AVX :
|
||||
return "AVX";
|
||||
case InstructionSet_AVX2 :
|
||||
return "AVX2";
|
||||
case InstructionSet_AES :
|
||||
return "AES";
|
||||
case InstructionSet_BMI1 :
|
||||
return "BMI1";
|
||||
case InstructionSet_BMI2 :
|
||||
return "BMI2";
|
||||
case InstructionSet_FMA :
|
||||
return "FMA";
|
||||
case InstructionSet_LZCNT :
|
||||
return "LZCNT";
|
||||
case InstructionSet_PCLMULQDQ :
|
||||
return "PCLMULQDQ";
|
||||
case InstructionSet_POPCNT :
|
||||
return "POPCNT";
|
||||
case InstructionSet_Vector128 :
|
||||
return "Vector128";
|
||||
case InstructionSet_Vector256 :
|
||||
return "Vector256";
|
||||
#endif // TARGET_X86
|
||||
|
||||
default:
|
||||
return "UnknownInstructionSet";
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
}
|
||||
|
||||
inline CORINFO_InstructionSet InstructionSetFromR2RInstructionSet(ReadyToRunInstructionSet r2rSet)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4065) // disable warning for switch statement with only default label.
|
||||
#endif
|
||||
|
||||
switch (r2rSet)
|
||||
{
|
||||
#ifdef TARGET_ARM64
|
||||
case READYTORUN_INSTRUCTION_ArmBase: return InstructionSet_ArmBase;
|
||||
case READYTORUN_INSTRUCTION_AdvSimd: return InstructionSet_AdvSimd;
|
||||
case READYTORUN_INSTRUCTION_Aes: return InstructionSet_Aes;
|
||||
case READYTORUN_INSTRUCTION_Crc32: return InstructionSet_Crc32;
|
||||
case READYTORUN_INSTRUCTION_Sha1: return InstructionSet_Sha1;
|
||||
case READYTORUN_INSTRUCTION_Sha256: return InstructionSet_Sha256;
|
||||
case READYTORUN_INSTRUCTION_Atomics: return InstructionSet_Atomics;
|
||||
#endif // TARGET_ARM64
|
||||
#ifdef TARGET_AMD64
|
||||
case READYTORUN_INSTRUCTION_X86Base: return InstructionSet_X86Base;
|
||||
case READYTORUN_INSTRUCTION_Sse: return InstructionSet_SSE;
|
||||
case READYTORUN_INSTRUCTION_Sse2: return InstructionSet_SSE2;
|
||||
case READYTORUN_INSTRUCTION_Sse3: return InstructionSet_SSE3;
|
||||
case READYTORUN_INSTRUCTION_Ssse3: return InstructionSet_SSSE3;
|
||||
case READYTORUN_INSTRUCTION_Sse41: return InstructionSet_SSE41;
|
||||
case READYTORUN_INSTRUCTION_Sse42: return InstructionSet_SSE42;
|
||||
case READYTORUN_INSTRUCTION_Avx: return InstructionSet_AVX;
|
||||
case READYTORUN_INSTRUCTION_Avx2: return InstructionSet_AVX2;
|
||||
case READYTORUN_INSTRUCTION_Aes: return InstructionSet_AES;
|
||||
case READYTORUN_INSTRUCTION_Bmi1: return InstructionSet_BMI1;
|
||||
case READYTORUN_INSTRUCTION_Bmi2: return InstructionSet_BMI2;
|
||||
case READYTORUN_INSTRUCTION_Fma: return InstructionSet_FMA;
|
||||
case READYTORUN_INSTRUCTION_Lzcnt: return InstructionSet_LZCNT;
|
||||
case READYTORUN_INSTRUCTION_Pclmulqdq: return InstructionSet_PCLMULQDQ;
|
||||
case READYTORUN_INSTRUCTION_Popcnt: return InstructionSet_POPCNT;
|
||||
#endif // TARGET_AMD64
|
||||
#ifdef TARGET_X86
|
||||
case READYTORUN_INSTRUCTION_X86Base: return InstructionSet_X86Base;
|
||||
case READYTORUN_INSTRUCTION_Sse: return InstructionSet_SSE;
|
||||
case READYTORUN_INSTRUCTION_Sse2: return InstructionSet_SSE2;
|
||||
case READYTORUN_INSTRUCTION_Sse3: return InstructionSet_SSE3;
|
||||
case READYTORUN_INSTRUCTION_Ssse3: return InstructionSet_SSSE3;
|
||||
case READYTORUN_INSTRUCTION_Sse41: return InstructionSet_SSE41;
|
||||
case READYTORUN_INSTRUCTION_Sse42: return InstructionSet_SSE42;
|
||||
case READYTORUN_INSTRUCTION_Avx: return InstructionSet_AVX;
|
||||
case READYTORUN_INSTRUCTION_Avx2: return InstructionSet_AVX2;
|
||||
case READYTORUN_INSTRUCTION_Aes: return InstructionSet_AES;
|
||||
case READYTORUN_INSTRUCTION_Bmi1: return InstructionSet_BMI1;
|
||||
case READYTORUN_INSTRUCTION_Bmi2: return InstructionSet_BMI2;
|
||||
case READYTORUN_INSTRUCTION_Fma: return InstructionSet_FMA;
|
||||
case READYTORUN_INSTRUCTION_Lzcnt: return InstructionSet_LZCNT;
|
||||
case READYTORUN_INSTRUCTION_Pclmulqdq: return InstructionSet_PCLMULQDQ;
|
||||
case READYTORUN_INSTRUCTION_Popcnt: return InstructionSet_POPCNT;
|
||||
#endif // TARGET_X86
|
||||
|
||||
default:
|
||||
return InstructionSet_ILLEGAL;
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // CORINFOINSTRUCTIONSET_H
|
|
@ -20,7 +20,7 @@
|
|||
// The JIT/EE interface is versioned. By "interface", we mean mean any and all communication between the
|
||||
// JIT and the EE. Any time a change is made to the interface, the JIT/EE interface version identifier
|
||||
// must be updated. See code:JITEEVersionIdentifier for more information.
|
||||
//
|
||||
//
|
||||
// NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -48,129 +48,6 @@ enum CorJitResult
|
|||
CORJIT_RECOVERABLEERROR = MAKE_HRESULT(SEVERITY_ERROR,FACILITY_NULL, 5),
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
Here is how CORJIT_FLAG_SKIP_VERIFICATION should be interepreted.
|
||||
Note that even if any method is inlined, it need not be verified.
|
||||
|
||||
if (CORJIT_FLAG_SKIP_VERIFICATION is passed in to ICorJitCompiler::compileMethod())
|
||||
{
|
||||
No verification needs to be done.
|
||||
Just compile the method, generating unverifiable code if necessary
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(ICorMethodInfo::isInstantiationOfVerifiedGeneric())
|
||||
{
|
||||
case INSTVER_NOT_INSTANTIATION:
|
||||
|
||||
//
|
||||
// Non-generic case, or open generic instantiation
|
||||
//
|
||||
|
||||
switch(canSkipMethodVerification())
|
||||
{
|
||||
case CORINFO_VERIFICATION_CANNOT_SKIP:
|
||||
{
|
||||
ICorMethodInfo::initConstraintsForVerification(&circularConstraints)
|
||||
if (circularConstraints)
|
||||
{
|
||||
Just emit code to call CORINFO_HELP_VERIFICATION
|
||||
The IL will not be compiled
|
||||
}
|
||||
else
|
||||
{
|
||||
Verify the method.
|
||||
if (unverifiable code is detected)
|
||||
{
|
||||
In place of branches with unverifiable code, emit code to call CORINFO_HELP_VERIFICATION
|
||||
Mark the method (and any of its instantiations) as unverifiable
|
||||
}
|
||||
Compile the rest of the verifiable code
|
||||
}
|
||||
}
|
||||
|
||||
case CORINFO_VERIFICATION_CAN_SKIP:
|
||||
{
|
||||
No verification needs to be done.
|
||||
Just compile the method, generating unverifiable code if necessary
|
||||
}
|
||||
|
||||
case CORINFO_VERIFICATION_RUNTIME_CHECK:
|
||||
{
|
||||
ICorMethodInfo::initConstraintsForVerification(&circularConstraints)
|
||||
if (circularConstraints)
|
||||
{
|
||||
Just emit code to call CORINFO_HELP_VERIFICATION
|
||||
The IL will not be compiled
|
||||
|
||||
TODO: This could be changed to call CORINFO_HELP_VERIFICATION_RUNTIME_CHECK
|
||||
}
|
||||
else
|
||||
{
|
||||
Verify the method.
|
||||
if (unverifiable code is detected)
|
||||
{
|
||||
In the prolog, emit code to call CORINFO_HELP_VERIFICATION_RUNTIME_CHECK
|
||||
Mark the method (and any of its instantiations) as unverifiable
|
||||
}
|
||||
Compile the method, generating unverifiable code if necessary
|
||||
}
|
||||
}
|
||||
case CORINFO_VERIFICATION_DONT_JIT:
|
||||
{
|
||||
ICorMethodInfo::initConstraintsForVerification(&circularConstraints)
|
||||
if (circularConstraints)
|
||||
{
|
||||
Just emit code to call CORINFO_HELP_VERIFICATION
|
||||
The IL will not be compiled
|
||||
}
|
||||
else
|
||||
{
|
||||
Verify the method.
|
||||
if (unverifiable code is detected)
|
||||
{
|
||||
Fail the jit
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case INSTVER_GENERIC_PASSED_VERIFICATION:
|
||||
{
|
||||
This cannot ever happen because the VM would pass in CORJIT_FLAG_SKIP_VERIFICATION.
|
||||
}
|
||||
|
||||
case INSTVER_GENERIC_FAILED_VERIFICATION:
|
||||
|
||||
switch(canSkipMethodVerification())
|
||||
{
|
||||
case CORINFO_VERIFICATION_CANNOT_SKIP:
|
||||
{
|
||||
This cannot be supported because the compiler does not know which branches should call CORINFO_HELP_VERIFICATION.
|
||||
The CLR will throw a VerificationException instead of trying to compile this method
|
||||
}
|
||||
|
||||
case CORINFO_VERIFICATION_CAN_SKIP:
|
||||
{
|
||||
This cannot ever happen because the CLR would pass in CORJIT_FLAG_SKIP_VERIFICATION.
|
||||
}
|
||||
|
||||
case CORINFO_VERIFICATION_RUNTIME_CHECK:
|
||||
{
|
||||
No verification needs to be done.
|
||||
In the prolog, emit code to call CORINFO_HELP_VERIFICATION_RUNTIME_CHECK
|
||||
Compile the method, generating unverifiable code if necessary
|
||||
}
|
||||
case CORINFO_VERIFICATION_DONT_JIT:
|
||||
{
|
||||
Fail the jit
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
// These are flags passed to ICorJitInfo::allocMem
|
||||
// to guide the memory allocation for the code, readonly data, and read-write data
|
||||
|
@ -179,6 +56,8 @@ enum CorJitAllocMemFlag
|
|||
CORJIT_ALLOCMEM_DEFAULT_CODE_ALIGN = 0x00000000, // The code will be use the normal alignment
|
||||
CORJIT_ALLOCMEM_FLG_16BYTE_ALIGN = 0x00000001, // The code will be 16-byte aligned
|
||||
CORJIT_ALLOCMEM_FLG_RODATA_16BYTE_ALIGN = 0x00000002, // The read-only data will be 16-byte aligned
|
||||
CORJIT_ALLOCMEM_FLG_32BYTE_ALIGN = 0x00000004, // The code will be 32-byte aligned
|
||||
CORJIT_ALLOCMEM_FLG_RODATA_32BYTE_ALIGN = 0x00000008, // The read-only data will be 32-byte aligned
|
||||
};
|
||||
|
||||
inline CorJitAllocMemFlag operator |(CorJitAllocMemFlag a, CorJitAllocMemFlag b)
|
||||
|
@ -210,7 +89,6 @@ extern "C" void __stdcall jitStartup(ICorJitHost* host);
|
|||
|
||||
class ICorJitCompiler;
|
||||
class ICorJitInfo;
|
||||
struct IEEMemoryManager;
|
||||
|
||||
extern "C" ICorJitCompiler* __stdcall getJit();
|
||||
|
||||
|
@ -218,9 +96,9 @@ extern "C" ICorJitCompiler* __stdcall getJit();
|
|||
// ICorJitCompiler is the interface that the EE uses to get IL bytecode converted to native code. Note that
|
||||
// to accomplish this the JIT has to call back to the EE to get symbolic information. The code:ICorJitInfo
|
||||
// type passed as 'comp' to compileMethod is the mechanism to get this information. This is often the more
|
||||
// interesting interface.
|
||||
//
|
||||
//
|
||||
// interesting interface.
|
||||
//
|
||||
//
|
||||
class ICorJitCompiler
|
||||
{
|
||||
public:
|
||||
|
@ -230,10 +108,10 @@ public:
|
|||
// nativeSizeOfCode are just for convenience because the JIT asks the EE for the memory to emit code into
|
||||
// (see code:ICorJitInfo.allocMem), so really the EE already knows where the method starts and how big
|
||||
// it is (in fact, it could be in more than one chunk).
|
||||
//
|
||||
//
|
||||
// * In the 32 bit jit this is implemented by code:CILJit.compileMethod
|
||||
// * For the 64 bit jit this is implemented by code:PreJit.compileMethod
|
||||
//
|
||||
//
|
||||
// Note: Obfuscators that are hacking the JIT depend on this method having __stdcall calling convention
|
||||
virtual CorJitResult __stdcall compileMethod (
|
||||
ICorJitInfo *comp, /* IN */
|
||||
|
@ -243,21 +121,13 @@ public:
|
|||
ULONG *nativeSizeOfCode /* OUT */
|
||||
) = 0;
|
||||
|
||||
// Some JIT compilers (most notably Phoenix), cache information about EE structures from one invocation
|
||||
// of the compiler to the next. This can be a problem when appdomains are unloaded, as some of this
|
||||
// cached information becomes stale. The code:ICorJitCompiler.isCacheCleanupRequired is called by the EE
|
||||
// early first to see if jit needs these notifications, and if so, the EE will call ClearCache is called
|
||||
// whenever the compiler should abandon its cache (eg on appdomain unload)
|
||||
virtual void clearCache() = 0;
|
||||
virtual BOOL isCacheCleanupRequired() = 0;
|
||||
|
||||
// Do any appropriate work at process shutdown. Default impl is to do nothing.
|
||||
virtual void ProcessShutdownWork(ICorStaticInfo* info) {};
|
||||
|
||||
// The EE asks the JIT for a "version identifier". This represents the version of the JIT/EE interface.
|
||||
// If the JIT doesn't implement the same JIT/EE interface expected by the EE (because the JIT doesn't
|
||||
// return the version identifier that the EE expects), then the EE fails to load the JIT.
|
||||
//
|
||||
//
|
||||
virtual void getVersionIdentifier(
|
||||
GUID* versionIdentifier /* OUT */
|
||||
) = 0;
|
||||
|
@ -266,35 +136,23 @@ public:
|
|||
// 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).
|
||||
virtual unsigned getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompileFlags) { return 0; }
|
||||
|
||||
// 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,
|
||||
// and not to implement those methods itself. The JIT must not return this method when getJit()
|
||||
// is called. Instead, it must pass along all calls to this interface from within its own
|
||||
// ICorJitCompiler implementation. If 'realJitCompiler' is nullptr, then the JIT should resume
|
||||
// executing all the functions itself.
|
||||
virtual void setRealJit(ICorJitCompiler* realJitCompiler) { }
|
||||
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
// #JitToEEInterface
|
||||
//
|
||||
//
|
||||
// ICorJitInfo is the main interface that the JIT uses to call back to the EE and get information. It is
|
||||
// the companion to code:ICorJitCompiler#EEToJitInterface. The concrete implementation of this in the
|
||||
// runtime is the code:CEEJitInfo type. There is also a version of this for the NGEN case.
|
||||
//
|
||||
// See code:ICorMethodInfo#EEJitContractDetails for subtle conventions used by this interface.
|
||||
//
|
||||
// There is more information on the JIT in the book of the runtime entry
|
||||
// runtime is the code:CEEJitInfo type. There is also a version of this for the NGEN case.
|
||||
//
|
||||
// See code:ICorMethodInfo#EEJitContractDetails for subtle conventions used by this interface.
|
||||
//
|
||||
// There is more information on the JIT in the book of the runtime entry
|
||||
// http://devdiv/sites/CLR/Product%20Documentation/2.0/BookOfTheRuntime/JIT/JIT%20Design.doc
|
||||
//
|
||||
//
|
||||
class ICorJitInfo : public ICorDynamicInfo
|
||||
{
|
||||
public:
|
||||
// OBSOLETE: return memory manager that the JIT can use to allocate a regular memory
|
||||
virtual IEEMemoryManager* getMemoryManager() = 0;
|
||||
|
||||
// get a block of memory for the code, readonly data, and read-write data
|
||||
virtual void allocMem (
|
||||
ULONG hotCodeSize, /* IN */
|
||||
|
@ -332,7 +190,7 @@ public:
|
|||
// Parameters:
|
||||
//
|
||||
// pHotCode main method code buffer, always filled in
|
||||
// pColdCode cold code buffer, only filled in if this is cold code,
|
||||
// pColdCode cold code buffer, only filled in if this is cold code,
|
||||
// null otherwise
|
||||
// startOffset start of code block, relative to appropriate code buffer
|
||||
// (e.g. pColdCode if cold, pHotCode if hot).
|
||||
|
@ -359,8 +217,6 @@ public:
|
|||
size_t size /* IN */
|
||||
) = 0;
|
||||
|
||||
virtual void yieldExecution() = 0;
|
||||
|
||||
// Indicate how many exception handler blocks are to be returned.
|
||||
// This is guaranteed to be called before any 'setEHinfo' call.
|
||||
// Note that allocMem must be called before this method can be called.
|
||||
|
@ -386,7 +242,7 @@ public:
|
|||
// do an assert. will return true if the code should retry (DebugBreak)
|
||||
// returns false, if the assert should be igored.
|
||||
virtual int doAssert(const char* szFile, int iLine, const char* szExpr) = 0;
|
||||
|
||||
|
||||
virtual void reportFatalError(CorJitResult result) = 0;
|
||||
|
||||
struct BlockCounts // Also defined by: CORBBTPROF_BLOCK_DATA
|
||||
|
@ -433,19 +289,11 @@ public:
|
|||
|
||||
virtual WORD getRelocTypeHint(void * target) = 0;
|
||||
|
||||
// A callback to identify the range of address known to point to
|
||||
// compiler-generated native entry points that call back into
|
||||
// MSIL.
|
||||
virtual void getModuleNativeEntryPointRange(
|
||||
void ** pStart, /* OUT */
|
||||
void ** pEnd /* OUT */
|
||||
) = 0;
|
||||
|
||||
// For what machine does the VM expect the JIT to generate code? The VM
|
||||
// returns one of the IMAGE_FILE_MACHINE_* values. Note that if the VM
|
||||
// is cross-compiling (such as the case for crossgen), it will return a
|
||||
// different value than if it was compiling for the host architecture.
|
||||
//
|
||||
//
|
||||
virtual DWORD getExpectedTargetArchitecture() = 0;
|
||||
|
||||
// Fetches extended flags for a particular compilation instance. Returns
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
#ifndef _COR_JIT_FLAGS_H_
|
||||
#define _COR_JIT_FLAGS_H_
|
||||
|
||||
#include "corinfoinstructionset.h"
|
||||
|
||||
class CORJIT_FLAGS
|
||||
{
|
||||
public:
|
||||
|
@ -34,15 +36,14 @@ public:
|
|||
CORJIT_FLAG_GCPOLL_CALLS = 6, // Emit calls to JIT_POLLGC for thread suspension.
|
||||
CORJIT_FLAG_MCJIT_BACKGROUND = 7, // Calling from multicore JIT background thread, do not call JitComplete
|
||||
|
||||
#if defined(_TARGET_X86_)
|
||||
#if defined(TARGET_X86)
|
||||
|
||||
CORJIT_FLAG_PINVOKE_RESTORE_ESP = 8, // Restore ESP after returning from inlined PInvoke
|
||||
CORJIT_FLAG_TARGET_P4 = 9,
|
||||
CORJIT_FLAG_USE_FCOMI = 10, // Generated code may use fcomi(p) instruction
|
||||
CORJIT_FLAG_USE_CMOV = 11, // Generated code may use cmov instruction
|
||||
CORJIT_FLAG_USE_SSE2 = 12, // Generated code may use SSE-2 instructions
|
||||
|
||||
#else // !defined(_TARGET_X86_)
|
||||
#else // !defined(TARGET_X86)
|
||||
|
||||
CORJIT_FLAG_UNUSED1 = 8,
|
||||
CORJIT_FLAG_UNUSED2 = 9,
|
||||
|
@ -50,29 +51,20 @@ public:
|
|||
CORJIT_FLAG_UNUSED4 = 11,
|
||||
CORJIT_FLAG_UNUSED5 = 12,
|
||||
|
||||
#endif // !defined(_TARGET_X86_)
|
||||
#endif // !defined(TARGET_X86)
|
||||
|
||||
CORJIT_FLAG_UNUSED6 = 13,
|
||||
|
||||
#if defined(_TARGET_X86_) || defined(_TARGET_AMD64_)
|
||||
|
||||
CORJIT_FLAG_USE_AVX = 14,
|
||||
CORJIT_FLAG_USE_AVX2 = 15,
|
||||
CORJIT_FLAG_USE_AVX_512 = 16,
|
||||
|
||||
#else // !defined(_TARGET_X86_) && !defined(_TARGET_AMD64_)
|
||||
CORJIT_FLAG_OSR = 13, // Generate alternate method for On Stack Replacement
|
||||
|
||||
CORJIT_FLAG_UNUSED7 = 14,
|
||||
CORJIT_FLAG_UNUSED8 = 15,
|
||||
CORJIT_FLAG_UNUSED9 = 16,
|
||||
|
||||
#endif // !defined(_TARGET_X86_) && !defined(_TARGET_AMD64_)
|
||||
|
||||
#if defined(_TARGET_X86_) || defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)
|
||||
#if defined(TARGET_X86) || defined(TARGET_AMD64) || defined(TARGET_ARM64)
|
||||
CORJIT_FLAG_FEATURE_SIMD = 17,
|
||||
#else
|
||||
CORJIT_FLAG_UNUSED10 = 17,
|
||||
#endif // !(defined(_TARGET_X86_) || defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_))
|
||||
#endif // !(defined(TARGET_X86) || defined(TARGET_AMD64) || defined(TARGET_ARM64))
|
||||
|
||||
CORJIT_FLAG_MAKEFINALCODE = 18, // Use the final code generator, i.e., not the interpreter.
|
||||
CORJIT_FLAG_READYTORUN = 19, // Use version-resilient code generation
|
||||
|
@ -94,69 +86,18 @@ public:
|
|||
CORJIT_FLAG_SAMPLING_JIT_BACKGROUND = 35, // JIT is being invoked as a result of stack sampling for hot methods in the background
|
||||
CORJIT_FLAG_USE_PINVOKE_HELPERS = 36, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions
|
||||
CORJIT_FLAG_REVERSE_PINVOKE = 37, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog
|
||||
CORJIT_FLAG_DESKTOP_QUIRKS = 38, // The JIT should generate desktop-quirk-compatible code
|
||||
// CORJIT_FLAG_UNUSED = 38,
|
||||
CORJIT_FLAG_TIER0 = 39, // This is the initial tier for tiered compilation which should generate code as quickly as possible
|
||||
CORJIT_FLAG_TIER1 = 40, // This is the final tier (for now) for tiered compilation which should generate high quality code
|
||||
|
||||
#if defined(_TARGET_ARM_)
|
||||
#if defined(TARGET_ARM)
|
||||
CORJIT_FLAG_RELATIVE_CODE_RELOCS = 41, // JIT should generate PC-relative address computations instead of EE relocation records
|
||||
#else // !defined(_TARGET_ARM_)
|
||||
#else // !defined(TARGET_ARM)
|
||||
CORJIT_FLAG_UNUSED11 = 41,
|
||||
#endif // !defined(_TARGET_ARM_)
|
||||
#endif // !defined(TARGET_ARM)
|
||||
|
||||
CORJIT_FLAG_NO_INLINING = 42, // JIT should not inline any called method into this method
|
||||
|
||||
#if defined(_TARGET_ARM64_)
|
||||
|
||||
CORJIT_FLAG_HAS_ARM64_AES = 43, // ID_AA64ISAR0_EL1.AES is 1 or better
|
||||
CORJIT_FLAG_HAS_ARM64_ATOMICS = 44, // ID_AA64ISAR0_EL1.Atomic is 2 or better
|
||||
CORJIT_FLAG_HAS_ARM64_CRC32 = 45, // ID_AA64ISAR0_EL1.CRC32 is 1 or better
|
||||
CORJIT_FLAG_HAS_ARM64_DCPOP = 46, // ID_AA64ISAR1_EL1.DPB is 1 or better
|
||||
CORJIT_FLAG_HAS_ARM64_DP = 47, // ID_AA64ISAR0_EL1.DP is 1 or better
|
||||
CORJIT_FLAG_HAS_ARM64_FCMA = 48, // ID_AA64ISAR1_EL1.FCMA is 1 or better
|
||||
CORJIT_FLAG_HAS_ARM64_FP = 49, // ID_AA64PFR0_EL1.FP is 0 or better
|
||||
CORJIT_FLAG_HAS_ARM64_FP16 = 50, // ID_AA64PFR0_EL1.FP is 1 or better
|
||||
CORJIT_FLAG_HAS_ARM64_JSCVT = 51, // ID_AA64ISAR1_EL1.JSCVT is 1 or better
|
||||
CORJIT_FLAG_HAS_ARM64_LRCPC = 52, // ID_AA64ISAR1_EL1.LRCPC is 1 or better
|
||||
CORJIT_FLAG_HAS_ARM64_PMULL = 53, // ID_AA64ISAR0_EL1.AES is 2 or better
|
||||
CORJIT_FLAG_HAS_ARM64_SHA1 = 54, // ID_AA64ISAR0_EL1.SHA1 is 1 or better
|
||||
CORJIT_FLAG_HAS_ARM64_SHA256 = 55, // ID_AA64ISAR0_EL1.SHA2 is 1 or better
|
||||
CORJIT_FLAG_HAS_ARM64_SHA512 = 56, // ID_AA64ISAR0_EL1.SHA2 is 2 or better
|
||||
CORJIT_FLAG_HAS_ARM64_SHA3 = 57, // ID_AA64ISAR0_EL1.SHA3 is 1 or better
|
||||
CORJIT_FLAG_HAS_ARM64_SIMD = 58, // ID_AA64PFR0_EL1.AdvSIMD is 0 or better
|
||||
CORJIT_FLAG_HAS_ARM64_SIMD_V81 = 59, // ID_AA64ISAR0_EL1.RDM is 1 or better
|
||||
CORJIT_FLAG_HAS_ARM64_SIMD_FP16 = 60, // ID_AA64PFR0_EL1.AdvSIMD is 1 or better
|
||||
CORJIT_FLAG_HAS_ARM64_SM3 = 61, // ID_AA64ISAR0_EL1.SM3 is 1 or better
|
||||
CORJIT_FLAG_HAS_ARM64_SM4 = 62, // ID_AA64ISAR0_EL1.SM4 is 1 or better
|
||||
CORJIT_FLAG_HAS_ARM64_SVE = 63 // ID_AA64PFR0_EL1.SVE is 1 or better
|
||||
|
||||
#elif defined(_TARGET_X86_) || defined(_TARGET_AMD64_)
|
||||
|
||||
CORJIT_FLAG_USE_SSE3 = 43,
|
||||
CORJIT_FLAG_USE_SSSE3 = 44,
|
||||
CORJIT_FLAG_USE_SSE41 = 45,
|
||||
CORJIT_FLAG_USE_SSE42 = 46,
|
||||
CORJIT_FLAG_USE_AES = 47,
|
||||
CORJIT_FLAG_USE_BMI1 = 48,
|
||||
CORJIT_FLAG_USE_BMI2 = 49,
|
||||
CORJIT_FLAG_USE_FMA = 50,
|
||||
CORJIT_FLAG_USE_LZCNT = 51,
|
||||
CORJIT_FLAG_USE_PCLMULQDQ = 52,
|
||||
CORJIT_FLAG_USE_POPCNT = 53,
|
||||
CORJIT_FLAG_UNUSED23 = 54,
|
||||
CORJIT_FLAG_UNUSED24 = 55,
|
||||
CORJIT_FLAG_UNUSED25 = 56,
|
||||
CORJIT_FLAG_UNUSED26 = 57,
|
||||
CORJIT_FLAG_UNUSED27 = 58,
|
||||
CORJIT_FLAG_UNUSED28 = 59,
|
||||
CORJIT_FLAG_UNUSED29 = 60,
|
||||
CORJIT_FLAG_UNUSED30 = 61,
|
||||
CORJIT_FLAG_UNUSED31 = 62,
|
||||
CORJIT_FLAG_UNUSED32 = 63
|
||||
|
||||
|
||||
#else // !defined(_TARGET_ARM64_) &&!defined(_TARGET_X86_) && !defined(_TARGET_AMD64_)
|
||||
|
||||
CORJIT_FLAG_UNUSED12 = 43,
|
||||
CORJIT_FLAG_UNUSED13 = 44,
|
||||
CORJIT_FLAG_UNUSED14 = 45,
|
||||
|
@ -178,8 +119,6 @@ public:
|
|||
CORJIT_FLAG_UNUSED30 = 61,
|
||||
CORJIT_FLAG_UNUSED31 = 62,
|
||||
CORJIT_FLAG_UNUSED32 = 63
|
||||
|
||||
#endif // !defined(_TARGET_ARM64_) &&!defined(_TARGET_X86_) && !defined(_TARGET_AMD64_)
|
||||
};
|
||||
|
||||
CORJIT_FLAGS()
|
||||
|
@ -198,11 +137,33 @@ public:
|
|||
CORJIT_FLAGS(const CORJIT_FLAGS& other)
|
||||
{
|
||||
corJitFlags = other.corJitFlags;
|
||||
instructionSetFlags = other.instructionSetFlags;
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
corJitFlags = 0;
|
||||
instructionSetFlags.Reset();
|
||||
}
|
||||
|
||||
void Set(CORINFO_InstructionSet instructionSet)
|
||||
{
|
||||
instructionSetFlags.AddInstructionSet(instructionSet);
|
||||
}
|
||||
|
||||
bool IsSet(CORINFO_InstructionSet instructionSet) const
|
||||
{
|
||||
return instructionSetFlags.HasInstructionSet(instructionSet);
|
||||
}
|
||||
|
||||
void Clear(CORINFO_InstructionSet instructionSet)
|
||||
{
|
||||
instructionSetFlags.RemoveInstructionSet(instructionSet);
|
||||
}
|
||||
|
||||
void Set64BitInstructionSetVariants()
|
||||
{
|
||||
instructionSetFlags.Set64BitInstructionSetVariants();
|
||||
}
|
||||
|
||||
void Set(CorJitFlag flag)
|
||||
|
@ -223,16 +184,17 @@ public:
|
|||
void Add(const CORJIT_FLAGS& other)
|
||||
{
|
||||
corJitFlags |= other.corJitFlags;
|
||||
}
|
||||
|
||||
void Remove(const CORJIT_FLAGS& other)
|
||||
{
|
||||
corJitFlags &= ~other.corJitFlags;
|
||||
instructionSetFlags.Add(other.instructionSetFlags);
|
||||
}
|
||||
|
||||
bool IsEmpty() const
|
||||
{
|
||||
return corJitFlags == 0;
|
||||
return corJitFlags == 0 && instructionSetFlags.IsEmpty();
|
||||
}
|
||||
|
||||
void EnsureValidInstructionSetSupport()
|
||||
{
|
||||
instructionSetFlags = EnsureInstructionSetFlagsAreValid(instructionSetFlags);
|
||||
}
|
||||
|
||||
// DO NOT USE THIS FUNCTION! (except in very restricted special cases)
|
||||
|
@ -241,9 +203,16 @@ public:
|
|||
return corJitFlags;
|
||||
}
|
||||
|
||||
// DO NOT USE THIS FUNCTION! (except in very restricted special cases)
|
||||
unsigned __int64 GetInstructionSetFlagsRaw()
|
||||
{
|
||||
return instructionSetFlags.GetFlagsRaw();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
unsigned __int64 corJitFlags;
|
||||
CORINFO_InstructionSetFlags instructionSetFlags;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -23,13 +23,13 @@ public:
|
|||
|
||||
// Return an integer config value for the given key, if any exists.
|
||||
virtual int getIntConfigValue(
|
||||
const wchar_t* name,
|
||||
const WCHAR* name,
|
||||
int defaultValue
|
||||
) = 0;
|
||||
|
||||
// Return a string config value for the given key, if any exists.
|
||||
virtual const wchar_t* getStringConfigValue(
|
||||
const wchar_t* name
|
||||
virtual const WCHAR* getStringConfigValue(
|
||||
const WCHAR* name
|
||||
) = 0;
|
||||
|
||||
// Free a string ConfigValue returned by the runtime.
|
||||
|
@ -37,7 +37,7 @@ public:
|
|||
// to return the string values to the runtime for deletion.
|
||||
// This avoids leaking the memory in the JIT.
|
||||
virtual void freeStringConfigValue(
|
||||
const wchar_t* value
|
||||
const WCHAR* value
|
||||
) = 0;
|
||||
|
||||
// Allocate memory slab of the given size in bytes. The host is expected to pool
|
||||
|
|
|
@ -148,7 +148,7 @@ DECLARE_INTERFACE_(IMetaDataHelper, IUnknown)
|
|||
// helper functions
|
||||
// This function is exposing the ability to translate signature from a given
|
||||
// source scope to a given target scope.
|
||||
//
|
||||
//
|
||||
STDMETHOD(TranslateSigWithScope)(
|
||||
IMetaDataAssemblyImport *pAssemImport, // [IN] importing assembly interface
|
||||
const void *pbHashValue, // [IN] Hash Blob for Assembly.
|
||||
|
@ -231,23 +231,19 @@ typedef enum CorElementTypeZapSig
|
|||
// by the RID of a GenericParam token, encoded as a compressed integer.
|
||||
ELEMENT_TYPE_VAR_ZAPSIG = 0x3b,
|
||||
|
||||
// ZapSig encoding for an array MethodTable to allow it to remain such after decoding
|
||||
// (rather than being transformed into the TypeHandle representing that array)
|
||||
//
|
||||
// The element is always followed by ELEMENT_TYPE_SZARRAY or ELEMENT_TYPE_ARRAY
|
||||
ELEMENT_TYPE_NATIVE_ARRAY_TEMPLATE_ZAPSIG = 0x3c,
|
||||
// UNUSED = 0x3c,
|
||||
|
||||
// ZapSig encoding for native value types in IL stubs. IL stub signatures may contain
|
||||
// ELEMENT_TYPE_INTERNAL followed by ParamTypeDesc with ELEMENT_TYPE_VALUETYPE element
|
||||
// type. It acts like a modifier to the underlying structure making it look like its
|
||||
// unmanaged view (size determined by unmanaged layout, blittable, no GC pointers).
|
||||
//
|
||||
//
|
||||
// ELEMENT_TYPE_NATIVE_VALUETYPE_ZAPSIG is used when encoding such types to NGEN images.
|
||||
// The signature looks like this: ET_NATIVE_VALUETYPE_ZAPSIG ET_VALUETYPE <token>.
|
||||
// See code:ZapSig.GetSignatureForTypeHandle and code:SigPointer.GetTypeHandleThrowing
|
||||
// where the encoding/decoding takes place.
|
||||
ELEMENT_TYPE_NATIVE_VALUETYPE_ZAPSIG = 0x3d,
|
||||
|
||||
|
||||
ELEMENT_TYPE_CANON_ZAPSIG = 0x3e, // zapsig encoding for [mscorlib]System.__Canon
|
||||
ELEMENT_TYPE_MODULE_ZAPSIG = 0x3f, // zapsig encoding for external module id#
|
||||
|
||||
|
@ -271,16 +267,16 @@ typedef enum CorCallingConventionInternal
|
|||
#define ELEMENT_TYPE_VALUEARRAY_UNSUPPORTED ((CorElementType) 0x17)
|
||||
#define ELEMENT_TYPE_R_UNSUPPORTED ((CorElementType) 0x1a)
|
||||
|
||||
// Use this guid in the SetOption if Reflection.Emit wants to control size of the initially allocated
|
||||
// Use this guid in the SetOption if Reflection.Emit wants to control size of the initially allocated
|
||||
// MetaData. See values: code:CorMetaDataInitialSize.
|
||||
//
|
||||
//
|
||||
// {2675b6bf-f504-4cb4-a4d5-084eea770ddc}
|
||||
EXTERN_GUID(MetaDataInitialSize, 0x2675b6bf, 0xf504, 0x4cb4, 0xa4, 0xd5, 0x08, 0x4e, 0xea, 0x77, 0x0d, 0xdc);
|
||||
|
||||
// Allowed values for code:MetaDataInitialSize option.
|
||||
typedef enum CorMetaDataInitialSize
|
||||
{
|
||||
MDInitialSizeDefault = 0,
|
||||
MDInitialSizeDefault = 0,
|
||||
MDInitialSizeMinimal = 1
|
||||
} CorMetaDataInitialSize;
|
||||
|
||||
|
@ -290,7 +286,7 @@ typedef enum CorOpenFlagsInternal
|
|||
#ifdef FEATURE_METADATA_LOAD_TRUSTED_IMAGES
|
||||
// Flag code:ofTrustedImage is used by mscordbi.dll, therefore defined in file:CorPriv.h
|
||||
ofTrustedImage = ofReserved3 // We trust this PE file (we are willing to do a LoadLibrary on it).
|
||||
// It is optional and only an (VM) optimization - typically for NGEN images
|
||||
// It is optional and only an (VM) optimization - typically for NGEN images
|
||||
// opened by debugger.
|
||||
#endif
|
||||
} CorOpenFlagsInternal;
|
||||
|
@ -322,11 +318,11 @@ STDAPI RuntimeGetAssemblyStrongNameHashForModule(HCORMODULE hModule,
|
|||
IMetaDataImport *pMDimport,
|
||||
BYTE *pbSNHash,
|
||||
DWORD *pcbSNHash);
|
||||
STDAPI RuntimeGetMDInternalImport(HCORMODULE hHandle,
|
||||
STDAPI RuntimeGetMDInternalImport(HCORMODULE hHandle,
|
||||
MDInternalImportFlags flags,
|
||||
IMDInternalImport** ppMDImport);
|
||||
|
||||
FORCEINLINE
|
||||
FORCEINLINE
|
||||
void ReleaseHCorModule(HCORMODULE hModule)
|
||||
{
|
||||
HRESULT hr = RuntimeReleaseHandle(hModule);
|
||||
|
@ -347,7 +343,7 @@ typedef Wrapper<HCORMODULE, DoNothing<HCORMODULE>, ReleaseHCorModule, (UINT_PTR)
|
|||
|
||||
// {848845BC-0C4A-42e3-8915-DC850112443D}
|
||||
EXTERN_GUID(IID_ISNAssemblySignature, 0x848845BC, 0x0C4A, 0x42e3, 0x89, 0x15, 0xDC, 0x85, 0x01, 0x12, 0x44, 0x3D);
|
||||
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE ISNAssemblySignature
|
||||
DECLARE_INTERFACE_(ISNAssemblySignature, IUnknown)
|
||||
|
@ -356,8 +352,8 @@ DECLARE_INTERFACE_(ISNAssemblySignature, IUnknown)
|
|||
// Returns the MVID if the assembly is delay-signed.
|
||||
// Fails if the assembly is not signed at all.
|
||||
STDMETHOD(GetSNAssemblySignature) (
|
||||
BYTE *pbSig, // [IN, OUT] Buffer to write signature
|
||||
DWORD *pcbSig // [IN, OUT] Size of buffer, bytes written
|
||||
BYTE *pbSig, // [IN, OUT] Buffer to write signature
|
||||
DWORD *pcbSig // [IN, OUT] Size of buffer, bytes written
|
||||
) PURE;
|
||||
};
|
||||
|
||||
|
@ -406,7 +402,7 @@ DECLARE_INTERFACE_(IGetIMDInternalImport, IUnknown)
|
|||
* NGen logger
|
||||
* --------------------------------------------------------------------------- */
|
||||
#include "mscorsvc.h"
|
||||
|
||||
|
||||
struct ICorSvcLogger;
|
||||
class SvcLogger
|
||||
{
|
||||
|
@ -424,7 +420,7 @@ public:
|
|||
void Printf(CorSvcLogLevel logLevel, const WCHAR *format, ...);
|
||||
void SvcPrintf(const WCHAR *format, ...);
|
||||
void Log(const WCHAR *message, CorSvcLogLevel logLevel = LogLevel_Warning);
|
||||
//Need to add this to allocate StackSString, as we don't want static class
|
||||
//Need to add this to allocate StackSString, as we don't want static class
|
||||
|
||||
private:
|
||||
|
||||
|
@ -441,7 +437,7 @@ BOOL HasSvcLogger();
|
|||
#endif // #ifndef DACCESS_COMPILE
|
||||
|
||||
// ===========================================================================
|
||||
#endif // #ifdef FEATURE_PREJIT
|
||||
#endif // #ifdef FEATURE_PREJIT
|
||||
// ===========================================================================
|
||||
|
||||
struct CORCOMPILE_ASSEMBLY_SIGNATURE;
|
||||
|
@ -457,18 +453,13 @@ STDAPI GetCORSystemDirectoryInternaL(
|
|||
SString& pBuffer
|
||||
);
|
||||
|
||||
//LONGPATH:TODO: Remove this once Desktop usage has been removed
|
||||
//LONGPATH:TODO: Remove this once Desktop usage has been removed
|
||||
STDAPI GetCORSystemDirectoryInternal(
|
||||
__out_ecount_part_opt(cchBuffer, *pdwLength) LPWSTR pBuffer,
|
||||
DWORD cchBuffer,
|
||||
__out_opt DWORD* pdwLength
|
||||
);
|
||||
|
||||
STDAPI GetCORVersionInternal(
|
||||
__out_ecount_z_opt(cchBuffer) LPWSTR pBuffer,
|
||||
DWORD cchBuffer,
|
||||
__out DWORD *pdwLength);
|
||||
|
||||
#endif // _CORPRIV_H_
|
||||
// EOF =======================================================================
|
||||
|
||||
|
|
|
@ -164,14 +164,14 @@ typedef union {FunctionID functionID; UINT_PTR clientID;} FunctionIDOrClientID;
|
|||
* for the same functionId. The profiler should be certain to return
|
||||
* the same values from this callback when it is called multiple times
|
||||
* with the same functionId.
|
||||
*
|
||||
*
|
||||
*/
|
||||
typedef UINT_PTR __stdcall FunctionIDMapper(
|
||||
FunctionID funcId,
|
||||
FunctionID funcId,
|
||||
BOOL *pbHookFunction);
|
||||
|
||||
typedef UINT_PTR __stdcall FunctionIDMapper2(
|
||||
FunctionID funcId,
|
||||
FunctionID funcId,
|
||||
void *clientData,
|
||||
BOOL *pbHookFunction);
|
||||
|
||||
|
@ -307,10 +307,10 @@ typedef struct _COR_PRF_METHOD
|
|||
*/
|
||||
typedef void STDMETHODCALLTYPE FunctionEnter(
|
||||
FunctionID funcID);
|
||||
|
||||
|
||||
typedef void STDMETHODCALLTYPE FunctionLeave(
|
||||
FunctionID funcID);
|
||||
|
||||
|
||||
typedef void STDMETHODCALLTYPE FunctionTailcall(
|
||||
FunctionID funcID);
|
||||
|
||||
|
@ -323,20 +323,20 @@ typedef void STDMETHODCALLTYPE FunctionTailcall(
|
|||
*/
|
||||
|
||||
typedef void STDMETHODCALLTYPE FunctionEnter2(
|
||||
FunctionID funcId,
|
||||
UINT_PTR clientData,
|
||||
COR_PRF_FRAME_INFO func,
|
||||
FunctionID funcId,
|
||||
UINT_PTR clientData,
|
||||
COR_PRF_FRAME_INFO func,
|
||||
COR_PRF_FUNCTION_ARGUMENT_INFO *argumentInfo);
|
||||
|
||||
|
||||
typedef void STDMETHODCALLTYPE FunctionLeave2(
|
||||
FunctionID funcId,
|
||||
UINT_PTR clientData,
|
||||
COR_PRF_FRAME_INFO func,
|
||||
FunctionID funcId,
|
||||
UINT_PTR clientData,
|
||||
COR_PRF_FRAME_INFO func,
|
||||
COR_PRF_FUNCTION_ARGUMENT_RANGE *retvalRange);
|
||||
|
||||
|
||||
typedef void STDMETHODCALLTYPE FunctionTailcall2(
|
||||
FunctionID funcId,
|
||||
UINT_PTR clientData,
|
||||
FunctionID funcId,
|
||||
UINT_PTR clientData,
|
||||
COR_PRF_FRAME_INFO func);
|
||||
|
||||
/*
|
||||
|
@ -352,10 +352,10 @@ typedef void STDMETHODCALLTYPE FunctionTailcall2(
|
|||
|
||||
typedef void STDMETHODCALLTYPE FunctionEnter3(
|
||||
FunctionIDOrClientID functionIDOrClientID);
|
||||
|
||||
|
||||
typedef void STDMETHODCALLTYPE FunctionLeave3(
|
||||
FunctionIDOrClientID functionIDOrClientID);
|
||||
|
||||
|
||||
typedef void STDMETHODCALLTYPE FunctionTailcall3(
|
||||
FunctionIDOrClientID functionIDOrClientID);
|
||||
|
||||
|
@ -369,18 +369,18 @@ typedef void STDMETHODCALLTYPE FunctionTailcall3(
|
|||
* FunctionIDMapper[2], then this is that remapped value; else it is the
|
||||
* true FunctionID of the function.
|
||||
*
|
||||
* eltInfo is an opaque handle that represents information about a given stack frame.
|
||||
* eltInfo is an opaque handle that represents information about a given stack frame.
|
||||
* It is only valid during the callback to which it is passed.
|
||||
*/
|
||||
|
||||
typedef void STDMETHODCALLTYPE FunctionEnter3WithInfo(
|
||||
FunctionIDOrClientID functionIDOrClientID,
|
||||
COR_PRF_ELT_INFO eltInfo);
|
||||
|
||||
|
||||
typedef void STDMETHODCALLTYPE FunctionLeave3WithInfo(
|
||||
FunctionIDOrClientID functionIDOrClientID,
|
||||
COR_PRF_ELT_INFO eltInfo);
|
||||
|
||||
|
||||
typedef void STDMETHODCALLTYPE FunctionTailcall3WithInfo(
|
||||
FunctionIDOrClientID functionIDOrClientID,
|
||||
COR_PRF_ELT_INFO eltInfo);
|
||||
|
@ -405,9 +405,9 @@ typedef void STDMETHODCALLTYPE FunctionTailcall3WithInfo(
|
|||
*
|
||||
* clientData is a void* passed straight through from DoStackSnapshot
|
||||
*
|
||||
* NOTE: One must limit the complexity of work done in StackSnapshotCallback.
|
||||
* For example, particularly when using DoStackSnapshot in an asynchronous manner,
|
||||
* the target thread may be holding locks. Executing code within StackSnapshotCallback
|
||||
* NOTE: One must limit the complexity of work done in StackSnapshotCallback.
|
||||
* For example, particularly when using DoStackSnapshot in an asynchronous manner,
|
||||
* the target thread may be holding locks. Executing code within StackSnapshotCallback
|
||||
* that requires the same locks could lead to deadlock.
|
||||
*/
|
||||
typedef HRESULT __stdcall StackSnapshotCallback(
|
||||
|
@ -436,7 +436,7 @@ typedef enum
|
|||
// behavior changes in V2.
|
||||
COR_PRF_MONITOR_CLASS_LOADS = 0x00000002,
|
||||
|
||||
// MONITOR_MODULE_LOADS controls the
|
||||
// MONITOR_MODULE_LOADS controls the
|
||||
// ModuleLoad*, ModuleUnload*, and ModuleAttachedToAssembly
|
||||
// callbacks.
|
||||
COR_PRF_MONITOR_MODULE_LOADS = 0x00000004,
|
||||
|
@ -450,7 +450,7 @@ typedef enum
|
|||
COR_PRF_MONITOR_APPDOMAIN_LOADS = 0x00000010,
|
||||
|
||||
// MONITOR_JIT_COMPILATION controls the
|
||||
// JITCompilation*, JITFunctionPitched, and JITInlining
|
||||
// JITCompilation*, JITFunctionPitched, and JITInlining
|
||||
// callbacks.
|
||||
COR_PRF_MONITOR_JIT_COMPILATION = 0x00000020,
|
||||
|
||||
|
@ -472,7 +472,7 @@ typedef enum
|
|||
COR_PRF_MONITOR_OBJECT_ALLOCATED = 0x00000100,
|
||||
|
||||
// MONITOR_THREADS controls the ThreadCreated,
|
||||
// ThreadDestroyed, ThreadAssignedToOSThread,
|
||||
// ThreadDestroyed, ThreadAssignedToOSThread,
|
||||
// and ThreadNameChanged callbacks.
|
||||
COR_PRF_MONITOR_THREADS = 0x00000200,
|
||||
|
||||
|
@ -481,11 +481,11 @@ typedef enum
|
|||
COR_PRF_MONITOR_REMOTING = 0x00000400,
|
||||
|
||||
// MONITOR_CODE_TRANSITIONS controls the
|
||||
// UnmanagedToManagedTransition and
|
||||
// UnmanagedToManagedTransition and
|
||||
// ManagedToUnmanagedTransition callbacks.
|
||||
COR_PRF_MONITOR_CODE_TRANSITIONS = 0x00000800,
|
||||
|
||||
// MONITOR_ENTERLEAVE controls the
|
||||
// MONITOR_ENTERLEAVE controls the
|
||||
// FunctionEnter*/Leave*/Tailcall* callbacks
|
||||
COR_PRF_MONITOR_ENTERLEAVE = 0x00001000,
|
||||
|
||||
|
@ -502,7 +502,7 @@ typedef enum
|
|||
COR_PRF_MONITOR_REMOTING_ASYNC = 0x00008000 | COR_PRF_MONITOR_REMOTING,
|
||||
|
||||
// MONITOR_SUSPENDS controls the RuntimeSuspend*,
|
||||
// RuntimeResume*, RuntimeThreadSuspended, and
|
||||
// RuntimeResume*, RuntimeThreadSuspended, and
|
||||
// RuntimeThreadResumed callbacks.
|
||||
COR_PRF_MONITOR_SUSPENDS = 0x00010000,
|
||||
|
||||
|
@ -579,8 +579,8 @@ typedef enum
|
|||
|
||||
// COR_PRF_REQUIRE_PROFILE_IMAGE represents all flags that require profiler-enhanced
|
||||
// images.
|
||||
COR_PRF_REQUIRE_PROFILE_IMAGE = COR_PRF_USE_PROFILE_IMAGES |
|
||||
COR_PRF_MONITOR_CODE_TRANSITIONS |
|
||||
COR_PRF_REQUIRE_PROFILE_IMAGE = COR_PRF_USE_PROFILE_IMAGES |
|
||||
COR_PRF_MONITOR_CODE_TRANSITIONS |
|
||||
COR_PRF_MONITOR_ENTERLEAVE,
|
||||
|
||||
COR_PRF_ALLOWABLE_AFTER_ATTACH = COR_PRF_MONITOR_THREADS |
|
||||
|
@ -640,8 +640,8 @@ typedef enum
|
|||
// Enables the large object allocation monitoring according to the LOH threshold.
|
||||
COR_PRF_HIGH_MONITOR_LARGEOBJECT_ALLOCATED = 0x00000040,
|
||||
|
||||
COR_PRF_HIGH_ALLOWABLE_AFTER_ATTACH = COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED |
|
||||
COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS |
|
||||
COR_PRF_HIGH_ALLOWABLE_AFTER_ATTACH = COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED |
|
||||
COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS |
|
||||
COR_PRF_HIGH_BASIC_GC |
|
||||
COR_PRF_HIGH_MONITOR_GC_MOVED_OBJECTS |
|
||||
COR_PRF_HIGH_MONITOR_LARGEOBJECT_ALLOCATED,
|
||||
|
@ -708,6 +708,7 @@ typedef enum
|
|||
COR_PRF_SUSPEND_FOR_INPROC_DEBUGGER = 6,
|
||||
COR_PRF_SUSPEND_FOR_GC_PREP = 7,
|
||||
COR_PRF_SUSPEND_FOR_REJIT = 8,
|
||||
COR_PRF_SUSPEND_FOR_PROFILER = 9,
|
||||
} COR_PRF_SUSPEND_REASON;
|
||||
|
||||
/*
|
||||
|
@ -735,6 +736,51 @@ typedef enum
|
|||
COR_PRF_REJIT_INLINING_CALLBACKS = 0x2
|
||||
} COR_PRF_REJIT_FLAGS;
|
||||
|
||||
typedef UINT_PTR EVENTPIPE_PROVIDER;
|
||||
typedef UINT_PTR EVENTPIPE_EVENT;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
COR_PRF_EVENTPIPE_BOOLEAN = 3, // Boolean
|
||||
COR_PRF_EVENTPIPE_CHAR = 4, // Unicode character
|
||||
COR_PRF_EVENTPIPE_SBYTE = 5, // Signed 8-bit integer
|
||||
COR_PRF_EVENTPIPE_BYTE = 6, // Unsigned 8-bit integer
|
||||
COR_PRF_EVENTPIPE_INT16 = 7, // Signed 16-bit integer
|
||||
COR_PRF_EVENTPIPE_UINT16 = 8, // Unsigned 16-bit integer
|
||||
COR_PRF_EVENTPIPE_INT32 = 9, // Signed 32-bit integer
|
||||
COR_PRF_EVENTPIPE_UINT32 = 10, // Unsigned 32-bit integer
|
||||
COR_PRF_EVENTPIPE_INT64 = 11, // Signed 64-bit integer
|
||||
COR_PRF_EVENTPIPE_UINT64 = 12, // Unsigned 64-bit integer
|
||||
COR_PRF_EVENTPIPE_SINGLE = 13, // IEEE 32-bit float
|
||||
COR_PRF_EVENTPIPE_DOUBLE = 14, // IEEE 64-bit double
|
||||
COR_PRF_EVENTPIPE_DECIMAL = 15, // Decimal
|
||||
COR_PRF_EVENTPIPE_DATETIME = 16, // DateTime
|
||||
COR_PRF_EVENTPIPE_GUID = 17, // Guid
|
||||
COR_PRF_EVENTPIPE_STRING = 18, // Unicode character string
|
||||
} COR_PRF_EVENTPIPE_PARAM_TYPE;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
COR_PRF_EVENTPIPE_LOGALWAYS = 0,
|
||||
COR_PRF_EVENTPIPE_CRITICAL = 1,
|
||||
COR_PRF_EVENTPIPE_ERROR = 2,
|
||||
COR_PRF_EVENTPIPE_WARNING = 3,
|
||||
COR_PRF_EVENTPIPE_INFORMATIONAL = 4,
|
||||
COR_PRF_EVENTPIPE_VERBOSE = 5
|
||||
} COR_PRF_EVENTPIPE_LEVEL;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT32 type;
|
||||
const WCHAR *name;
|
||||
} COR_PRF_EVENTPIPE_PARAM_DESC;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT64 ptr;
|
||||
UINT32 size;
|
||||
UINT32 reserved;
|
||||
} COR_PRF_EVENT_DATA;
|
||||
|
||||
/* -------------------------------------------------------------------------- *
|
||||
* Forward declarations
|
||||
|
@ -929,9 +975,9 @@ interface ICorProfilerCallback : IUnknown
|
|||
* this module may start coming afterwards however internal safeguards
|
||||
* protecting the runtime from recursive loading are still present and so it is
|
||||
* a bad time to begin inquiries on this module. The notification is informational
|
||||
* only.
|
||||
* only.
|
||||
*
|
||||
* Note: ModuleLoadFinished is a reasonable time to interrogate MetaData via API's
|
||||
* Note: ModuleLoadFinished is a reasonable time to interrogate MetaData via API's
|
||||
* like GetModuleMetadata, however APIs that create (e.g. ClassID's and FunctionID's)
|
||||
* are not safe to use here. Profiler writers are advised to stay in the universe of
|
||||
* tokens.
|
||||
|
@ -996,7 +1042,7 @@ interface ICorProfilerCallback : IUnknown
|
|||
* this class may start coming afterwards however internal safeguards
|
||||
* protecting the runtime from recursive loading are still present and so it is
|
||||
* a bad time to begin inquiries on this class. The notification is informational
|
||||
* only.
|
||||
* only.
|
||||
*
|
||||
*/
|
||||
HRESULT ClassLoadStarted(
|
||||
|
@ -1096,7 +1142,7 @@ interface ICorProfilerCallback : IUnknown
|
|||
* The JITCachedFunctionSearchStarted/Finished callbacks
|
||||
* will now occur only for some functions in regular NGEN images;
|
||||
* only profiler-optimized NGEN images will generate callbacks for
|
||||
* all functions in the image. Profilers which do not use these callbacks
|
||||
* all functions in the image. Profilers which do not use these callbacks
|
||||
* to force a function to be JIT-compiled should move to using a lazy
|
||||
* strategy for gathering function information.
|
||||
*
|
||||
|
@ -1135,7 +1181,7 @@ interface ICorProfilerCallback : IUnknown
|
|||
* The JITCachedFunctionSearchStarted/Finished callbacks
|
||||
* will now occur only for some functions in regular NGEN images;
|
||||
* only profiler-optimized NGEN images will generate callbacks for
|
||||
* all functions in the image. Profilers which do not use these callbacks
|
||||
* all functions in the image. Profilers which do not use these callbacks
|
||||
* to force a function to be JIT-compiled should move to using a lazy
|
||||
* strategy for gathering function information.
|
||||
*
|
||||
|
@ -1431,6 +1477,8 @@ interface ICorProfilerCallback : IUnknown
|
|||
* the runtime is preparing for a GC.
|
||||
* COR_PRF_SUSPEND_FOR_INPROC_DEBUGGER
|
||||
* the runtime is suspending for in-process debugging.
|
||||
* COR_PRF_SUSPEND_FOR_PROFILER
|
||||
* the runtime is suspending because of ICorProfilerInfo10::SuspendRuntime.
|
||||
* COR_PRF_SUSPEND_OTHER
|
||||
* the runtime is suspending for a reason other than those above.
|
||||
*/
|
||||
|
@ -1480,7 +1528,7 @@ interface ICorProfilerCallback : IUnknown
|
|||
|
||||
/*
|
||||
* The CLR calls RuntimeThreadSuspended to notify the code profiler
|
||||
* that a particular thread has been suspended.
|
||||
* that a particular thread has been suspended.
|
||||
*
|
||||
* This notification may occur any time between the RuntimeSuspendStarted
|
||||
* and the associated RuntimeResumeStarted. Notifications that occur
|
||||
|
@ -1543,11 +1591,11 @@ interface ICorProfilerCallback : IUnknown
|
|||
*
|
||||
* NOTE: None of the objectIDs returned by MovedReferences are valid during the callback
|
||||
* itself, as the GC may be in the middle of moving objects from old to new. Thus profilers
|
||||
* should not attempt to inspect objects during a MovedReferences call. At
|
||||
* should not attempt to inspect objects during a MovedReferences call. At
|
||||
* GarbageCollectionFinished, all objects have been moved to their new locations, and
|
||||
* inspection may be done.
|
||||
*
|
||||
* THIS CALLBACK IS OBSOLETE. It reports ranges for objects >4GB as ULONG_MAX
|
||||
* THIS CALLBACK IS OBSOLETE. It reports ranges for objects >4GB as UINT32_MAX
|
||||
* on 64-bit platforms. Use ICorProfilerCallback4::MovedReferences2 instead.
|
||||
*/
|
||||
HRESULT MovedReferences(
|
||||
|
@ -1602,7 +1650,7 @@ interface ICorProfilerCallback : IUnknown
|
|||
*
|
||||
* NOTE: None of the objectIDs returned by ObjectReferences are valid during the callback
|
||||
* itself, as the GC may be in the middle of moving objects from old to new. Thus profilers
|
||||
* should not attempt to inspect objects during an ObjectReferences call. At
|
||||
* should not attempt to inspect objects during an ObjectReferences call. At
|
||||
* GarbageCollectionFinished, all objects have been moved to their new locations, and
|
||||
* inspection may be done.
|
||||
*/
|
||||
|
@ -1624,7 +1672,7 @@ interface ICorProfilerCallback : IUnknown
|
|||
*
|
||||
* NOTE: None of the objectIDs returned by RootReferences are valid during the callback
|
||||
* itself, as the GC may be in the middle of moving objects from old to new. Thus profilers
|
||||
* should not attempt to inspect objects during a RootReferences call. At
|
||||
* should not attempt to inspect objects during a RootReferences call. At
|
||||
* GarbageCollectionFinished, all objects have been moved to their new locations, and
|
||||
* inspection may be done.
|
||||
*/
|
||||
|
@ -1874,7 +1922,7 @@ typedef enum
|
|||
*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
{
|
||||
COR_PRF_GC_ROOT_PINNING = 0x1, // Prevents GC from moving the object
|
||||
COR_PRF_GC_ROOT_WEAKREF = 0x2, // Does not prevent collection
|
||||
COR_PRF_GC_ROOT_INTERIOR = 0x4, // Refers to a field of the object rather than the object itself
|
||||
|
@ -1882,7 +1930,7 @@ typedef enum
|
|||
// COR_PRF_GC_ROOT_WEAKREF will be set also
|
||||
} COR_PRF_GC_ROOT_FLAGS;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* COR_PRF_FINALIZER_FLAGS is used by FinalizableObjectQueued to describe
|
||||
* the finalizer for the object.
|
||||
|
@ -1893,7 +1941,7 @@ typedef enum
|
|||
COR_PRF_FINALIZER_CRITICAL = 0x1 // Critical finalizer
|
||||
} COR_PRF_FINALIZER_FLAGS;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* COR_PRF_GC_GENERATION contains the numbers used to represent each GC generation
|
||||
* in the GetGenerationBounds and GetObjectGeneration functions.
|
||||
|
@ -1904,7 +1952,8 @@ typedef enum
|
|||
COR_PRF_GC_GEN_0 = 0,
|
||||
COR_PRF_GC_GEN_1 = 1,
|
||||
COR_PRF_GC_GEN_2 = 2,
|
||||
COR_PRF_GC_LARGE_OBJECT_HEAP = 3
|
||||
COR_PRF_GC_LARGE_OBJECT_HEAP = 3,
|
||||
COR_PRF_GC_PINNED_OBJECT_HEAP= 4
|
||||
} COR_PRF_GC_GENERATION;
|
||||
|
||||
|
||||
|
@ -1930,19 +1979,19 @@ typedef struct COR_PRF_GC_GENERATION_RANGE
|
|||
typedef enum
|
||||
{
|
||||
COR_PRF_CLAUSE_NONE = 0, // not a real clause (only used in error cases)
|
||||
COR_PRF_CLAUSE_FILTER = 1,
|
||||
COR_PRF_CLAUSE_CATCH = 2,
|
||||
COR_PRF_CLAUSE_FINALLY = 3,
|
||||
COR_PRF_CLAUSE_FILTER = 1,
|
||||
COR_PRF_CLAUSE_CATCH = 2,
|
||||
COR_PRF_CLAUSE_FINALLY = 3,
|
||||
} COR_PRF_CLAUSE_TYPE;
|
||||
|
||||
/*
|
||||
* COR_PRF_EX_CLAUSE_INFO identifies a specific exception clause instance and its associated frame.
|
||||
* When an exception notification is received, GetNotifiedExceptionClauseInfo() may be used to get the
|
||||
* native address and frame information for the exception clause (catch/finally/filter) that is
|
||||
* about to be run (ExceptionCatchEnter, ExceptionUnwindFinallyEnter, ExceptionFilterEnter) or has just
|
||||
* been run (ExceptionCatchLeave, ExceptionUnwindFinallyLeave, ExceptionFilterLeave).
|
||||
* COR_PRF_EX_CLAUSE_INFO identifies a specific exception clause instance and its associated frame.
|
||||
* When an exception notification is received, GetNotifiedExceptionClauseInfo() may be used to get the
|
||||
* native address and frame information for the exception clause (catch/finally/filter) that is
|
||||
* about to be run (ExceptionCatchEnter, ExceptionUnwindFinallyEnter, ExceptionFilterEnter) or has just
|
||||
* been run (ExceptionCatchLeave, ExceptionUnwindFinallyLeave, ExceptionFilterLeave).
|
||||
*/
|
||||
typedef struct COR_PRF_EX_CLAUSE_INFO
|
||||
typedef struct COR_PRF_EX_CLAUSE_INFO
|
||||
{
|
||||
COR_PRF_CLAUSE_TYPE clauseType; // the type of clause we just entered or left
|
||||
UINT_PTR programCounter; // the native entry point of the clause handler (e.g. EIP)
|
||||
|
@ -1963,25 +2012,25 @@ typedef enum
|
|||
* Bits from COR_PRF_MODULE_FLAGS are returned to the profiler in GetModuleInfo2's
|
||||
* pdwModuleFlags output parameter. Some combinations of 2 or more flags are possible,
|
||||
* though not all combinations are possible.
|
||||
*/
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
// The module was loaded from disk
|
||||
COR_PRF_MODULE_DISK = 0x00000001,
|
||||
|
||||
|
||||
// The module had been generated via NGEN
|
||||
COR_PRF_MODULE_NGEN = 0x00000002,
|
||||
|
||||
|
||||
// The module was created via methods in the Reflection.Emit namespace
|
||||
COR_PRF_MODULE_DYNAMIC = 0x00000004,
|
||||
|
||||
|
||||
// The module's lifetime is managed by the garbage collector.
|
||||
COR_PRF_MODULE_COLLECTIBLE = 0x00000008,
|
||||
|
||||
|
||||
// The module contains no metadata and is used strictly as a resource. The managed
|
||||
// equivalent of this bit is the System.Reflection.Module.IsResource() method.
|
||||
COR_PRF_MODULE_RESOURCE = 0x00000010,
|
||||
|
||||
|
||||
// The module's layout in memory is flat, as opposed to mapped. For modules that have
|
||||
// this bit set, profilers that directly read information out of the PE header will
|
||||
// need to be careful when interpreting RVAs present in the PE header.
|
||||
|
@ -2035,11 +2084,11 @@ interface ICorProfilerCallback2 : ICorProfilerCallback
|
|||
*/
|
||||
|
||||
/*
|
||||
* The CLR calls GarbageCollectionStarted before beginning a
|
||||
* The CLR calls GarbageCollectionStarted before beginning a
|
||||
* garbage collection. All GC callbacks pertaining to this
|
||||
* collection will occur between the GarbageCollectionStarted
|
||||
* callback and the corresponding GarbageCollectionFinished
|
||||
* callback. Corresponding GarbageCollectionStarted and
|
||||
* callback. Corresponding GarbageCollectionStarted and
|
||||
* GarbageCollectionFinished callbacks need not occur on the same thread.
|
||||
*
|
||||
* cGenerations indicates the total number of entries in
|
||||
|
@ -2052,7 +2101,7 @@ interface ICorProfilerCallback2 : ICorProfilerCallback
|
|||
*
|
||||
* NOTE: It is safe to inspect objects in their original locations
|
||||
* during this callback. The GC will begin moving objects after
|
||||
* the profiler returns from this callback. Therefore, after
|
||||
* the profiler returns from this callback. Therefore, after
|
||||
* returning, the profiler should consider all ObjectIDs to be invalid
|
||||
* until it receives a GarbageCollectionFinished callback.
|
||||
*/
|
||||
|
@ -2090,7 +2139,7 @@ interface ICorProfilerCallback2 : ICorProfilerCallback
|
|||
* objectIDRangeStart[i] <= ObjectID < objectIDRangeStart[i] + cObjectIDRangeLength[i]
|
||||
* for 0 <= i < cMovedObjectIDRanges, then the ObjectID has survived the collection
|
||||
*
|
||||
* THIS CALLBACK IS OBSOLETE. It reports ranges for objects >4GB as ULONG_MAX
|
||||
* THIS CALLBACK IS OBSOLETE. It reports ranges for objects >4GB as UINT32_MAX
|
||||
* on 64-bit platforms. Use ICorProfilerCallback4::SurvivingReferences2 instead.
|
||||
*/
|
||||
HRESULT SurvivingReferences(
|
||||
|
@ -2152,7 +2201,7 @@ interface ICorProfilerCallback2 : ICorProfilerCallback
|
|||
*
|
||||
* NOTE: None of the objectIDs returned by RootReferences2 are valid during the callback
|
||||
* itself, as the GC may be in the middle of moving objects from old to new. Thus profilers
|
||||
* should not attempt to inspect objects during a RootReferences2 call. At
|
||||
* should not attempt to inspect objects during a RootReferences2 call. At
|
||||
* GarbageCollectionFinished, all objects have been moved to their new locations, and
|
||||
* inspection may be done.
|
||||
*/
|
||||
|
@ -2237,7 +2286,7 @@ interface ICorProfilerCallback4 : ICorProfilerCallback3
|
|||
|
||||
/*
|
||||
* This is called to report an error encountered while processing a ReJIT request.
|
||||
* This may either be called from within the RequestReJIT call itself, or called after
|
||||
* This may either be called from within the RequestReJIT call itself, or called after
|
||||
* RequestReJIT returns, if the error was encountered later on.
|
||||
*/
|
||||
HRESULT ReJITError(
|
||||
|
@ -2268,13 +2317,13 @@ interface ICorProfilerCallback4 : ICorProfilerCallback3
|
|||
*
|
||||
* NOTE: None of the objectIDs returned by MovedReferences are valid during the callback
|
||||
* itself, as the GC may be in the middle of moving objects from old to new. Thus profilers
|
||||
* should not attempt to inspect objects during a MovedReferences call. At
|
||||
* should not attempt to inspect objects during a MovedReferences call. At
|
||||
* GarbageCollectionFinished, all objects have been moved to their new locations, and
|
||||
* inspection may be done.
|
||||
*
|
||||
* If the profiler implements ICorProfilerCallback4, ICorProfilerCallback4::MovedReferences2
|
||||
* is called first and ICorProfilerCallback::MovedReferences is called second but only if
|
||||
* ICorProfilerCallback4::MovedReferences2 returned success. Profilers can return failure
|
||||
* If the profiler implements ICorProfilerCallback4, ICorProfilerCallback4::MovedReferences2
|
||||
* is called first and ICorProfilerCallback::MovedReferences is called second but only if
|
||||
* ICorProfilerCallback4::MovedReferences2 returned success. Profilers can return failure
|
||||
* from ICorProfilerCallback4::MovedReferences2 to save some chattiness.
|
||||
*/
|
||||
HRESULT MovedReferences2(
|
||||
|
@ -2312,9 +2361,9 @@ interface ICorProfilerCallback4 : ICorProfilerCallback3
|
|||
* objectIDRangeStart[i] <= ObjectID < objectIDRangeStart[i] + cObjectIDRangeLength[i]
|
||||
* for 0 <= i < cMovedObjectIDRanges, then the ObjectID has survived the collection
|
||||
*
|
||||
* If the profiler implements ICorProfilerCallback4, ICorProfilerCallback4::SurvivingReferences2
|
||||
* is called first and ICorProfilerCallback2::SurvivingReferences is called second but only if
|
||||
* ICorProfilerCallback4::SurvivingReferences2 returned success. Profilers can return failure
|
||||
* If the profiler implements ICorProfilerCallback4, ICorProfilerCallback4::SurvivingReferences2
|
||||
* is called first and ICorProfilerCallback2::SurvivingReferences is called second but only if
|
||||
* ICorProfilerCallback4::SurvivingReferences2 returned success. Profilers can return failure
|
||||
* from ICorProfilerCallback4::SurvivingReferences2 to save some chattiness.
|
||||
*/
|
||||
HRESULT SurvivingReferences2(
|
||||
|
@ -2334,17 +2383,17 @@ interface ICorProfilerCallback4 : ICorProfilerCallback3
|
|||
interface ICorProfilerCallback5 : ICorProfilerCallback4
|
||||
{
|
||||
/*
|
||||
* The CLR calls ConditionalWeakTableElementReferences with information
|
||||
* The CLR calls ConditionalWeakTableElementReferences with information
|
||||
* about dependent handles after a garbage collection has occurred.
|
||||
*
|
||||
* For each root ID in rootIds, keyRefIds will contain the ObjectID for
|
||||
* For each root ID in rootIds, keyRefIds will contain the ObjectID for
|
||||
* the primary element in the dependent handle pair, and valueRefIds will
|
||||
* contain the ObjectID for the secondary element (keyRefIds[i] keeps
|
||||
* contain the ObjectID for the secondary element (keyRefIds[i] keeps
|
||||
* valueRefIds[i] alive).
|
||||
*
|
||||
* NOTE: None of the objectIDs returned by ConditionalWeakTableElementReferences
|
||||
* are valid during the callback itself, as the GC may be in the middle
|
||||
* of moving objects from old to new. Thus profilers should not attempt
|
||||
* are valid during the callback itself, as the GC may be in the middle
|
||||
* of moving objects from old to new. Thus profilers should not attempt
|
||||
* to inspect objects during a ConditionalWeakTableElementReferences call.
|
||||
* At GarbageCollectionFinished, all objects have been moved to their new
|
||||
* locations, and inspection may be done.
|
||||
|
@ -2377,11 +2426,11 @@ interface ICorProfilerCallback6 : ICorProfilerCallback5
|
|||
//
|
||||
// The profiler uses the ICorProfilerAssemblyReferenceProvider provided to add assembly references
|
||||
// to the CLR assembly reference closure walker. The ICorProfilerAssemblyReferenceProvider
|
||||
// should only be used from within this callback. The profiler will still need to explicitly add assembly
|
||||
// should only be used from within this callback. The profiler will still need to explicitly add assembly
|
||||
// references via IMetaDataAssemblyEmit, from within the ModuleLoadFinished callback for the referencing assembly,
|
||||
// even though the profiler implements this GetAssemblyReferences callback. This callback does not result in
|
||||
// modified metadata; only in a modified assembly reference closure walk.
|
||||
//
|
||||
//
|
||||
// The profiler should be prepared to receive duplicate calls to this callback for the same assembly,
|
||||
// and should respond identically for each such duplicate call (by making the same set of
|
||||
// ICorProfilerAssemblyReferenceProvider::AddAssemblyReference calls).
|
||||
|
@ -2694,7 +2743,7 @@ interface ICorProfilerInfo : IUnknown
|
|||
* Retrieve information about a given module.
|
||||
*
|
||||
* When the module is loaded from disk, the name returned will be the filename;
|
||||
* otherwise, the name will be the name from the metadata Module table (i.e.,
|
||||
* otherwise, the name will be the name from the metadata Module table (i.e.,
|
||||
* the same as the managed System.Reflection.Module.ScopeName).
|
||||
*
|
||||
* NOTE: While this function may be called as soon as the moduleId is alive,
|
||||
|
@ -2939,7 +2988,7 @@ interface ICorProfilerInfo2 : ICorProfilerInfo
|
|||
* will return CORPROF_E_STACKSNAPSHOT_UNMANAGED_CTX. Contexts are
|
||||
* only provided by profilers that hijack threads to force them to walk their
|
||||
* own stacks; profilers should not attempt to provide a context when walking
|
||||
* another thread's stack. If context is NULL, the stack walk will begin at the
|
||||
* another thread's stack. If context is NULL, the stack walk will begin at the
|
||||
* last available managed frame for the target thread.
|
||||
*
|
||||
* See the definition of StackSnapshotCallback for more information.
|
||||
|
@ -2976,14 +3025,14 @@ interface ICorProfilerInfo2 : ICorProfilerInfo
|
|||
/*
|
||||
* GetFunctionInfo2 returns the parent class of a function, plus the
|
||||
* function's metadata token and the ClassIDs of its type arguments
|
||||
* (if any).
|
||||
* (if any).
|
||||
*
|
||||
* When a COR_PRF_FRAME_INFO obtained from a FunctionEnter2
|
||||
* callback is passed, the ClassID and all type arguments will be exact.
|
||||
*
|
||||
* When a COR_PRF_FRAME_INFO from any other source is passed, or
|
||||
* when 0 is passed as the frameInfo argument, exact ClassID and type
|
||||
* arguments cannot always be determined. The value returned in pClassId
|
||||
* When a COR_PRF_FRAME_INFO from any other source is passed, or
|
||||
* when 0 is passed as the frameInfo argument, exact ClassID and type
|
||||
* arguments cannot always be determined. The value returned in pClassId
|
||||
* may be NULL and some type args will come back as System.Object.
|
||||
*
|
||||
*/
|
||||
|
@ -3072,7 +3121,7 @@ interface ICorProfilerInfo2 : ICorProfilerInfo
|
|||
* Calling this function with a TypeRef token can have unpredictable results; callers
|
||||
* should resolve the TypeRef to a TypeDef and use that.
|
||||
*
|
||||
* If the type is not already loaded, calling this function will cause it to be.
|
||||
* If the type is not already loaded, calling this function will cause it to be.
|
||||
* Loading is a dangerous operation in many contexts. For example, calling
|
||||
* this function during loading of modules or other types could lead to an infinite
|
||||
* loop as the runtime attempts to circularly load things.
|
||||
|
@ -3098,7 +3147,7 @@ interface ICorProfilerInfo2 : ICorProfilerInfo
|
|||
* Calling this function with a MethodRef token can have unpredictable results; callers
|
||||
* should resolve the MethodRef to a MethodDef and use that.
|
||||
*
|
||||
* If the function is not already loaded, calling this function will cause it to be.
|
||||
* If the function is not already loaded, calling this function will cause it to be.
|
||||
* Loading is a dangerous operation in many contexts. For example, calling
|
||||
* this function during loading of modules or types could lead to an infinite
|
||||
* loop as the runtime attempts to circularly load things.
|
||||
|
@ -3164,7 +3213,7 @@ interface ICorProfilerInfo2 : ICorProfilerInfo
|
|||
|
||||
/*
|
||||
* GetRVAStaticAddress gets the address of the home for the given
|
||||
* RVA static. It must be called from a managed thread. Otherwise,
|
||||
* RVA static. It must be called from a managed thread. Otherwise,
|
||||
* it will return CORPROF_E_NOT_MANAGED_THREAD.
|
||||
*/
|
||||
HRESULT GetRVAStaticAddress(
|
||||
|
@ -3201,11 +3250,11 @@ interface ICorProfilerInfo2 : ICorProfilerInfo
|
|||
|
||||
/*
|
||||
* GetContextStaticAddress gets the address of the home for the given
|
||||
* Context static in the given context. It must be called from a managed
|
||||
* Context static in the given context. It must be called from a managed
|
||||
* thread. Otherwise, it will return CORPROF_E_NOT_MANAGED_THREAD.
|
||||
*
|
||||
* This function may return CORPROF_E_DATAINCOMPLETE if the given static
|
||||
* has not been assigned a home in the given Context.
|
||||
* has not been assigned a home in the given Context.
|
||||
*/
|
||||
HRESULT GetContextStaticAddress(
|
||||
[in] ClassID classId,
|
||||
|
@ -3259,7 +3308,7 @@ interface ICorProfilerInfo2 : ICorProfilerInfo
|
|||
[in] ULONG cObjectRanges,
|
||||
[out] ULONG *pcObjectRanges,
|
||||
[out, size_is(cObjectRanges), length_is(*pcObjectRanges)] COR_PRF_GC_GENERATION_RANGE ranges[]);
|
||||
|
||||
|
||||
/*
|
||||
* GetObjectGeneration returns which generation the given object is currently in, along
|
||||
* with the start and length of the segment containing the object. It may be called
|
||||
|
@ -3272,24 +3321,24 @@ interface ICorProfilerInfo2 : ICorProfilerInfo
|
|||
|
||||
|
||||
/*
|
||||
* When an exception notification is received, GetNotifiedExceptionClauseInfo() may be used
|
||||
* When an exception notification is received, GetNotifiedExceptionClauseInfo() may be used
|
||||
* to get the native address and frame information for the exception clause (catch/finally/filter)
|
||||
* that is about to be run (ExceptionCatchEnter, ExceptionUnwindFinallyEnter, ExceptionFilterEnter)
|
||||
* or has just been run (ExceptionCatchLeave, ExceptionUnwindFinallyLeave, ExceptionFilterLeave).
|
||||
* or has just been run (ExceptionCatchLeave, ExceptionUnwindFinallyLeave, ExceptionFilterLeave).
|
||||
*
|
||||
* This call may be made at any time after one of the Enter calls above until either the matching
|
||||
* Leave call is received or until a nested exception throws out of the current clause in which case
|
||||
* there will be no Leave notification for that clause. Note it is not possible for a throw to escape
|
||||
* there will be no Leave notification for that clause. Note it is not possible for a throw to escape
|
||||
* a Filter so there is always a Leave in that case.
|
||||
*
|
||||
* Return values:
|
||||
* S_OK indicates success
|
||||
* S_FALSE indicates that no exception clause is active
|
||||
* CORPROF_E_NOT_MANAGED_THREAD indicates an unmanaged thread.
|
||||
* S_FALSE indicates that no exception clause is active
|
||||
* CORPROF_E_NOT_MANAGED_THREAD indicates an unmanaged thread.
|
||||
*/
|
||||
|
||||
HRESULT GetNotifiedExceptionClauseInfo(
|
||||
[out] COR_PRF_EX_CLAUSE_INFO *pinfo);
|
||||
[out] COR_PRF_EX_CLAUSE_INFO *pinfo);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3316,7 +3365,7 @@ interface ICorProfilerInfo2 : ICorProfilerInfo
|
|||
local
|
||||
]
|
||||
interface ICorProfilerInfo3 : ICorProfilerInfo2
|
||||
{
|
||||
{
|
||||
/*
|
||||
* Returns an enumerator for all previously jitted functions. May overlap with
|
||||
* functions previously reported via CompilationStarted callbacks.
|
||||
|
@ -3349,8 +3398,8 @@ interface ICorProfilerInfo3 : ICorProfilerInfo2
|
|||
|
||||
/*
|
||||
* The code profiler calls SetFunctionHooks3 to specify handlers
|
||||
* for FunctionEnter3, FunctionLeave3, and FunctionTailcall3, and calls
|
||||
* SetFunctionHooks3WithInfo to specify handlers for FunctionEnter3WithInfo,
|
||||
* for FunctionEnter3, FunctionLeave3, and FunctionTailcall3, and calls
|
||||
* SetFunctionHooks3WithInfo to specify handlers for FunctionEnter3WithInfo,
|
||||
* FunctionLeave3WithInfo, and FunctionTailcall3WithInfo.
|
||||
*
|
||||
* Note that only one set of callbacks may be active at a time. Thus,
|
||||
|
@ -3376,34 +3425,34 @@ interface ICorProfilerInfo3 : ICorProfilerInfo2
|
|||
[in] FunctionTailcall3WithInfo *pFuncTailcall3WithInfo);
|
||||
|
||||
/*
|
||||
* The profiler can call GetFunctionEnter3Info to gather frame info and argument info
|
||||
* in FunctionEnter3WithInfo callback. The profiler needs to allocate sufficient space
|
||||
* for COR_PRF_FUNCTION_ARGUMENT_INFO of the function it's inspecting and indicate the
|
||||
* The profiler can call GetFunctionEnter3Info to gather frame info and argument info
|
||||
* in FunctionEnter3WithInfo callback. The profiler needs to allocate sufficient space
|
||||
* for COR_PRF_FUNCTION_ARGUMENT_INFO of the function it's inspecting and indicate the
|
||||
* size in a ULONG pointed by pcbArgumentInfo.
|
||||
*/
|
||||
HRESULT GetFunctionEnter3Info(
|
||||
[in] FunctionID functionId,
|
||||
HRESULT GetFunctionEnter3Info(
|
||||
[in] FunctionID functionId,
|
||||
[in] COR_PRF_ELT_INFO eltInfo,
|
||||
[out] COR_PRF_FRAME_INFO *pFrameInfo,
|
||||
[in, out] ULONG *pcbArgumentInfo,
|
||||
[out, size_is(*pcbArgumentInfo)] COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo);
|
||||
|
||||
|
||||
/*
|
||||
* The profiler can call GetFunctionLeave3Info to gather frame info and return value
|
||||
* in FunctionLeave3WithInfo callback.
|
||||
* The profiler can call GetFunctionLeave3Info to gather frame info and return value
|
||||
* in FunctionLeave3WithInfo callback.
|
||||
*/
|
||||
HRESULT GetFunctionLeave3Info(
|
||||
[in] FunctionID functionId,
|
||||
HRESULT GetFunctionLeave3Info(
|
||||
[in] FunctionID functionId,
|
||||
[in] COR_PRF_ELT_INFO eltInfo,
|
||||
[out] COR_PRF_FRAME_INFO *pFrameInfo,
|
||||
[out] COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange);
|
||||
|
||||
|
||||
/*
|
||||
* The profiler can call GetFunctionTailcall3Info to gather frame info in
|
||||
* FunctionTailcall3WithInfo callback.
|
||||
* The profiler can call GetFunctionTailcall3Info to gather frame info in
|
||||
* FunctionTailcall3WithInfo callback.
|
||||
*/
|
||||
HRESULT GetFunctionTailcall3Info(
|
||||
[in] FunctionID functionId,
|
||||
HRESULT GetFunctionTailcall3Info(
|
||||
[in] FunctionID functionId,
|
||||
[in] COR_PRF_ELT_INFO eltInfo,
|
||||
[out] COR_PRF_FRAME_INFO *pFrameInfo);
|
||||
|
||||
|
@ -3411,7 +3460,7 @@ interface ICorProfilerInfo3 : ICorProfilerInfo2
|
|||
|
||||
/*
|
||||
* The profiler can call GetRuntimeInformation to query CLR version information.
|
||||
* Passing NULL to any parameter is acceptable except pcchVersionString cannot
|
||||
* Passing NULL to any parameter is acceptable except pcchVersionString cannot
|
||||
* be NULL if szVersionString is not NULL.
|
||||
*/
|
||||
HRESULT GetRuntimeInformation([out] USHORT *pClrInstanceId,
|
||||
|
@ -3454,12 +3503,12 @@ interface ICorProfilerInfo3 : ICorProfilerInfo2
|
|||
* Retrieve information about a given module.
|
||||
*
|
||||
* When the module is loaded from disk, the name returned will be the filename;
|
||||
* otherwise, the name will be the name from the metadata Module table (i.e.,
|
||||
* otherwise, the name will be the name from the metadata Module table (i.e.,
|
||||
* the same as the managed System.Reflection.Module.ScopeName).
|
||||
*
|
||||
*
|
||||
* *pdwModuleFlags will be filled in with a bitmask of values from COR_PRF_MODULE_FLAGS
|
||||
* that specify some properties of the module.
|
||||
*
|
||||
*
|
||||
* NOTE: While this function may be called as soon as the moduleId is alive,
|
||||
* the AssemblyID of the containing assembly will not be available until the
|
||||
* ModuleAttachedToAssembly callback.
|
||||
|
@ -3493,12 +3542,12 @@ interface ICorProfilerObjectEnum : IUnknown
|
|||
{
|
||||
HRESULT Skip(
|
||||
[in] ULONG celt);
|
||||
|
||||
|
||||
HRESULT Reset();
|
||||
|
||||
|
||||
HRESULT Clone(
|
||||
[out] ICorProfilerObjectEnum **ppEnum);
|
||||
|
||||
|
||||
HRESULT GetCount(
|
||||
[out] ULONG *pcelt);
|
||||
|
||||
|
@ -3522,11 +3571,11 @@ interface ICorProfilerObjectEnum : IUnknown
|
|||
interface ICorProfilerFunctionEnum : IUnknown
|
||||
{
|
||||
HRESULT Skip([in] ULONG celt);
|
||||
|
||||
|
||||
HRESULT Reset();
|
||||
|
||||
|
||||
HRESULT Clone([out] ICorProfilerFunctionEnum **ppEnum);
|
||||
|
||||
|
||||
HRESULT GetCount([out] ULONG *pcelt);
|
||||
|
||||
HRESULT Next([in] ULONG celt,
|
||||
|
@ -3548,11 +3597,11 @@ interface ICorProfilerFunctionEnum : IUnknown
|
|||
interface ICorProfilerModuleEnum : IUnknown
|
||||
{
|
||||
HRESULT Skip([in] ULONG celt);
|
||||
|
||||
|
||||
HRESULT Reset();
|
||||
|
||||
|
||||
HRESULT Clone([out] ICorProfilerModuleEnum **ppEnum);
|
||||
|
||||
|
||||
HRESULT GetCount([out] ULONG *pcelt);
|
||||
|
||||
HRESULT Next([in] ULONG celt,
|
||||
|
@ -3588,7 +3637,7 @@ interface IMethodMalloc : IUnknown
|
|||
|
||||
/*
|
||||
* The CLR implements the ICorProfilerFunctionControl interface. This interface
|
||||
* is used by a code profiler to communicate with the CLR to control how the
|
||||
* is used by a code profiler to communicate with the CLR to control how the
|
||||
* JIT should generate code when rejitting a specific method.
|
||||
*
|
||||
* The ICorProfilerFunctionControl interface implemented by the CLR uses the
|
||||
|
@ -3650,7 +3699,7 @@ interface ICorProfilerFunctionControl : IUnknown
|
|||
local
|
||||
]
|
||||
interface ICorProfilerInfo4 : ICorProfilerInfo3
|
||||
{
|
||||
{
|
||||
HRESULT EnumThreads([out] ICorProfilerThreadEnum **ppEnum);
|
||||
HRESULT InitializeCurrentThread();
|
||||
|
||||
|
@ -3716,7 +3765,7 @@ interface ICorProfilerInfo4 : ICorProfilerInfo3
|
|||
[in] FunctionID functionId,
|
||||
[in] ULONG cReJitIds,
|
||||
[out] ULONG * pcReJitIds,
|
||||
[out, size_is(cReJitIds), length_is(*pcReJitIds)]
|
||||
[out, size_is(cReJitIds), length_is(*pcReJitIds)]
|
||||
ReJITID reJitIds[]);
|
||||
|
||||
/*
|
||||
|
@ -3734,7 +3783,7 @@ interface ICorProfilerInfo4 : ICorProfilerInfo3
|
|||
/*
|
||||
* Returns an enumerator for all previously jitted functions. May overlap with
|
||||
* functions previously reported via CompilationStarted callbacks. The returned
|
||||
* enumeration will include values for the COR_PRF_FUNCTION::reJitId field
|
||||
* enumeration will include values for the COR_PRF_FUNCTION::reJitId field
|
||||
*/
|
||||
HRESULT EnumJITedFunctions2([out] ICorProfilerFunctionEnum** ppEnum);
|
||||
|
||||
|
@ -3789,12 +3838,12 @@ interface ICorProfilerInfo5 : ICorProfilerInfo4
|
|||
interface ICorProfilerInfo6 : ICorProfilerInfo5
|
||||
{
|
||||
/*
|
||||
* Returns an enumerator for all methods that
|
||||
* - belong to a given NGen or R2R module (inlinersModuleId) and
|
||||
* - inlined a body of a given method (inlineeModuleId / inlineeMethodId).
|
||||
* Returns an enumerator for all methods that
|
||||
* - belong to a given NGen or R2R module (inlinersModuleId) and
|
||||
* - inlined a body of a given method (inlineeModuleId / inlineeMethodId).
|
||||
*
|
||||
* If incompleteData is set to TRUE after function is called, it means that the methods enumerator
|
||||
* doesn't contain all methods inlining a given method.
|
||||
* If incompleteData is set to TRUE after function is called, it means that the methods enumerator
|
||||
* doesn't contain all methods inlining a given method.
|
||||
* It can happen when one or more direct or indirect dependencies of inliners module haven't been loaded yet.
|
||||
* If profiler needs accurate data it should retry later when more modules are loaded (preferably on each module load).
|
||||
*
|
||||
|
@ -3803,7 +3852,7 @@ interface ICorProfilerInfo6 : ICorProfilerInfo5
|
|||
* NOTE: If the inlinee method is decorated with the System.Runtime.Versioning.NonVersionable attribute then
|
||||
* then some inliners may not ever be reported. If you need to get a full accounting you can avoid the issue
|
||||
* by disabling the use of all native images.
|
||||
*
|
||||
*
|
||||
*/
|
||||
HRESULT EnumNgenModuleMethodsInliningThisMethod(
|
||||
[in] ModuleID inlinersModuleId,
|
||||
|
@ -3841,8 +3890,8 @@ interface ICorProfilerInfo7 : ICorProfilerInfo6
|
|||
*
|
||||
* Returns S_OK if the length could be determined (even if it is 0)
|
||||
*
|
||||
* Note: The current implementation does not support reflection.emit.
|
||||
* CORPROF_E_MODULE_IS_DYNAMIC will be returned in that case.
|
||||
* Note: The current implementation does not support reflection.emit.
|
||||
* CORPROF_E_MODULE_IS_DYNAMIC will be returned in that case.
|
||||
*/
|
||||
HRESULT GetInMemorySymbolsLength(
|
||||
[in] ModuleID moduleId,
|
||||
|
@ -3850,7 +3899,7 @@ interface ICorProfilerInfo7 : ICorProfilerInfo6
|
|||
|
||||
/* Reads bytes from an in-memory symbol stream
|
||||
*
|
||||
* This function attempts to read countSymbolBytes of data starting at offset
|
||||
* This function attempts to read countSymbolBytes of data starting at offset
|
||||
* symbolsReadOffset within the in-memory stream. The data will be copied into
|
||||
* pSymbolBytes which is expected to have countSymbolBytes of space available.
|
||||
* pCountSymbolsBytesRead contains the actual number of bytes read which
|
||||
|
@ -3879,7 +3928,7 @@ interface ICorProfilerInfo7 : ICorProfilerInfo6
|
|||
interface ICorProfilerInfo8 : ICorProfilerInfo7
|
||||
{
|
||||
/*
|
||||
* Determines if a function has associated metadata
|
||||
* Determines if a function has associated metadata
|
||||
*
|
||||
* Certain methods like IL Stubs or LCG Methods do not have
|
||||
* associated metadata that can be retrieved using the IMetaDataImport APIs.
|
||||
|
@ -3961,7 +4010,7 @@ interface ICorProfilerInfo10 : ICorProfilerInfo9
|
|||
/*
|
||||
* This method will ReJIT the methods requested, as well as any inliners
|
||||
* of the methods requested.
|
||||
*
|
||||
*
|
||||
* RequestReJIT does not do any tracking of inlined methods. The profiler
|
||||
* was expected to track inlining and call RequestReJIT for all inliners
|
||||
* to make sure every instance of an inlined method was ReJITted.
|
||||
|
@ -3982,6 +4031,74 @@ interface ICorProfilerInfo10 : ICorProfilerInfo9
|
|||
HRESULT ResumeRuntime();
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(06398876-8987-4154-B621-40A00D6E4D04),
|
||||
pointer_default(unique),
|
||||
local
|
||||
]
|
||||
interface ICorProfilerInfo11 : ICorProfilerInfo10
|
||||
{
|
||||
/*
|
||||
* Get environment variable for the running managed code.
|
||||
*/
|
||||
HRESULT GetEnvironmentVariable(
|
||||
[in, string] const WCHAR *szName,
|
||||
[in] ULONG cchValue,
|
||||
[out] ULONG *pcchValue,
|
||||
[out, annotation("_Out_writes_to_(cchValue, *pcchValue)")]
|
||||
WCHAR szValue[]);
|
||||
|
||||
/*
|
||||
* Set environment variable for the running managed code.
|
||||
*
|
||||
* The code profiler calls this function to modify environment variables of the
|
||||
* current managed process. For example, it can be used in the profiler's Initialize()
|
||||
* or InitializeForAttach() callbacks.
|
||||
*
|
||||
* szName is the name of the environment variable, should not be NULL.
|
||||
*
|
||||
* szValue is the contents of the environment variable, or NULL if the variable should be deleted.
|
||||
*/
|
||||
HRESULT SetEnvironmentVariable(
|
||||
[in, string] const WCHAR *szName,
|
||||
[in, string] const WCHAR *szValue);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(27b24ccd-1cb1-47c5-96ee-98190dc30959),
|
||||
pointer_default(unique),
|
||||
local
|
||||
]
|
||||
interface ICorProfilerInfo12 : ICorProfilerInfo11
|
||||
{
|
||||
HRESULT EventPipeCreateProvider(
|
||||
[in, string] const WCHAR *szName,
|
||||
[out] EVENTPIPE_PROVIDER *pProviderHandle);
|
||||
|
||||
HRESULT EventPipeDefineEvent(
|
||||
[in] EVENTPIPE_PROVIDER provHandle,
|
||||
[in, string] const WCHAR *szName,
|
||||
[in] UINT32 eventID,
|
||||
[in] UINT64 keywords,
|
||||
[in] UINT32 eventVersion,
|
||||
[in] UINT32 level,
|
||||
[in] BOOL needStack,
|
||||
[in] UINT32 cParamDescs,
|
||||
[in, size_is(cParamDescs)]
|
||||
COR_PRF_EVENTPIPE_PARAM_DESC pParamDescs[],
|
||||
[out] EVENTPIPE_EVENT *pEventHandle);
|
||||
|
||||
HRESULT EventPipeWriteEvent(
|
||||
[in] EVENTPIPE_EVENT eventHandle,
|
||||
[in, size_is(cData)]
|
||||
COR_PRF_EVENT_DATA data[],
|
||||
[in] UINT32 cData,
|
||||
[in] LPCGUID pActivityId,
|
||||
[in] LPCGUID pRelatedActivityId);
|
||||
}
|
||||
|
||||
/*
|
||||
* This interface lets you iterate over methods in the runtime.
|
||||
*/
|
||||
|
@ -4021,11 +4138,11 @@ interface ICorProfilerMethodEnum : IUnknown
|
|||
interface ICorProfilerThreadEnum : IUnknown
|
||||
{
|
||||
HRESULT Skip([in] ULONG celt);
|
||||
|
||||
|
||||
HRESULT Reset();
|
||||
|
||||
|
||||
HRESULT Clone([out] ICorProfilerThreadEnum **ppEnum);
|
||||
|
||||
|
||||
HRESULT GetCount([out] ULONG *pcelt);
|
||||
|
||||
HRESULT Next([in] ULONG celt,
|
||||
|
|
|
@ -15,7 +15,7 @@ cpp_quote("#endif")
|
|||
typedef enum
|
||||
{
|
||||
COR_PUB_MANAGEDONLY = 0x00000001 // Must always be set,
|
||||
// only enumerates
|
||||
// only enumerates
|
||||
// managed processes
|
||||
} COR_PUB_ENUMPROCESS;
|
||||
|
||||
|
@ -79,25 +79,25 @@ interface ICorPublish : IUnknown
|
|||
{
|
||||
/*
|
||||
* Retrieves a list of managed processes on this machine which
|
||||
* the current user has permission to debug. In this version,
|
||||
* Type must always be equal to COR_PUB_MANAGEDONLY.
|
||||
* The list is based on a snapshot of the processes running when
|
||||
* the current user has permission to debug. In this version,
|
||||
* Type must always be equal to COR_PUB_MANAGEDONLY.
|
||||
* The list is based on a snapshot of the processes running when
|
||||
* the enum method is called. The enumerator will not reflect any
|
||||
* processes that start before or terminate after EnumProcesses is called.
|
||||
* If EnumProcesses is called more than once on this ICorPublish
|
||||
* instance, a new up-to-date enumeration will be returned without
|
||||
* instance, a new up-to-date enumeration will be returned without
|
||||
* affecting any previous ones.
|
||||
*/
|
||||
HRESULT EnumProcesses([in] COR_PUB_ENUMPROCESS Type,
|
||||
[out] ICorPublishProcessEnum **ppIEnum);
|
||||
|
||||
/*
|
||||
* Gets a new ICorPublishProcess object for the managed process
|
||||
* Gets a new ICorPublishProcess object for the managed process
|
||||
* with the given process ID. Returns failure if the process doesn't
|
||||
* exist, or isn't a managed process that can be debugged by the current
|
||||
* user.
|
||||
* user.
|
||||
*/
|
||||
HRESULT GetProcess([in] unsigned pid,
|
||||
HRESULT GetProcess([in] unsigned pid,
|
||||
[out] ICorPublishProcess **ppProcess);
|
||||
}
|
||||
|
||||
|
@ -151,37 +151,37 @@ interface ICorPublishProcess : IUnknown
|
|||
{
|
||||
/*
|
||||
* Returns true if the process is known to have managed code
|
||||
* running in it. Since this version of ICorPublish only provides access
|
||||
* running in it. Since this version of ICorPublish only provides access
|
||||
* to managed processes, this method always returns true.
|
||||
*/
|
||||
HRESULT IsManaged([out] BOOL *pbManaged);
|
||||
|
||||
|
||||
/*
|
||||
* Enumerates the list of known application domains in this process.
|
||||
* This list is based on a snapshot of the existing AppDomains when
|
||||
* this method is called. This method may be called more than
|
||||
* once to create a new up-to-date list. Existing enumerations will not
|
||||
* be affected by calls to this method. If the process has been
|
||||
* be affected by calls to this method. If the process has been
|
||||
* terminated, this will fail with CORDBG_E_PROCESS_TERMINATED.
|
||||
*/
|
||||
HRESULT EnumAppDomains([out] ICorPublishAppDomainEnum **ppEnum);
|
||||
|
||||
|
||||
/*
|
||||
* Returns the OS ID for this process.
|
||||
*/
|
||||
HRESULT GetProcessID([out] unsigned *pid);
|
||||
|
||||
|
||||
/*
|
||||
* Get the full path of the executable for this process.
|
||||
* If szName is non-null, this copies up to cchName characters (including
|
||||
* If szName is non-null, this copies up to cchName characters (including
|
||||
* the null terminator) into szName, and ensures it is null-terminated.
|
||||
* If pcchName is non-null, the actual number of characters in the name
|
||||
* (including the null terminator) is stored there. This method returns
|
||||
* S_OK regardless of how many characters were copied.
|
||||
*/
|
||||
HRESULT GetDisplayName([in] ULONG32 cchName,
|
||||
HRESULT GetDisplayName([in] ULONG32 cchName,
|
||||
[out] ULONG32 *pcchName,
|
||||
[out, size_is(cchName),
|
||||
[out, size_is(cchName),
|
||||
length_is(*pcchName)] WCHAR *szName);
|
||||
}
|
||||
#pragma warning(pop)
|
||||
|
@ -200,23 +200,23 @@ interface ICorPublishProcess : IUnknown
|
|||
interface ICorPublishAppDomain : IUnknown
|
||||
{
|
||||
/*
|
||||
* Gets the identification number of this application domain.
|
||||
* Note that this number is unique to this AppDomain, but only
|
||||
* Gets the identification number of this application domain.
|
||||
* Note that this number is unique to this AppDomain, but only
|
||||
* within the containing process.
|
||||
*/
|
||||
HRESULT GetID([out] ULONG32 *puId);
|
||||
|
||||
|
||||
/*
|
||||
* Get the name for an application domain.
|
||||
* If szName is non-null, this copies up to cchName characters (including
|
||||
* If szName is non-null, this copies up to cchName characters (including
|
||||
* the null terminator) into szName, and ensures it is null-terminated.
|
||||
* If pcchName is non-null, the actual number of characters in the name
|
||||
* (including the null terminator) is stored there. This method returns
|
||||
* S_OK regardless of how many characters were copied.
|
||||
*/
|
||||
HRESULT GetName([in] ULONG32 cchName,
|
||||
HRESULT GetName([in] ULONG32 cchName,
|
||||
[out] ULONG32 *pcchName,
|
||||
[out, size_is(cchName),
|
||||
[out, size_is(cchName),
|
||||
length_is(*pcchName)] WCHAR *szName);
|
||||
}
|
||||
#pragma warning(pop)
|
||||
|
@ -238,7 +238,7 @@ interface ICorPublishProcessEnum : ICorPublishEnum
|
|||
* Gets the next "celt" processes in the enumeration.
|
||||
*/
|
||||
HRESULT Next([in] ULONG celt,
|
||||
[out, size_is(celt),
|
||||
[out, size_is(celt),
|
||||
length_is(*pceltFetched)] ICorPublishProcess **objects,
|
||||
[out] ULONG *pceltFetched);
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ interface ICorPublishAppDomainEnum : ICorPublishEnum
|
|||
* Gets the next "celt" application domains in the enumeration.
|
||||
*/
|
||||
HRESULT Next([in] ULONG celt,
|
||||
[out, size_is(celt),
|
||||
[out, size_is(celt),
|
||||
length_is(*pceltFetched)] ICorPublishAppDomain **objects,
|
||||
[out] ULONG *pceltFetched);
|
||||
}
|
||||
|
|
|
@ -294,7 +294,7 @@ typedef enum CorSymSearchPolicyAttributes
|
|||
interface ISymUnmanagedBinder2 : ISymUnmanagedBinder
|
||||
{
|
||||
/*
|
||||
* Given a metadata interface and a file name, returns the correct
|
||||
* Given a metadata interface and a file name, returns the correct
|
||||
* ISymUnmanagedReader interface that will read the debugging symbols associated
|
||||
* with the module.
|
||||
*
|
||||
|
@ -327,7 +327,7 @@ interface ISymUnmanagedBinder3 : ISymUnmanagedBinder2
|
|||
{
|
||||
/*
|
||||
* GetReaderFromCallback allows the user to implement supply via callback either an
|
||||
* IID_IDiaReadExeAtRVACallback or IID_IDiaReadExeAtOffsetCallback to obtain the
|
||||
* IID_IDiaReadExeAtRVACallback or IID_IDiaReadExeAtOffsetCallback to obtain the
|
||||
* Debug directory information from memory.
|
||||
*/
|
||||
HRESULT GetReaderFromCallback([in] IUnknown *importer,
|
||||
|
@ -445,7 +445,7 @@ interface ISymUnmanagedDocument : IUnknown
|
|||
|
||||
/* ------------------------------------------------------------------------- *
|
||||
* ISymUnmanagedDocumentWriter interface
|
||||
*
|
||||
*
|
||||
* Provides functions for writing to a document referenced by a symbol
|
||||
* store.
|
||||
* ------------------------------------------------------------------------- */
|
||||
|
@ -608,7 +608,7 @@ interface ISymENCUnmanagedMethod : IUnknown
|
|||
* Get the documents this method has lines in.
|
||||
*/
|
||||
HRESULT GetDocumentsForMethod([in] ULONG32 cDocs,
|
||||
[out] ULONG32 *pcDocs,
|
||||
[out] ULONG32 *pcDocs,
|
||||
[in, size_is(cDocs)] ISymUnmanagedDocument* documents[]);
|
||||
/*
|
||||
* Get the smallest start line and largest end line, for the method, in a specific document.
|
||||
|
@ -850,8 +850,8 @@ interface ISymUnmanagedSourceServerModule : IUnknown
|
|||
// returns the source server data for the module
|
||||
// caller must free using CoTaskMemFree()
|
||||
HRESULT GetSourceServerData(
|
||||
[out] ULONG* pDataByteCount,
|
||||
[out, size_is (, *pDataByteCount)] BYTE** ppData);
|
||||
[out] ULONG* pDataByteCount,
|
||||
[out, size_is (, *pDataByteCount)] BYTE** ppData);
|
||||
|
||||
}
|
||||
|
||||
|
@ -927,7 +927,7 @@ interface ISymUnmanagedReaderSymbolSearchInfo : IUnknown
|
|||
/* ------------------------------------------------------------------------- *
|
||||
* ISymUnmanagedScope interface
|
||||
*
|
||||
* Represents a lexical scope within a method.
|
||||
* Represents a lexical scope within a method.
|
||||
* ------------------------------------------------------------------------- */
|
||||
|
||||
[
|
||||
|
@ -1005,12 +1005,12 @@ interface ISymUnmanagedConstant : IUnknown
|
|||
length_is(*pcchName)] WCHAR szName[]);
|
||||
|
||||
HRESULT GetValue(VARIANT* pValue);
|
||||
|
||||
|
||||
HRESULT GetSignature([in] ULONG32 cSig,
|
||||
[out] ULONG32 *pcSig,
|
||||
[out, size_is(cSig),
|
||||
length_is(*pcSig)] BYTE sig[]);
|
||||
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -1134,7 +1134,7 @@ interface ISymUnmanagedSymbolSearchInfo : IUnknown
|
|||
/* ------------------------------------------------------------------------- *
|
||||
* ISymUnmanagedWriter interface
|
||||
*
|
||||
* Represents a symbol writer. Provides methods to define documents,
|
||||
* Represents a symbol writer. Provides methods to define documents,
|
||||
* sequence points, lexical scopes, and variables.
|
||||
* ------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -1496,7 +1496,7 @@ interface ISymUnmanagedWriter3 : ISymUnmanagedWriter2
|
|||
{
|
||||
/*
|
||||
* Open a method, and also provide its real section offset in image
|
||||
*/
|
||||
*/
|
||||
HRESULT OpenMethod2( [in] mdMethodDef method,
|
||||
[in] ULONG32 isect,
|
||||
[in] ULONG32 offset);
|
||||
|
@ -1560,11 +1560,11 @@ interface ISymUnmanagedWriter5 : ISymUnmanagedWriter4
|
|||
|
||||
/*
|
||||
* Maps the given metadata token to the given source line span in the specified
|
||||
* source file.
|
||||
* source file.
|
||||
*
|
||||
* Must be called between calls to OpenMapTokensToSourceSpans() and
|
||||
* CloseMapTokensToSourceSpans().
|
||||
*/
|
||||
*/
|
||||
HRESULT MapTokenToSourceSpan([in] mdToken token,
|
||||
[in] ISymUnmanagedDocumentWriter* document,
|
||||
[in] ULONG32 line,
|
||||
|
@ -1604,16 +1604,16 @@ interface ISymUnmanagedReader2 : ISymUnmanagedReader
|
|||
[out] ULONG32 *pcBuffer,
|
||||
[out, size_is(cBuffer),
|
||||
length_is(*pcBuffer)] BYTE buffer[]);
|
||||
|
||||
|
||||
/*
|
||||
* Gets every method that has line information in the provided Document.
|
||||
*/
|
||||
* Gets every method that has line information in the provided Document.
|
||||
*/
|
||||
HRESULT GetMethodsInDocument([in] ISymUnmanagedDocument *document,
|
||||
[in] ULONG32 cMethod,
|
||||
[out] ULONG32* pcMethod,
|
||||
[out, size_is(cMethod),
|
||||
length_is(*pcMethod)] ISymUnmanagedMethod* pRetVal[]);
|
||||
|
||||
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- *
|
||||
|
@ -1625,21 +1625,21 @@ interface ISymUnmanagedReader2 : ISymUnmanagedReader
|
|||
uuid(d682fd12-43de-411c-811b-be8404cea126),
|
||||
pointer_default(unique)
|
||||
]
|
||||
interface ISymNGenWriter : IUnknown
|
||||
interface ISymNGenWriter : IUnknown
|
||||
{
|
||||
/*
|
||||
* Add a new public symbol to the NGEN PDB.
|
||||
*/
|
||||
HRESULT AddSymbol([in] BSTR pSymbol,
|
||||
[in] USHORT iSection,
|
||||
HRESULT AddSymbol([in] BSTR pSymbol,
|
||||
[in] USHORT iSection,
|
||||
[in] ULONGLONG rva);
|
||||
|
||||
|
||||
/*
|
||||
* Adds a new section to the NGEN PDB.
|
||||
*/
|
||||
HRESULT AddSection([in] USHORT iSection,
|
||||
[in] USHORT flags,
|
||||
[in] long offset,
|
||||
HRESULT AddSection([in] USHORT iSection,
|
||||
[in] USHORT flags,
|
||||
[in] long offset,
|
||||
[in] long cb);
|
||||
};
|
||||
|
||||
|
@ -1655,25 +1655,25 @@ interface ISymNGenWriter : IUnknown
|
|||
]
|
||||
interface ISymNGenWriter2 : ISymNGenWriter
|
||||
{
|
||||
HRESULT OpenModW([in] const wchar_t* wszModule,
|
||||
[in] const wchar_t* wszObjFile,
|
||||
HRESULT OpenModW([in] LPCWSTR wszModule,
|
||||
[in] LPCWSTR wszObjFile,
|
||||
[out] BYTE** ppmod);
|
||||
|
||||
HRESULT CloseMod([in] BYTE* pmod);
|
||||
|
||||
HRESULT ModAddSymbols([in] BYTE* pmod, [in] BYTE* pbSym, [in] long cb);
|
||||
|
||||
|
||||
HRESULT ModAddSecContribEx(
|
||||
[in] BYTE* pmod,
|
||||
[in] USHORT isect,
|
||||
[in] long off,
|
||||
[in] long cb,
|
||||
[in] ULONG dwCharacteristics,
|
||||
[in] DWORD dwDataCrc,
|
||||
[in] BYTE* pmod,
|
||||
[in] USHORT isect,
|
||||
[in] long off,
|
||||
[in] long cb,
|
||||
[in] ULONG dwCharacteristics,
|
||||
[in] DWORD dwDataCrc,
|
||||
[in] DWORD dwRelocCrc);
|
||||
|
||||
HRESULT QueryPDBNameExW(
|
||||
[out, size_is(cchMax)] wchar_t wszPDB[],
|
||||
[out, size_is(cchMax)] WCHAR wszPDB[],
|
||||
[in] SIZE_T cchMax);
|
||||
};
|
||||
|
||||
|
@ -1727,7 +1727,7 @@ interface ISymUnmanagedAsyncMethodPropertiesWriter : IUnknown
|
|||
*/
|
||||
HRESULT DefineAsyncStepInfo([in] ULONG32 count,
|
||||
[in, size_is(count)] ULONG32 yieldOffsets[],
|
||||
[in, size_is(count)] ULONG32 breakpointOffset[],
|
||||
[in, size_is(count)] ULONG32 breakpointOffset[],
|
||||
[in, size_is(count)] mdToken breakpointMethod[]);
|
||||
};
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
//
|
||||
// Note: This file gets parsed by the Mono IL Linker (https://github.com/mono/linker/) which may throw an exception during parsing.
|
||||
// Specifically, this (https://github.com/mono/linker/blob/master/corebuild/integration/ILLink.Tasks/CreateRuntimeRootDescriptorFile.cs) will try to
|
||||
// Specifically, this (https://github.com/mono/linker/blob/master/corebuild/integration/ILLink.Tasks/CreateRuntimeRootDescriptorFile.cs) will try to
|
||||
// parse this header, and it may throw an exception while doing that. If you edit this file and get a build failure on msbuild.exe D:\repos\coreclr\build.proj
|
||||
// you might want to check out the parser linked above.
|
||||
//
|
||||
|
|
|
@ -8,11 +8,32 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#if (!defined(_WIN64) && defined(_TARGET_64BIT_)) || (defined(_WIN64) && !defined(_TARGET_64BIT_))
|
||||
#if (!defined(HOST_64BIT) && defined(TARGET_64BIT)) || (defined(HOST_64BIT) && !defined(TARGET_64BIT))
|
||||
#define CROSSBITNESS_COMPILE
|
||||
#endif
|
||||
|
||||
#if !defined(_ARM_) && defined(_TARGET_ARM_) // Non-ARM Host managing ARM related code
|
||||
// Target platform-specific library naming
|
||||
//
|
||||
#ifdef TARGET_WINDOWS
|
||||
#define MAKE_TARGET_DLLNAME_W(name) name W(".dll")
|
||||
#define MAKE_TARGET_DLLNAME_A(name) name ".dll"
|
||||
#else // TARGET_WINDOWS
|
||||
#ifdef TARGET_OSX
|
||||
#define MAKE_TARGET_DLLNAME_W(name) W("lib") name W(".dylib")
|
||||
#define MAKE_TARGET_DLLNAME_A(name) "lib" name ".dylib"
|
||||
#else
|
||||
#define MAKE_TARGET_DLLNAME_W(name) W("lib") name W(".so")
|
||||
#define MAKE_TARGET_DLLNAME_A(name) "lib" name ".so"
|
||||
#endif
|
||||
#endif // TARGET_WINDOWS
|
||||
|
||||
#ifdef UNICODE
|
||||
#define MAKE_TARGET_DLLNAME(name) MAKE_TARGET_DLLNAME_W(name)
|
||||
#else
|
||||
#define MAKE_TARGET_DLLNAME(name) MAKE_TARGET_DLLNAME_A(name)
|
||||
#endif
|
||||
|
||||
#if !defined(HOST_ARM) && defined(TARGET_ARM) // Non-ARM Host managing ARM related code
|
||||
|
||||
#ifndef CROSS_COMPILE
|
||||
#define CROSS_COMPILE
|
||||
|
@ -82,7 +103,7 @@ typedef struct DECLSPEC_ALIGN(8) _T_CONTEXT {
|
|||
DWORD Bcr[ARM_MAX_BREAKPOINTS];
|
||||
DWORD Wvr[ARM_MAX_WATCHPOINTS];
|
||||
DWORD Wcr[ARM_MAX_WATCHPOINTS];
|
||||
|
||||
|
||||
DWORD Padding2[2];
|
||||
|
||||
} T_CONTEXT, *PT_CONTEXT;
|
||||
|
@ -92,37 +113,15 @@ typedef struct DECLSPEC_ALIGN(8) _T_CONTEXT {
|
|||
// each frame function.
|
||||
//
|
||||
|
||||
#ifndef FEATURE_PAL
|
||||
#ifdef _X86_
|
||||
typedef struct _RUNTIME_FUNCTION {
|
||||
#if defined(HOST_WINDOWS)
|
||||
typedef struct _T_RUNTIME_FUNCTION {
|
||||
DWORD BeginAddress;
|
||||
DWORD UnwindData;
|
||||
} RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
|
||||
|
||||
//
|
||||
// Define unwind history table structure.
|
||||
//
|
||||
|
||||
#define UNWIND_HISTORY_TABLE_SIZE 12
|
||||
|
||||
typedef struct _UNWIND_HISTORY_TABLE_ENTRY {
|
||||
DWORD ImageBase;
|
||||
PRUNTIME_FUNCTION FunctionEntry;
|
||||
} UNWIND_HISTORY_TABLE_ENTRY, *PUNWIND_HISTORY_TABLE_ENTRY;
|
||||
|
||||
typedef struct _UNWIND_HISTORY_TABLE {
|
||||
DWORD Count;
|
||||
BYTE LocalHint;
|
||||
BYTE GlobalHint;
|
||||
BYTE Search;
|
||||
BYTE Once;
|
||||
DWORD LowAddress;
|
||||
DWORD HighAddress;
|
||||
UNWIND_HISTORY_TABLE_ENTRY Entry[UNWIND_HISTORY_TABLE_SIZE];
|
||||
} UNWIND_HISTORY_TABLE, *PUNWIND_HISTORY_TABLE;
|
||||
#endif // _X86_
|
||||
#endif // !FEATURE_PAL
|
||||
|
||||
} T_RUNTIME_FUNCTION, *PT_RUNTIME_FUNCTION;
|
||||
#else // HOST_WINDOWS
|
||||
#define T_RUNTIME_FUNCTION RUNTIME_FUNCTION
|
||||
#define PT_RUNTIME_FUNCTION PRUNTIME_FUNCTION
|
||||
#endif // HOST_WINDOWS
|
||||
|
||||
//
|
||||
// Nonvolatile context pointer record.
|
||||
|
@ -156,7 +155,7 @@ typedef struct _T_KNONVOLATILE_CONTEXT_POINTERS {
|
|||
//
|
||||
|
||||
typedef
|
||||
PRUNTIME_FUNCTION
|
||||
PT_RUNTIME_FUNCTION
|
||||
(*PGET_RUNTIME_FUNCTION_CALLBACK) (
|
||||
IN DWORD64 ControlPc,
|
||||
IN PVOID Context
|
||||
|
@ -165,29 +164,20 @@ PRUNTIME_FUNCTION
|
|||
typedef struct _T_DISPATCHER_CONTEXT {
|
||||
ULONG ControlPc;
|
||||
ULONG ImageBase;
|
||||
PRUNTIME_FUNCTION FunctionEntry;
|
||||
PT_RUNTIME_FUNCTION FunctionEntry;
|
||||
ULONG EstablisherFrame;
|
||||
ULONG TargetPc;
|
||||
PT_CONTEXT ContextRecord;
|
||||
PEXCEPTION_ROUTINE LanguageHandler;
|
||||
PVOID HandlerData;
|
||||
PUNWIND_HISTORY_TABLE HistoryTable;
|
||||
PVOID HistoryTable;
|
||||
ULONG ScopeIndex;
|
||||
BOOLEAN ControlPcIsUnwound;
|
||||
PUCHAR NonVolatileRegisters;
|
||||
} T_DISPATCHER_CONTEXT, *PT_DISPATCHER_CONTEXT;
|
||||
|
||||
#if defined(FEATURE_PAL) || defined(_X86_)
|
||||
#define T_RUNTIME_FUNCTION RUNTIME_FUNCTION
|
||||
#define PT_RUNTIME_FUNCTION PRUNTIME_FUNCTION
|
||||
#else
|
||||
typedef struct _T_RUNTIME_FUNCTION {
|
||||
DWORD BeginAddress;
|
||||
DWORD UnwindData;
|
||||
} T_RUNTIME_FUNCTION, *PT_RUNTIME_FUNCTION;
|
||||
#endif
|
||||
|
||||
#elif defined(_AMD64_) && defined(_TARGET_ARM64_) // Host amd64 managing ARM64 related code
|
||||
#elif defined(HOST_AMD64) && defined(TARGET_ARM64) // Host amd64 managing ARM64 related code
|
||||
|
||||
#ifndef CROSS_COMPILE
|
||||
#define CROSS_COMPILE
|
||||
|
@ -318,7 +308,7 @@ typedef struct _T_DISPATCHER_CONTEXT {
|
|||
PCONTEXT ContextRecord;
|
||||
PEXCEPTION_ROUTINE LanguageHandler;
|
||||
PVOID HandlerData;
|
||||
PUNWIND_HISTORY_TABLE HistoryTable;
|
||||
PVOID HistoryTable;
|
||||
DWORD ScopeIndex;
|
||||
BOOLEAN ControlPcIsUnwound;
|
||||
PBYTE NonVolatileRegisters;
|
||||
|
@ -370,8 +360,66 @@ typedef struct _T_KNONVOLATILE_CONTEXT_POINTERS {
|
|||
#define T_RUNTIME_FUNCTION RUNTIME_FUNCTION
|
||||
#define PT_RUNTIME_FUNCTION PRUNTIME_FUNCTION
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(DACCESS_COMPILE) && defined(TARGET_UNIX)
|
||||
// This is a TARGET oriented copy of CRITICAL_SECTION and PAL_CS_NATIVE_DATA_SIZE
|
||||
// It is configured based on TARGET configuration rather than HOST configuration
|
||||
// There is validation code in src/coreclr/src/vm/crst.cpp to keep these from
|
||||
// getting out of sync
|
||||
|
||||
#define T_CRITICAL_SECTION_VALIDATION_MESSAGE "T_CRITICAL_SECTION validation failed. It is not in sync with CRITICAL_SECTION"
|
||||
|
||||
#if defined(TARGET_OSX) && defined(TARGET_X86)
|
||||
#define DAC_CS_NATIVE_DATA_SIZE 76
|
||||
#elif defined(TARGET_OSX) && defined(TARGET_AMD64)
|
||||
#define DAC_CS_NATIVE_DATA_SIZE 120
|
||||
#elif defined(TARGET_FREEBSD) && defined(TARGET_X86)
|
||||
#define DAC_CS_NATIVE_DATA_SIZE 12
|
||||
#elif defined(TARGET_FREEBSD) && defined(TARGET_AMD64)
|
||||
#define DAC_CS_NATIVE_DATA_SIZE 24
|
||||
#elif defined(TARGET_LINUX) && defined(TARGET_ARM)
|
||||
#define DAC_CS_NATIVE_DATA_SIZE 80
|
||||
#elif defined(TARGET_LINUX) && defined(TARGET_ARM64)
|
||||
#define DAC_CS_NATIVE_DATA_SIZE 116
|
||||
#elif defined(TARGET_LINUX) && defined(TARGET_X86)
|
||||
#define DAC_CS_NATIVE_DATA_SIZE 76
|
||||
#elif defined(TARGET_LINUX) && defined(TARGET_AMD64)
|
||||
#define DAC_CS_NATIVE_DATA_SIZE 96
|
||||
#elif defined(TARGET_NETBSD) && defined(TARGET_AMD64)
|
||||
#define DAC_CS_NATIVE_DATA_SIZE 96
|
||||
#elif defined(TARGET_NETBSD) && defined(TARGET_ARM)
|
||||
#define DAC_CS_NATIVE_DATA_SIZE 56
|
||||
#elif defined(TARGET_NETBSD) && defined(TARGET_X86)
|
||||
#define DAC_CS_NATIVE_DATA_SIZE 56
|
||||
#elif defined(__sun) && defined(TARGET_AMD64)
|
||||
#define DAC_CS_NATIVE_DATA_SIZE 48
|
||||
#else
|
||||
#warning
|
||||
#error DAC_CS_NATIVE_DATA_SIZE is not defined for this architecture. This should be same value as PAL_CS_NATIVE_DATA_SIZE (aka sizeof(PAL_CS_NATIVE_DATA)).
|
||||
#endif
|
||||
|
||||
struct T_CRITICAL_SECTION {
|
||||
PVOID DebugInfo;
|
||||
LONG LockCount;
|
||||
LONG RecursionCount;
|
||||
HANDLE OwningThread;
|
||||
ULONG_PTR SpinCount;
|
||||
|
||||
#ifdef PAL_TRACK_CRITICAL_SECTIONS_DATA
|
||||
BOOL bInternal;
|
||||
#endif // PAL_TRACK_CRITICAL_SECTIONS_DATA
|
||||
volatile DWORD dwInitState;
|
||||
|
||||
union CSNativeDataStorage
|
||||
{
|
||||
BYTE rgNativeDataStorage[DAC_CS_NATIVE_DATA_SIZE];
|
||||
PVOID pvAlign; // make sure the storage is machine-pointer-size aligned
|
||||
} csnds;
|
||||
};
|
||||
#else
|
||||
#define T_CRITICAL_SECTION CRITICAL_SECTION
|
||||
#endif
|
||||
|
||||
#ifdef CROSSGEN_COMPILE
|
||||
void CrossGenNotSupported(const char * message);
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
// This file describes the range of Crst types available and their mapping to a numeric level (used by the
|
||||
// runtime in debug mode to validate we're deadlock free). To modify these settings edit the
|
||||
// file:CrstTypes.def file and run the clr\bin\CrstTypeTool utility to generate a new version of this file.
|
||||
// file:CrstTypes.def file and run the clr\artifacts\CrstTypeTool utility to generate a new version of this file.
|
||||
|
||||
// Each Crst type is declared as a value in the following CrstType enum.
|
||||
enum CrstType
|
||||
|
@ -35,11 +35,11 @@ enum CrstType
|
|||
CrstCLRPrivBinderMaps = 16,
|
||||
CrstCLRPrivBinderMapsAdd = 17,
|
||||
CrstCodeFragmentHeap = 18,
|
||||
CrstCOMCallWrapper = 19,
|
||||
CrstCOMWrapperCache = 20,
|
||||
CrstConnectionNameTable = 21,
|
||||
CrstContexts = 22,
|
||||
CrstCoreCLRBinderLog = 23,
|
||||
CrstCodeVersioning = 19,
|
||||
CrstCOMCallWrapper = 20,
|
||||
CrstCOMWrapperCache = 21,
|
||||
CrstConnectionNameTable = 22,
|
||||
CrstContexts = 23,
|
||||
CrstCrstCLRPrivBinderLocalWinMDPath = 24,
|
||||
CrstCSPCache = 25,
|
||||
CrstDataTest1 = 26,
|
||||
|
@ -63,113 +63,115 @@ enum CrstType
|
|||
CrstException = 44,
|
||||
CrstExecuteManLock = 45,
|
||||
CrstExecuteManRangeLock = 46,
|
||||
CrstFCall = 47,
|
||||
CrstFriendAccessCache = 48,
|
||||
CrstFuncPtrStubs = 49,
|
||||
CrstFusionAppCtx = 50,
|
||||
CrstGCCover = 51,
|
||||
CrstGCMemoryPressure = 52,
|
||||
CrstGlobalStrLiteralMap = 53,
|
||||
CrstHandleTable = 54,
|
||||
CrstHostAssemblyMap = 55,
|
||||
CrstHostAssemblyMapAdd = 56,
|
||||
CrstIbcProfile = 57,
|
||||
CrstIJWFixupData = 58,
|
||||
CrstIJWHash = 59,
|
||||
CrstILStubGen = 60,
|
||||
CrstInlineTrackingMap = 61,
|
||||
CrstInstMethodHashTable = 62,
|
||||
CrstInterfaceVTableMap = 63,
|
||||
CrstInterop = 64,
|
||||
CrstInteropData = 65,
|
||||
CrstIOThreadpoolWorker = 66,
|
||||
CrstIsJMCMethod = 67,
|
||||
CrstISymUnmanagedReader = 68,
|
||||
CrstJit = 69,
|
||||
CrstJitGenericHandleCache = 70,
|
||||
CrstJitInlineTrackingMap = 71,
|
||||
CrstJitPerf = 72,
|
||||
CrstJumpStubCache = 73,
|
||||
CrstLeafLock = 74,
|
||||
CrstListLock = 75,
|
||||
CrstLoaderAllocator = 76,
|
||||
CrstLoaderAllocatorReferences = 77,
|
||||
CrstLoaderHeap = 78,
|
||||
CrstMda = 79,
|
||||
CrstMetadataTracker = 80,
|
||||
CrstMethodDescBackpatchInfoTracker = 81,
|
||||
CrstModIntPairList = 82,
|
||||
CrstModule = 83,
|
||||
CrstModuleFixup = 84,
|
||||
CrstModuleLookupTable = 85,
|
||||
CrstMulticoreJitHash = 86,
|
||||
CrstMulticoreJitManager = 87,
|
||||
CrstMUThunkHash = 88,
|
||||
CrstNativeBinderInit = 89,
|
||||
CrstNativeImageCache = 90,
|
||||
CrstNls = 91,
|
||||
CrstNotifyGdb = 92,
|
||||
CrstObjectList = 93,
|
||||
CrstOnEventManager = 94,
|
||||
CrstPatchEntryPoint = 95,
|
||||
CrstPEImage = 96,
|
||||
CrstPEImagePDBStream = 97,
|
||||
CrstPendingTypeLoadEntry = 98,
|
||||
CrstPinHandle = 99,
|
||||
CrstPinnedByrefValidation = 100,
|
||||
CrstProfilerGCRefDataFreeList = 101,
|
||||
CrstProfilingAPIStatus = 102,
|
||||
CrstPublisherCertificate = 103,
|
||||
CrstRCWCache = 104,
|
||||
CrstRCWCleanupList = 105,
|
||||
CrstRCWRefCache = 106,
|
||||
CrstReadyToRunEntryPointToMethodDescMap = 107,
|
||||
CrstReDacl = 108,
|
||||
CrstReflection = 109,
|
||||
CrstReJITDomainTable = 110,
|
||||
CrstReJITGlobalRequest = 111,
|
||||
CrstRemoting = 112,
|
||||
CrstRetThunkCache = 113,
|
||||
CrstRWLock = 114,
|
||||
CrstSavedExceptionInfo = 115,
|
||||
CrstSaveModuleProfileData = 116,
|
||||
CrstSecurityStackwalkCache = 117,
|
||||
CrstSharedAssemblyCreate = 118,
|
||||
CrstSigConvert = 119,
|
||||
CrstSingleUseLock = 120,
|
||||
CrstSpecialStatics = 121,
|
||||
CrstSqmManager = 122,
|
||||
CrstStackSampler = 123,
|
||||
CrstStressLog = 124,
|
||||
CrstStrongName = 125,
|
||||
CrstStubCache = 126,
|
||||
CrstStubDispatchCache = 127,
|
||||
CrstStubUnwindInfoHeapSegments = 128,
|
||||
CrstSyncBlockCache = 129,
|
||||
CrstSyncHashLock = 130,
|
||||
CrstSystemBaseDomain = 131,
|
||||
CrstSystemDomain = 132,
|
||||
CrstSystemDomainDelayedUnloadList = 133,
|
||||
CrstThreadIdDispenser = 134,
|
||||
CrstThreadpoolEventCache = 135,
|
||||
CrstThreadpoolTimerQueue = 136,
|
||||
CrstThreadpoolWaitThreads = 137,
|
||||
CrstThreadpoolWorker = 138,
|
||||
CrstThreadStaticDataHashTable = 139,
|
||||
CrstThreadStore = 140,
|
||||
CrstTieredCompilation = 141,
|
||||
CrstTPMethodTable = 142,
|
||||
CrstTypeEquivalenceMap = 143,
|
||||
CrstTypeIDMap = 144,
|
||||
CrstUMEntryThunkCache = 145,
|
||||
CrstUMThunkHash = 146,
|
||||
CrstUniqueStack = 147,
|
||||
CrstUnresolvedClassLock = 148,
|
||||
CrstUnwindInfoTableLock = 149,
|
||||
CrstVSDIndirectionCellLock = 150,
|
||||
CrstWinRTFactoryCache = 151,
|
||||
CrstWrapperTemplate = 152,
|
||||
kNumberOfCrstTypes = 153
|
||||
CrstExternalObjectContextCache = 47,
|
||||
CrstFCall = 48,
|
||||
CrstFriendAccessCache = 49,
|
||||
CrstFuncPtrStubs = 50,
|
||||
CrstFusionAppCtx = 51,
|
||||
CrstGCCover = 52,
|
||||
CrstGCMemoryPressure = 53,
|
||||
CrstGlobalStrLiteralMap = 54,
|
||||
CrstHandleTable = 55,
|
||||
CrstHostAssemblyMap = 56,
|
||||
CrstHostAssemblyMapAdd = 57,
|
||||
CrstIbcProfile = 58,
|
||||
CrstIJWFixupData = 59,
|
||||
CrstIJWHash = 60,
|
||||
CrstILStubGen = 61,
|
||||
CrstInlineTrackingMap = 62,
|
||||
CrstInstMethodHashTable = 63,
|
||||
CrstInterfaceVTableMap = 64,
|
||||
CrstInterop = 65,
|
||||
CrstInteropData = 66,
|
||||
CrstIOThreadpoolWorker = 67,
|
||||
CrstIsJMCMethod = 68,
|
||||
CrstISymUnmanagedReader = 69,
|
||||
CrstJit = 70,
|
||||
CrstJitGenericHandleCache = 71,
|
||||
CrstJitInlineTrackingMap = 72,
|
||||
CrstJitPatchpoint = 73,
|
||||
CrstJitPerf = 74,
|
||||
CrstJumpStubCache = 75,
|
||||
CrstLeafLock = 76,
|
||||
CrstListLock = 77,
|
||||
CrstLoaderAllocator = 78,
|
||||
CrstLoaderAllocatorReferences = 79,
|
||||
CrstLoaderHeap = 80,
|
||||
CrstMda = 81,
|
||||
CrstMetadataTracker = 82,
|
||||
CrstMethodDescBackpatchInfoTracker = 83,
|
||||
CrstModIntPairList = 84,
|
||||
CrstModule = 85,
|
||||
CrstModuleFixup = 86,
|
||||
CrstModuleLookupTable = 87,
|
||||
CrstMulticoreJitHash = 88,
|
||||
CrstMulticoreJitManager = 89,
|
||||
CrstMUThunkHash = 90,
|
||||
CrstNativeBinderInit = 91,
|
||||
CrstNativeImageCache = 92,
|
||||
CrstNativeImageEagerFixups = 93,
|
||||
CrstNls = 94,
|
||||
CrstNotifyGdb = 95,
|
||||
CrstObjectList = 96,
|
||||
CrstOnEventManager = 97,
|
||||
CrstPatchEntryPoint = 98,
|
||||
CrstPEImage = 99,
|
||||
CrstPEImagePDBStream = 100,
|
||||
CrstPendingTypeLoadEntry = 101,
|
||||
CrstPinHandle = 102,
|
||||
CrstPinnedByrefValidation = 103,
|
||||
CrstProfilerGCRefDataFreeList = 104,
|
||||
CrstProfilingAPIStatus = 105,
|
||||
CrstPublisherCertificate = 106,
|
||||
CrstRCWCache = 107,
|
||||
CrstRCWCleanupList = 108,
|
||||
CrstRCWRefCache = 109,
|
||||
CrstReadyToRunEntryPointToMethodDescMap = 110,
|
||||
CrstReDacl = 111,
|
||||
CrstReflection = 112,
|
||||
CrstReJITGlobalRequest = 113,
|
||||
CrstRemoting = 114,
|
||||
CrstRetThunkCache = 115,
|
||||
CrstRWLock = 116,
|
||||
CrstSavedExceptionInfo = 117,
|
||||
CrstSaveModuleProfileData = 118,
|
||||
CrstSecurityStackwalkCache = 119,
|
||||
CrstSharedAssemblyCreate = 120,
|
||||
CrstSigConvert = 121,
|
||||
CrstSingleUseLock = 122,
|
||||
CrstSpecialStatics = 123,
|
||||
CrstSqmManager = 124,
|
||||
CrstStackSampler = 125,
|
||||
CrstStressLog = 126,
|
||||
CrstStrongName = 127,
|
||||
CrstStubCache = 128,
|
||||
CrstStubDispatchCache = 129,
|
||||
CrstStubUnwindInfoHeapSegments = 130,
|
||||
CrstSyncBlockCache = 131,
|
||||
CrstSyncHashLock = 132,
|
||||
CrstSystemBaseDomain = 133,
|
||||
CrstSystemDomain = 134,
|
||||
CrstSystemDomainDelayedUnloadList = 135,
|
||||
CrstThreadIdDispenser = 136,
|
||||
CrstThreadpoolEventCache = 137,
|
||||
CrstThreadpoolTimerQueue = 138,
|
||||
CrstThreadpoolWaitThreads = 139,
|
||||
CrstThreadpoolWorker = 140,
|
||||
CrstThreadStaticDataHashTable = 141,
|
||||
CrstThreadStore = 142,
|
||||
CrstTieredCompilation = 143,
|
||||
CrstTPMethodTable = 144,
|
||||
CrstTypeEquivalenceMap = 145,
|
||||
CrstTypeIDMap = 146,
|
||||
CrstUMEntryThunkCache = 147,
|
||||
CrstUMThunkHash = 148,
|
||||
CrstUniqueStack = 149,
|
||||
CrstUnresolvedClassLock = 150,
|
||||
CrstUnwindInfoTableLock = 151,
|
||||
CrstVSDIndirectionCellLock = 152,
|
||||
CrstWinRTFactoryCache = 153,
|
||||
CrstWrapperTemplate = 154,
|
||||
kNumberOfCrstTypes = 155
|
||||
};
|
||||
|
||||
#endif // __CRST_TYPES_INCLUDED
|
||||
|
@ -182,28 +184,28 @@ int g_rgCrstLevelMap[] =
|
|||
{
|
||||
9, // CrstAllowedFiles
|
||||
9, // CrstAppDomainCache
|
||||
13, // CrstAppDomainHandleTable
|
||||
14, // CrstAppDomainHandleTable
|
||||
0, // CrstArgBasedStubCache
|
||||
0, // CrstAssemblyDependencyGraph
|
||||
0, // CrstAssemblyIdentityCache
|
||||
0, // CrstAssemblyList
|
||||
7, // CrstAssemblyLoader
|
||||
3, // CrstAvailableClass
|
||||
3, // CrstAvailableParamTypes
|
||||
4, // CrstAvailableParamTypes
|
||||
7, // CrstBaseDomain
|
||||
-1, // CrstCCompRC
|
||||
9, // CrstCer
|
||||
12, // CrstClassFactInfoHash
|
||||
13, // CrstClassFactInfoHash
|
||||
8, // CrstClassInit
|
||||
-1, // CrstClrNotification
|
||||
0, // CrstCLRPrivBinderMaps
|
||||
3, // CrstCLRPrivBinderMapsAdd
|
||||
6, // CrstCodeFragmentHeap
|
||||
10, // CrstCodeVersioning
|
||||
0, // CrstCOMCallWrapper
|
||||
4, // CrstCOMWrapperCache
|
||||
0, // CrstConnectionNameTable
|
||||
16, // CrstContexts
|
||||
-1, // CrstCoreCLRBinderLog
|
||||
17, // CrstContexts
|
||||
0, // CrstCrstCLRPrivBinderLocalWinMDPath
|
||||
7, // CrstCSPCache
|
||||
3, // CrstDataTest1
|
||||
|
@ -215,25 +217,26 @@ int g_rgCrstLevelMap[] =
|
|||
0, // CrstDebuggerHeapExecMemLock
|
||||
0, // CrstDebuggerHeapLock
|
||||
4, // CrstDebuggerJitInfo
|
||||
10, // CrstDebuggerMutex
|
||||
11, // CrstDebuggerMutex
|
||||
0, // CrstDelegateToFPtrHash
|
||||
15, // CrstDomainLocalBlock
|
||||
16, // CrstDomainLocalBlock
|
||||
0, // CrstDynamicIL
|
||||
3, // CrstDynamicMT
|
||||
3, // CrstDynLinkZapItems
|
||||
7, // CrstEtwTypeLogHash
|
||||
17, // CrstEventPipe
|
||||
18, // CrstEventPipe
|
||||
0, // CrstEventStore
|
||||
0, // CrstException
|
||||
7, // CrstExecuteManLock
|
||||
0, // CrstExecuteManRangeLock
|
||||
0, // CrstExternalObjectContextCache
|
||||
3, // CrstFCall
|
||||
7, // CrstFriendAccessCache
|
||||
7, // CrstFuncPtrStubs
|
||||
5, // CrstFusionAppCtx
|
||||
10, // CrstGCCover
|
||||
11, // CrstGCCover
|
||||
0, // CrstGCMemoryPressure
|
||||
12, // CrstGlobalStrLiteralMap
|
||||
13, // CrstGlobalStrLiteralMap
|
||||
1, // CrstHandleTable
|
||||
0, // CrstHostAssemblyMap
|
||||
3, // CrstHostAssemblyMapAdd
|
||||
|
@ -242,35 +245,37 @@ int g_rgCrstLevelMap[] =
|
|||
0, // CrstIJWHash
|
||||
7, // CrstILStubGen
|
||||
3, // CrstInlineTrackingMap
|
||||
16, // CrstInstMethodHashTable
|
||||
17, // CrstInstMethodHashTable
|
||||
0, // CrstInterfaceVTableMap
|
||||
17, // CrstInterop
|
||||
18, // CrstInterop
|
||||
4, // CrstInteropData
|
||||
12, // CrstIOThreadpoolWorker
|
||||
13, // CrstIOThreadpoolWorker
|
||||
0, // CrstIsJMCMethod
|
||||
7, // CrstISymUnmanagedReader
|
||||
8, // CrstJit
|
||||
0, // CrstJitGenericHandleCache
|
||||
15, // CrstJitInlineTrackingMap
|
||||
16, // CrstJitInlineTrackingMap
|
||||
3, // CrstJitPatchpoint
|
||||
-1, // CrstJitPerf
|
||||
6, // CrstJumpStubCache
|
||||
0, // CrstLeafLock
|
||||
-1, // CrstListLock
|
||||
14, // CrstLoaderAllocator
|
||||
15, // CrstLoaderAllocatorReferences
|
||||
15, // CrstLoaderAllocator
|
||||
16, // CrstLoaderAllocatorReferences
|
||||
0, // CrstLoaderHeap
|
||||
0, // CrstMda
|
||||
-1, // CrstMetadataTracker
|
||||
13, // CrstMethodDescBackpatchInfoTracker
|
||||
14, // CrstMethodDescBackpatchInfoTracker
|
||||
0, // CrstModIntPairList
|
||||
4, // CrstModule
|
||||
14, // CrstModuleFixup
|
||||
15, // CrstModuleFixup
|
||||
3, // CrstModuleLookupTable
|
||||
0, // CrstMulticoreJitHash
|
||||
12, // CrstMulticoreJitManager
|
||||
13, // CrstMulticoreJitManager
|
||||
0, // CrstMUThunkHash
|
||||
-1, // CrstNativeBinderInit
|
||||
-1, // CrstNativeImageCache
|
||||
0, // CrstNativeImageEagerFixups
|
||||
0, // CrstNls
|
||||
0, // CrstNotifyGdb
|
||||
2, // CrstObjectList
|
||||
|
@ -278,7 +283,7 @@ int g_rgCrstLevelMap[] =
|
|||
0, // CrstPatchEntryPoint
|
||||
4, // CrstPEImage
|
||||
0, // CrstPEImagePDBStream
|
||||
18, // CrstPendingTypeLoadEntry
|
||||
19, // CrstPendingTypeLoadEntry
|
||||
0, // CrstPinHandle
|
||||
0, // CrstPinnedByrefValidation
|
||||
0, // CrstProfilerGCRefDataFreeList
|
||||
|
@ -290,9 +295,8 @@ int g_rgCrstLevelMap[] =
|
|||
4, // CrstReadyToRunEntryPointToMethodDescMap
|
||||
0, // CrstReDacl
|
||||
9, // CrstReflection
|
||||
9, // CrstReJITDomainTable
|
||||
14, // CrstReJITGlobalRequest
|
||||
19, // CrstRemoting
|
||||
17, // CrstReJITGlobalRequest
|
||||
20, // CrstRemoting
|
||||
3, // CrstRetThunkCache
|
||||
0, // CrstRWLock
|
||||
3, // CrstSavedExceptionInfo
|
||||
|
@ -312,15 +316,15 @@ int g_rgCrstLevelMap[] =
|
|||
3, // CrstSyncBlockCache
|
||||
0, // CrstSyncHashLock
|
||||
4, // CrstSystemBaseDomain
|
||||
12, // CrstSystemDomain
|
||||
13, // CrstSystemDomain
|
||||
0, // CrstSystemDomainDelayedUnloadList
|
||||
0, // CrstThreadIdDispenser
|
||||
0, // CrstThreadpoolEventCache
|
||||
7, // CrstThreadpoolTimerQueue
|
||||
7, // CrstThreadpoolWaitThreads
|
||||
12, // CrstThreadpoolWorker
|
||||
13, // CrstThreadpoolWorker
|
||||
4, // CrstThreadStaticDataHashTable
|
||||
11, // CrstThreadStore
|
||||
12, // CrstThreadStore
|
||||
9, // CrstTieredCompilation
|
||||
9, // CrstTPMethodTable
|
||||
3, // CrstTypeEquivalenceMap
|
||||
|
@ -357,11 +361,11 @@ LPCSTR g_rgCrstNameMap[] =
|
|||
"CrstCLRPrivBinderMaps",
|
||||
"CrstCLRPrivBinderMapsAdd",
|
||||
"CrstCodeFragmentHeap",
|
||||
"CrstCodeVersioning",
|
||||
"CrstCOMCallWrapper",
|
||||
"CrstCOMWrapperCache",
|
||||
"CrstConnectionNameTable",
|
||||
"CrstContexts",
|
||||
"CrstCoreCLRBinderLog",
|
||||
"CrstCrstCLRPrivBinderLocalWinMDPath",
|
||||
"CrstCSPCache",
|
||||
"CrstDataTest1",
|
||||
|
@ -385,6 +389,7 @@ LPCSTR g_rgCrstNameMap[] =
|
|||
"CrstException",
|
||||
"CrstExecuteManLock",
|
||||
"CrstExecuteManRangeLock",
|
||||
"CrstExternalObjectContextCache",
|
||||
"CrstFCall",
|
||||
"CrstFriendAccessCache",
|
||||
"CrstFuncPtrStubs",
|
||||
|
@ -410,6 +415,7 @@ LPCSTR g_rgCrstNameMap[] =
|
|||
"CrstJit",
|
||||
"CrstJitGenericHandleCache",
|
||||
"CrstJitInlineTrackingMap",
|
||||
"CrstJitPatchpoint",
|
||||
"CrstJitPerf",
|
||||
"CrstJumpStubCache",
|
||||
"CrstLeafLock",
|
||||
|
@ -429,6 +435,7 @@ LPCSTR g_rgCrstNameMap[] =
|
|||
"CrstMUThunkHash",
|
||||
"CrstNativeBinderInit",
|
||||
"CrstNativeImageCache",
|
||||
"CrstNativeImageEagerFixups",
|
||||
"CrstNls",
|
||||
"CrstNotifyGdb",
|
||||
"CrstObjectList",
|
||||
|
@ -448,7 +455,6 @@ LPCSTR g_rgCrstNameMap[] =
|
|||
"CrstReadyToRunEntryPointToMethodDescMap",
|
||||
"CrstReDacl",
|
||||
"CrstReflection",
|
||||
"CrstReJITDomainTable",
|
||||
"CrstReJITGlobalRequest",
|
||||
"CrstRemoting",
|
||||
"CrstRetThunkCache",
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include <wchar.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef FEATURE_PAL
|
||||
#ifdef HOST_WINDOWS
|
||||
// CoreCLR.dll uses linker .def files to control the exported symbols.
|
||||
// Define DLLEXPORT macro as empty on Windows.
|
||||
#define DLLEXPORT
|
||||
|
|
|
@ -206,7 +206,7 @@ typedef enum CV_modifier_e {
|
|||
CV_MOD_CONST = 0x0001,
|
||||
CV_MOD_VOLATILE = 0x0002,
|
||||
CV_MOD_UNALIGNED = 0x0003,
|
||||
|
||||
|
||||
// 0x0200 - 0x03ff - HLSL modifiers.
|
||||
|
||||
CV_MOD_HLSL_UNIFORM = 0x0200,
|
||||
|
@ -226,7 +226,7 @@ typedef enum CV_modifier_e {
|
|||
CV_MOD_HLSL_UAV_GLOBALLY_COHERENT = 0x020e,
|
||||
|
||||
// 0x0400 - 0xffff - Unused.
|
||||
|
||||
|
||||
} CV_modifier_e;
|
||||
|
||||
|
||||
|
@ -237,7 +237,7 @@ typedef enum CV_builtin_e {
|
|||
|
||||
// 0x0000 - 0x01ff - Reserved.
|
||||
CV_BI_INVALID = 0x0000,
|
||||
|
||||
|
||||
// 0x0200 - 0x03ff - HLSL types.
|
||||
|
||||
CV_BI_HLSL_INTERFACE_POINTER = 0x0200,
|
||||
|
@ -278,7 +278,7 @@ typedef enum CV_builtin_e {
|
|||
CV_BI_HLSL_MIN16UINT = 0x0223,
|
||||
|
||||
// 0x0400 - 0xffff - Unused.
|
||||
|
||||
|
||||
} CV_builtin_e;
|
||||
|
||||
|
||||
|
@ -650,7 +650,7 @@ typedef enum CV_HREG_e {
|
|||
CV_REG_YMM7I1 = 297,
|
||||
CV_REG_YMM7I2 = 298,
|
||||
CV_REG_YMM7I3 = 299,
|
||||
|
||||
|
||||
CV_REG_YMM0F0 = 300, // AVX floating-point single precise registers
|
||||
CV_REG_YMM0F1 = 301,
|
||||
CV_REG_YMM0F2 = 302,
|
||||
|
@ -715,7 +715,7 @@ typedef enum CV_HREG_e {
|
|||
CV_REG_YMM7F5 = 361,
|
||||
CV_REG_YMM7F6 = 362,
|
||||
CV_REG_YMM7F7 = 363,
|
||||
|
||||
|
||||
CV_REG_YMM0D0 = 364, // AVX floating-point double precise registers
|
||||
CV_REG_YMM0D1 = 365,
|
||||
CV_REG_YMM0D2 = 366,
|
||||
|
@ -1328,10 +1328,10 @@ typedef enum CV_HREG_e {
|
|||
//
|
||||
// Registers for ARM VFP10 support
|
||||
//
|
||||
|
||||
|
||||
CV_ARM_FPSCR = 40,
|
||||
CV_ARM_FPEXC = 41,
|
||||
|
||||
|
||||
CV_ARM_FS0 = 50,
|
||||
CV_ARM_FS1 = 51,
|
||||
CV_ARM_FS2 = 52,
|
||||
|
@ -1368,7 +1368,7 @@ typedef enum CV_HREG_e {
|
|||
//
|
||||
// ARM VFP Floating Point Extra control registers
|
||||
//
|
||||
|
||||
|
||||
CV_ARM_FPEXTRA0 = 90,
|
||||
CV_ARM_FPEXTRA1 = 91,
|
||||
CV_ARM_FPEXTRA2 = 92,
|
||||
|
@ -1379,23 +1379,23 @@ typedef enum CV_HREG_e {
|
|||
CV_ARM_FPEXTRA7 = 97,
|
||||
|
||||
// XSCALE Concan co-processor registers
|
||||
CV_ARM_WR0 = 128,
|
||||
CV_ARM_WR1 = 129,
|
||||
CV_ARM_WR2 = 130,
|
||||
CV_ARM_WR3 = 131,
|
||||
CV_ARM_WR4 = 132,
|
||||
CV_ARM_WR5 = 133,
|
||||
CV_ARM_WR6 = 134,
|
||||
CV_ARM_WR7 = 135,
|
||||
CV_ARM_WR8 = 136,
|
||||
CV_ARM_WR9 = 137,
|
||||
CV_ARM_WR10 = 138,
|
||||
CV_ARM_WR11 = 139,
|
||||
CV_ARM_WR12 = 140,
|
||||
CV_ARM_WR13 = 141,
|
||||
CV_ARM_WR14 = 142,
|
||||
CV_ARM_WR15 = 143,
|
||||
|
||||
CV_ARM_WR0 = 128,
|
||||
CV_ARM_WR1 = 129,
|
||||
CV_ARM_WR2 = 130,
|
||||
CV_ARM_WR3 = 131,
|
||||
CV_ARM_WR4 = 132,
|
||||
CV_ARM_WR5 = 133,
|
||||
CV_ARM_WR6 = 134,
|
||||
CV_ARM_WR7 = 135,
|
||||
CV_ARM_WR8 = 136,
|
||||
CV_ARM_WR9 = 137,
|
||||
CV_ARM_WR10 = 138,
|
||||
CV_ARM_WR11 = 139,
|
||||
CV_ARM_WR12 = 140,
|
||||
CV_ARM_WR13 = 141,
|
||||
CV_ARM_WR14 = 142,
|
||||
CV_ARM_WR15 = 143,
|
||||
|
||||
// XSCALE Concan co-processor control registers
|
||||
CV_ARM_WCID = 144,
|
||||
CV_ARM_WCON = 145,
|
||||
|
@ -1417,7 +1417,7 @@ typedef enum CV_HREG_e {
|
|||
//
|
||||
// ARM VFPv3/Neon extended floating Point
|
||||
//
|
||||
|
||||
|
||||
CV_ARM_FS32 = 200,
|
||||
CV_ARM_FS33 = 201,
|
||||
CV_ARM_FS34 = 202,
|
||||
|
@ -1453,57 +1453,57 @@ typedef enum CV_HREG_e {
|
|||
|
||||
// ARM double-precision floating point
|
||||
|
||||
CV_ARM_ND0 = 300,
|
||||
CV_ARM_ND1 = 301,
|
||||
CV_ARM_ND2 = 302,
|
||||
CV_ARM_ND3 = 303,
|
||||
CV_ARM_ND4 = 304,
|
||||
CV_ARM_ND0 = 300,
|
||||
CV_ARM_ND1 = 301,
|
||||
CV_ARM_ND2 = 302,
|
||||
CV_ARM_ND3 = 303,
|
||||
CV_ARM_ND4 = 304,
|
||||
CV_ARM_ND5 = 305,
|
||||
CV_ARM_ND6 = 306,
|
||||
CV_ARM_ND7 = 307,
|
||||
CV_ARM_ND8 = 308,
|
||||
CV_ARM_ND9 = 309,
|
||||
CV_ARM_ND10 = 310,
|
||||
CV_ARM_ND6 = 306,
|
||||
CV_ARM_ND7 = 307,
|
||||
CV_ARM_ND8 = 308,
|
||||
CV_ARM_ND9 = 309,
|
||||
CV_ARM_ND10 = 310,
|
||||
CV_ARM_ND11 = 311,
|
||||
CV_ARM_ND12 = 312,
|
||||
CV_ARM_ND13 = 313,
|
||||
CV_ARM_ND14 = 314,
|
||||
CV_ARM_ND15 = 315,
|
||||
CV_ARM_ND12 = 312,
|
||||
CV_ARM_ND13 = 313,
|
||||
CV_ARM_ND14 = 314,
|
||||
CV_ARM_ND15 = 315,
|
||||
CV_ARM_ND16 = 316,
|
||||
CV_ARM_ND17 = 317,
|
||||
CV_ARM_ND18 = 318,
|
||||
CV_ARM_ND19 = 319,
|
||||
CV_ARM_ND20 = 320,
|
||||
CV_ARM_ND17 = 317,
|
||||
CV_ARM_ND18 = 318,
|
||||
CV_ARM_ND19 = 319,
|
||||
CV_ARM_ND20 = 320,
|
||||
CV_ARM_ND21 = 321,
|
||||
CV_ARM_ND22 = 322,
|
||||
CV_ARM_ND23 = 323,
|
||||
CV_ARM_ND24 = 324,
|
||||
CV_ARM_ND25 = 325,
|
||||
CV_ARM_ND22 = 322,
|
||||
CV_ARM_ND23 = 323,
|
||||
CV_ARM_ND24 = 324,
|
||||
CV_ARM_ND25 = 325,
|
||||
CV_ARM_ND26 = 326,
|
||||
CV_ARM_ND27 = 327,
|
||||
CV_ARM_ND28 = 328,
|
||||
CV_ARM_ND29 = 329,
|
||||
CV_ARM_ND30 = 330,
|
||||
CV_ARM_ND27 = 327,
|
||||
CV_ARM_ND28 = 328,
|
||||
CV_ARM_ND29 = 329,
|
||||
CV_ARM_ND30 = 330,
|
||||
CV_ARM_ND31 = 331,
|
||||
|
||||
// ARM extended precision floating point
|
||||
|
||||
CV_ARM_NQ0 = 400,
|
||||
CV_ARM_NQ1 = 401,
|
||||
CV_ARM_NQ2 = 402,
|
||||
CV_ARM_NQ3 = 403,
|
||||
CV_ARM_NQ4 = 404,
|
||||
CV_ARM_NQ0 = 400,
|
||||
CV_ARM_NQ1 = 401,
|
||||
CV_ARM_NQ2 = 402,
|
||||
CV_ARM_NQ3 = 403,
|
||||
CV_ARM_NQ4 = 404,
|
||||
CV_ARM_NQ5 = 405,
|
||||
CV_ARM_NQ6 = 406,
|
||||
CV_ARM_NQ7 = 407,
|
||||
CV_ARM_NQ8 = 408,
|
||||
CV_ARM_NQ9 = 409,
|
||||
CV_ARM_NQ10 = 410,
|
||||
CV_ARM_NQ6 = 406,
|
||||
CV_ARM_NQ7 = 407,
|
||||
CV_ARM_NQ8 = 408,
|
||||
CV_ARM_NQ9 = 409,
|
||||
CV_ARM_NQ10 = 410,
|
||||
CV_ARM_NQ11 = 411,
|
||||
CV_ARM_NQ12 = 412,
|
||||
CV_ARM_NQ13 = 413,
|
||||
CV_ARM_NQ14 = 414,
|
||||
CV_ARM_NQ15 = 415,
|
||||
CV_ARM_NQ12 = 412,
|
||||
CV_ARM_NQ13 = 413,
|
||||
CV_ARM_NQ14 = 414,
|
||||
CV_ARM_NQ15 = 415,
|
||||
|
||||
//
|
||||
// Register set for ARM64
|
||||
|
@ -1694,7 +1694,7 @@ typedef enum CV_HREG_e {
|
|||
// Floating point status register
|
||||
|
||||
CV_ARM64_FPSR = 220,
|
||||
|
||||
|
||||
//
|
||||
// Register set for Intel IA64
|
||||
//
|
||||
|
@ -2757,7 +2757,7 @@ typedef enum CV_HREG_e {
|
|||
CV_SHMEDIA_R61 = 71,
|
||||
CV_SHMEDIA_R62 = 72,
|
||||
CV_SHMEDIA_R63 = 73,
|
||||
|
||||
|
||||
// Target Registers - 32 bit
|
||||
CV_SHMEDIA_TR0 = 74,
|
||||
CV_SHMEDIA_TR1 = 75,
|
||||
|
@ -3319,7 +3319,7 @@ typedef enum CV_HREG_e {
|
|||
CV_AMD64_YMM5 = 373,
|
||||
CV_AMD64_YMM6 = 374,
|
||||
CV_AMD64_YMM7 = 375,
|
||||
CV_AMD64_YMM8 = 376,
|
||||
CV_AMD64_YMM8 = 376,
|
||||
CV_AMD64_YMM9 = 377,
|
||||
CV_AMD64_YMM10 = 378,
|
||||
CV_AMD64_YMM11 = 379,
|
||||
|
@ -3337,7 +3337,7 @@ typedef enum CV_HREG_e {
|
|||
CV_AMD64_YMM5H = 389,
|
||||
CV_AMD64_YMM6H = 390,
|
||||
CV_AMD64_YMM7H = 391,
|
||||
CV_AMD64_YMM8H = 392,
|
||||
CV_AMD64_YMM8H = 392,
|
||||
CV_AMD64_YMM9H = 393,
|
||||
CV_AMD64_YMM10H = 394,
|
||||
CV_AMD64_YMM11H = 395,
|
||||
|
@ -3576,7 +3576,7 @@ typedef enum CV_HREG_e {
|
|||
CV_AMD64_YMM15F5 = 621,
|
||||
CV_AMD64_YMM15F6 = 622,
|
||||
CV_AMD64_YMM15F7 = 623,
|
||||
|
||||
|
||||
CV_AMD64_YMM0D0 = 624, // AVX floating-point double precise registers
|
||||
CV_AMD64_YMM0D1 = 625,
|
||||
CV_AMD64_YMM0D2 = 626,
|
||||
|
@ -3649,47 +3649,47 @@ typedef enum CV_HREG_e {
|
|||
} CV_HREG_e;
|
||||
|
||||
typedef enum CV_HLSLREG_e {
|
||||
CV_HLSLREG_TEMP = 0,
|
||||
CV_HLSLREG_INPUT = 1,
|
||||
CV_HLSLREG_OUTPUT = 2,
|
||||
CV_HLSLREG_INDEXABLE_TEMP = 3,
|
||||
CV_HLSLREG_IMMEDIATE32 = 4,
|
||||
CV_HLSLREG_IMMEDIATE64 = 5,
|
||||
CV_HLSLREG_SAMPLER = 6,
|
||||
CV_HLSLREG_RESOURCE = 7,
|
||||
CV_HLSLREG_CONSTANT_BUFFER = 8,
|
||||
CV_HLSLREG_IMMEDIATE_CONSTANT_BUFFER = 9,
|
||||
CV_HLSLREG_LABEL = 10,
|
||||
CV_HLSLREG_INPUT_PRIMITIVEID = 11,
|
||||
CV_HLSLREG_OUTPUT_DEPTH = 12,
|
||||
CV_HLSLREG_NULL = 13,
|
||||
CV_HLSLREG_RASTERIZER = 14,
|
||||
CV_HLSLREG_OUTPUT_COVERAGE_MASK = 15,
|
||||
CV_HLSLREG_STREAM = 16,
|
||||
CV_HLSLREG_FUNCTION_BODY = 17,
|
||||
CV_HLSLREG_FUNCTION_TABLE = 18,
|
||||
CV_HLSLREG_INTERFACE = 19,
|
||||
CV_HLSLREG_FUNCTION_INPUT = 20,
|
||||
CV_HLSLREG_FUNCTION_OUTPUT = 21,
|
||||
CV_HLSLREG_OUTPUT_CONTROL_POINT_ID = 22,
|
||||
CV_HLSLREG_INPUT_FORK_INSTANCE_ID = 23,
|
||||
CV_HLSLREG_INPUT_JOIN_INSTANCE_ID = 24,
|
||||
CV_HLSLREG_INPUT_CONTROL_POINT = 25,
|
||||
CV_HLSLREG_OUTPUT_CONTROL_POINT = 26,
|
||||
CV_HLSLREG_INPUT_PATCH_CONSTANT = 27,
|
||||
CV_HLSLREG_INPUT_DOMAIN_POINT = 28,
|
||||
CV_HLSLREG_THIS_POINTER = 29,
|
||||
CV_HLSLREG_UNORDERED_ACCESS_VIEW = 30,
|
||||
CV_HLSLREG_THREAD_GROUP_SHARED_MEMORY = 31,
|
||||
CV_HLSLREG_INPUT_THREAD_ID = 32,
|
||||
CV_HLSLREG_INPUT_THREAD_GROUP_ID = 33,
|
||||
CV_HLSLREG_INPUT_THREAD_ID_IN_GROUP = 34,
|
||||
CV_HLSLREG_INPUT_COVERAGE_MASK = 35,
|
||||
CV_HLSLREG_TEMP = 0,
|
||||
CV_HLSLREG_INPUT = 1,
|
||||
CV_HLSLREG_OUTPUT = 2,
|
||||
CV_HLSLREG_INDEXABLE_TEMP = 3,
|
||||
CV_HLSLREG_IMMEDIATE32 = 4,
|
||||
CV_HLSLREG_IMMEDIATE64 = 5,
|
||||
CV_HLSLREG_SAMPLER = 6,
|
||||
CV_HLSLREG_RESOURCE = 7,
|
||||
CV_HLSLREG_CONSTANT_BUFFER = 8,
|
||||
CV_HLSLREG_IMMEDIATE_CONSTANT_BUFFER = 9,
|
||||
CV_HLSLREG_LABEL = 10,
|
||||
CV_HLSLREG_INPUT_PRIMITIVEID = 11,
|
||||
CV_HLSLREG_OUTPUT_DEPTH = 12,
|
||||
CV_HLSLREG_NULL = 13,
|
||||
CV_HLSLREG_RASTERIZER = 14,
|
||||
CV_HLSLREG_OUTPUT_COVERAGE_MASK = 15,
|
||||
CV_HLSLREG_STREAM = 16,
|
||||
CV_HLSLREG_FUNCTION_BODY = 17,
|
||||
CV_HLSLREG_FUNCTION_TABLE = 18,
|
||||
CV_HLSLREG_INTERFACE = 19,
|
||||
CV_HLSLREG_FUNCTION_INPUT = 20,
|
||||
CV_HLSLREG_FUNCTION_OUTPUT = 21,
|
||||
CV_HLSLREG_OUTPUT_CONTROL_POINT_ID = 22,
|
||||
CV_HLSLREG_INPUT_FORK_INSTANCE_ID = 23,
|
||||
CV_HLSLREG_INPUT_JOIN_INSTANCE_ID = 24,
|
||||
CV_HLSLREG_INPUT_CONTROL_POINT = 25,
|
||||
CV_HLSLREG_OUTPUT_CONTROL_POINT = 26,
|
||||
CV_HLSLREG_INPUT_PATCH_CONSTANT = 27,
|
||||
CV_HLSLREG_INPUT_DOMAIN_POINT = 28,
|
||||
CV_HLSLREG_THIS_POINTER = 29,
|
||||
CV_HLSLREG_UNORDERED_ACCESS_VIEW = 30,
|
||||
CV_HLSLREG_THREAD_GROUP_SHARED_MEMORY = 31,
|
||||
CV_HLSLREG_INPUT_THREAD_ID = 32,
|
||||
CV_HLSLREG_INPUT_THREAD_GROUP_ID = 33,
|
||||
CV_HLSLREG_INPUT_THREAD_ID_IN_GROUP = 34,
|
||||
CV_HLSLREG_INPUT_COVERAGE_MASK = 35,
|
||||
CV_HLSLREG_INPUT_THREAD_ID_IN_GROUP_FLATTENED = 36,
|
||||
CV_HLSLREG_INPUT_GS_INSTANCE_ID = 37,
|
||||
CV_HLSLREG_OUTPUT_DEPTH_GREATER_EQUAL = 38,
|
||||
CV_HLSLREG_OUTPUT_DEPTH_LESS_EQUAL = 39,
|
||||
CV_HLSLREG_CYCLE_COUNTER = 40,
|
||||
CV_HLSLREG_INPUT_GS_INSTANCE_ID = 37,
|
||||
CV_HLSLREG_OUTPUT_DEPTH_GREATER_EQUAL = 38,
|
||||
CV_HLSLREG_OUTPUT_DEPTH_LESS_EQUAL = 39,
|
||||
CV_HLSLREG_CYCLE_COUNTER = 40,
|
||||
} CV_HLSLREG_e;
|
||||
|
||||
enum StackFrameTypeEnum
|
||||
|
|
|
@ -945,7 +945,7 @@ typedef enum LEAF_ENUM_e {
|
|||
LF_UTF8STRING = 0x801b,
|
||||
|
||||
LF_REAL16 = 0x801c,
|
||||
|
||||
|
||||
LF_PAD0 = 0xf0,
|
||||
LF_PAD1 = 0xf1,
|
||||
LF_PAD2 = 0xf2,
|
||||
|
@ -1001,7 +1001,7 @@ typedef enum CV_ptrtype_e {
|
|||
// To support for l-value and r-value reference, we added CV_PTR_MODE_LVREF
|
||||
// and CV_PTR_MODE_RVREF. CV_PTR_MODE_REF should be removed at some point.
|
||||
// We keep it now so that old code that uses it won't be broken.
|
||||
//
|
||||
//
|
||||
|
||||
typedef enum CV_ptrmode_e {
|
||||
CV_PTR_MODE_PTR = 0x00, // "normal" pointer
|
||||
|
@ -1665,14 +1665,14 @@ typedef struct lfFuncId {
|
|||
unsigned short leaf; // LF_FUNC_ID
|
||||
CV_ItemId scopeId; // parent scope of the ID, 0 if global
|
||||
CV_typ_t type; // function type
|
||||
unsigned char name[CV_ZEROLEN];
|
||||
unsigned char name[CV_ZEROLEN];
|
||||
} lfFuncId;
|
||||
|
||||
typedef struct lfMFuncId {
|
||||
unsigned short leaf; // LF_MFUNC_ID
|
||||
CV_typ_t parentType; // type index of parent
|
||||
CV_typ_t type; // function type
|
||||
unsigned char name[CV_ZEROLEN];
|
||||
unsigned char name[CV_ZEROLEN];
|
||||
} lfMFuncId;
|
||||
|
||||
typedef struct lfStringId {
|
||||
|
@ -1693,7 +1693,7 @@ typedef struct lfUdtModSrcLine {
|
|||
CV_typ_t type; // UDT's type index
|
||||
CV_ItemId src; // index into string table where source file name is saved
|
||||
unsigned long line; // line number
|
||||
unsigned short imod; // module that contributes this UDT definition
|
||||
unsigned short imod; // module that contributes this UDT definition
|
||||
} lfUdtModSrcLine;
|
||||
|
||||
typedef enum CV_BuildInfo_e {
|
||||
|
@ -2955,7 +2955,7 @@ typedef enum SYM_ENUM_e {
|
|||
S_DPC_SYM_TAG_MAP = 0x1158, // DPC pointer tag value to symbol record map
|
||||
|
||||
#endif // CC_DP_CXX
|
||||
|
||||
|
||||
S_ARMSWITCHTABLE = 0x1159,
|
||||
S_CALLEES = 0x115a,
|
||||
S_CALLERS = 0x115b,
|
||||
|
@ -3054,7 +3054,7 @@ typedef struct CV_LVARFLAGS {
|
|||
unsigned short fAddrTaken :1; // address is taken
|
||||
unsigned short fCompGenx :1; // variable is compiler generated
|
||||
unsigned short fIsAggregate :1; // the symbol is splitted in temporaries,
|
||||
// which are treated by compiler as
|
||||
// which are treated by compiler as
|
||||
// independent entities
|
||||
unsigned short fIsAggregated :1; // Counterpart of fIsAggregate - tells
|
||||
// that it is a part of a fIsAggregate symbol
|
||||
|
@ -3089,7 +3089,7 @@ typedef struct CV_LVAR_ADDR_RANGE { // defines a range of addresses
|
|||
unsigned short cbRange;
|
||||
} CV_LVAR_ADDR_RANGE;
|
||||
|
||||
// Represents the holes in overall address range, all address is pre-bbt.
|
||||
// Represents the holes in overall address range, all address is pre-bbt.
|
||||
// it is for compress and reduce the amount of relocations need.
|
||||
|
||||
typedef struct CV_LVAR_ADDR_GAP {
|
||||
|
@ -4088,9 +4088,9 @@ typedef struct FRAMEPROCSYM {
|
|||
} FRAMEPROCSYM;
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace CodeViewInfo
|
||||
namespace CodeViewInfo
|
||||
{
|
||||
__inline unsigned short ExpandEncodedBasePointerReg(unsigned machineType, unsigned encodedFrameReg)
|
||||
__inline unsigned short ExpandEncodedBasePointerReg(unsigned machineType, unsigned encodedFrameReg)
|
||||
{
|
||||
static const unsigned short rgFramePointerRegX86[] = {
|
||||
CV_REG_NONE, CV_ALLREG_VFRAME, CV_REG_EBP, CV_REG_EBX};
|
||||
|
@ -4174,7 +4174,7 @@ typedef struct INLINESITESYM2 {
|
|||
typedef struct LOCALSYM {
|
||||
unsigned short reclen; // Record length
|
||||
unsigned short rectyp; // S_LOCAL
|
||||
CV_typ_t typind; // type index
|
||||
CV_typ_t typind; // type index
|
||||
CV_LVARFLAGS flags; // local var flags
|
||||
|
||||
unsigned char name[CV_ZEROLEN]; // Name of this symbol, a null terminated array of UTF8 characters.
|
||||
|
@ -4183,7 +4183,7 @@ typedef struct LOCALSYM {
|
|||
typedef struct FILESTATICSYM {
|
||||
unsigned short reclen; // Record length
|
||||
unsigned short rectyp; // S_FILESTATIC
|
||||
CV_typ_t typind; // type index
|
||||
CV_typ_t typind; // type index
|
||||
CV_uoff32_t modOffset; // index of mod filename in stringtable
|
||||
CV_LVARFLAGS flags; // local var flags
|
||||
|
||||
|
@ -4197,7 +4197,7 @@ typedef struct DEFRANGESYM { // A live range of sub field of variable
|
|||
CV_uoff32_t program; // DIA program to evaluate the value of the symbol
|
||||
|
||||
CV_LVAR_ADDR_RANGE range; // Range of addresses where this program is valid
|
||||
CV_LVAR_ADDR_GAP gaps[CV_ZEROLEN]; // The value is not available in following gaps.
|
||||
CV_LVAR_ADDR_GAP gaps[CV_ZEROLEN]; // The value is not available in following gaps.
|
||||
} DEFRANGESYM;
|
||||
|
||||
typedef struct DEFRANGESYMSUBFIELD { // A live range of sub field of variable. like locala.i
|
||||
|
@ -4209,7 +4209,7 @@ typedef struct DEFRANGESYMSUBFIELD { // A live range of sub field of variable. l
|
|||
CV_uoff32_t offParent; // Offset in parent variable.
|
||||
|
||||
CV_LVAR_ADDR_RANGE range; // Range of addresses where this program is valid
|
||||
CV_LVAR_ADDR_GAP gaps[CV_ZEROLEN]; // The value is not available in following gaps.
|
||||
CV_LVAR_ADDR_GAP gaps[CV_ZEROLEN]; // The value is not available in following gaps.
|
||||
} DEFRANGESYMSUBFIELD;
|
||||
|
||||
typedef struct CV_RANGEATTR {
|
||||
|
@ -4219,11 +4219,11 @@ typedef struct CV_RANGEATTR {
|
|||
|
||||
typedef struct DEFRANGESYMREGISTER { // A live range of en-registed variable
|
||||
unsigned short reclen; // Record length
|
||||
unsigned short rectyp; // S_DEFRANGE_REGISTER
|
||||
unsigned short rectyp; // S_DEFRANGE_REGISTER
|
||||
unsigned short reg; // Register to hold the value of the symbol
|
||||
CV_RANGEATTR attr; // Attribute of the register range.
|
||||
CV_LVAR_ADDR_RANGE range; // Range of addresses where this program is valid
|
||||
CV_LVAR_ADDR_GAP gaps[CV_ZEROLEN]; // The value is not available in following gaps.
|
||||
CV_LVAR_ADDR_GAP gaps[CV_ZEROLEN]; // The value is not available in following gaps.
|
||||
} DEFRANGESYMREGISTER;
|
||||
|
||||
typedef struct DEFRANGESYMFRAMEPOINTERREL { // A live range of frame variable
|
||||
|
@ -4233,10 +4233,10 @@ typedef struct DEFRANGESYMFRAMEPOINTERREL { // A live range of frame variable
|
|||
CV_off32_t offFramePointer; // offset to frame pointer
|
||||
|
||||
CV_LVAR_ADDR_RANGE range; // Range of addresses where this program is valid
|
||||
CV_LVAR_ADDR_GAP gaps[CV_ZEROLEN]; // The value is not available in following gaps.
|
||||
CV_LVAR_ADDR_GAP gaps[CV_ZEROLEN]; // The value is not available in following gaps.
|
||||
} DEFRANGESYMFRAMEPOINTERREL;
|
||||
|
||||
typedef struct DEFRANGESYMFRAMEPOINTERREL_FULL_SCOPE { // A frame variable valid in all function scope
|
||||
typedef struct DEFRANGESYMFRAMEPOINTERREL_FULL_SCOPE { // A frame variable valid in all function scope
|
||||
unsigned short reclen; // Record length
|
||||
unsigned short rectyp; // S_DEFRANGE_FRAMEPOINTER_REL
|
||||
|
||||
|
@ -4245,17 +4245,17 @@ typedef struct DEFRANGESYMFRAMEPOINTERREL_FULL_SCOPE { // A frame variable valid
|
|||
|
||||
#define CV_OFFSET_PARENT_LENGTH_LIMIT 12
|
||||
|
||||
// Note DEFRANGESYMREGISTERREL and DEFRANGESYMSUBFIELDREGISTER had same layout.
|
||||
// Note DEFRANGESYMREGISTERREL and DEFRANGESYMSUBFIELDREGISTER had same layout.
|
||||
typedef struct DEFRANGESYMSUBFIELDREGISTER { // A live range of sub field of variable. like locala.i
|
||||
unsigned short reclen; // Record length
|
||||
unsigned short rectyp; // S_DEFRANGE_SUBFIELD_REGISTER
|
||||
unsigned short rectyp; // S_DEFRANGE_SUBFIELD_REGISTER
|
||||
|
||||
unsigned short reg; // Register to hold the value of the symbol
|
||||
CV_RANGEATTR attr; // Attribute of the register range.
|
||||
CV_uoff32_t offParent : CV_OFFSET_PARENT_LENGTH_LIMIT; // Offset in parent variable.
|
||||
CV_uoff32_t padding : 20; // Padding for future use.
|
||||
CV_LVAR_ADDR_RANGE range; // Range of addresses where this program is valid
|
||||
CV_LVAR_ADDR_GAP gaps[CV_ZEROLEN]; // The value is not available in following gaps.
|
||||
CV_LVAR_ADDR_GAP gaps[CV_ZEROLEN]; // The value is not available in following gaps.
|
||||
} DEFRANGESYMSUBFIELDREGISTER;
|
||||
|
||||
// Note DEFRANGESYMREGISTERREL and DEFRANGESYMSUBFIELDREGISTER had same layout.
|
||||
|
@ -4284,7 +4284,7 @@ typedef struct DEFRANGESYMHLSL { // A live range of variable related to a sym
|
|||
unsigned short spilledUdtMember : 1; // this is a spilled member
|
||||
unsigned short memorySpace : 4; // memory space
|
||||
unsigned short padding : 9; // for future use
|
||||
|
||||
|
||||
unsigned short offsetParent; // Offset in parent variable.
|
||||
unsigned short sizeInParent; // Size of enregistered portion
|
||||
|
||||
|
@ -4298,7 +4298,7 @@ typedef struct DEFRANGESYMHLSL { // A live range of variable related to a sym
|
|||
(((x)->reclen + sizeof((x)->reclen) - sizeof(DEFRANGESYM)) / sizeof(CV_LVAR_ADDR_GAP))
|
||||
|
||||
#define CV_DEFRANGESYMSUBFIELD_GAPS_COUNT(x) \
|
||||
(((x)->reclen + sizeof((x)->reclen) - sizeof(DEFRANGESYMSUBFIELD)) / sizeof(CV_LVAR_ADDR_GAP))
|
||||
(((x)->reclen + sizeof((x)->reclen) - sizeof(DEFRANGESYMSUBFIELD)) / sizeof(CV_LVAR_ADDR_GAP))
|
||||
|
||||
#define CV_DEFRANGESYMHLSL_GAPS_COUNT(x) \
|
||||
(((x)->reclen + sizeof((x)->reclen) - sizeof(DEFRANGESYMHLSL) - (x)->regIndices * sizeof(CV_uoff32_t)) / sizeof(CV_LVAR_ADDR_GAP))
|
||||
|
@ -4313,10 +4313,10 @@ typedef struct DEFRANGESYMHLSL { // A live range of variable related to a sym
|
|||
|
||||
#define CV_DEFRANGESYMHLSL_OFFSET_PTR_BASE(x, t) \
|
||||
reinterpret_cast<t>(((CV_LVAR_ADDR_GAP*)(x)->data) + CV_DEFRANGESYMHLSL_GAPS_COUNT(x))
|
||||
|
||||
|
||||
#define CV_DEFRANGESYMHLSL_OFFSET_CONST_PTR(x) \
|
||||
CV_DEFRANGESYMHLSL_OFFSET_PTR_BASE(x, const CV_uoff32_t*)
|
||||
|
||||
|
||||
#define CV_DEFRANGESYMHLSL_OFFSET_PTR(x) \
|
||||
CV_DEFRANGESYMHLSL_OFFSET_PTR_BASE(x, CV_uoff32_t*)
|
||||
|
||||
|
@ -4326,12 +4326,12 @@ typedef struct DEFRANGESYMHLSL { // A live range of variable related to a sym
|
|||
typedef struct LOCALDPCGROUPSHAREDSYM {
|
||||
unsigned short reclen; // Record length
|
||||
unsigned short rectyp; // S_LOCAL_DPC_GROUPSHARED
|
||||
CV_typ_t typind; // type index
|
||||
CV_typ_t typind; // type index
|
||||
CV_LVARFLAGS flags; // local var flags
|
||||
|
||||
unsigned short dataslot; // Base data (cbuffer, groupshared, etc.) slot
|
||||
unsigned short dataoff; // Base data byte offset start
|
||||
|
||||
|
||||
unsigned char name[CV_ZEROLEN]; // Name of this symbol, a null terminated array of UTF8 characters.
|
||||
} LOCALDPCGROUPSHAREDSYM;
|
||||
|
||||
|
@ -4494,13 +4494,13 @@ typedef struct HEAPALLOCSITE {
|
|||
|
||||
typedef enum CV_cookietype_e
|
||||
{
|
||||
CV_COOKIETYPE_COPY = 0,
|
||||
CV_COOKIETYPE_XOR_SP,
|
||||
CV_COOKIETYPE_COPY = 0,
|
||||
CV_COOKIETYPE_XOR_SP,
|
||||
CV_COOKIETYPE_XOR_BP,
|
||||
CV_COOKIETYPE_XOR_R13,
|
||||
} CV_cookietype_e;
|
||||
|
||||
// Symbol for describing security cookie's position and type
|
||||
// Symbol for describing security cookie's position and type
|
||||
// (raw, xor'd with esp, xor'd with ebp).
|
||||
|
||||
typedef struct FRAMECOOKIE {
|
||||
|
@ -4578,7 +4578,7 @@ enum DEBUG_S_SUBSECTION_TYPE {
|
|||
};
|
||||
|
||||
struct CV_DebugSSubsectionHeader_t {
|
||||
enum DEBUG_S_SUBSECTION_TYPE type;
|
||||
enum DEBUG_S_SUBSECTION_TYPE type;
|
||||
CV_off32_t cbLen;
|
||||
};
|
||||
|
||||
|
@ -4640,14 +4640,14 @@ typedef struct tagXFIXUP_DATA {
|
|||
unsigned long rvaTarget;
|
||||
} XFIXUP_DATA;
|
||||
|
||||
// Those cross scope IDs are private convention,
|
||||
// it used to delay the ID merging for frontend and backend even linker.
|
||||
// It is transparent for DIA client.
|
||||
// Use those ID will let DIA run a litter slower and but
|
||||
// Those cross scope IDs are private convention,
|
||||
// it used to delay the ID merging for frontend and backend even linker.
|
||||
// It is transparent for DIA client.
|
||||
// Use those ID will let DIA run a litter slower and but
|
||||
// avoid the copy type tree in some scenarios.
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace CodeViewInfo
|
||||
namespace CodeViewInfo
|
||||
{
|
||||
|
||||
typedef struct ComboID
|
||||
|
@ -4690,7 +4690,7 @@ typedef struct CrossScopeId
|
|||
{
|
||||
static const unsigned int LocalIdBitWidth = 20;
|
||||
static const unsigned int IdScopeBitWidth = 11;
|
||||
static const unsigned int StartCrossScopeId =
|
||||
static const unsigned int StartCrossScopeId =
|
||||
(unsigned int) (1 << (LocalIdBitWidth + IdScopeBitWidth));
|
||||
static const unsigned int LocalIdMask = (1 << LocalIdBitWidth) - 1;
|
||||
static const unsigned int ScopeIdMask = StartCrossScopeId - (1 << LocalIdBitWidth);
|
||||
|
@ -4701,8 +4701,8 @@ typedef struct CrossScopeId
|
|||
// Compilation unit at most reference to another 2K compilation units.
|
||||
static const unsigned int MaxScopeId = (1 << IdScopeBitWidth) - 1;
|
||||
|
||||
CrossScopeId(unsigned short aIdScopeId, unsigned int aLocalId)
|
||||
{
|
||||
CrossScopeId(unsigned short aIdScopeId, unsigned int aLocalId)
|
||||
{
|
||||
crossScopeId = StartCrossScopeId
|
||||
| (aIdScopeId << LocalIdBitWidth)
|
||||
| aLocalId;
|
||||
|
@ -4720,12 +4720,12 @@ typedef struct CrossScopeId
|
|||
return (crossScopeId & ScopeIdMask) >> LocalIdBitWidth;
|
||||
}
|
||||
|
||||
static bool IsCrossScopeId(unsigned int i)
|
||||
static bool IsCrossScopeId(unsigned int i)
|
||||
{
|
||||
return (StartCrossScopeId & i) != 0;
|
||||
}
|
||||
|
||||
static CrossScopeId Decode(unsigned int i)
|
||||
static CrossScopeId Decode(unsigned int i)
|
||||
{
|
||||
CrossScopeId retval;
|
||||
retval.crossScopeId = i;
|
||||
|
@ -4738,7 +4738,7 @@ private:
|
|||
|
||||
unsigned int crossScopeId;
|
||||
|
||||
} CrossScopeId;
|
||||
} CrossScopeId;
|
||||
|
||||
// Combined encoding of TI or FuncId, In compiler implementation
|
||||
// Id prefixed by 1 if it is function ID.
|
||||
|
@ -4761,12 +4761,12 @@ typedef struct DecoratedItemId
|
|||
return decoratedItemId;
|
||||
}
|
||||
|
||||
bool IsFuncId()
|
||||
bool IsFuncId()
|
||||
{
|
||||
return (decoratedItemId & 0x80000000) == 0x80000000;
|
||||
}
|
||||
|
||||
CV_ItemId GetItemId()
|
||||
CV_ItemId GetItemId()
|
||||
{
|
||||
return decoratedItemId & 0x7fffffff;
|
||||
}
|
||||
|
@ -4781,20 +4781,20 @@ private:
|
|||
// Or compile time PDB full path
|
||||
|
||||
typedef struct tagPdbIdScope {
|
||||
CV_off32_t offObjectFilePath;
|
||||
CV_off32_t offObjectFilePath;
|
||||
} PdbIdScope;
|
||||
|
||||
// An array of all imports by import module.
|
||||
// List all cross reference for a specific ID scope.
|
||||
// Format of DEBUG_S_CROSSSCOPEIMPORTS subsection is
|
||||
// Format of DEBUG_S_CROSSSCOPEIMPORTS subsection is
|
||||
typedef struct tagCrossScopeReferences {
|
||||
PdbIdScope externalScope; // Module of definition Scope.
|
||||
unsigned int countOfCrossReferences; // Count of following array.
|
||||
unsigned int countOfCrossReferences; // Count of following array.
|
||||
CV_ItemId referenceIds[CV_ZEROLEN]; // CV_ItemId in another compilation unit.
|
||||
} CrossScopeReferences;
|
||||
|
||||
// An array of all exports in this module.
|
||||
// Format of DEBUG_S_CROSSSCOPEEXPORTS subsection is
|
||||
// Format of DEBUG_S_CROSSSCOPEEXPORTS subsection is
|
||||
typedef struct tagLocalIdAndGlobalIdPair {
|
||||
CV_ItemId localId; // local id inside the compile time PDB scope. 0 based
|
||||
CV_ItemId globalId; // global id inside the link time PDB scope, if scope are different.
|
||||
|
@ -4836,11 +4836,11 @@ typedef struct tagInlineeSourceLineEx {
|
|||
enum BinaryAnnotationOpcode
|
||||
{
|
||||
BA_OP_Invalid, // link time pdb contains PADDINGs
|
||||
BA_OP_CodeOffset, // param : start offset
|
||||
BA_OP_CodeOffset, // param : start offset
|
||||
BA_OP_ChangeCodeOffsetBase, // param : nth separated code chunk (main code chunk == 0)
|
||||
BA_OP_ChangeCodeOffset, // param : delta of offset
|
||||
BA_OP_ChangeCodeLength, // param : length of code, default next start
|
||||
BA_OP_ChangeFile, // param : fileId
|
||||
BA_OP_ChangeFile, // param : fileId
|
||||
BA_OP_ChangeLineOffset, // param : line offset (signed)
|
||||
BA_OP_ChangeLineEndDelta, // param : how many lines, default 1
|
||||
BA_OP_ChangeRangeKind, // param : either 1 (default, for statement)
|
||||
|
@ -4917,14 +4917,14 @@ inline UInt32 CVCompressData(
|
|||
//
|
||||
// Return value is the uncompressed unsigned integer. pData is incremented to
|
||||
// point to the next piece of uncompressed data.
|
||||
//
|
||||
//
|
||||
// Returns -1 if what is passed in is incorrectly compressed data, such as
|
||||
// (*pBytes & 0xE0) == 0xE0.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline UInt32 CVUncompressData(
|
||||
PCompressedAnnotation & pData) // [IN,OUT] compressed data
|
||||
PCompressedAnnotation & pData) // [IN,OUT] compressed data
|
||||
{
|
||||
UInt32 res = (UInt32)(-1);
|
||||
|
||||
|
@ -4940,7 +4940,7 @@ inline UInt32 CVUncompressData(
|
|||
res |= *pData++;
|
||||
}
|
||||
else if ((*pData & 0xE0) == 0xC0) {
|
||||
// 110? ????
|
||||
// 110? ????
|
||||
|
||||
res = (*pData++ & 0x1f) << 24;
|
||||
res |= *pData++ << 16;
|
||||
|
@ -4948,13 +4948,13 @@ inline UInt32 CVUncompressData(
|
|||
res |= *pData++;
|
||||
}
|
||||
|
||||
return res;
|
||||
return res;
|
||||
}
|
||||
|
||||
// Encode smaller absolute numbers with smaller buffer.
|
||||
//
|
||||
// General compression only work for input < 0x1FFFFFFF
|
||||
// algorithm will not work on 0x80000000
|
||||
// General compression only work for input < 0x1FFFFFFF
|
||||
// algorithm will not work on 0x80000000
|
||||
|
||||
inline unsigned __int32 EncodeSignedInt32(__int32 input)
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
//
|
||||
//
|
||||
// CycleTimer has methods related to getting cycle timer values.
|
||||
// It uses an all-statics class as a namespace mechanism.
|
||||
//
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
//*****************************************************************************
|
||||
// File: daccess.h
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
// Support for external access of runtime data structures. These
|
||||
|
@ -27,24 +27,24 @@
|
|||
// way to write data back currently.
|
||||
//
|
||||
// DAC-ized code:
|
||||
// - is read-only (non-invasive). So DACized codepaths can not trigger a GC.
|
||||
// - is read-only (non-invasive). So DACized codepaths can not trigger a GC.
|
||||
// - has no Thread* object. In reality, DAC-ized codepaths are
|
||||
// ReadProcessMemory calls from out-of-process. Conceptually, they
|
||||
// are like a pure-native (preemptive) thread.
|
||||
// ReadProcessMemory calls from out-of-process. Conceptually, they
|
||||
// are like a pure-native (preemptive) thread.
|
||||
////
|
||||
// This means that in particular, you cannot DACize a GCTRIGGERS function.
|
||||
// This means that in particular, you cannot DACize a GCTRIGGERS function.
|
||||
// Neither can you DACize a function that throws if this will involve
|
||||
// allocating a new exception object. There may be
|
||||
// exceptions to these rules if you can guarantee that the DACized
|
||||
// part of the code path cannot cause a garbage collection (see
|
||||
// EditAndContinueModule::ResolveField for an example).
|
||||
// If you need to DACize a function that may trigger
|
||||
// allocating a new exception object. There may be
|
||||
// exceptions to these rules if you can guarantee that the DACized
|
||||
// part of the code path cannot cause a garbage collection (see
|
||||
// EditAndContinueModule::ResolveField for an example).
|
||||
// If you need to DACize a function that may trigger
|
||||
// a GC, it is probably best to refactor the function so that the DACized
|
||||
// part of the code path is in a separate function. For instance,
|
||||
// functions with GetOrCreate() semantics are hard to DAC-ize because
|
||||
// functions with GetOrCreate() semantics are hard to DAC-ize because
|
||||
// they the Create portion is inherently invasive. Instead, consider refactoring
|
||||
// into a GetOrFail() function that DAC can call; and then make GetOrCreate()
|
||||
// a wrapper around that.
|
||||
// into a GetOrFail() function that DAC can call; and then make GetOrCreate()
|
||||
// a wrapper around that.
|
||||
|
||||
//
|
||||
// This code works by hiding the details of access to target memory.
|
||||
|
@ -87,7 +87,7 @@
|
|||
// PTR_RangeSection pleft;
|
||||
// ... Other fields omitted ...
|
||||
// } RangeSection;
|
||||
//
|
||||
//
|
||||
// RangeSection* pRS = m_RangeTree;
|
||||
//
|
||||
// while (pRS != NULL)
|
||||
|
@ -289,7 +289,7 @@
|
|||
// ...
|
||||
// }
|
||||
//
|
||||
// SystemDomain::m_appDomainIndexList;
|
||||
// SystemDomain::m_appDomainIndexList;
|
||||
//
|
||||
// extern DWORD gThreadTLSIndex;
|
||||
//
|
||||
|
@ -314,7 +314,7 @@
|
|||
// SVAL_IMPL(ArrayListStatic, SystemDomain, m_appDomainIndexList);
|
||||
//
|
||||
// GVAL_DECL(DWORD, gThreadTLSIndex);
|
||||
//
|
||||
//
|
||||
// GVAL_IMPL_INIT(DWORD, gThreadTLSIndex, TLS_OUT_OF_INDEXES);
|
||||
//
|
||||
// When declaring the variable, the first argument declares the
|
||||
|
@ -325,27 +325,27 @@
|
|||
//
|
||||
// Things get slightly more complicated when declaring an embedded
|
||||
// array. In this case the data element is not a single element and
|
||||
// therefore cannot be represented by a ?PTR. In the case of a global
|
||||
// therefore cannot be represented by a ?PTR. In the case of a global
|
||||
// array, you should use the GARY_DECL and GARY_IMPL macros.
|
||||
// We durrently have no support for declaring static array data members
|
||||
// or initialized arrays. Array data members that are dynamically allocated
|
||||
// need to be treated as pointer members. To reference individual elements
|
||||
// you must use pointer arithmetic (see rule 2 above). An array declared
|
||||
// as a local variable within a function does not need to be DACized.
|
||||
// as a local variable within a function does not need to be DACized.
|
||||
//
|
||||
//
|
||||
// All uses of ?VAL_DECL must have a corresponding entry given in the
|
||||
// DacGlobals structure in src\inc\dacvars.h. For SVAL_DECL the entry
|
||||
// is class__name. For GVAL_DECL the entry is dac__name. You must add
|
||||
// is class__name. For GVAL_DECL the entry is dac__name. You must add
|
||||
// these entries in dacvars.h using the DEFINE_DACVAR macro. Note that
|
||||
// these entries also are used for dumping memory in mini dumps and
|
||||
// heap dumps. If it's not appropriate to dump a variable, (e.g.,
|
||||
// it's an array or some other value that is not important to have
|
||||
// in a minidump) a second macro, DEFINE_DACVAR_NO_DUMP, will allow
|
||||
// these entries also are used for dumping memory in mini dumps and
|
||||
// heap dumps. If it's not appropriate to dump a variable, (e.g.,
|
||||
// it's an array or some other value that is not important to have
|
||||
// in a minidump) a second macro, DEFINE_DACVAR_NO_DUMP, will allow
|
||||
// you to make the required entry in the DacGlobals structure without
|
||||
// dumping its value.
|
||||
// dumping its value.
|
||||
//
|
||||
// For convenience, here is a list of the various variable declaration and
|
||||
// For convenience, here is a list of the various variable declaration and
|
||||
// initialization macros:
|
||||
// SVAL_DECL(type, name) static non-pointer data class MyClass
|
||||
// member declared within {
|
||||
|
@ -355,11 +355,11 @@
|
|||
//
|
||||
// SVAL_IMPL(type, cls, name) static non-pointer data // int MyClass::i;
|
||||
// member defined outside SVAL_IMPL(int, MyClass, i);
|
||||
// the class declaration
|
||||
// the class declaration
|
||||
//
|
||||
// SVAL_IMPL_INIT(type, cls, static non-pointer data // int MyClass::i = 0;
|
||||
// name, val) member defined and SVAL_IMPL_INIT(int, MyClass, i, 0);
|
||||
// initialized outside the
|
||||
// initialized outside the
|
||||
// class declaration
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// SPTR_DECL(type, name) static pointer data class MyClass
|
||||
|
@ -370,27 +370,27 @@
|
|||
//
|
||||
// SPTR_IMPL(type, cls, name) static pointer data // int * MyClass::pInt;
|
||||
// member defined outside SPTR_IMPL(int, MyClass, pInt);
|
||||
// the class declaration
|
||||
// the class declaration
|
||||
//
|
||||
// SPTR_IMPL_INIT(type, cls, static pointer data // int * MyClass::pInt = NULL;
|
||||
// name, val) member defined and SPTR_IMPL_INIT(int, MyClass, pInt, NULL);
|
||||
// initialized outside the
|
||||
// initialized outside the
|
||||
// class declaration
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// GVAL_DECL(type, name) extern declaration of // extern int g_i
|
||||
// global non-pointer GVAL_DECL(int, g_i);
|
||||
// variable
|
||||
// variable
|
||||
//
|
||||
// GVAL_IMPL(type, name) declaration of a // int g_i
|
||||
// global non-pointer GVAL_IMPL(int, g_i);
|
||||
// variable
|
||||
// variable
|
||||
//
|
||||
// GVAL_IMPL_INIT (type, declaration and // int g_i = 0;
|
||||
// name, initialization of a GVAL_IMPL_INIT(int, g_i, 0);
|
||||
// val) global non-pointer
|
||||
// variable
|
||||
// ****Note****
|
||||
// If you use GVAL_? to declare a global variable of a structured type and you need to
|
||||
// If you use GVAL_? to declare a global variable of a structured type and you need to
|
||||
// access a member of the type, you cannot use the dot operator. Instead, you must take the
|
||||
// address of the variable and use the arrow operator. For example:
|
||||
// struct
|
||||
|
@ -400,14 +400,14 @@
|
|||
// } MyStruct;
|
||||
// GVAL_IMPL(MyStruct, g_myStruct);
|
||||
// int i = (&g_myStruct)->x;
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// GPTR_DECL(type, name) extern declaration of // extern int * g_pInt
|
||||
// global pointer GPTR_DECL(int, g_pInt);
|
||||
// variable
|
||||
// variable
|
||||
//
|
||||
// GPTR_IMPL(type, name) declaration of a // int * g_pInt
|
||||
// global pointer GPTR_IMPL(int, g_pInt);
|
||||
// variable
|
||||
// variable
|
||||
//
|
||||
// GPTR_IMPL_INIT (type, declaration and // int * g_pInt = 0;
|
||||
// name, initialization of a GPTR_IMPL_INIT(int, g_pInt, NULL);
|
||||
|
@ -416,11 +416,11 @@
|
|||
// ------------------------------------------------------------------------------------------------
|
||||
// GARY_DECL(type, name) extern declaration of // extern int g_rgIntList[MAX_ELEMENTS];
|
||||
// a global array GPTR_DECL(int, g_rgIntList, MAX_ELEMENTS);
|
||||
// variable
|
||||
// variable
|
||||
//
|
||||
// GARY_IMPL(type, name) declaration of a // int g_rgIntList[MAX_ELEMENTS];
|
||||
// global pointer GPTR_IMPL(int, g_rgIntList, MAX_ELEMENTS);
|
||||
// variable
|
||||
// variable
|
||||
//
|
||||
//
|
||||
// Certain pieces of code, such as the stack walker, rely on identifying
|
||||
|
@ -585,26 +585,26 @@ struct DacTableHeader
|
|||
// This requires special casting to ULONG64 to sign-extend if necessary.
|
||||
typedef ULONG_PTR TADDR;
|
||||
|
||||
// TSIZE_T used for counts or ranges that need to span the size of a
|
||||
// TSIZE_T used for counts or ranges that need to span the size of a
|
||||
// target pointer. For cross-plat, this may be different than SIZE_T
|
||||
// which reflects the host pointer size.
|
||||
typedef SIZE_T TSIZE_T;
|
||||
|
||||
|
||||
//
|
||||
// The following table contains all the global information that data access needs to begin
|
||||
// operation. All of the values stored here are RVAs. DacGlobalBase() returns the current
|
||||
// The following table contains all the global information that data access needs to begin
|
||||
// operation. All of the values stored here are RVAs. DacGlobalBase() returns the current
|
||||
// base address to combine with to get a full target address.
|
||||
//
|
||||
|
||||
typedef struct _DacGlobals
|
||||
{
|
||||
#ifdef FEATURE_PAL
|
||||
#ifdef TARGET_UNIX
|
||||
static void Initialize();
|
||||
void InitializeEntries(TADDR baseAddress);
|
||||
#endif // FEATURE_PAL
|
||||
#endif // TARGET_UNIX
|
||||
|
||||
// These will define all of the dac related mscorwks static and global variables
|
||||
// These will define all of the dac related mscorwks static and global variables
|
||||
#define DEFINE_DACVAR(id_type, size, id, var) id_type id;
|
||||
#define DEFINE_DACVAR_NO_DUMP(id_type, size, id, var) id_type id;
|
||||
#include "dacvars.h"
|
||||
|
@ -614,9 +614,9 @@ typedef struct _DacGlobals
|
|||
ULONG fn__DACNotifyCompilationFinished;
|
||||
ULONG fn__ThePreStub;
|
||||
|
||||
#ifdef _TARGET_ARM_
|
||||
#ifdef TARGET_ARM
|
||||
ULONG fn__ThePreStubCompactARM;
|
||||
#endif // _TARGET_ARM_
|
||||
#endif // TARGET_ARM
|
||||
|
||||
ULONG fn__ThePreStubPatchLabel;
|
||||
ULONG fn__PrecodeFixupThunk;
|
||||
|
@ -689,7 +689,7 @@ HRESULT DacWriteHostInstance(PVOID host, bool throwEx);
|
|||
|
||||
// This is meant to mimic the RethrowTerminalExceptions/
|
||||
// SwallowAllExceptions/RethrowTransientExceptions macros to allow minidump
|
||||
// gathering cancelation for details see
|
||||
// gathering cancelation for details see
|
||||
// code:ClrDataAccess.EnumMemoryRegionsWrapper
|
||||
|
||||
// This is usable in EX_TRY exactly how RethrowTerminalExceptions et cetera
|
||||
|
@ -697,7 +697,7 @@ HRESULT DacWriteHostInstance(PVOID host, bool throwEx);
|
|||
if (GET_EXCEPTION()->GetHR() == COR_E_OPERATIONCANCELED) \
|
||||
{ \
|
||||
EX_RETHROW; \
|
||||
}
|
||||
}
|
||||
|
||||
// Occasionally it's necessary to allocate some host memory for
|
||||
// instance data that's created on the fly and so doesn't directly
|
||||
|
@ -718,7 +718,7 @@ bool DacHostPtrHasEnumMark(LPCVOID host);
|
|||
// This helps perf for minidumps of apps with large managed stacks.
|
||||
bool DacHasMethodDescBeenEnumerated(LPCVOID pMD);
|
||||
|
||||
// Sets a flag indicating that EnumMemoryRegions on a method desciptor
|
||||
// Sets a flag indicating that EnumMemoryRegions on a method desciptor
|
||||
// has been successfully called. The function returns true if
|
||||
// this flag had been previously set.
|
||||
bool DacSetMethodDescEnumerated(LPCVOID pMD);
|
||||
|
@ -729,8 +729,8 @@ BOOL DacValidateMD(LPCVOID pMD);
|
|||
// Enumerate the instructions around a call site to help debugger stack walking heuristics
|
||||
void DacEnumCodeForStackwalk(TADDR taCallEnd);
|
||||
|
||||
// Given the address and the size of a memory range which is stored in the buffer, replace all the patches
|
||||
// in the buffer with the real opcodes. This is especially important on X64 where the unwinder needs to
|
||||
// Given the address and the size of a memory range which is stored in the buffer, replace all the patches
|
||||
// in the buffer with the real opcodes. This is especially important on X64 where the unwinder needs to
|
||||
// disassemble the native instructions.
|
||||
class MemoryRange;
|
||||
HRESULT DacReplacePatchesInHostMemory(MemoryRange range, PVOID pBuffer);
|
||||
|
@ -738,7 +738,7 @@ HRESULT DacReplacePatchesInHostMemory(MemoryRange range, PVOID pBuffer);
|
|||
//
|
||||
// Convenience macros for EnumMemoryRegions implementations.
|
||||
//
|
||||
|
||||
|
||||
// Enumerate the given host instance and return
|
||||
// true if the instance hasn't already been enumerated.
|
||||
#define DacEnumHostDPtrMem(host) \
|
||||
|
@ -766,29 +766,29 @@ HRESULT DacReplacePatchesInHostMemory(MemoryRange range, PVOID pBuffer);
|
|||
if (!DacEnumHostSPtrMem(this, type)) return
|
||||
#define DAC_ENUM_VTHIS() \
|
||||
if (!DacEnumHostVPtrMem(this)) return
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
class ReflectionModule;
|
||||
interface IMDInternalImport* DacGetMDImport(const class PEFile* peFile,
|
||||
bool throwEx);
|
||||
interface IMDInternalImport* DacGetMDImport(const ReflectionModule* reflectionModule,
|
||||
interface IMDInternalImport* DacGetMDImport(const ReflectionModule* reflectionModule,
|
||||
bool throwEx);
|
||||
|
||||
int DacGetIlMethodSize(TADDR methAddr);
|
||||
struct COR_ILMETHOD* DacGetIlMethod(TADDR methAddr);
|
||||
#ifdef WIN64EXCEPTIONS
|
||||
#ifdef FEATURE_EH_FUNCLETS
|
||||
struct _UNWIND_INFO * DacGetUnwindInfo(TADDR taUnwindInfo);
|
||||
|
||||
// virtually unwind a CONTEXT out-of-process
|
||||
struct _KNONVOLATILE_CONTEXT_POINTERS;
|
||||
BOOL DacUnwindStackFrame(T_CONTEXT * pContext, T_KNONVOLATILE_CONTEXT_POINTERS* pContextPointers);
|
||||
#endif // WIN64EXCEPTIONS
|
||||
#endif // FEATURE_EH_FUNCLETS
|
||||
|
||||
#if defined(FEATURE_PAL)
|
||||
#if defined(TARGET_UNIX)
|
||||
// call back through data target to unwind out-of-process
|
||||
HRESULT DacVirtualUnwind(ULONG32 threadId, PT_CONTEXT context, PT_KNONVOLATILE_CONTEXT_POINTERS contextPointers);
|
||||
#endif // FEATURE_PAL
|
||||
#endif // TARGET_UNIX
|
||||
|
||||
#ifdef FEATURE_MINIMETADATA_IN_TRIAGEDUMPS
|
||||
class SString;
|
||||
|
@ -796,17 +796,17 @@ void DacMdCacheAddEEName(TADDR taEE, const SString& ssEEName);
|
|||
bool DacMdCacheGetEEName(TADDR taEE, SString & ssEEName);
|
||||
#endif // FEATURE_MINIMETADATA_IN_TRIAGEDUMPS
|
||||
|
||||
//
|
||||
//
|
||||
// Computes (taBase + (dwIndex * dwElementSize()), with overflow checks.
|
||||
//
|
||||
//
|
||||
// Arguments:
|
||||
// taBase the base TADDR value
|
||||
// dwIndex the index of the offset
|
||||
// dwElementSize the size of each element (to multiply the offset by)
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// The resulting TADDR, or throws CORDB_E_TARGET_INCONSISTENT on overlow.
|
||||
//
|
||||
//
|
||||
// Notes:
|
||||
// The idea here is that overflows during address arithmetic suggest that we're operating on corrupt
|
||||
// pointers. It helps to improve reliability to detect the cases we can (like overflow) and fail. Note
|
||||
|
@ -814,7 +814,7 @@ bool DacMdCacheGetEEName(TADDR taEE, SString & ssEEName);
|
|||
// failing on overflow is just one easy case of corruption to detect. There is no need to use checked
|
||||
// arithmetic everywhere in the DAC infrastructure, this is intended just for the places most likely to
|
||||
// help catch bugs (eg. __DPtr::operator[]).
|
||||
//
|
||||
//
|
||||
inline TADDR DacTAddrOffset( TADDR taBase, TSIZE_T dwIndex, TSIZE_T dwElementSize )
|
||||
{
|
||||
ClrSafeInt<TADDR> t(taBase);
|
||||
|
@ -847,10 +847,10 @@ public:
|
|||
return m_addr == 0;
|
||||
}
|
||||
// We'd like to have an implicit conversion to bool here since the C++
|
||||
// standard says all pointer types are implicitly converted to bool.
|
||||
// standard says all pointer types are implicitly converted to bool.
|
||||
// Unfortunately, that would cause ambiguous overload errors for uses
|
||||
// of operator== and operator!=. Instead callers will have to compare
|
||||
// directly against NULL.
|
||||
// directly against NULL.
|
||||
|
||||
bool operator==(TADDR addr) const
|
||||
{
|
||||
|
@ -893,21 +893,21 @@ protected:
|
|||
|
||||
// Pointer wrapper base class for various forms of normal data.
|
||||
// This has the common functionality between __DPtr and __ArrayDPtr.
|
||||
// The DPtrType type parameter is the actual derived type in use. This is necessary so that
|
||||
// inhereted functions preserve exact return types.
|
||||
// The DPtrType type parameter is the actual derived type in use. This is necessary so that
|
||||
// inhereted functions preserve exact return types.
|
||||
template<typename type, typename DPtrType>
|
||||
class __DPtrBase : public __TPtrBase
|
||||
{
|
||||
public:
|
||||
typedef type _Type;
|
||||
typedef type* _Ptr;
|
||||
|
||||
|
||||
protected:
|
||||
// Constructors
|
||||
// Constructors
|
||||
// All protected - this type should not be used directly - use one of the derived types instead.
|
||||
__DPtrBase< type, DPtrType >(void) : __TPtrBase() {}
|
||||
__DPtrBase< type, DPtrType >(TADDR addr) : __TPtrBase(addr) {}
|
||||
|
||||
|
||||
explicit __DPtrBase< type, DPtrType >(__TPtrBase addr)
|
||||
{
|
||||
m_addr = addr.GetAddr();
|
||||
|
@ -969,7 +969,7 @@ public:
|
|||
|
||||
// Array index operator
|
||||
// we want an operator[] for all possible numeric types (rather than rely on
|
||||
// implicit numeric conversions on the argument) to prevent ambiguity with
|
||||
// implicit numeric conversions on the argument) to prevent ambiguity with
|
||||
// DPtr's implicit conversion to type* and the built-in operator[].
|
||||
// @dbgtodo : we could also use this technique to simplify other operators below.
|
||||
template<typename indexType>
|
||||
|
@ -1001,7 +1001,7 @@ public:
|
|||
|
||||
//-------------------------------------------------------------------------
|
||||
// operator+
|
||||
|
||||
|
||||
DPtrType operator+(unsigned short val)
|
||||
{
|
||||
return DPtrType(DacTAddrOffset(m_addr, val, sizeof(type)));
|
||||
|
@ -1019,7 +1019,7 @@ public:
|
|||
{
|
||||
return DPtrType(DacTAddrOffset(m_addr, val, sizeof(type)));
|
||||
}
|
||||
#if defined (_WIN64)
|
||||
#if defined (HOST_64BIT)
|
||||
DPtrType operator+(unsigned int val)
|
||||
{
|
||||
return DPtrType(DacTAddrOffset(m_addr, val, sizeof(type)));
|
||||
|
@ -1045,7 +1045,7 @@ public:
|
|||
|
||||
//-------------------------------------------------------------------------
|
||||
// operator-
|
||||
|
||||
|
||||
DPtrType operator-(unsigned short val)
|
||||
{
|
||||
return DPtrType(m_addr - val * sizeof(type));
|
||||
|
@ -1063,7 +1063,7 @@ public:
|
|||
{
|
||||
return DPtrType(m_addr - val * sizeof(type));
|
||||
}
|
||||
#ifdef _WIN64
|
||||
#ifdef HOST_64BIT
|
||||
DPtrType operator-(unsigned int val)
|
||||
{
|
||||
return DPtrType(m_addr - val * sizeof(type));
|
||||
|
@ -1092,7 +1092,7 @@ public:
|
|||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
|
||||
DPtrType& operator+=(size_t val)
|
||||
{
|
||||
m_addr += val * sizeof(type);
|
||||
|
@ -1103,7 +1103,7 @@ public:
|
|||
m_addr -= val * sizeof(type);
|
||||
return static_cast<DPtrType&>(*this);
|
||||
}
|
||||
|
||||
|
||||
DPtrType& operator++()
|
||||
{
|
||||
m_addr += sizeof(type);
|
||||
|
@ -1158,8 +1158,8 @@ public:
|
|||
__DPtr< type >(__DPtr<mutable_type> const & rhs) : __DPtrBase<type,__DPtr<type> >(rhs.GetAddr()) {}
|
||||
|
||||
// construct from GlobalPtr
|
||||
explicit __DPtr< type >(__GlobalPtr< type*, __DPtr< type > > globalPtr) :
|
||||
__DPtrBase<type,__DPtr<type> >(globalPtr.GetAddr()) {}
|
||||
explicit __DPtr< type >(__GlobalPtr< type*, __DPtr< type > > globalPtr) :
|
||||
__DPtrBase<type,__DPtr<type> >(globalPtr.GetAddr()) {}
|
||||
|
||||
explicit __DPtr< type >(__TPtrBase addr) : __DPtrBase<type,__DPtr<type> >(addr) {}
|
||||
explicit __DPtr< type >(type const * host) : __DPtrBase<type,__DPtr<type> >(host) {}
|
||||
|
@ -1179,7 +1179,7 @@ public:
|
|||
// A restricted form of DPtr that doesn't have any conversions to pointer types.
|
||||
// This is useful for pointer types that almost always represent arrays, as opposed
|
||||
// to pointers to single instances (eg. PTR_BYTE). In these cases, allowing implicit
|
||||
// conversions to (for eg.) BYTE* would usually result in incorrect usage (eg. pointer
|
||||
// conversions to (for eg.) BYTE* would usually result in incorrect usage (eg. pointer
|
||||
// arithmetic and array indexing), since only a single instance has been marshalled to the host.
|
||||
// If you really must marshal a single instance (eg. converting T* to PTR_T is too painful for now),
|
||||
// then use code:DacUnsafeMarshalSingleElement so we can identify such unsafe code.
|
||||
|
@ -1193,7 +1193,7 @@ public:
|
|||
|
||||
// construct const from non-const
|
||||
typedef typename std::remove_const<type>::type mutable_type;
|
||||
__ArrayDPtr< type >(__ArrayDPtr<mutable_type> const & rhs) : __DPtrBase<type,__ArrayDPtr<type> >(rhs.GetAddr()) {}
|
||||
__ArrayDPtr< type >(__ArrayDPtr<mutable_type> const & rhs) : __DPtrBase<type,__ArrayDPtr<type> >(rhs.GetAddr()) {}
|
||||
|
||||
explicit __ArrayDPtr< type >(__TPtrBase addr) : __DPtrBase<type,__ArrayDPtr<type> >(addr) {}
|
||||
|
||||
|
@ -1214,7 +1214,7 @@ class __SPtr : public __TPtrBase
|
|||
public:
|
||||
typedef type _Type;
|
||||
typedef type* _Ptr;
|
||||
|
||||
|
||||
__SPtr< type >(void) : __TPtrBase() {}
|
||||
__SPtr< type >(TADDR addr) : __TPtrBase(addr) {}
|
||||
explicit __SPtr< type >(__TPtrBase addr)
|
||||
|
@ -1269,7 +1269,7 @@ public:
|
|||
{
|
||||
DacError(E_INVALIDARG);
|
||||
}
|
||||
|
||||
|
||||
return *(type*)DacInstantiateTypeByAddress(m_addr,
|
||||
type::DacSize(m_addr),
|
||||
true);
|
||||
|
@ -1306,7 +1306,7 @@ public:
|
|||
// This type is not expected to be used anyway.
|
||||
typedef type* _Type;
|
||||
typedef type* _Ptr;
|
||||
|
||||
|
||||
__VPtr< type >(void) : __TPtrBase() {}
|
||||
__VPtr< type >(TADDR addr) : __TPtrBase(addr) {}
|
||||
explicit __VPtr< type >(__TPtrBase addr)
|
||||
|
@ -1317,7 +1317,7 @@ public:
|
|||
{
|
||||
m_addr = DacGetTargetAddrForHostAddr(host, true);
|
||||
}
|
||||
|
||||
|
||||
__VPtr< type >& operator=(const __TPtrBase& ptr)
|
||||
{
|
||||
m_addr = ptr.GetAddr();
|
||||
|
@ -1337,7 +1337,7 @@ public:
|
|||
{
|
||||
return (type*)DacInstantiateClassByVTable(m_addr, sizeof(type), true);
|
||||
}
|
||||
|
||||
|
||||
bool operator==(const __VPtr< type >& ptr) const
|
||||
{
|
||||
return m_addr == ptr.m_addr;
|
||||
|
@ -1378,7 +1378,7 @@ class __Str8Ptr : public __DPtr<char>
|
|||
public:
|
||||
typedef type _Type;
|
||||
typedef type* _Ptr;
|
||||
|
||||
|
||||
__Str8Ptr< type, maxChars >(void) : __DPtr<char>() {}
|
||||
__Str8Ptr< type, maxChars >(TADDR addr) : __DPtr<char>(addr) {}
|
||||
explicit __Str8Ptr< type, maxChars >(__TPtrBase addr)
|
||||
|
@ -1431,7 +1431,7 @@ class __Str16Ptr : public __DPtr<WCHAR>
|
|||
public:
|
||||
typedef type _Type;
|
||||
typedef type* _Ptr;
|
||||
|
||||
|
||||
__Str16Ptr< type, maxChars >(void) : __DPtr<WCHAR>() {}
|
||||
__Str16Ptr< type, maxChars >(TADDR addr) : __DPtr<WCHAR>(addr) {}
|
||||
explicit __Str16Ptr< type, maxChars >(__TPtrBase addr)
|
||||
|
@ -1508,7 +1508,7 @@ public:
|
|||
DacWriteHostInstance(ptr, true);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
bool IsValid(void) const
|
||||
{
|
||||
return __DPtr< type >(DacGlobalBase() + *m_rvaPtr).IsValid();
|
||||
|
@ -1536,12 +1536,12 @@ public:
|
|||
{
|
||||
return __DPtr< type >(DacGlobalBase() + *m_rvaPtr);
|
||||
}
|
||||
|
||||
|
||||
type& operator[](unsigned int index) const
|
||||
{
|
||||
return __DPtr< type >(DacGlobalBase() + *m_rvaPtr)[index];
|
||||
}
|
||||
|
||||
|
||||
bool IsValid(void) const
|
||||
{
|
||||
// Only validates the base pointer, not the full array range.
|
||||
|
@ -1569,7 +1569,7 @@ public:
|
|||
{
|
||||
return __DPtr< store_type >(DacGlobalBase() + *m_rvaPtr);
|
||||
}
|
||||
|
||||
|
||||
store_type & operator=(store_type & val)
|
||||
{
|
||||
store_type* ptr = __DPtr< store_type >(DacGlobalBase() + *m_rvaPtr);
|
||||
|
@ -1579,7 +1579,7 @@ public:
|
|||
DacWriteHostInstance(ptr, true);
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
acc_type operator->() const
|
||||
{
|
||||
return (acc_type)*__DPtr< store_type >(DacGlobalBase() + *m_rvaPtr);
|
||||
|
@ -1601,7 +1601,7 @@ public:
|
|||
{
|
||||
return (*__DPtr< store_type >(DacGlobalBase() + *m_rvaPtr))[index];
|
||||
}
|
||||
|
||||
|
||||
typename store_type::_Type& operator[](unsigned int index)
|
||||
{
|
||||
return (*__DPtr< store_type >(DacGlobalBase() + *m_rvaPtr))[index];
|
||||
|
@ -1616,7 +1616,7 @@ public:
|
|||
{
|
||||
return DacGlobalBase() + *m_rvaPtr;
|
||||
}
|
||||
|
||||
|
||||
// This is only testing the the pointer memory is available but does not verify
|
||||
// the memory that it points to.
|
||||
//
|
||||
|
@ -1624,7 +1624,7 @@ public:
|
|||
{
|
||||
return __DPtr< store_type >(DacGlobalBase() + *m_rvaPtr).IsValid();
|
||||
}
|
||||
|
||||
|
||||
bool IsValid(void) const
|
||||
{
|
||||
return __DPtr< store_type >(DacGlobalBase() + *m_rvaPtr).IsValid() &&
|
||||
|
@ -1672,7 +1672,7 @@ inline bool operator!=(acc_type host,
|
|||
}
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
// __VoidPtr is a type that behaves like void* but for target pointers.
|
||||
// Behavior of PTR_VOID:
|
||||
// * has void* semantics. Will compile to void* in non-DAC builds (just like
|
||||
|
@ -1683,14 +1683,14 @@ inline bool operator!=(acc_type host,
|
|||
// * like void*, no pointer arithmetic or dereferencing is allowed
|
||||
// * like TADDR, can be used to construct any __DPtr / __VPtr instance
|
||||
// * representation is the same as a void* (for marshalling / casting)
|
||||
//
|
||||
//
|
||||
// One way in which __VoidPtr is unlike void* is that it can't be cast to
|
||||
// pointer or integer types. On the one hand, this is a good thing as it forces
|
||||
// us to keep target pointers separate from other data types. On the other hand
|
||||
// in practice this means we have to use dac_cast<TADDR> in places where we used
|
||||
// to use a (TADDR) cast. Unfortunately C++ provides us no way to allow the
|
||||
// explicit cast to primitive types without also allowing implicit conversions.
|
||||
//
|
||||
//
|
||||
// This is very similar in spirit to TADDR. The primary difference is that
|
||||
// PTR_VOID has pointer semantics, where TADDR has integer semantics. When
|
||||
// dacizing uses of void* to TADDR, casts must be inserted everywhere back to
|
||||
|
@ -1700,7 +1700,7 @@ inline bool operator!=(acc_type host,
|
|||
// instead etc.). Ideally we'd probably have just one type for this purpose
|
||||
// (named TADDR but with the semantics of PTR_VOID), but outright conversion
|
||||
// would require too much work.
|
||||
//
|
||||
//
|
||||
class __VoidPtr : public __TPtrBase
|
||||
{
|
||||
public:
|
||||
|
@ -1714,7 +1714,7 @@ public:
|
|||
m_addr = addr.GetAddr();
|
||||
}
|
||||
|
||||
// Like TPtrBase, VoidPtrs can also be created impicitly from all GlobalPtrs
|
||||
// Like TPtrBase, VoidPtrs can also be created impicitly from all GlobalPtrs
|
||||
template<typename acc_type, typename store_type>
|
||||
__VoidPtr(__GlobalPtr<acc_type, store_type> globalPtr)
|
||||
{
|
||||
|
@ -1778,7 +1778,7 @@ public:
|
|||
bool operator>=(const __TPtrBase& ptr) const
|
||||
{
|
||||
return m_addr >= ptr.GetAddr();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
typedef __VoidPtr PTR_VOID;
|
||||
|
@ -1805,21 +1805,21 @@ typedef __VoidPtr PTR_CVOID;
|
|||
|
||||
//
|
||||
// VPTR_ANY_CLASS_METHODS - Defines the following methods for all VPTR classes
|
||||
//
|
||||
// VPtrSize
|
||||
//
|
||||
// VPtrSize
|
||||
// Returns the size of the dynamic type of the object (as opposed to sizeof
|
||||
// which is based only on the static type).
|
||||
//
|
||||
// which is based only on the static type).
|
||||
//
|
||||
// VPtrHostVTable
|
||||
// Returns the address of the vtable for this type.
|
||||
// We create a temporary instance of this type in order to read it's vtable pointer
|
||||
// We create a temporary instance of this type in order to read it's vtable pointer
|
||||
// (at offset 0). For this temporary instance, we do not want to initialize any fields,
|
||||
// so we use the marshalling ctor. Since we didn't initialize any fields, we also don't
|
||||
// wan't to run the dtor (marshaled data structures don't normally expect their destructor
|
||||
// or non-DAC constructors to be called in DAC builds anyway). So, rather than create a
|
||||
// normal stack object, or put the object on the heap, we create the temporary object
|
||||
// wan't to run the dtor (marshaled data structures don't normally expect their destructor
|
||||
// or non-DAC constructors to be called in DAC builds anyway). So, rather than create a
|
||||
// normal stack object, or put the object on the heap, we create the temporary object
|
||||
// on the stack using placement-new and alloca, and don't destruct it.
|
||||
//
|
||||
//
|
||||
#define VPTR_ANY_CLASS_METHODS(name) \
|
||||
virtual ULONG32 VPtrSize(void) { SUPPORTS_DAC; return sizeof(name); } \
|
||||
static PVOID VPtrHostVTable() { \
|
||||
|
@ -1970,15 +1970,15 @@ public: name(TADDR addr, TADDR vtAddr);
|
|||
|
||||
// This value is used to intiailize target pointers to NULL. We want this to be TADDR type
|
||||
// (as opposed to, say, __TPtrBase) so that it can be used in the non-explicit ctor overloads,
|
||||
// eg. as an argument default value.
|
||||
// We can't always just use NULL because that's 0 which (in C++) can be any integer or pointer
|
||||
// eg. as an argument default value.
|
||||
// We can't always just use NULL because that's 0 which (in C++) can be any integer or pointer
|
||||
// type (causing an ambiguous overload compiler error when used in explicit ctor forms).
|
||||
#define PTR_NULL ((TADDR)0)
|
||||
|
||||
// Provides an empty method implementation when compiled
|
||||
// for DACCESS_COMPILE. For example, use to stub out methods needed
|
||||
// for vtable entries but otherwise unused.
|
||||
// Note that these functions are explicitly NOT marked SUPPORTS_DAC so that we'll get a
|
||||
// Note that these functions are explicitly NOT marked SUPPORTS_DAC so that we'll get a
|
||||
// DacCop warning if any calls to them are detected.
|
||||
// @dbgtodo : It's probably almost always wrong to call any such function, so
|
||||
// we should probably throw a better error (DacNotImpl), and ideally mark the function
|
||||
|
@ -2069,7 +2069,7 @@ enum DacCopWarningCode
|
|||
// if).
|
||||
//
|
||||
// Arguments:
|
||||
// code: a literal value from DacCopWarningCode indicating which violation should be suppressed.
|
||||
// code: a literal value from DacCopWarningCode indicating which violation should be suppressed.
|
||||
// szReasonString: a short description of why this exclusion is necessary. This is intended just
|
||||
// to help readers of the code understand the source of the problem, and what would be required
|
||||
// to fix it. More details can be provided in comments if desired.
|
||||
|
@ -2087,10 +2087,10 @@ inline void DACCOP_IGNORE(DacCopWarningCode code, const char * szReasonString)
|
|||
|
||||
// *******************************************************
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!NOTE!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
//
|
||||
// Please search this file for the type name to find the
|
||||
//
|
||||
// Please search this file for the type name to find the
|
||||
// DAC versions of these definitions
|
||||
//
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!NOTE!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// *******************************************************
|
||||
|
||||
|
@ -2099,7 +2099,7 @@ inline void DACCOP_IGNORE(DacCopWarningCode code, const char * szReasonString)
|
|||
// can be done on it directly, as with the DACCESS_COMPILE definition.
|
||||
// This also helps expose pointer usage that may need to be changed.
|
||||
typedef ULONG_PTR TADDR;
|
||||
|
||||
|
||||
typedef void* PTR_VOID;
|
||||
typedef LPVOID* PTR_PTR_VOID;
|
||||
typedef const void* PTR_CVOID;
|
||||
|
@ -2113,7 +2113,7 @@ typedef const void* PTR_CVOID;
|
|||
#define S16PTR(type) type*
|
||||
#define S16PTRMAX(type, maxChars) type*
|
||||
|
||||
#if defined(FEATURE_PAL)
|
||||
#if defined(TARGET_UNIX)
|
||||
|
||||
#define VPTR_VTABLE_CLASS(name, base) \
|
||||
friend struct _DacGlobals; \
|
||||
|
@ -2147,7 +2147,7 @@ public: name(int dummy) : base(dummy) {}
|
|||
VPTR_ABSTRACT_VTABLE_CLASS(name, base) \
|
||||
name() : base() {}
|
||||
|
||||
#else // FEATURE_PAL
|
||||
#else // TARGET_UNIX
|
||||
|
||||
#define VPTR_VTABLE_CLASS(name, base)
|
||||
#define VPTR_VTABLE_CLASS_AND_CTOR(name, base)
|
||||
|
@ -2158,15 +2158,14 @@ public: name(int dummy) : base(dummy) {}
|
|||
#define VPTR_ABSTRACT_VTABLE_CLASS(name, base)
|
||||
#define VPTR_ABSTRACT_VTABLE_CLASS_AND_CTOR(name, base)
|
||||
|
||||
#endif // FEATURE_PAL
|
||||
#endif // TARGET_UNIX
|
||||
|
||||
// helper macro to make the vtables unique for DAC
|
||||
#define VPTR_UNIQUE(unique) virtual int MakeVTableUniqueForDAC() { return unique; }
|
||||
#define VPTR_UNIQUE_BaseDomain (100000)
|
||||
#define VPTR_UNIQUE_SystemDomain (VPTR_UNIQUE_BaseDomain + 1)
|
||||
#define VPTR_UNIQUE_ComMethodFrame (VPTR_UNIQUE_SystemDomain + 1)
|
||||
#define VPTR_UNIQUE_StubHelperFrame (VPTR_UNIQUE_ComMethodFrame + 1)
|
||||
#define VPTR_UNIQUE_RedirectedThreadFrame (VPTR_UNIQUE_StubHelperFrame + 1)
|
||||
#define VPTR_UNIQUE_RedirectedThreadFrame (VPTR_UNIQUE_ComMethodFrame + 1)
|
||||
#define VPTR_UNIQUE_HijackFrame (VPTR_UNIQUE_RedirectedThreadFrame + 1)
|
||||
|
||||
#define PTR_TO_TADDR(ptr) ((TADDR)(ptr))
|
||||
|
@ -2222,7 +2221,7 @@ public: name(int dummy) : base(dummy) {}
|
|||
#define DAC_EMPTY()
|
||||
#define DAC_EMPTY_ERR()
|
||||
#define DAC_EMPTY_RET(retVal)
|
||||
#define DAC_UNEXPECTED()
|
||||
#define DAC_UNEXPECTED()
|
||||
|
||||
#define DACCOP_IGNORE(warningCode, reasonString)
|
||||
|
||||
|
@ -2244,13 +2243,13 @@ public: name(int dummy) : base(dummy) {}
|
|||
// ?PTR(Tgt) <- TADDR - Create PTR type (DPtr etc.) from TADDR
|
||||
// ?PTR(Tgt) <- ?PTR(Src) - Convert one PTR type to another
|
||||
// ?PTR(Tgt) <- Src * - Create PTR type from dac host object instance
|
||||
// TADDR <- ?PTR(Src) - Get TADDR of PTR object (DPtr etc.)
|
||||
// TADDR <- Src * - Get TADDR of dac host object instance
|
||||
// TADDR <- ?PTR(Src) - Get TADDR of PTR object (DPtr etc.)
|
||||
// TADDR <- Src * - Get TADDR of dac host object instance
|
||||
//
|
||||
// Note that there is no direct convertion to other host-pointer types (because we don't
|
||||
// know if you want a DPTR or VPTR etc.). However, due to the implicit DAC conversions,
|
||||
// you can just use dac_cast<PTR_Foo> and assign that to a Foo*.
|
||||
//
|
||||
//
|
||||
// The beauty of this syntax is that it is consistent regardless
|
||||
// of source and target casting types. You just use dac_cast
|
||||
// and the partial template specialization will do the right thing.
|
||||
|
@ -2276,7 +2275,7 @@ public: name(int dummy) : base(dummy) {}
|
|||
// Example comparsions of some old and new syntax, where
|
||||
// h is a host pointer, such as "Foo *h;"
|
||||
// p is a DPTR, such as "PTR_Foo p;"
|
||||
//
|
||||
//
|
||||
// PTR_HOST_TO_TADDR(h) ==> dac_cast<TADDR>(h)
|
||||
// PTR_TO_TADDR(p) ==> dac_cast<TADDR>(p)
|
||||
// PTR_Foo(PTR_HOST_TO_TADDR(h)) ==> dac_cast<PTR_Foo>(h)
|
||||
|
@ -2294,7 +2293,7 @@ inline Tgt dac_cast(Src src)
|
|||
// In non-DAC builds, dac_cast is the same as a C-style cast because we need to support:
|
||||
// - casting away const
|
||||
// - conversions between pointers and TADDR
|
||||
// Perhaps we should more precisely restrict it's usage, but we get the precise
|
||||
// Perhaps we should more precisely restrict it's usage, but we get the precise
|
||||
// restrictions in DAC builds, so it wouldn't buy us much.
|
||||
return (Tgt)(src);
|
||||
#endif
|
||||
|
@ -2393,19 +2392,19 @@ typedef DPTR(IMAGE_TLS_DIRECTORY) PTR_IMAGE_TLS_DIRECTORY;
|
|||
#include <xclrdata.h>
|
||||
#endif
|
||||
|
||||
#if defined(_TARGET_X86_) && defined(FEATURE_PAL)
|
||||
#if defined(TARGET_X86) && defined(TARGET_UNIX)
|
||||
typedef DPTR(struct _UNWIND_INFO) PTR_UNWIND_INFO;
|
||||
#endif
|
||||
|
||||
#ifdef _TARGET_64BIT_
|
||||
#ifdef TARGET_64BIT
|
||||
typedef DPTR(T_RUNTIME_FUNCTION) PTR_RUNTIME_FUNCTION;
|
||||
typedef DPTR(struct _UNWIND_INFO) PTR_UNWIND_INFO;
|
||||
#if defined(_TARGET_AMD64_)
|
||||
#if defined(TARGET_AMD64)
|
||||
typedef DPTR(union _UNWIND_CODE) PTR_UNWIND_CODE;
|
||||
#endif // _TARGET_AMD64_
|
||||
#endif // _TARGET_64BIT_
|
||||
#endif // TARGET_AMD64
|
||||
#endif // TARGET_64BIT
|
||||
|
||||
#ifdef _TARGET_ARM_
|
||||
#ifdef TARGET_ARM
|
||||
typedef DPTR(T_RUNTIME_FUNCTION) PTR_RUNTIME_FUNCTION;
|
||||
#endif
|
||||
|
||||
|
@ -2419,7 +2418,7 @@ typedef TADDR PCODE;
|
|||
typedef DPTR(PCODE) PTR_PCODE;
|
||||
typedef DPTR(PTR_PCODE) PTR_PTR_PCODE;
|
||||
|
||||
// There is another concept we should have, "pointer to the start of an instruction" -- a PCODE with any mode bits masked off.
|
||||
// There is another concept we should have, "pointer to the start of an instruction" -- a PCODE with any mode bits masked off.
|
||||
// Attempts to introduce this concept, and classify uses of PCODE as one or the other,
|
||||
// turned out to be too hard: either name choice required *many* code changes, and decisions in unfamiliar code. So despite the
|
||||
// the comment above, the PCODE is currently sometimes used for the PINSTR concept.
|
||||
|
@ -2452,11 +2451,23 @@ typedef DPTR(PTR_PCODE) PTR_PTR_PCODE;
|
|||
#define MAIN_DAC_MODULE_NAME_W W("mscordaccore")
|
||||
#define MAIN_DAC_MODULE_DLL_NAME_W W("mscordaccore.dll")
|
||||
|
||||
// TARGET_CONSISTENCY_CHECK represents a condition that should not fail unless the DAC target is corrupt.
|
||||
// TARGET_CONSISTENCY_CHECK represents a condition that should not fail unless the DAC target is corrupt.
|
||||
// This is in contrast to ASSERTs in DAC infrastructure code which shouldn't fail regardless of the memory
|
||||
// read from the target. At the moment we treat these the same, but in the future we will want a mechanism
|
||||
// for disabling just the target consistency checks (eg. for tests that intentionally use corrupted targets).
|
||||
// @dbgtodo : Separating asserts and target consistency checks is tracked by DevDiv Bugs 31674
|
||||
#define TARGET_CONSISTENCY_CHECK(expr,msg) _ASSERTE_MSG(expr,msg)
|
||||
|
||||
// For cross compilation, controlling type layout is important
|
||||
// We add a simple macro here which defines DAC_ALIGNAS to the C++11 alignas operator
|
||||
// This helps force the alignment of the next member
|
||||
// For most cross compilation cases the layout of types simply works
|
||||
// There are a few cases (where this macro is helpful) which are not consistent accross platforms:
|
||||
// - Base class whose size is padded to its align size. On Linux the gcc/clang
|
||||
// layouts will reuse this padding in the derived class for the first member
|
||||
// - Class with an vtable pointer and an alignment greater than the pointer size.
|
||||
// The Windows compilers will align the first member to the alignment size of the
|
||||
// class. Linux will align the first member to its natural alignment
|
||||
#define DAC_ALIGNAS(a) alignas(a)
|
||||
|
||||
#endif // #ifndef __daccess_h__
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -4,21 +4,21 @@
|
|||
// This file contains the globals and statics that are visible to DAC.
|
||||
// It is used for the following:
|
||||
// 1. in daccess.h to build the table of DAC globals
|
||||
// 2. in enummem.cpp to dump out the related memory of static and globals
|
||||
// 2. in enummem.cpp to dump out the related memory of static and globals
|
||||
// in a mini dump or heap dump
|
||||
// 3. in DacUpdateDll and toolbox\DacTablenGen\main.cs
|
||||
//
|
||||
// To use this functionality for other tools or purposes, define the
|
||||
// DEFINE_DACVAR macro & include dacvars.h like so (see enummem.cpp and/or
|
||||
// To use this functionality for other tools or purposes, define the
|
||||
// DEFINE_DACVAR macro & include dacvars.h like so (see enummem.cpp and/or
|
||||
// daccess.h for examples):
|
||||
//
|
||||
// #define DEFINE_DACVAR(type, size, id, var) type id; //this defn. discards
|
||||
// //the size
|
||||
// #include "dacvars.h"
|
||||
//
|
||||
// @dbgtodo:
|
||||
// Ideally we may be able to build a tool that generates this automatically.
|
||||
// At the least, we should automatically verify that the contents of this file
|
||||
// @dbgtodo:
|
||||
// Ideally we may be able to build a tool that generates this automatically.
|
||||
// At the least, we should automatically verify that the contents of this file
|
||||
// are consistent with the uses of all the macros like SVAL_DECL and GARY_DECL.
|
||||
//
|
||||
//=================================================
|
||||
|
@ -26,45 +26,45 @@
|
|||
//=================================================
|
||||
// You need to add a global or static declared with DAC macros, such as SPTR_*
|
||||
// GPTR_*, SVAL_*, GVAL_*, or GARY_*, only if the global or static is actually used
|
||||
// in a DACized code path. If you have declared a static or global that way just
|
||||
// because you were pattern-matching or because you anticipate that the variable
|
||||
// in a DACized code path. If you have declared a static or global that way just
|
||||
// because you were pattern-matching or because you anticipate that the variable
|
||||
// may eventually be used in a DACized code path, you don't need to add it here,
|
||||
// although in that case, you should not really use the DAC macro when you declare
|
||||
// the global or static.
|
||||
// the global or static.
|
||||
// * * *
|
||||
// The FIRST ARGUMENT should always be specified as ULONG. This is the type of
|
||||
// the offsets for the corresponding id in the _DacGlobals table.
|
||||
// @dbgtodo:
|
||||
// the offsets for the corresponding id in the _DacGlobals table.
|
||||
// @dbgtodo:
|
||||
// We should get rid of the ULONG argument since it's always the same. We would
|
||||
// also need to modify DacTablenGen\main.cs.
|
||||
// * * *
|
||||
// The SECOND ARGUMENT, "true_type," is used to calculate the true size of the
|
||||
// static/global variable. It is currently used only in enummem.cpp to write out
|
||||
// The SECOND ARGUMENT, "true_type," is used to calculate the true size of the
|
||||
// static/global variable. It is currently used only in enummem.cpp to write out
|
||||
// theproper size of memory for dumps.
|
||||
// * * *
|
||||
// The THIRD ARGUMENT should be a qualified name. If the variable is a static data
|
||||
// member, the name should be <class_name>__<member_name>. If the variable is a
|
||||
// member, the name should be <class_name>__<member_name>. If the variable is a
|
||||
// global, the name should be <dac>__<global_name>.
|
||||
// * * *
|
||||
// The FOURTH ARGUMENT should be the actual name of the static/global variable. If
|
||||
// The FOURTH ARGUMENT should be the actual name of the static/global variable. If
|
||||
// static data the should be [<namespace>::]<class_name>::<member_name>. If global,
|
||||
// it should look like <global_name>.
|
||||
// * * *
|
||||
// If you need to add an entry to this file, your type may not be visible when
|
||||
// If you need to add an entry to this file, your type may not be visible when
|
||||
// this file is compiled. In that case, you need to do one of two things:
|
||||
// - If the type is a pointer type, you can simply use UNKNOWN_POINTER_TYPE as the
|
||||
// "true type." It may be useful to specify the non-visible type in a comment.
|
||||
// - If the type is a composite/user-defined type, you must #include the header
|
||||
// - If the type is a pointer type, you can simply use UNKNOWN_POINTER_TYPE as the
|
||||
// "true type." It may be useful to specify the non-visible type in a comment.
|
||||
// - If the type is a composite/user-defined type, you must #include the header
|
||||
// file that defines the type in enummem.cpp. Do NOT #include it in daccess.h
|
||||
// Array types may be dumped via an explicit call to enumMem, so they should
|
||||
// be declared with DEFINE_DACVAR_NO_DUMP. The size in this case is immaterial, since
|
||||
// nothing will be dumped.
|
||||
// Array types may be dumped via an explicit call to enumMem, so they should
|
||||
// be declared with DEFINE_DACVAR_NO_DUMP. The size in this case is immaterial, since
|
||||
// nothing will be dumped.
|
||||
|
||||
#ifndef DEFINE_DACVAR
|
||||
#define DEFINE_DACVAR(type, true_type, id, var)
|
||||
#endif
|
||||
|
||||
// Use this macro to define a static var that is known to DAC, but not captured in a dump.
|
||||
// Use this macro to define a static var that is known to DAC, but not captured in a dump.
|
||||
#ifndef DEFINE_DACVAR_NO_DUMP
|
||||
#define DEFINE_DACVAR_NO_DUMP(type, true_type, id, var)
|
||||
#endif
|
||||
|
@ -95,6 +95,7 @@ DEFINE_DACVAR(ULONG, PTR_JumpStubStubManager, JumpStubStubManager__g_pManager, J
|
|||
DEFINE_DACVAR(ULONG, PTR_RangeSectionStubManager, RangeSectionStubManager__g_pManager, RangeSectionStubManager::g_pManager)
|
||||
DEFINE_DACVAR(ULONG, PTR_DelegateInvokeStubManager, DelegateInvokeStubManager__g_pManager, DelegateInvokeStubManager::g_pManager)
|
||||
DEFINE_DACVAR(ULONG, PTR_VirtualCallStubManagerManager, VirtualCallStubManagerManager__g_pManager, VirtualCallStubManagerManager::g_pManager)
|
||||
DEFINE_DACVAR(ULONG, PTR_CallCountingStubManager, CallCountingStubManager__g_pManager, CallCountingStubManager::g_pManager)
|
||||
|
||||
DEFINE_DACVAR(ULONG, PTR_ThreadStore, ThreadStore__s_pThreadStore, ThreadStore::s_pThreadStore)
|
||||
|
||||
|
@ -103,7 +104,7 @@ DEFINE_DACVAR(ULONG, ThreadpoolMgr::ThreadCounter, ThreadpoolMgr__WorkerCounter,
|
|||
DEFINE_DACVAR(ULONG, int, ThreadpoolMgr__MinLimitTotalWorkerThreads, ThreadpoolMgr::MinLimitTotalWorkerThreads)
|
||||
DEFINE_DACVAR(ULONG, DWORD, ThreadpoolMgr__MaxLimitTotalWorkerThreads, ThreadpoolMgr::MaxLimitTotalWorkerThreads)
|
||||
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE /*PTR_WorkRequest*/, ThreadpoolMgr__WorkRequestHead, ThreadpoolMgr::WorkRequestHead) // PTR_WorkRequest is not defined. So use a pointer type
|
||||
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE /*PTR_WorkRequest*/, ThreadpoolMgr__WorkRequestTail, ThreadpoolMgr::WorkRequestTail) //
|
||||
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE /*PTR_WorkRequest*/, ThreadpoolMgr__WorkRequestTail, ThreadpoolMgr::WorkRequestTail) //
|
||||
DEFINE_DACVAR(ULONG, ThreadpoolMgr::ThreadCounter, ThreadpoolMgr__CPThreadCounter, ThreadpoolMgr::CPThreadCounter)
|
||||
DEFINE_DACVAR(ULONG, LONG, ThreadpoolMgr__MaxFreeCPThreads, ThreadpoolMgr::MaxFreeCPThreads)
|
||||
DEFINE_DACVAR(ULONG, LONG, ThreadpoolMgr__MaxLimitTotalCPThreads, ThreadpoolMgr::MaxLimitTotalCPThreads)
|
||||
|
@ -160,7 +161,7 @@ DEFINE_DACVAR(ULONG, PTR_BYTE, dac__g_highest_address, ::g_highest_address)
|
|||
|
||||
DEFINE_DACVAR(ULONG, IGCHeap, dac__g_pGCHeap, ::g_pGCHeap)
|
||||
|
||||
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pThinLockThreadIdDispenser, ::g_pThinLockThreadIdDispenser)
|
||||
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pThinLockThreadIdDispenser, ::g_pThinLockThreadIdDispenser)
|
||||
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pModuleIndexDispenser, ::g_pModuleIndexDispenser)
|
||||
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pObjectClass, ::g_pObjectClass)
|
||||
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pRuntimeTypeClass, ::g_pRuntimeTypeClass)
|
||||
|
@ -187,7 +188,6 @@ DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pEnumClass, ::g_pEnumClass)
|
|||
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pThreadClass, ::g_pThreadClass)
|
||||
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pPredefinedArrayTypes, ::g_pPredefinedArrayTypes)
|
||||
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_TypedReferenceMT, ::g_TypedReferenceMT)
|
||||
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pByteArrayMT, ::g_pByteArrayMT)
|
||||
|
||||
#ifdef FEATURE_COMINTEROP
|
||||
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pBaseCOMObject, ::g_pBaseCOMObject)
|
||||
|
@ -198,13 +198,10 @@ DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pBaseRuntimeClass, ::g_pBaseRu
|
|||
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pICastableInterface, ::g_pICastableInterface)
|
||||
#endif // FEATURE_ICASTABLE
|
||||
|
||||
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pExecuteBackoutCodeHelperMethod, ::g_pExecuteBackoutCodeHelperMethod)
|
||||
|
||||
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pObjectFinalizerMD, ::g_pObjectFinalizerMD)
|
||||
|
||||
DEFINE_DACVAR(ULONG, bool, dac__g_fProcessDetach, ::g_fProcessDetach)
|
||||
DEFINE_DACVAR(ULONG, DWORD, dac__g_fEEShutDown, ::g_fEEShutDown)
|
||||
DEFINE_DACVAR(ULONG, DWORD, dac__g_fHostConfig, ::g_fHostConfig)
|
||||
|
||||
DEFINE_DACVAR(ULONG, ULONG, dac__g_CORDebuggerControlFlags, ::g_CORDebuggerControlFlags)
|
||||
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pDebugger, ::g_pDebugger)
|
||||
|
@ -228,10 +225,10 @@ DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pRCWCleanupList, ::g_pRCWClean
|
|||
DEFINE_DACVAR(ULONG, BOOL, RCWWalker__s_bIsGlobalPeggingOn, RCWWalker::s_bIsGlobalPeggingOn)
|
||||
#endif // FEATURE_COMINTEROP
|
||||
|
||||
#ifndef FEATURE_PAL
|
||||
#ifndef TARGET_UNIX
|
||||
DEFINE_DACVAR(ULONG, SIZE_T, dac__g_runtimeLoadedBaseAddress, ::g_runtimeLoadedBaseAddress)
|
||||
DEFINE_DACVAR(ULONG, SIZE_T, dac__g_runtimeVirtualSize, ::g_runtimeVirtualSize)
|
||||
#endif // !FEATURE_PAL
|
||||
#endif // !TARGET_UNIX
|
||||
|
||||
DEFINE_DACVAR(ULONG, SyncBlockCache *, SyncBlockCache__s_pSyncBlockCache, SyncBlockCache::s_pSyncBlockCache)
|
||||
|
||||
|
@ -241,9 +238,9 @@ DEFINE_DACVAR(ULONG, SIZE_T, dac__s_gsCookie, ::s_gsCookie)
|
|||
|
||||
DEFINE_DACVAR_NO_DUMP(ULONG, SIZE_T, dac__g_FCDynamicallyAssignedImplementations, ::g_FCDynamicallyAssignedImplementations)
|
||||
|
||||
#ifndef FEATURE_PAL
|
||||
#ifndef TARGET_UNIX
|
||||
DEFINE_DACVAR(ULONG, HANDLE, dac__g_hContinueStartupEvent, ::g_hContinueStartupEvent)
|
||||
#endif // !FEATURE_PAL
|
||||
#endif // !TARGET_UNIX
|
||||
DEFINE_DACVAR(ULONG, DWORD, CorHost2__m_dwStartupFlags, CorHost2::m_dwStartupFlags)
|
||||
|
||||
DEFINE_DACVAR(ULONG, HRESULT, dac__g_hrFatalError, ::g_hrFatalError)
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
// DbgEngineMetrics.h
|
||||
//
|
||||
// This file contains the defintion of CLR_ENGINE_METRICS. This struct is used for Silverlight debugging.
|
||||
//
|
||||
//
|
||||
// ======================================================================================
|
||||
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
|||
//---------------------------------------------------------------------------------------
|
||||
//
|
||||
// This struct contains information necessary for Silverlight debugging. coreclr.dll has a static struct
|
||||
// of this type. It is read by dbgshim.dll to help synchronize the debugger and coreclr.dll in launch
|
||||
// of this type. It is read by dbgshim.dll to help synchronize the debugger and coreclr.dll in launch
|
||||
// and early attach scenarios.
|
||||
//
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ extern int _DbgBreakCount;
|
|||
#define PRE_ASSERTE /* if you need to change modes before doing asserts override */
|
||||
#define POST_ASSERTE /* put it back */
|
||||
|
||||
#if !defined(_ASSERTE_MSG)
|
||||
#if !defined(_ASSERTE_MSG)
|
||||
#define _ASSERTE_MSG(expr, msg) \
|
||||
do { \
|
||||
if (!(expr)) { \
|
||||
|
@ -100,13 +100,13 @@ void DECLSPEC_NORETURN __FreeBuildAssertFail(const char *szFile, int iLine, cons
|
|||
return FALSE; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef _DEBUG_IMPL
|
||||
|
||||
// A macro to execute a statement only in _DEBUG_IMPL.
|
||||
#define DEBUG_IMPL_STMT(stmt) stmt
|
||||
|
||||
|
||||
#define _ASSERTE_IMPL(expr) _ASSERTE((expr))
|
||||
|
||||
#if defined(_M_IX86)
|
||||
|
@ -201,7 +201,7 @@ do { hr = (EXPR); if(hr != ERROR_SUCCESS) { hr = HRESULT_FROM_WIN32(hr); goto LA
|
|||
#define _ASSERT _ASSERTE
|
||||
|
||||
|
||||
#if defined(_DEBUG) && !defined(FEATURE_PAL)
|
||||
#if defined(_DEBUG) && defined(HOST_WINDOWS)
|
||||
|
||||
// This function returns the EXE time stamp (effectively a random number)
|
||||
// Under retail it always returns 0. This is meant to be used in the
|
||||
|
@ -214,7 +214,7 @@ unsigned DbgGetEXETimeStamp();
|
|||
// will not be coorelated with each other (9973 is prime). Returns false on a retail build
|
||||
#define DbgRandomOnHashAndExe(hash, fractionOn) \
|
||||
(((DbgGetEXETimeStamp() * __LINE__ * ((hash) ? (hash) : 1)) % 9973) < \
|
||||
unsigned(fractionOn * 9973))
|
||||
unsigned((fractionOn) * 9973))
|
||||
#define DbgRandomOnExe(fractionOn) DbgRandomOnHashAndExe(0, fractionOn)
|
||||
#define DbgRandomOnStringAndExe(string, fractionOn) DbgRandomOnHashAndExe(HashStringA(string), fractionOn)
|
||||
|
||||
|
@ -227,43 +227,4 @@ unsigned DbgGetEXETimeStamp();
|
|||
|
||||
#endif // _DEBUG && !FEATUREPAL
|
||||
|
||||
#ifdef _DEBUG
|
||||
namespace clr
|
||||
{
|
||||
namespace dbg
|
||||
{
|
||||
// In debug builds, this can be used to write known bad values into
|
||||
// memory. One example is in ComUtil::IUnknownCommon::~IUnknownCommon,
|
||||
// which overwrites its instance memory with a known bad value after
|
||||
// completing its destructor.
|
||||
template < typename T >
|
||||
void PoisonMem(T &val)
|
||||
{
|
||||
ZeroMemory((void*)&val, sizeof(T));
|
||||
}
|
||||
|
||||
template < typename T >
|
||||
void PoisonMem(T* ptr, size_t len)
|
||||
{
|
||||
ZeroMemory((void*)ptr, sizeof(T)* len);
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
||||
// Empty versions of the functions in retail that will be inlined
|
||||
// and completely elided.
|
||||
namespace clr
|
||||
{
|
||||
namespace dbg
|
||||
{
|
||||
template < typename T >
|
||||
inline void PoisonMem(T &) {}
|
||||
|
||||
template < typename T >
|
||||
void PoisonMem(T* ptr, size_t len){}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
//
|
||||
#ifdef _PREFAST_
|
||||
|
||||
// Use prefast to detect gotos out of no-return blocks. The gotos out of no-return blocks
|
||||
// Use prefast to detect gotos out of no-return blocks. The gotos out of no-return blocks
|
||||
// should be reported as memory leaks by prefast. The (nothrow) is because PREfix sees the
|
||||
// throw from the new statement, and doesn't like these macros used in a destructor (and
|
||||
// the NULL returned by failure works just fine in delete[])
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
//
|
||||
// Contains convenience functionality for lazily loading modules
|
||||
// and getting entrypoints within them.
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef DelayLoadHelpers_h
|
||||
#define DelayLoadHelpers_h
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef _DLWRAP_H
|
||||
#define _DLWRAP_H
|
||||
|
@ -13,7 +13,7 @@
|
|||
//nothrow implementations
|
||||
|
||||
#if defined(VER_H) && !defined (GetFileVersionInfoSizeW_NoThrow)
|
||||
DWORD
|
||||
DWORD
|
||||
GetFileVersionInfoSizeW_NoThrow(
|
||||
LPCWSTR lptstrFilename, /* Filename of version stamped file */
|
||||
LPDWORD lpdwHandle
|
||||
|
@ -41,8 +41,8 @@ VerQueryValueW_NoThrow(
|
|||
#endif
|
||||
|
||||
#if defined(_WININET_) && !defined (CreateUrlCacheEntryW_NoThrow)
|
||||
__success(return)
|
||||
BOOL
|
||||
__success(return)
|
||||
BOOL
|
||||
CreateUrlCacheEntryW_NoThrow(
|
||||
IN LPCWSTR lpszUrlName,
|
||||
IN DWORD dwExpectedFileSize,
|
||||
|
@ -53,7 +53,7 @@ CreateUrlCacheEntryW_NoThrow(
|
|||
#endif
|
||||
|
||||
#if defined(_WININET_) && !defined (CommitUrlCacheEntryW_NoThrow)
|
||||
BOOL
|
||||
BOOL
|
||||
CommitUrlCacheEntryW_NoThrow(
|
||||
IN LPCWSTR lpszUrlName,
|
||||
IN LPCWSTR lpszLocalFileName,
|
||||
|
@ -68,7 +68,7 @@ CommitUrlCacheEntryW_NoThrow(
|
|||
#endif
|
||||
|
||||
#if defined(_WININET_) && !defined (InternetTimeToSystemTimeA_NoThrow)
|
||||
BOOL
|
||||
BOOL
|
||||
InternetTimeToSystemTimeA_NoThrow(
|
||||
IN LPCSTR lpszTime, // NULL terminated string
|
||||
OUT SYSTEMTIME *pst, // output in GMT time
|
||||
|
@ -77,16 +77,16 @@ InternetTimeToSystemTimeA_NoThrow(
|
|||
#endif
|
||||
|
||||
#if defined(__urlmon_h__) && !defined(CoInternetCreateSecurityManager_NoThrow)
|
||||
HRESULT
|
||||
HRESULT
|
||||
CoInternetCreateSecurityManager_NoThrow(
|
||||
IServiceProvider *pSP,
|
||||
IInternetSecurityManager **ppSM,
|
||||
IInternetSecurityManager **ppSM,
|
||||
DWORD dwReserved
|
||||
);
|
||||
#endif
|
||||
|
||||
#if defined(__urlmon_h__) && !defined(URLDownloadToCacheFileW_NoThrow)
|
||||
HRESULT
|
||||
HRESULT
|
||||
URLDownloadToCacheFileW_NoThrow(
|
||||
LPUNKNOWN lpUnkcaller,
|
||||
LPCWSTR szURL,
|
||||
|
@ -98,7 +98,7 @@ URLDownloadToCacheFileW_NoThrow(
|
|||
#endif
|
||||
|
||||
#if defined(__urlmon_h__) && !defined(CoInternetGetSession_NoThrow)
|
||||
HRESULT
|
||||
HRESULT
|
||||
CoInternetGetSession_NoThrow(
|
||||
WORD dwSessionMode,
|
||||
IInternetSession **ppIInternetSession,
|
||||
|
@ -107,8 +107,8 @@ CoInternetGetSession_NoThrow(
|
|||
#endif
|
||||
|
||||
#if defined(__urlmon_h__) && !defined(CopyBindInfo_NoThrow)
|
||||
HRESULT
|
||||
CopyBindInfo_NoThrow(
|
||||
HRESULT
|
||||
CopyBindInfo_NoThrow(
|
||||
const BINDINFO * pcbiSrc, BINDINFO * pbiDest
|
||||
);
|
||||
#endif
|
||||
|
@ -116,42 +116,42 @@ CopyBindInfo_NoThrow(
|
|||
|
||||
|
||||
//overrides
|
||||
#undef InternetTimeToSystemTimeA
|
||||
#undef CommitUrlCacheEntryW
|
||||
#undef HttpQueryInfoA
|
||||
#undef InternetCloseHandle
|
||||
#undef HttpSendRequestA
|
||||
#undef HttpOpenRequestA
|
||||
#undef InternetConnectA
|
||||
#undef InternetOpenA
|
||||
#undef InternetReadFile
|
||||
#undef CreateUrlCacheEntryW
|
||||
#undef CoInternetGetSession
|
||||
#undef CopyBindInfo
|
||||
#undef CoInternetCreateSecurityManager
|
||||
#undef URLDownloadToCacheFileW
|
||||
#undef FDICreate
|
||||
#undef FDIIsCabinet
|
||||
#undef FDICopy
|
||||
#undef FDIDestroy
|
||||
#undef VerQueryValueW
|
||||
#undef GetFileVersionInfoW
|
||||
#undef GetFileVersionInfoSizeW
|
||||
#undef VerQueryValueA
|
||||
#undef GetFileVersionInfoA
|
||||
#undef GetFileVersionInfoSizeA
|
||||
#undef InternetTimeToSystemTimeA
|
||||
#undef CommitUrlCacheEntryW
|
||||
#undef HttpQueryInfoA
|
||||
#undef InternetCloseHandle
|
||||
#undef HttpSendRequestA
|
||||
#undef HttpOpenRequestA
|
||||
#undef InternetConnectA
|
||||
#undef InternetOpenA
|
||||
#undef InternetReadFile
|
||||
#undef CreateUrlCacheEntryW
|
||||
#undef CoInternetGetSession
|
||||
#undef CopyBindInfo
|
||||
#undef CoInternetCreateSecurityManager
|
||||
#undef URLDownloadToCacheFileW
|
||||
#undef FDICreate
|
||||
#undef FDIIsCabinet
|
||||
#undef FDICopy
|
||||
#undef FDIDestroy
|
||||
#undef VerQueryValueW
|
||||
#undef GetFileVersionInfoW
|
||||
#undef GetFileVersionInfoSizeW
|
||||
#undef VerQueryValueA
|
||||
#undef GetFileVersionInfoA
|
||||
#undef GetFileVersionInfoSizeA
|
||||
|
||||
|
||||
#define InternetTimeToSystemTimeA InternetTimeToSystemTimeA_NoThrow
|
||||
#define CommitUrlCacheEntryW CommitUrlCacheEntryW_NoThrow
|
||||
#define CreateUrlCacheEntryW CreateUrlCacheEntryW_NoThrow
|
||||
#define CoInternetGetSession CoInternetGetSession_NoThrow
|
||||
#define CopyBindInfo CopyBindInfo_NoThrow
|
||||
#define CoInternetCreateSecurityManager CoInternetCreateSecurityManager_NoThrow
|
||||
#define URLDownloadToCacheFileW URLDownloadToCacheFileW_NoThrow
|
||||
#define VerQueryValueW VerQueryValueW_NoThrow
|
||||
#define GetFileVersionInfoW GetFileVersionInfoW_NoThrow
|
||||
#define GetFileVersionInfoSizeW GetFileVersionInfoSizeW_NoThrow
|
||||
#define InternetTimeToSystemTimeA InternetTimeToSystemTimeA_NoThrow
|
||||
#define CommitUrlCacheEntryW CommitUrlCacheEntryW_NoThrow
|
||||
#define CreateUrlCacheEntryW CreateUrlCacheEntryW_NoThrow
|
||||
#define CoInternetGetSession CoInternetGetSession_NoThrow
|
||||
#define CopyBindInfo CopyBindInfo_NoThrow
|
||||
#define CoInternetCreateSecurityManager CoInternetCreateSecurityManager_NoThrow
|
||||
#define URLDownloadToCacheFileW URLDownloadToCacheFileW_NoThrow
|
||||
#define VerQueryValueW VerQueryValueW_NoThrow
|
||||
#define GetFileVersionInfoW GetFileVersionInfoW_NoThrow
|
||||
#define GetFileVersionInfoSizeW GetFileVersionInfoSizeW_NoThrow
|
||||
#define VerQueryValueA Use_VerQueryValueW
|
||||
#define GetFileVersionInfoA Use_GetFileVersionInfoW
|
||||
#define GetFileVersionInfoSizeA Use_GetFileVersionInfoSizeW
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
#pragma once
|
||||
|
||||
// The byte values of the ECMA pseudo public key and its token.
|
||||
const BYTE g_rbNeutralPublicKey[] = { 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0 };
|
||||
const BYTE g_rbNeutralPublicKeyToken[] = { 0xb7, 0x7a, 0x5c, 0x56, 0x19, 0x34, 0xe0, 0x89 };
|
||||
|
|
@ -32,11 +32,11 @@
|
|||
#include "bitvector.h"
|
||||
#include "gcinfotypes.h"
|
||||
|
||||
#if !defined(_TARGET_X86_)
|
||||
#if !defined(TARGET_X86)
|
||||
#define USE_GC_INFO_DECODER
|
||||
#endif
|
||||
|
||||
#if (defined(_TARGET_X86_) && !defined(FEATURE_PAL)) || defined(_TARGET_AMD64_)
|
||||
#if (defined(TARGET_X86) && !defined(TARGET_UNIX)) || defined(TARGET_AMD64)
|
||||
#define HAS_QUICKUNWIND
|
||||
#endif
|
||||
|
||||
|
@ -52,7 +52,7 @@ typedef struct _DAC_SLOT_LOCATION
|
|||
int reg;
|
||||
int regOffset;
|
||||
bool targetPtr;
|
||||
|
||||
|
||||
_DAC_SLOT_LOCATION(int _reg, int _regOffset, bool _targetPtr)
|
||||
: reg(_reg), regOffset(_regOffset), targetPtr(_targetPtr)
|
||||
{
|
||||
|
@ -160,7 +160,7 @@ enum
|
|||
};
|
||||
|
||||
#ifndef DACCESS_COMPILE
|
||||
#ifndef WIN64EXCEPTIONS
|
||||
#ifndef FEATURE_EH_FUNCLETS
|
||||
virtual void FixContext(ContextType ctxType,
|
||||
EHContext *ctx,
|
||||
EECodeInfo *pCodeInfo,
|
||||
|
@ -170,10 +170,10 @@ virtual void FixContext(ContextType ctxType,
|
|||
CodeManState *pState,
|
||||
size_t ** ppShadowSP, // OUT
|
||||
size_t ** ppEndRegion) = 0; // OUT
|
||||
#endif // !WIN64EXCEPTIONS
|
||||
#endif // !FEATURE_EH_FUNCLETS
|
||||
#endif // #ifndef DACCESS_COMPILE
|
||||
|
||||
#ifdef _TARGET_X86_
|
||||
#ifdef TARGET_X86
|
||||
/*
|
||||
Gets the ambient stack pointer value at the given nesting level within
|
||||
the method.
|
||||
|
@ -183,7 +183,7 @@ virtual TADDR GetAmbientSP(PREGDISPLAY pContext,
|
|||
DWORD dwRelOffset,
|
||||
DWORD nestingLevel,
|
||||
CodeManState *pState) = 0;
|
||||
#endif // _TARGET_X86_
|
||||
#endif // TARGET_X86
|
||||
|
||||
/*
|
||||
Get the number of bytes used for stack parameters.
|
||||
|
@ -214,11 +214,11 @@ virtual bool UnwindStackFrame(PREGDISPLAY pContext,
|
|||
virtual bool IsGcSafe(EECodeInfo *pCodeInfo,
|
||||
DWORD dwRelOffset) = 0;
|
||||
|
||||
#if defined(_TARGET_ARM_) || defined(_TARGET_ARM64_)
|
||||
#if defined(TARGET_ARM) || defined(TARGET_ARM64)
|
||||
virtual bool HasTailCalls(EECodeInfo *pCodeInfo) = 0;
|
||||
#endif // _TARGET_ARM_ || _TARGET_ARM64_
|
||||
#endif // TARGET_ARM || TARGET_ARM64
|
||||
|
||||
#if defined(_TARGET_AMD64_) && defined(_DEBUG)
|
||||
#if defined(TARGET_AMD64) && defined(_DEBUG)
|
||||
/*
|
||||
Locates the end of the last interruptible region in the given code range.
|
||||
Returns 0 if the entire range is uninterruptible. Returns the end point
|
||||
|
@ -227,7 +227,7 @@ virtual bool HasTailCalls(EECodeInfo *pCodeInfo) = 0;
|
|||
virtual unsigned FindEndOfLastInterruptibleRegion(unsigned curOffset,
|
||||
unsigned endOffset,
|
||||
GCInfoToken gcInfoToken) = 0;
|
||||
#endif // _TARGET_AMD64_ && _DEBUG
|
||||
#endif // TARGET_AMD64 && _DEBUG
|
||||
|
||||
#ifndef CROSSGEN_COMPILE
|
||||
/*
|
||||
|
@ -245,23 +245,15 @@ virtual bool EnumGcRefs(PREGDISPLAY pContext,
|
|||
DWORD relOffsetOverride = NO_OVERRIDE_OFFSET) = 0;
|
||||
#endif // !CROSSGEN_COMPILE
|
||||
|
||||
#if !defined(DACCESS_COMPILE) && !defined(CROSSGEN_COMPILE)
|
||||
/*
|
||||
Return the address of the local security object reference
|
||||
(if available).
|
||||
*/
|
||||
virtual OBJECTREF* GetAddrOfSecurityObject(CrawlFrame *pCF) = 0;
|
||||
#endif // !DACCESS_COMPILE && !CROSSGEN_COMPILE
|
||||
|
||||
#ifndef CROSSGEN_COMPILE
|
||||
/*
|
||||
For a non-static method, "this" pointer is passed in as argument 0.
|
||||
However, if there is a "ldarga 0" or "starg 0" in the IL,
|
||||
However, if there is a "ldarga 0" or "starg 0" in the IL,
|
||||
JIT will create a copy of arg0 and redirect all "ldarg(a) 0" and "starg 0" to this copy.
|
||||
(See Compiler::lvaArg0Var for more details.)
|
||||
|
||||
|
||||
The following method returns the original "this" argument, i.e. the one that is passed in,
|
||||
if it is a non-static method AND the object is still alive.
|
||||
if it is a non-static method AND the object is still alive.
|
||||
Returns NULL in all other cases.
|
||||
*/
|
||||
virtual OBJECTREF GetInstance(PREGDISPLAY pContext,
|
||||
|
@ -316,10 +308,12 @@ virtual bool IsInSynchronizedRegion(
|
|||
virtual size_t GetFunctionSize(GCInfoToken gcInfoToken) = 0;
|
||||
|
||||
/*
|
||||
Returns the ReturnKind of a given function as reported in the GC info.
|
||||
* Get information necessary for return address hijacking of the method represented by the gcInfoToken.
|
||||
* If it can be hijacked, it sets the returnKind output parameter to the kind of the return value and
|
||||
* returns true.
|
||||
* If hijacking is not possible for some reason, it return false.
|
||||
*/
|
||||
|
||||
virtual ReturnKind GetReturnKind(GCInfoToken gcInfotoken) = 0;
|
||||
virtual bool GetReturnAddressHijackInfo(GCInfoToken gcInfoToken, ReturnKind * returnKind) = 0;
|
||||
|
||||
#ifndef USE_GC_INFO_DECODER
|
||||
/*
|
||||
|
@ -332,7 +326,7 @@ virtual unsigned int GetFrameSize(GCInfoToken gcInfoToken) = 0;
|
|||
|
||||
/* Debugger API */
|
||||
|
||||
#ifndef WIN64EXCEPTIONS
|
||||
#ifndef FEATURE_EH_FUNCLETS
|
||||
virtual const BYTE* GetFinallyReturnAddr(PREGDISPLAY pReg)=0;
|
||||
|
||||
virtual BOOL IsInFilter(GCInfoToken gcInfoToken,
|
||||
|
@ -347,7 +341,7 @@ virtual BOOL LeaveFinally(GCInfoToken gcInfoToken,
|
|||
virtual void LeaveCatch(GCInfoToken gcInfoToken,
|
||||
unsigned offset,
|
||||
PCONTEXT pCtx)=0;
|
||||
#endif // WIN64EXCEPTIONS
|
||||
#endif // FEATURE_EH_FUNCLETS
|
||||
|
||||
#ifdef EnC_SUPPORTED
|
||||
|
||||
|
@ -391,7 +385,7 @@ public:
|
|||
|
||||
|
||||
#ifndef DACCESS_COMPILE
|
||||
#ifndef WIN64EXCEPTIONS
|
||||
#ifndef FEATURE_EH_FUNCLETS
|
||||
/*
|
||||
Last chance for the runtime support to do fixups in the context
|
||||
before execution continues inside a filter, catch handler, or finally
|
||||
|
@ -406,10 +400,10 @@ void FixContext(ContextType ctxType,
|
|||
CodeManState *pState,
|
||||
size_t ** ppShadowSP, // OUT
|
||||
size_t ** ppEndRegion); // OUT
|
||||
#endif // !WIN64EXCEPTIONS
|
||||
#endif // !FEATURE_EH_FUNCLETS
|
||||
#endif // #ifndef DACCESS_COMPILE
|
||||
|
||||
#ifdef _TARGET_X86_
|
||||
#ifdef TARGET_X86
|
||||
/*
|
||||
Gets the ambient stack pointer value at the given nesting level within
|
||||
the method.
|
||||
|
@ -420,13 +414,13 @@ TADDR GetAmbientSP(PREGDISPLAY pContext,
|
|||
DWORD dwRelOffset,
|
||||
DWORD nestingLevel,
|
||||
CodeManState *pState);
|
||||
#endif // _TARGET_X86_
|
||||
#endif // TARGET_X86
|
||||
|
||||
/*
|
||||
Get the number of bytes used for stack parameters.
|
||||
This is currently only used on x86.
|
||||
*/
|
||||
virtual
|
||||
virtual
|
||||
ULONG32 GetStackParameterSize(EECodeInfo* pCodeInfo);
|
||||
|
||||
#ifndef CROSSGEN_COMPILE
|
||||
|
@ -474,12 +468,12 @@ virtual
|
|||
bool IsGcSafe( EECodeInfo *pCodeInfo,
|
||||
DWORD dwRelOffset);
|
||||
|
||||
#if defined(_TARGET_ARM_) || defined(_TARGET_ARM64_)
|
||||
#if defined(TARGET_ARM) || defined(TARGET_ARM64)
|
||||
virtual
|
||||
bool HasTailCalls(EECodeInfo *pCodeInfo);
|
||||
#endif // _TARGET_ARM_ || _TARGET_ARM64_
|
||||
#endif // TARGET_ARM || TARGET_ARM64
|
||||
|
||||
#if defined(_TARGET_AMD64_) && defined(_DEBUG)
|
||||
#if defined(TARGET_AMD64) && defined(_DEBUG)
|
||||
/*
|
||||
Locates the end of the last interruptible region in the given code range.
|
||||
Returns 0 if the entire range is uninterruptible. Returns the end point
|
||||
|
@ -489,7 +483,7 @@ virtual
|
|||
unsigned FindEndOfLastInterruptibleRegion(unsigned curOffset,
|
||||
unsigned endOffset,
|
||||
GCInfoToken gcInfoToken);
|
||||
#endif // _TARGET_AMD64_ && _DEBUG
|
||||
#endif // TARGET_AMD64 && _DEBUG
|
||||
|
||||
#ifndef CROSSGEN_COMPILE
|
||||
/*
|
||||
|
@ -518,22 +512,6 @@ bool EnumGcRefsConservative(PREGDISPLAY pRD,
|
|||
LPVOID hCallBack);
|
||||
#endif // FEATURE_CONSERVATIVE_GC
|
||||
|
||||
#ifdef _TARGET_X86_
|
||||
/*
|
||||
Return the address of the local security object reference
|
||||
using data that was previously cached before in UnwindStackFrame
|
||||
using StackwalkCacheUnwindInfo
|
||||
*/
|
||||
static OBJECTREF* GetAddrOfSecurityObjectFromCachedInfo(
|
||||
PREGDISPLAY pRD,
|
||||
StackwalkCacheUnwindInfo * stackwalkCacheUnwindInfo);
|
||||
#endif // _TARGET_X86_
|
||||
|
||||
#if !defined(DACCESS_COMPILE) && !defined(CROSSGEN_COMPILE)
|
||||
virtual
|
||||
OBJECTREF* GetAddrOfSecurityObject(CrawlFrame *pCF) DAC_UNEXPECTED();
|
||||
#endif // !DACCESS_COMPILE && !CROSSGEN_COMPILE
|
||||
|
||||
#ifndef CROSSGEN_COMPILE
|
||||
virtual
|
||||
OBJECTREF GetInstance(
|
||||
|
@ -555,20 +533,20 @@ PTR_VOID GetParamTypeArg(PREGDISPLAY pContext,
|
|||
virtual GenericParamContextType GetParamContextType(PREGDISPLAY pContext,
|
||||
EECodeInfo * pCodeInfo);
|
||||
|
||||
#if defined(WIN64EXCEPTIONS) && defined(USE_GC_INFO_DECODER) && !defined(CROSSGEN_COMPILE)
|
||||
#if defined(FEATURE_EH_FUNCLETS) && defined(USE_GC_INFO_DECODER) && !defined(CROSSGEN_COMPILE)
|
||||
/*
|
||||
Returns the generics token. This is used by GetInstance() and GetParamTypeArg() on WIN64.
|
||||
*/
|
||||
static
|
||||
static
|
||||
PTR_VOID GetExactGenericsToken(PREGDISPLAY pContext,
|
||||
EECodeInfo * pCodeInfo);
|
||||
|
||||
static
|
||||
static
|
||||
PTR_VOID GetExactGenericsToken(SIZE_T baseStackSlot,
|
||||
EECodeInfo * pCodeInfo);
|
||||
|
||||
|
||||
#endif // WIN64EXCEPTIONS && USE_GC_INFO_DECODER && !CROSSGEN_COMPILE
|
||||
#endif // FEATURE_EH_FUNCLETS && USE_GC_INFO_DECODER && !CROSSGEN_COMPILE
|
||||
|
||||
#ifndef CROSSGEN_COMPILE
|
||||
/*
|
||||
|
@ -609,9 +587,12 @@ virtual
|
|||
size_t GetFunctionSize(GCInfoToken gcInfoToken);
|
||||
|
||||
/*
|
||||
Returns the ReturnKind of a given function.
|
||||
* Get information necessary for return address hijacking of the method represented by the gcInfoToken.
|
||||
* If it can be hijacked, it sets the returnKind output parameter to the kind of the return value and
|
||||
* returns true.
|
||||
* If hijacking is not possible for some reason, it return false.
|
||||
*/
|
||||
virtual ReturnKind GetReturnKind(GCInfoToken gcInfotoken);
|
||||
virtual bool GetReturnAddressHijackInfo(GCInfoToken gcInfoToken, ReturnKind * returnKind);
|
||||
|
||||
#ifndef USE_GC_INFO_DECODER
|
||||
/*
|
||||
|
@ -623,7 +604,7 @@ unsigned int GetFrameSize(GCInfoToken gcInfoToken);
|
|||
|
||||
#ifndef DACCESS_COMPILE
|
||||
|
||||
#ifndef WIN64EXCEPTIONS
|
||||
#ifndef FEATURE_EH_FUNCLETS
|
||||
virtual const BYTE* GetFinallyReturnAddr(PREGDISPLAY pReg);
|
||||
virtual BOOL IsInFilter(GCInfoToken gcInfoToken,
|
||||
unsigned offset,
|
||||
|
@ -635,7 +616,7 @@ virtual BOOL LeaveFinally(GCInfoToken gcInfoToken,
|
|||
virtual void LeaveCatch(GCInfoToken gcInfoToken,
|
||||
unsigned offset,
|
||||
PCONTEXT pCtx);
|
||||
#endif // WIN64EXCEPTIONS
|
||||
#endif // FEATURE_EH_FUNCLETS
|
||||
|
||||
#ifdef EnC_SUPPORTED
|
||||
/*
|
||||
|
@ -654,13 +635,13 @@ HRESULT FixContextForEnC(PCONTEXT pCtx,
|
|||
|
||||
#endif // #ifndef DACCESS_COMPILE
|
||||
|
||||
#ifdef WIN64EXCEPTIONS
|
||||
#ifdef FEATURE_EH_FUNCLETS
|
||||
static void EnsureCallerContextIsValid( PREGDISPLAY pRD, StackwalkCacheEntry* pCacheEntry, EECodeInfo * pCodeInfo = NULL );
|
||||
static size_t GetCallerSp( PREGDISPLAY pRD );
|
||||
#ifdef _TARGET_X86_
|
||||
#ifdef TARGET_X86
|
||||
static size_t GetResumeSp( PCONTEXT pContext );
|
||||
#endif // _TARGET_X86_
|
||||
#endif // WIN64EXCEPTIONS
|
||||
#endif // TARGET_X86
|
||||
#endif // FEATURE_EH_FUNCLETS
|
||||
|
||||
#ifdef DACCESS_COMPILE
|
||||
virtual void EnumMemoryRegions(CLRDataEnumMemoryFlags flags);
|
||||
|
@ -668,7 +649,7 @@ HRESULT FixContextForEnC(PCONTEXT pCtx,
|
|||
|
||||
};
|
||||
|
||||
#ifdef _TARGET_X86_
|
||||
#ifdef TARGET_X86
|
||||
bool UnwindStackFrame(PREGDISPLAY pContext,
|
||||
EECodeInfo *pCodeInfo,
|
||||
unsigned flags,
|
||||
|
@ -726,13 +707,13 @@ struct hdrInfo
|
|||
|
||||
// Size of the epilogs in the method.
|
||||
// For methods which use CEE_JMP, some epilogs may end with a "ret" instruction
|
||||
// and some may end with a "jmp". The epilogSize reported should be for the
|
||||
// and some may end with a "jmp". The epilogSize reported should be for the
|
||||
// epilog with the smallest size.
|
||||
unsigned int epilogSize;
|
||||
|
||||
unsigned char epilogCnt;
|
||||
bool epilogEnd; // is the epilog at the end of the method
|
||||
|
||||
|
||||
bool ebpFrame; // locals and arguments addressed relative to EBP
|
||||
bool doubleAlign; // is the stack double-aligned? locals addressed relative to ESP, and arguments relative to EBP
|
||||
bool interruptible; // intr. at all times (excluding prolog/epilog), not just call sites
|
||||
|
@ -765,7 +746,7 @@ struct hdrInfo
|
|||
unsigned int revPInvokeOffset; // INVALID_REV_PINVOKE_OFFSET if there is no Reverse PInvoke frame
|
||||
|
||||
enum { NOT_IN_PROLOG = -1, NOT_IN_EPILOG = -1 };
|
||||
|
||||
|
||||
int prologOffs; // NOT_IN_PROLOG if not in prolog
|
||||
int epilogOffs; // NOT_IN_EPILOG if not in epilog. It is never 0
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
// ==++==
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
|
@ -29,34 +29,34 @@ typedef PTR_VOID PTR_EXCEPTION_CLAUSE_TOKEN;
|
|||
struct EE_ILEXCEPTION_CLAUSE {
|
||||
//Flags is not marked as volatile since it is always accessed
|
||||
// from within a critical section
|
||||
CorExceptionFlag Flags;
|
||||
DWORD TryStartPC;
|
||||
CorExceptionFlag Flags;
|
||||
DWORD TryStartPC;
|
||||
DWORD TryEndPC;
|
||||
DWORD HandlerStartPC;
|
||||
DWORD HandlerEndPC;
|
||||
DWORD HandlerStartPC;
|
||||
DWORD HandlerEndPC;
|
||||
union {
|
||||
void* TypeHandle;
|
||||
void* TypeHandle;
|
||||
mdToken ClassToken;
|
||||
DWORD FilterOffset;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
struct EE_ILEXCEPTION;
|
||||
typedef DPTR(EE_ILEXCEPTION) PTR_EE_ILEXCEPTION;
|
||||
|
||||
struct EE_ILEXCEPTION : public COR_ILMETHOD_SECT_FAT
|
||||
struct EE_ILEXCEPTION : public COR_ILMETHOD_SECT_FAT
|
||||
{
|
||||
EE_ILEXCEPTION_CLAUSE Clauses[1]; // actually variable size
|
||||
|
||||
void Init(unsigned ehCount)
|
||||
void Init(unsigned ehCount)
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
|
||||
SetKind(CorILMethod_Sect_FatFormat);
|
||||
SetDataSize((unsigned)sizeof(EE_ILEXCEPTION_CLAUSE) * ehCount);
|
||||
SetDataSize((unsigned)sizeof(EE_ILEXCEPTION_CLAUSE) * ehCount);
|
||||
}
|
||||
|
||||
unsigned EHCount() const
|
||||
unsigned EHCount() const
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
|
||||
|
@ -71,7 +71,7 @@ struct EE_ILEXCEPTION : public COR_ILMETHOD_SECT_FAT
|
|||
|
||||
return (offsetof(EE_ILEXCEPTION, Clauses) + sizeof(EE_ILEXCEPTION_CLAUSE) * ehCount);
|
||||
}
|
||||
EE_ILEXCEPTION_CLAUSE *EHClause(unsigned i)
|
||||
EE_ILEXCEPTION_CLAUSE *EHClause(unsigned i)
|
||||
{
|
||||
LIMITED_METHOD_DAC_CONTRACT;
|
||||
return &(PTR_EE_ILEXCEPTION_CLAUSE(PTR_HOST_MEMBER_TADDR(EE_ILEXCEPTION,this,Clauses))[i]);
|
||||
|
@ -128,19 +128,19 @@ inline BOOL IsDuplicateClause(EE_ILEXCEPTION_CLAUSE* pEHClause)
|
|||
return pEHClause->Flags & COR_ILEXCEPTION_CLAUSE_DUPLICATED;
|
||||
}
|
||||
|
||||
#if defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)
|
||||
#if defined(TARGET_AMD64) || defined(TARGET_ARM64)
|
||||
// Finally is the only EH construct that can be part of the execution as being fall-through.
|
||||
//
|
||||
// "Cloned" finally is a contruct that represents a finally block that is used as
|
||||
// fall through for normal try-block execution. Such a "cloned" finally will:
|
||||
//
|
||||
//
|
||||
// 1) Have its try-clause's Start and End PC the same as its handler's start PC (i.e. will have
|
||||
// zero length try block), AND
|
||||
// 2) Is marked duplicate
|
||||
//
|
||||
// Because of their fall-through nature, JIT guarantees that only finally constructs can be cloned,
|
||||
// and not catch or fault (since they cannot be fallen through but are invoked as funclets).
|
||||
//
|
||||
//
|
||||
// The cloned finally construct is also used to mark "call to finally" thunks that are not within
|
||||
// the EH region protected by the finally, and also not within the enclosing region. This is done
|
||||
// to prevent ThreadAbortException from creating an infinite loop of calling the same finally.
|
||||
|
@ -150,7 +150,7 @@ inline BOOL IsClonedFinally(EE_ILEXCEPTION_CLAUSE* pEHClause)
|
|||
(pEHClause->TryStartPC == pEHClause->HandlerStartPC) &&
|
||||
IsFinally(pEHClause) && IsDuplicateClause(pEHClause));
|
||||
}
|
||||
#endif // defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)
|
||||
#endif // defined(TARGET_AMD64) || defined(TARGET_ARM64)
|
||||
|
||||
#endif // __eexcp_h__
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
//
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
// #EventTracing
|
||||
// Windows
|
||||
// ETW (Event Tracing for Windows) is a high-performance, low overhead and highly scalable
|
||||
|
@ -42,7 +42,7 @@ struct ProfilingScanContext : ScanContext
|
|||
BOOL fProfilerPinned;
|
||||
void * pvEtwContext;
|
||||
void *pHeapId;
|
||||
|
||||
|
||||
ProfilingScanContext(BOOL fProfilerPinnedParam) : ScanContext()
|
||||
{
|
||||
LIMITED_METHOD_CONTRACT;
|
||||
|
@ -97,7 +97,7 @@ namespace ETW
|
|||
|
||||
// The type this TypeLoggingInfo represents
|
||||
TypeHandle th;
|
||||
|
||||
|
||||
// Smart sampling
|
||||
|
||||
// These bucket values remember stats of a particular time slice that are used to
|
||||
|
@ -148,13 +148,13 @@ namespace ETW
|
|||
// Take lock, and consult hash table to see if this is the first time we've
|
||||
// encountered the type, in which case, log it
|
||||
kTypeLogBehaviorTakeLockAndLogIfFirstTime,
|
||||
|
||||
|
||||
// Don't take lock, don't consult hash table. Just log the type. (This is
|
||||
// used in cases when checking for dupe type logging isn't worth it, such as
|
||||
// when logging the finalization of an object.)
|
||||
kTypeLogBehaviorAlwaysLog,
|
||||
|
||||
// When logging the type for GCSampledObjectAllocation events,
|
||||
// When logging the type for GCSampledObjectAllocation events,
|
||||
// we already know we need to log the type (since we already
|
||||
// looked it up in the hash). But we would still need to consult the hash
|
||||
// for any type parameters, so kTypeLogBehaviorAlwaysLog isn't appropriate,
|
||||
|
@ -193,7 +193,7 @@ namespace ETW
|
|||
// When WPA triggers a GC, it gives us this unique number to append to our
|
||||
// GCStart event so WPA can correlate the CLR's GC with the JScript GC they
|
||||
// triggered at the same time.
|
||||
//
|
||||
//
|
||||
// We set this value when the GC is triggered, and then retrieve the value on the
|
||||
// first subsequent FireGcStart() method call for a full, induced GC, assuming
|
||||
// that that's the GC that WPA triggered. This is imperfect, and if we were in
|
||||
|
@ -251,9 +251,9 @@ namespace ETW
|
|||
|
||||
// These values are gotten from the gc_reason
|
||||
// in gcimpl.h
|
||||
typedef enum _GC_REASON {
|
||||
GC_ALLOC_SOH = 0,
|
||||
GC_INDUCED = 1,
|
||||
typedef enum _GC_REASON {
|
||||
GC_ALLOC_SOH = 0,
|
||||
GC_INDUCED = 1,
|
||||
GC_LOWMEMORY = 2,
|
||||
GC_EMPTY = 3,
|
||||
GC_ALLOC_LOH = 4,
|
||||
|
@ -265,12 +265,12 @@ namespace ETW
|
|||
GC_INDUCED_COMPACTING = 10,
|
||||
GC_LOWMEMORY_HOST = 11
|
||||
} GC_REASON;
|
||||
typedef enum _GC_TYPE {
|
||||
GC_NGC = 0,
|
||||
GC_BGC = 1,
|
||||
typedef enum _GC_TYPE {
|
||||
GC_NGC = 0,
|
||||
GC_BGC = 1,
|
||||
GC_FGC = 2
|
||||
} GC_TYPE;
|
||||
typedef enum _GC_ROOT_KIND {
|
||||
typedef enum _GC_ROOT_KIND {
|
||||
GC_ROOT_STACK = 0,
|
||||
GC_ROOT_FQ = 1,
|
||||
GC_ROOT_HANDLES = 2,
|
||||
|
@ -291,9 +291,9 @@ namespace ETW
|
|||
|
||||
struct {
|
||||
ULONG Reason;
|
||||
// This is only valid when SuspendEE is called by GC (ie, Reason is either
|
||||
// This is only valid when SuspendEE is called by GC (ie, Reason is either
|
||||
// SUSPEND_FOR_GC or SUSPEND_FOR_GC_PREP.
|
||||
ULONG GcCount;
|
||||
ULONG GcCount;
|
||||
} SuspendEE;
|
||||
|
||||
struct {
|
||||
|
@ -301,8 +301,8 @@ namespace ETW
|
|||
} GCMark;
|
||||
|
||||
struct {
|
||||
ULONGLONG SegmentSize;
|
||||
ULONGLONG LargeObjectSegmentSize;
|
||||
ULONGLONG SegmentSize;
|
||||
ULONGLONG LargeObjectSegmentSize;
|
||||
BOOL ServerGC; // TRUE means it's server GC; FALSE means it's workstation.
|
||||
} GCSettings;
|
||||
|
||||
|
@ -310,7 +310,7 @@ namespace ETW
|
|||
// The generation that triggered this notification.
|
||||
ULONG Count;
|
||||
// 1 means the notification was due to allocation; 0 means it was due to other factors.
|
||||
ULONG Alloc;
|
||||
ULONG Alloc;
|
||||
} GCFullNotify;
|
||||
} ETW_GC_INFO, *PETW_GC_INFO;
|
||||
|
||||
|
@ -343,7 +343,7 @@ namespace ETW
|
|||
static BOOL ShouldWalkStaticsAndCOMForEtw();
|
||||
static VOID WalkStaticsAndCOMForETW();
|
||||
static VOID EndHeapDump(ProfilerWalkHeapContext * profilerWalkHeapContext);
|
||||
#ifdef FEATURE_EVENT_TRACE
|
||||
#ifdef FEATURE_EVENT_TRACE
|
||||
static VOID BeginMovedReferences(size_t * pProfilingContext);
|
||||
static VOID MovedReference(BYTE * pbMemBlockStart, BYTE * pbMemBlockEnd, ptrdiff_t cbRelocDistance, size_t profilingContext, BOOL fCompacting, BOOL fAllowProfApiNotification = TRUE);
|
||||
static VOID EndMovedReferences(size_t profilingContext, BOOL fAllowProfApiNotification = TRUE);
|
||||
|
@ -352,7 +352,7 @@ namespace ETW
|
|||
static VOID BeginMovedReferences(size_t * pProfilingContext) {};
|
||||
static VOID MovedReference(BYTE * pbMemBlockStart, BYTE * pbMemBlockEnd, ptrdiff_t cbRelocDistance, size_t profilingContext, BOOL fCompacting, BOOL fAllowProfApiNotification = TRUE) {};
|
||||
static VOID EndMovedReferences(size_t profilingContext, BOOL fAllowProfApiNotification = TRUE) {};
|
||||
#endif // FEATURE_EVENT_TRACE
|
||||
#endif // FEATURE_EVENT_TRACE
|
||||
static VOID SendFinalizeObjectEvent(MethodTable * pMT, Object * pObj);
|
||||
};
|
||||
};
|
||||
|
|
|
@ -46,6 +46,16 @@ enum EtwTypeFlags
|
|||
kEtwTypeFlagsFinalizable = 0x2,
|
||||
kEtwTypeFlagsExternallyImplementedCOMObject = 0x4,
|
||||
kEtwTypeFlagsArray = 0x8,
|
||||
kEtwTypeFlagsArrayRankBit0 = 0x100,
|
||||
kEtwTypeFlagsArrayRankBit1 = 0x200,
|
||||
kEtwTypeFlagsArrayRankBit2 = 0x400,
|
||||
kEtwTypeFlagsArrayRankBit3 = 0x800,
|
||||
kEtwTypeFlagsArrayRankBit4 = 0x1000,
|
||||
kEtwTypeFlagsArrayRankBit5 = 0x2000,
|
||||
|
||||
kEtwTypeFlagsArrayRankMask = 0x3F00,
|
||||
kEtwTypeFlagsArrayRankShift = 8,
|
||||
kEtwTypeFlagsArrayRankMax = kEtwTypeFlagsArrayRankMask >> kEtwTypeFlagsArrayRankShift
|
||||
};
|
||||
|
||||
enum EtwThreadFlags
|
||||
|
@ -65,14 +75,14 @@ enum EtwThreadFlags
|
|||
#define EVENT_PIPE_ENABLED() (FALSE)
|
||||
#endif
|
||||
|
||||
#if !defined(FEATURE_PAL)
|
||||
#if !defined(HOST_UNIX)
|
||||
|
||||
//
|
||||
// Use this macro at the least before calling the Event Macros
|
||||
//
|
||||
|
||||
#define ETW_TRACING_INITIALIZED(RegHandle) \
|
||||
((g_pEtwTracer && RegHandle) || EVENT_PIPE_ENABLED())
|
||||
((g_pEtwTracer && (RegHandle)) || EVENT_PIPE_ENABLED())
|
||||
|
||||
//
|
||||
// Use this macro to check if an event is enabled
|
||||
|
@ -95,7 +105,7 @@ enum EtwThreadFlags
|
|||
((ProviderSymbol##_Context.IsEnabled) || EVENT_PIPE_ENABLED())
|
||||
|
||||
|
||||
#else //!defined(FEATURE_PAL)
|
||||
#else //!defined(HOST_UNIX)
|
||||
#if defined(FEATURE_PERFTRACING)
|
||||
#define ETW_INLINE
|
||||
#define ETWOnStartup(StartEventName, EndEventName)
|
||||
|
@ -122,7 +132,7 @@ enum EtwThreadFlags
|
|||
#define ETW_TRACING_CATEGORY_ENABLED(Context, Level, Keyword) (ETW_CATEGORY_ENABLED(Context, Level, Keyword))
|
||||
#define ETW_PROVIDER_ENABLED(ProviderSymbol) (XplatEventLogger::IsProviderEnabled(Context))
|
||||
#endif // defined(FEATURE_PERFTRACING)
|
||||
#endif // !defined(FEATURE_PAL)
|
||||
#endif // !defined(HOST_UNIX)
|
||||
|
||||
#else // FEATURE_EVENT_TRACE
|
||||
|
||||
|
@ -160,7 +170,7 @@ public:
|
|||
#ifdef FEATURE_EVENT_TRACE
|
||||
|
||||
class Object;
|
||||
#if !defined(FEATURE_PAL)
|
||||
#if !defined(HOST_UNIX)
|
||||
|
||||
/***************************************/
|
||||
/* Tracing levels supported by CLR ETW */
|
||||
|
@ -204,12 +214,12 @@ struct ProfilingScanContext;
|
|||
#include <evntrace.h>
|
||||
#include <evntprov.h>
|
||||
#endif //!FEATURE_REDHAWK
|
||||
#endif //!defined(FEATURE_PAL)
|
||||
#endif //!defined(HOST_UNIX)
|
||||
|
||||
|
||||
#else // FEATURE_EVENT_TRACE
|
||||
|
||||
#include "etmdummy.h"
|
||||
#include "../gc/env/etmdummy.h"
|
||||
#endif // FEATURE_EVENT_TRACE
|
||||
|
||||
#ifndef FEATURE_REDHAWK
|
||||
|
@ -221,9 +231,19 @@ struct ProfilingScanContext;
|
|||
extern UINT32 g_nClrInstanceId;
|
||||
|
||||
#define GetClrInstanceId() (static_cast<UINT16>(g_nClrInstanceId))
|
||||
#if defined(FEATURE_PAL) && (defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT))
|
||||
#if defined(HOST_UNIX) && (defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT))
|
||||
#define KEYWORDZERO 0x0
|
||||
|
||||
#define DEF_LTTNG_KEYWORD_ENABLED 1
|
||||
#ifdef FEATURE_EVENT_TRACE
|
||||
#include "clrproviders.h"
|
||||
#endif // FEATURE_EVENT_TRACE
|
||||
#include "clrconfig.h"
|
||||
|
||||
#endif // defined(HOST_UNIX) && (defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT))
|
||||
|
||||
#if defined(FEATURE_PERFTRACING) || defined(FEATURE_EVENTSOURCE_XPLAT)
|
||||
|
||||
/***************************************/
|
||||
/* Tracing levels supported by CLR ETW */
|
||||
/***************************************/
|
||||
|
@ -234,10 +254,6 @@ extern UINT32 g_nClrInstanceId;
|
|||
#define TRACE_LEVEL_INFORMATION 4 // Includes non-error cases such as Entry-Exit
|
||||
#define TRACE_LEVEL_VERBOSE 5 // Detailed traces from intermediate steps
|
||||
|
||||
#define DEF_LTTNG_KEYWORD_ENABLED 1
|
||||
#include "clrproviders.h"
|
||||
#include "clrconfig.h"
|
||||
|
||||
class XplatEventLoggerConfiguration
|
||||
{
|
||||
public:
|
||||
|
@ -271,7 +287,11 @@ public:
|
|||
_enabledKeywords = ParseEnabledKeywordsMask(keywordsComponent);
|
||||
|
||||
auto levelComponent = GetNextComponentString(keywordsComponent.End + 1);
|
||||
_level = ParseEnabledKeywordsMask(levelComponent);
|
||||
_level = ParseLevel(levelComponent);
|
||||
|
||||
auto argumentComponent = GetNextComponentString(levelComponent.End + 1);
|
||||
_argument = ParseArgument(argumentComponent);
|
||||
|
||||
_isValid = true;
|
||||
}
|
||||
|
||||
|
@ -285,16 +305,21 @@ public:
|
|||
return _provider;
|
||||
}
|
||||
|
||||
ULONGLONG GetEnabledKeywordsMask() const
|
||||
uint64_t GetEnabledKeywordsMask() const
|
||||
{
|
||||
return _enabledKeywords;
|
||||
}
|
||||
|
||||
UINT GetLevel() const
|
||||
uint32_t GetLevel() const
|
||||
{
|
||||
return _level;
|
||||
}
|
||||
|
||||
LPCWSTR GetArgument() const
|
||||
{
|
||||
return _argument;
|
||||
}
|
||||
|
||||
private:
|
||||
struct ComponentSpan
|
||||
{
|
||||
|
@ -310,9 +335,8 @@ private:
|
|||
|
||||
ComponentSpan GetNextComponentString(LPCWSTR start) const
|
||||
{
|
||||
static WCHAR ComponentDelimiter = W(':');
|
||||
|
||||
auto end = wcschr(start, ComponentDelimiter);
|
||||
const WCHAR ComponentDelimiter = W(':');
|
||||
const WCHAR * end = wcschr(start, ComponentDelimiter);
|
||||
if (end == nullptr)
|
||||
{
|
||||
end = start + wcslen(start);
|
||||
|
@ -321,22 +345,22 @@ private:
|
|||
return ComponentSpan(start, end);
|
||||
}
|
||||
|
||||
LPCWSTR ParseProviderName(ComponentSpan const & component) const
|
||||
NewArrayHolder<WCHAR> ParseProviderName(ComponentSpan const & component) const
|
||||
{
|
||||
auto providerName = (WCHAR*)nullptr;
|
||||
NewArrayHolder<WCHAR> providerName = nullptr;
|
||||
if ((component.End - component.Start) != 0)
|
||||
{
|
||||
auto const length = component.End - component.Start;
|
||||
providerName = new WCHAR[length + 1];
|
||||
memset(providerName, '\0', (length + 1) * sizeof(WCHAR));
|
||||
wcsncpy(providerName, component.Start, length);
|
||||
providerName[length] = '\0';
|
||||
}
|
||||
return providerName;
|
||||
}
|
||||
|
||||
ULONGLONG ParseEnabledKeywordsMask(ComponentSpan const & component) const
|
||||
uint64_t ParseEnabledKeywordsMask(ComponentSpan const & component) const
|
||||
{
|
||||
auto enabledKeywordsMask = (ULONGLONG)(-1);
|
||||
auto enabledKeywordsMask = (uint64_t)(-1);
|
||||
if ((component.End - component.Start) != 0)
|
||||
{
|
||||
enabledKeywordsMask = _wcstoui64(component.Start, nullptr, 16);
|
||||
|
@ -344,9 +368,9 @@ private:
|
|||
return enabledKeywordsMask;
|
||||
}
|
||||
|
||||
UINT ParseLevel(ComponentSpan const & component) const
|
||||
uint32_t ParseLevel(ComponentSpan const & component) const
|
||||
{
|
||||
auto level = TRACE_LEVEL_VERBOSE;
|
||||
int level = TRACE_LEVEL_VERBOSE; // Verbose
|
||||
if ((component.End - component.Start) != 0)
|
||||
{
|
||||
level = _wtoi(component.Start);
|
||||
|
@ -354,11 +378,28 @@ private:
|
|||
return level;
|
||||
}
|
||||
|
||||
LPCWSTR _provider;
|
||||
ULONGLONG _enabledKeywords;
|
||||
UINT _level;
|
||||
NewArrayHolder<WCHAR> ParseArgument(ComponentSpan const & component) const
|
||||
{
|
||||
NewArrayHolder<WCHAR> argument = nullptr;
|
||||
if ((component.End - component.Start) != 0)
|
||||
{
|
||||
auto const length = component.End - component.Start;
|
||||
argument = new WCHAR[length + 1];
|
||||
wcsncpy(argument, component.Start, length);
|
||||
argument[length] = '\0';
|
||||
}
|
||||
return argument;
|
||||
}
|
||||
|
||||
NewArrayHolder<WCHAR> _provider;
|
||||
uint64_t _enabledKeywords;
|
||||
uint32_t _level;
|
||||
NewArrayHolder<WCHAR> _argument;
|
||||
bool _isValid;
|
||||
};
|
||||
#endif // defined(FEATURE_PERFTRACING) || defined(FEATURE_EVENTSOURCE_XPLAT)
|
||||
|
||||
#if defined(HOST_UNIX) && (defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT))
|
||||
|
||||
class XplatEventLoggerController
|
||||
{
|
||||
|
@ -378,9 +419,10 @@ public:
|
|||
{
|
||||
ActivateAllKeywordsOfAllProviders();
|
||||
}
|
||||
#ifdef FEATURE_EVENT_TRACE
|
||||
else
|
||||
{
|
||||
auto provider = GetProvider(providerName);
|
||||
LTTNG_TRACE_CONTEXT *provider = GetProvider(providerName);
|
||||
if (provider == nullptr)
|
||||
{
|
||||
return;
|
||||
|
@ -389,20 +431,23 @@ public:
|
|||
provider->Level = level;
|
||||
provider->IsEnabled = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void ActivateAllKeywordsOfAllProviders()
|
||||
{
|
||||
#ifdef FEATURE_EVENT_TRACE
|
||||
for (LTTNG_TRACE_CONTEXT * const provider : ALL_LTTNG_PROVIDERS_CONTEXT)
|
||||
{
|
||||
provider->EnabledKeywordsBitmask = (ULONGLONG)(-1);
|
||||
provider->Level = TRACE_LEVEL_VERBOSE;
|
||||
provider->IsEnabled = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
#ifdef FEATURE_EVENT_TRACE
|
||||
static LTTNG_TRACE_CONTEXT * const GetProvider(LPCWSTR providerName)
|
||||
{
|
||||
auto length = wcslen(providerName);
|
||||
|
@ -415,6 +460,7 @@ private:
|
|||
}
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
class XplatEventLogger
|
||||
|
@ -427,6 +473,7 @@ public:
|
|||
return configEventLogging.val(CLRConfig::EXTERNAL_EnableEventLog);
|
||||
}
|
||||
|
||||
#ifdef FEATURE_EVENT_TRACE
|
||||
inline static bool IsProviderEnabled(DOTNET_TRACE_CONTEXT providerCtx)
|
||||
{
|
||||
return providerCtx.LttngProvider->IsEnabled;
|
||||
|
@ -448,7 +495,7 @@ public:
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
This method is where COMPlus_LTTngConfig environment variable is parsed and is registered with the runtime provider
|
||||
|
@ -479,7 +526,7 @@ public:
|
|||
}
|
||||
while (configToParse != nullptr)
|
||||
{
|
||||
static WCHAR comma = W(',');
|
||||
const WCHAR comma = W(',');
|
||||
auto end = wcschr(configToParse, comma);
|
||||
configuration.Parse(configToParse);
|
||||
XplatEventLoggerController::UpdateProviderContext(configuration);
|
||||
|
@ -493,7 +540,7 @@ public:
|
|||
};
|
||||
|
||||
|
||||
#endif // defined(FEATURE_PAL) && (defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT))
|
||||
#endif // defined(HOST_UNIX) && (defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT))
|
||||
|
||||
#if defined(FEATURE_EVENT_TRACE)
|
||||
|
||||
|
@ -535,7 +582,7 @@ VOID EventPipeEtwCallbackDotNETRuntimePrivate(
|
|||
_In_opt_ EventFilterDescriptor* FilterData,
|
||||
_Inout_opt_ PVOID CallbackContext);
|
||||
|
||||
#ifndef FEATURE_PAL
|
||||
#ifndef HOST_UNIX
|
||||
// Callback and stack support
|
||||
#if !defined(DONOT_DEFINE_ETW_CALLBACK) && !defined(DACCESS_COMPILE)
|
||||
extern "C" {
|
||||
|
@ -558,7 +605,7 @@ extern "C" {
|
|||
// User defined callback
|
||||
//
|
||||
#define MCGEN_PRIVATE_ENABLE_CALLBACK(RequestCode, Context, InOutBufferSize, Buffer) \
|
||||
EtwCallback(NULL /* SourceId */, (RequestCode==WMI_ENABLE_EVENTS) ? EVENT_CONTROL_CODE_ENABLE_PROVIDER : EVENT_CONTROL_CODE_DISABLE_PROVIDER, 0 /* Level */, 0 /* MatchAnyKeyword */, 0 /* MatchAllKeyword */, NULL /* FilterData */, Context)
|
||||
EtwCallback(NULL /* SourceId */, ((RequestCode)==WMI_ENABLE_EVENTS) ? EVENT_CONTROL_CODE_ENABLE_PROVIDER : EVENT_CONTROL_CODE_DISABLE_PROVIDER, 0 /* Level */, 0 /* MatchAnyKeyword */, 0 /* MatchAllKeyword */, NULL /* FilterData */, Context)
|
||||
|
||||
//
|
||||
// User defined callback2
|
||||
|
@ -585,7 +632,7 @@ extern "C" {
|
|||
EtwCallout(RegHandle, Descriptor, NumberOfArguments, EventData)
|
||||
#endif //!DONOT_DEFINE_ETW_CALLBACK && !DACCESS_COMPILE
|
||||
|
||||
#endif //!FEATURE_PAL
|
||||
#endif //!HOST_UNIX
|
||||
#include "clretwallmain.h"
|
||||
|
||||
#if defined(FEATURE_PERFTRACING)
|
||||
|
@ -643,7 +690,7 @@ class Thread;
|
|||
namespace ETW
|
||||
{
|
||||
// Class to wrap the ETW infrastructure logic
|
||||
#if !defined(FEATURE_PAL)
|
||||
#if !defined(HOST_UNIX)
|
||||
class CEtwTracer
|
||||
{
|
||||
#if defined(FEATURE_EVENT_TRACE)
|
||||
|
@ -668,7 +715,7 @@ namespace ETW
|
|||
}
|
||||
#endif // FEATURE_EVENT_TRACE
|
||||
};
|
||||
#endif // !defined(FEATURE_PAL)
|
||||
#endif // !defined(HOST_UNIX)
|
||||
|
||||
class LoaderLog;
|
||||
class MethodLog;
|
||||
|
@ -739,7 +786,7 @@ namespace ETW
|
|||
|
||||
class SamplingLog
|
||||
{
|
||||
#if defined(FEATURE_EVENT_TRACE) && !defined(FEATURE_PAL)
|
||||
#if defined(FEATURE_EVENT_TRACE) && !defined(HOST_UNIX)
|
||||
public:
|
||||
typedef enum _EtwStackWalkStatus
|
||||
{
|
||||
|
@ -756,7 +803,7 @@ namespace ETW
|
|||
public:
|
||||
static ULONG SendStackTrace(MCGEN_TRACE_CONTEXT TraceContext, PCEVENT_DESCRIPTOR Descriptor, LPCGUID EventGuid);
|
||||
EtwStackWalkStatus GetCurrentThreadsCallStack(UINT32 *frameCount, PVOID **Stack);
|
||||
#endif // FEATURE_EVENT_TRACE && !defined(FEATURE_PAL)
|
||||
#endif // FEATURE_EVENT_TRACE && !defined(HOST_UNIX)
|
||||
};
|
||||
|
||||
// Class to wrap all Loader logic for ETW
|
||||
|
@ -846,6 +893,7 @@ namespace ETW
|
|||
static VOID SendMethodILToNativeMapEvent(MethodDesc * pMethodDesc, DWORD dwEventOptions, PCODE pNativeCodeStartAddress, ReJITID ilCodeId);
|
||||
static VOID SendMethodEvent(MethodDesc *pMethodDesc, DWORD dwEventOptions, BOOL bIsJit, SString *namespaceOrClassName=NULL, SString *methodName=NULL, SString *methodSignature=NULL, PCODE pNativeCodeStartAddress = 0, PrepareCodeConfig *pConfig = NULL);
|
||||
static VOID SendHelperEvent(ULONGLONG ullHelperStartAddress, ULONG ulHelperSize, LPCWSTR pHelperName);
|
||||
static VOID SendMethodDetailsEvent(MethodDesc *pMethodDesc);
|
||||
public:
|
||||
typedef union _MethodStructs
|
||||
{
|
||||
|
@ -1193,6 +1241,10 @@ namespace ETW
|
|||
#else
|
||||
static bool IsEnabled() { return false; }
|
||||
static void SendSettings() {}
|
||||
static void SendPause() {}
|
||||
static void SendResume(UINT32 newMethodCount) {}
|
||||
static void SendBackgroundJitStart(UINT32 pendingMethodCount) {}
|
||||
static void SendBackgroundJitStop(UINT32 pendingMethodCount, UINT32 jittedMethodCount) {}
|
||||
#endif
|
||||
|
||||
DISABLE_CONSTRUCT_COPY(Runtime);
|
||||
|
@ -1235,12 +1287,17 @@ namespace ETW
|
|||
#define ETWLoaderStaticLoad 0 // Static reference load
|
||||
#define ETWLoaderDynamicLoad 1 // Dynamic assembly load
|
||||
|
||||
#if defined(FEATURE_EVENT_TRACE) && !defined(FEATURE_PAL)
|
||||
#if defined(FEATURE_EVENT_TRACE) && !defined(HOST_UNIX)
|
||||
//
|
||||
// The ONE and only ONE global instantiation of this class
|
||||
//
|
||||
extern ETW::CEtwTracer * g_pEtwTracer;
|
||||
|
||||
EXTERN_C DOTNET_TRACE_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context;
|
||||
EXTERN_C DOTNET_TRACE_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context;
|
||||
EXTERN_C DOTNET_TRACE_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context;
|
||||
EXTERN_C DOTNET_TRACE_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_STRESS_PROVIDER_DOTNET_Context;
|
||||
|
||||
//
|
||||
// Special Handling of Startup events
|
||||
//
|
||||
|
@ -1397,18 +1454,18 @@ typedef struct _MCGEN_TRACE_BUFFER {
|
|||
return Result;
|
||||
};
|
||||
|
||||
#endif // FEATURE_EVENT_TRACE && !defined(FEATURE_PAL)
|
||||
#endif // FEATURE_EVENT_TRACE && !defined(HOST_UNIX)
|
||||
#ifdef FEATURE_EVENT_TRACE
|
||||
#ifdef _TARGET_X86_
|
||||
#ifdef TARGET_X86
|
||||
struct CallStackFrame
|
||||
{
|
||||
struct CallStackFrame* m_Next;
|
||||
SIZE_T m_ReturnAddress;
|
||||
};
|
||||
#endif // _TARGET_X86_
|
||||
#endif // TARGET_X86
|
||||
#endif // FEATURE_EVENT_TRACE
|
||||
|
||||
#if defined(FEATURE_EVENT_TRACE) && !defined(FEATURE_PAL)
|
||||
#if defined(FEATURE_EVENT_TRACE) && !defined(HOST_UNIX)
|
||||
FORCEINLINE
|
||||
BOOLEAN __stdcall
|
||||
McGenEventProviderEnabled(
|
||||
|
@ -1443,7 +1500,7 @@ McGenEventProviderEnabled(
|
|||
}
|
||||
return FALSE;
|
||||
}
|
||||
#endif // FEATURE_EVENT_TRACE && !defined(FEATURE_PAL)
|
||||
#endif // FEATURE_EVENT_TRACE && !defined(HOST_UNIX)
|
||||
|
||||
|
||||
#endif // !FEATURE_REDHAWK
|
||||
|
|
|
@ -6,15 +6,15 @@
|
|||
#if !defined(_EX_H_)
|
||||
#define _EX_H_
|
||||
|
||||
#ifdef FEATURE_PAL
|
||||
#ifdef HOST_UNIX
|
||||
#define EX_TRY_HOLDER \
|
||||
HardwareExceptionHolder \
|
||||
NativeExceptionHolderCatchAll __exceptionHolder; \
|
||||
__exceptionHolder.Push(); \
|
||||
|
||||
#else // FEATURE_PAL
|
||||
#else // HOST_UNIX
|
||||
#define EX_TRY_HOLDER
|
||||
#endif // FEATURE_PAL
|
||||
#endif // HOST_UNIX
|
||||
|
||||
#include "sstring.h"
|
||||
#include "crtwrap.h"
|
||||
|
@ -29,7 +29,7 @@
|
|||
#endif
|
||||
|
||||
|
||||
//===========================================================================================
|
||||
//===========================================================================================
|
||||
// These abstractions hide the difference between legacy desktop CLR's (that don't support
|
||||
// side-by-side-inproc and rely on a fixed SEH code to identify managed exceptions) and
|
||||
// new CLR's that support side-by-side inproc.
|
||||
|
@ -39,7 +39,7 @@
|
|||
// the module handle of the owning CLR is stored in ExceptionRecord.ExceptionInformation[4].
|
||||
//
|
||||
// (Note: all existing SEH's use either only slot [0] or no slots at all. We are leaving
|
||||
// slots [1] thru [3] open for future expansion.)
|
||||
// slots [1] thru [3] open for future expansion.)
|
||||
//===========================================================================================
|
||||
|
||||
// Is this exception code one of the special CLR-specific SEH codes that participate in the
|
||||
|
@ -76,7 +76,7 @@ DWORD MarkAsThrownByUs(/*out*/ ULONG_PTR exceptionArgs[INSTANCE_TAGGED_SEH_PARAM
|
|||
// *and* whether it was tagged by the calling instance of the CLR.
|
||||
//
|
||||
// If this is a non-tagged-SEH-enabled build, it is blindly assumed to be tagged by the
|
||||
// calling instance of the CLR.
|
||||
// calling instance of the CLR.
|
||||
BOOL WasThrownByUs(const EXCEPTION_RECORD *pcER, DWORD dwExceptionCode);
|
||||
|
||||
|
||||
|
@ -87,8 +87,8 @@ BOOL IsComPlusException(const EXCEPTION_RECORD *pcER);
|
|||
VOID RaiseComPlusException();
|
||||
|
||||
|
||||
//===========================================================================================
|
||||
//===========================================================================================
|
||||
//===========================================================================================
|
||||
//===========================================================================================
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------
|
||||
|
@ -112,7 +112,7 @@ void GenerateTopLevelHRExceptionMessage(HRESULT hresult, SString &result);
|
|||
// We save current ExceptionPointers using VectoredExceptionHandler. The save data is only valid
|
||||
// duing exception handling. GetCurrentExceptionPointers returns the saved data.
|
||||
// ---------------------------------------------------------------------------
|
||||
void GetCurrentExceptionPointers(PEXCEPTION_POINTERS pExceptionInfo);
|
||||
void GetCurrentExceptionPointers(PEXCEPTION_POINTERS pExceptionInfo DEBUG_ARG(bool checkExceptionRecordLocation));
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// We save current ExceptionPointers using VectoredExceptionHandler. The save data is only valid
|
||||
|
@ -254,7 +254,7 @@ class Exception
|
|||
// Preallocated exceptions: If there is a preallocated instance of some
|
||||
// subclass of Exception, override this function and return a correct
|
||||
// value. The default implementation returns constant FALSE
|
||||
virtual BOOL IsPreallocatedException();
|
||||
virtual BOOL IsPreallocatedException();
|
||||
BOOL IsPreallocatedOOMException();
|
||||
|
||||
static void Delete(Exception* pvMemory);
|
||||
|
@ -264,16 +264,16 @@ protected:
|
|||
// This virtual method must be implemented by any non abstract Exception
|
||||
// derived class. It must allocate a NEW exception of the identical type and
|
||||
// copy all the relevant fields from the current exception to the new one.
|
||||
// It is NOT responsible however for copying the inner exception. This
|
||||
// It is NOT responsible however for copying the inner exception. This
|
||||
// will be handled by the base Exception class.
|
||||
virtual Exception *CloneHelper();
|
||||
virtual Exception *CloneHelper();
|
||||
|
||||
// This virtual method must be implemented by Exception subclasses whose
|
||||
// DomainBoundClone behavior is different than their normal clone behavior.
|
||||
// DomainBoundClone behavior is different than their normal clone behavior.
|
||||
// It must allocate a NEW exception of the identical type and
|
||||
// copy all the relevant fields from the current exception to the new one.
|
||||
// It is NOT responsible however for copying the inner exception. This
|
||||
// will be handled by the base Exception class.
|
||||
// It is NOT responsible however for copying the inner exception. This
|
||||
// will be handled by the base Exception class.
|
||||
virtual Exception *DomainBoundCloneHelper() { return CloneHelper(); }
|
||||
};
|
||||
|
||||
|
@ -295,16 +295,16 @@ typedef ExceptionHolderTemplate<Exception> ExceptionHolder;
|
|||
// class ExceptionHolder
|
||||
//
|
||||
// This is a very lightweight holder class for use inside the EX_TRY family
|
||||
// of macros. It is based on the standard Holder classes, but has been
|
||||
// of macros. It is based on the standard Holder classes, but has been
|
||||
// highly specialized for this one function, so that extra code can be
|
||||
// removed, and the resulting code can be simple enough for all of the
|
||||
// non-exceptional-case code to be inlined.
|
||||
class ExceptionHolder
|
||||
{
|
||||
private:
|
||||
Exception *m_value;
|
||||
Exception *m_value;
|
||||
BOOL m_acquired;
|
||||
|
||||
|
||||
public:
|
||||
FORCEINLINE ExceptionHolder(Exception *pException = NULL, BOOL take = TRUE)
|
||||
: m_value(pException)
|
||||
|
@ -321,7 +321,7 @@ public:
|
|||
}
|
||||
|
||||
Exception* operator->() { return m_value; }
|
||||
|
||||
|
||||
void operator=(Exception *p)
|
||||
{
|
||||
Release();
|
||||
|
@ -330,11 +330,11 @@ public:
|
|||
}
|
||||
|
||||
BOOL IsNull() { return m_value == NULL; }
|
||||
|
||||
operator Exception*() { return m_value; }
|
||||
|
||||
|
||||
operator Exception*() { return m_value; }
|
||||
|
||||
Exception* GetValue() { return m_value; }
|
||||
|
||||
|
||||
void SuppressRelease() { m_acquired = FALSE; }
|
||||
|
||||
private:
|
||||
|
@ -359,7 +359,7 @@ private:
|
|||
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// HRException class. Implements exception API for exceptions generated from HRESULTs
|
||||
|
@ -385,18 +385,18 @@ class HRException : public Exception
|
|||
// Virtual overrides
|
||||
HRESULT GetHR();
|
||||
|
||||
BOOL IsSameInstanceType(Exception *pException)
|
||||
BOOL IsSameInstanceType(Exception *pException)
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
WRAPPER_NO_CONTRACT;
|
||||
return pException->GetInstanceType() == GetType() && pException->GetHR() == m_hr;
|
||||
}
|
||||
|
||||
protected:
|
||||
protected:
|
||||
virtual Exception *CloneHelper()
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
return new HRException(m_hr);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@ -418,12 +418,12 @@ class HRMsgException : public HRException
|
|||
// Virtual overrides
|
||||
void GetMessage(SString &s);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
virtual Exception *CloneHelper()
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
return new HRMsgException(m_hr, m_msg);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@ -447,12 +447,12 @@ class COMException : public HRException
|
|||
IErrorInfo *GetErrorInfo();
|
||||
void GetMessage(SString &result);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
virtual Exception *CloneHelper()
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
return new COMException(m_hr, m_pErrorInfo);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@ -476,9 +476,9 @@ class SEHException : public Exception
|
|||
virtual int GetInstanceType() { LIMITED_METHOD_CONTRACT; return c_type; }
|
||||
virtual BOOL IsType(int type) { WRAPPER_NO_CONTRACT; return type == c_type || Exception::IsType(type); }
|
||||
|
||||
BOOL IsSameInstanceType(Exception *pException)
|
||||
BOOL IsSameInstanceType(Exception *pException)
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
WRAPPER_NO_CONTRACT;
|
||||
return pException->GetInstanceType() == GetType() && pException->GetHR() == GetHR();
|
||||
}
|
||||
|
||||
|
@ -487,12 +487,12 @@ class SEHException : public Exception
|
|||
IErrorInfo *GetErrorInfo();
|
||||
void GetMessage(SString &result);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
virtual Exception *CloneHelper()
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
return new SEHException(&m_exception);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@ -520,38 +520,38 @@ class DelegatingException : public Exception
|
|||
virtual int GetInstanceType() { LIMITED_METHOD_CONTRACT; return c_type; }
|
||||
virtual BOOL IsType(int type) { WRAPPER_NO_CONTRACT; return type == c_type || Exception::IsType(type); }
|
||||
|
||||
BOOL IsSameInstanceType(Exception *pException)
|
||||
BOOL IsSameInstanceType(Exception *pException)
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
WRAPPER_NO_CONTRACT;
|
||||
return pException->GetInstanceType() == GetType() && pException->GetHR() == GetHR();
|
||||
}
|
||||
|
||||
// Virtual overrides
|
||||
virtual BOOL IsDomainBound() {return Exception::IsDomainBound() ||(m_delegatedException!=NULL && m_delegatedException->IsDomainBound());} ;
|
||||
virtual BOOL IsDomainBound() {return Exception::IsDomainBound() ||(m_delegatedException!=NULL && m_delegatedException->IsDomainBound());} ;
|
||||
HRESULT GetHR();
|
||||
IErrorInfo *GetErrorInfo();
|
||||
void GetMessage(SString &result);
|
||||
virtual Exception *Clone();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
virtual Exception *CloneHelper()
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
return new DelegatingException();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// class OutOfMemoryException
|
||||
//
|
||||
// While there could be any number of instances of this class, there is one
|
||||
// special instance, the pre-allocated OOM exception. Storage for that
|
||||
// special instance, the pre-allocated OOM exception. Storage for that
|
||||
// instance is allocated in the image, so we can always obtain it, even
|
||||
// in low memory situations.
|
||||
// Note that, in fact, there is only one instance.
|
||||
//------------------------------------------------------------------------------
|
||||
class OutOfMemoryException : public Exception
|
||||
{
|
||||
{
|
||||
private:
|
||||
static const int c_type = 0x4F4F4D20; // 'OOM '
|
||||
BOOL bIsPreallocated;
|
||||
|
@ -564,10 +564,10 @@ class OutOfMemoryException : public Exception
|
|||
static int GetType() {LIMITED_METHOD_CONTRACT; return c_type; }
|
||||
virtual int GetInstanceType() { LIMITED_METHOD_CONTRACT; return c_type; }
|
||||
BOOL IsType(int type) { WRAPPER_NO_CONTRACT; return type == c_type || Exception::IsType(type); }
|
||||
|
||||
BOOL IsSameInstanceType(Exception *pException)
|
||||
|
||||
BOOL IsSameInstanceType(Exception *pException)
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
WRAPPER_NO_CONTRACT;
|
||||
return pException->GetInstanceType() == GetType();
|
||||
}
|
||||
|
||||
|
@ -575,7 +575,7 @@ class OutOfMemoryException : public Exception
|
|||
void GetMessage(SString &result) { WRAPPER_NO_CONTRACT; result.SetASCII("Out Of Memory"); }
|
||||
|
||||
virtual Exception *Clone();
|
||||
|
||||
|
||||
virtual BOOL IsPreallocatedException() { return bIsPreallocated; }
|
||||
};
|
||||
|
||||
|
@ -609,9 +609,9 @@ public:
|
|||
|
||||
#ifdef ENABLE_CONTRACTS_IMPL
|
||||
// Restore the original OkayToThrow value since we're leaving the try block.
|
||||
|
||||
|
||||
m_pClrDebugState->SetOkToThrow( m_oldOkayToThrowValue );
|
||||
#endif // ENABLE_CONTRACTS_IMPL
|
||||
#endif // ENABLE_CONTRACTS_IMPL
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -621,7 +621,7 @@ protected:
|
|||
private:
|
||||
BOOL m_oldOkayToThrowValue;
|
||||
ClrDebugState *m_pClrDebugState;
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@ -649,15 +649,15 @@ private:
|
|||
// 1. They catch all exceptions, both C++ and SEH exceptions.
|
||||
// 2. They catch only C++ exceptions.
|
||||
//
|
||||
// Which way they are defined depends on what sort of handling of SEH
|
||||
// Which way they are defined depends on what sort of handling of SEH
|
||||
// exceptions, like AV's, you wish to have in your DLL. In general we
|
||||
// do not typically want to catch and swallow AV's.
|
||||
//
|
||||
// By default, the macros catch all exceptions. This is how they work when
|
||||
// compiled into the primary runtime DLL (clr.dll). This is reasonable for
|
||||
// the CLR becuase it needs to also catch managed exceptions, which are SEH
|
||||
// exceptions, and because that DLL also includes a vectored exception
|
||||
// handler that will take down the process on any AV within clr.dll.
|
||||
// exceptions, and because that DLL also includes a vectored exception
|
||||
// handler that will take down the process on any AV within clr.dll.
|
||||
//
|
||||
// But for uses of these macros outside of the CLR DLL there are other
|
||||
// possibilities. If a DLL only uses facilities in Utilcode that throw the
|
||||
|
@ -733,7 +733,7 @@ private:
|
|||
// 4) RethrowCorruptingExceptionsEx - same as (2) but rethrow of CE can be controlled via a condition.
|
||||
//
|
||||
// By default, if a CE is encountered when one of the above policies are applied, the runtime will
|
||||
// ensure that the CE propagates up the stack and not get swallowed unless the developer chooses to override the behaviour.
|
||||
// ensure that the CE propagates up the stack and not get swallowed unless the developer chooses to override the behaviour.
|
||||
// This can be done by using the "Ex" versions above that take a conditional which evaluates to a BOOL. In such a case,
|
||||
// the CE will *only* be rethrown if the conditional evalutes to TRUE. For examples, refer to COMToCLRWorker or
|
||||
// DispatchInfo::InvokeMember implementations.
|
||||
|
@ -747,7 +747,7 @@ private:
|
|||
//
|
||||
// We also check the global override flag incase it has been set to force pre-V4 beahviour. "0" implies it has not
|
||||
// been overriden.
|
||||
#define SET_CE_RETHROW_FLAG_FOR_EX_CATCH(expr) (((expr == TRUE) && \
|
||||
#define SET_CE_RETHROW_FLAG_FOR_EX_CATCH(expr) ((((expr) == TRUE) && \
|
||||
(CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_legacyCorruptedStateExceptionsPolicy) == 0) && \
|
||||
IsProcessCorruptedStateException(GetCurrentExceptionCode(), FALSE)))
|
||||
|
||||
|
@ -841,8 +841,8 @@ Exception *ExThrowWithInnerHelper(Exception *inner);
|
|||
// This macro will set the m_innerException into the newly created exception
|
||||
// The passed in _type has to be derived from CLRException. You cannot put OOM
|
||||
// as the inner exception. If we are throwing in OOM case, allocate more memory (this macro will clone)
|
||||
// does not make any sense.
|
||||
//
|
||||
// does not make any sense.
|
||||
//
|
||||
#define EX_THROW_WITH_INNER(_type, _args, _inner) \
|
||||
{ \
|
||||
FAULT_NOT_FATAL(); \
|
||||
|
@ -893,7 +893,7 @@ Exception *ExThrowWithInnerHelper(Exception *inner);
|
|||
DEBUG_ASSURE_NO_RETURN_BEGIN(EX_TRY) \
|
||||
EX_TRY_HOLDER \
|
||||
|
||||
|
||||
|
||||
#define EX_CATCH_IMPL_EX(DerivedExceptionClass) \
|
||||
DEBUG_ASSURE_NO_RETURN_END(EX_TRY) \
|
||||
} \
|
||||
|
@ -967,11 +967,11 @@ Exception *ExThrowWithInnerHelper(Exception *inner);
|
|||
|
||||
|
||||
// Here we finally define the EX_CATCH* macros that will be used throughout the system.
|
||||
// These can catch C++ and SEH exceptions, or just C++ exceptions.
|
||||
// These can catch C++ and SEH exceptions, or just C++ exceptions.
|
||||
// See code:NO_HOST_CPP_EH_ONLY for more details.
|
||||
//
|
||||
// Note: we make it illegal to use forms that are redundant with the basic EX_CATCH
|
||||
// version. I.e., in the C++ & SEH version, EX_CATCH_CPP_AND_SEH is the same as EX_CATCH.
|
||||
// version. I.e., in the C++ & SEH version, EX_CATCH_CPP_AND_SEH is the same as EX_CATCH.
|
||||
// Likewise, in the C++ only version, EX_CATCH_CPP_ONLY is redundant with EX_CATCH.
|
||||
|
||||
#ifndef NO_HOST_CPP_EH_ONLY
|
||||
|
@ -986,8 +986,8 @@ Exception *ExThrowWithInnerHelper(Exception *inner);
|
|||
#define EX_CATCH_CPP_ONLY Dont_Use_EX_CATCH_CPP_ONLY
|
||||
#define EX_CATCH_CPP_AND_SEH EX_CATCH_IMPL
|
||||
|
||||
// Note: at this time we don't have a use case for EX_CATCH_EX, and we do not have
|
||||
// the C++-only version of the implementation available. Thus we disallow its use at this time.
|
||||
// Note: at this time we don't have a use case for EX_CATCH_EX, and we do not have
|
||||
// the C++-only version of the implementation available. Thus we disallow its use at this time.
|
||||
// If a real use case arises then we should go ahead and enable this.
|
||||
#define EX_CATCH_EX Dont_Use_EX_CATCH_EX
|
||||
#endif
|
||||
|
@ -1002,7 +1002,7 @@ Exception *ExThrowWithInnerHelper(Exception *inner);
|
|||
} \
|
||||
|
||||
|
||||
// "terminalexceptionpolicy" must be one of "RethrowTerminalExceptions",
|
||||
// "terminalexceptionpolicy" must be one of "RethrowTerminalExceptions",
|
||||
// "RethrowTransientExceptions", or "SwallowAllExceptions"
|
||||
|
||||
#define EX_END_CATCH(terminalexceptionpolicy) \
|
||||
|
@ -1068,7 +1068,7 @@ Exception *ExThrowWithInnerHelper(Exception *inner);
|
|||
} \
|
||||
EX_END_CATCH(SwallowAllExceptions)
|
||||
|
||||
|
||||
|
||||
//===================================================================================
|
||||
// Macro for catching managed exception object.
|
||||
//
|
||||
|
@ -1090,7 +1090,7 @@ Exception *ExThrowWithInnerHelper(Exception *inner);
|
|||
|
||||
|
||||
#ifdef FEATURE_COMINTEROP
|
||||
|
||||
|
||||
//===================================================================================
|
||||
// Macro for defining external entrypoints such as COM interop boundaries.
|
||||
// The boundary will catch all exceptions (including terminals) and convert
|
||||
|
@ -1276,10 +1276,10 @@ inline Exception::HandlerState::HandlerState()
|
|||
|
||||
#if defined(STACK_GUARDS_DEBUG) && defined(ENABLE_CONTRACTS_IMPL)
|
||||
// If we have a debug state, use its setting for SO tolerance. The default
|
||||
// is SO-tolerant if we have no debug state. Can't probe w/o debug state and
|
||||
// is SO-tolerant if we have no debug state. Can't probe w/o debug state and
|
||||
// can't enter SO-interolant mode w/o probing.
|
||||
GetClrDebugState();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void Exception::HandlerState::CleanupTry()
|
||||
|
@ -1396,7 +1396,7 @@ inline HRESULT IfFailThrow(HRESULT hr)
|
|||
inline HRESULT IfFailThrow(HRESULT hr, SString &msg)
|
||||
{
|
||||
WRAPPER_NO_CONTRACT;
|
||||
|
||||
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ThrowHR(hr, msg);
|
||||
|
|
|
@ -19,7 +19,7 @@ class InlineFactory : public Factory<PRODUCT>
|
|||
{
|
||||
public:
|
||||
InlineFactory() : m_next(NULL), m_cProduct(0) { WRAPPER_NO_CONTRACT; }
|
||||
~InlineFactory() { WRAPPER_NO_CONTRACT; if (m_next) delete m_next; }
|
||||
~InlineFactory() { WRAPPER_NO_CONTRACT; if (m_next) delete m_next; }
|
||||
PRODUCT* Create();
|
||||
|
||||
private:
|
||||
|
@ -34,7 +34,7 @@ private:
|
|||
{
|
||||
m_next = new (nothrow) InlineFactory<PRODUCT, MAX_FACTORY_PRODUCT>();
|
||||
}
|
||||
|
||||
|
||||
return m_next;
|
||||
}
|
||||
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче