From e9a47b722de821171e69726b1bb3d85a20bec14a Mon Sep 17 00:00:00 2001 From: David Wrighton Date: Wed, 2 Dec 2020 10:02:32 -0800 Subject: [PATCH] Use jit interface thunkgen tech for more files (#45044) - Reduce the boilerplate logic when modifying the jit ee interface - 3 new files in superpmi are now autogenerated as well as 2 files in the jit directory are now autogenerated - Reduce to only having one copy of the jit-ee interface guid --- docs/project/updating-jitinterface.md | 8 +- .../superpmi/superpmi-shared/icorjitinfoimpl.h | 1591 ++++----- .../superpmi/superpmi-shim-counter/icorjitinfo.cpp | 1376 +++----- .../superpmi/superpmi-shim-simple/icorjitinfo.cpp | 1359 +++----- src/coreclr/src/inc/corinfo.h | 40 +- src/coreclr/src/inc/corjit.h | 4 +- src/coreclr/src/inc/jiteeversionguid.h | 39 + src/coreclr/src/jit/ICorJitInfo_API_names.h | 8 +- src/coreclr/src/jit/ICorJitInfo_API_wrapper.hpp | 938 +++--- .../src/tools/Common/JitInterface/CorInfoBase.cs | 12 +- .../Common/JitInterface/ThunkGenerator/Program.cs | 334 +- .../JitInterface/ThunkGenerator/ThunkInput.txt | 21 +- .../Common/JitInterface/ThunkGenerator/gen.bat | 2 +- .../Common/JitInterface/ThunkGenerator/gen.sh | 4 +- .../tools/aot/jitinterface/corinfoexception.cpp | 8 +- .../src/tools/aot/jitinterface/corinfoexception.h | 6 +- .../src/tools/aot/jitinterface/jitinterface.cpp | 2 +- .../src/tools/aot/jitinterface/jitinterface.h | 3428 +++++++++++--------- .../src/tools/aot/jitinterface/jitwrapper.cpp | 11 +- 19 files changed, 4353 insertions(+), 4838 deletions(-) create mode 100644 src/coreclr/src/inc/jiteeversionguid.h diff --git a/docs/project/updating-jitinterface.md b/docs/project/updating-jitinterface.md index b509bbf..d530412 100644 --- a/docs/project/updating-jitinterface.md +++ b/docs/project/updating-jitinterface.md @@ -10,14 +10,14 @@ The JitInterface serves two purposes: There are several components that consume the JIT outside of the runtime. Since those components don't consume the JIT using the header, changes to the JIT have to be ported manually. -The JitInterface is versioned by a GUID. Any change to JitInterface is required to update the JitInterface GUID located in corinfo.h (look for `JITEEVersionIdentifier`). Not doing so has consequences that are sometimes hard to debug. +The JitInterface is versioned by a GUID. Any change to JitInterface is required to update the JitInterface GUID located in jiteeversionguid.h (look for `JITEEVersionIdentifier`). Not doing so has consequences that are sometimes hard to debug. + +If a method was added or modified in ICorStaticInfo or ICorDynamicInfo, port the change to src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt. Functions must be in the same order in ThunkInput.txt as they exist in corinfo.h and corjit.h. Run gen.bat or gen.sh to regenerate CorInfoBase.cs, jitinterface.h, ICorJitInfo_API_names.h, ICorJitInfo_API_wrapper.hpp, superpmi-shared\icorjitinfoimpl.h, superpmi-shim-counter\icorjitinfo.cpp, and superpmi-shim-simple\icorjitinfo.cpp from ThunkInput.txt. Provide a managed implementation of the method in CorInfoImpl.cs. ## Porting JitInterface changes to crossgen2 Crossgen2 is the AOT compiler for CoreCLR. It generates native code for .NET apps ahead of time and uses the JIT to do that. Since crossgen2 is written in managed code, it doesn't consume the C++ headers and maintains a managed copy of them. Changes to JitInterface need to be ported managed code. 1. If an enum/struct was modified or added, port the change to CorInfoTypes.cs. -2. If a method was added or modified in ICorStaticInfo or ICorDynamicInfo, port the change to ThunkInput.txt. - Run gen.bat or gen.sh to regenerate CorInfoBase.cs and jitinterface.h from ThunkInput.txt. Provide a managed implementation of the method in CorInfoImpl.cs. If the managed implementation is specific to CoreCLR ReadyToRun (and doesn't apply to full AOT compilation), provide the implementation in CorInfoImpl.ReadyToRun.cs instead. -3. Update JitInterface GUID in jitwrapper.cpp. +2. If a method was added or modified in ICorStaticInfo or ICorDynamicInfo, if the managed implementation is specific to CoreCLR ReadyToRun (and doesn't apply to full AOT compilation), provide the implementation in CorInfoImpl.ReadyToRun.cs instead or CorInfoImpl.cs. diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h index 0a7e086..688afbf 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h @@ -1,7 +1,9 @@ -// -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// DO NOT EDIT THIS FILE! IT IS AUTOGENERATED +// To regenerate run the gen script in src/coreclr/src/tools/Common/JitInterface/ThunkGenerator +// and follow the instructions in docs/project/updating-jitinterface.md #ifndef _ICorJitInfoImpl #define _ICorJitInfoImpl @@ -15,1054 +17,705 @@ // interface declaration (with the "virtual" and "= 0" syntax removed). This is to make it easy to compare // against the interface declaration. -// clang-format off - -public: /**********************************************************************************/ -// -// ICorMethodInfo -// +// clang-format off /**********************************************************************************/ -// return flags (defined above, CORINFO_FLG_PUBLIC ...) -DWORD getMethodAttribs(CORINFO_METHOD_HANDLE ftn /* IN */ - ); +public: -// sets private JIT flags, which can be, retrieved using getAttrib. -void setMethodAttribs(CORINFO_METHOD_HANDLE ftn, /* IN */ - CorInfoMethodRuntimeFlags attribs /* IN */ - ); +DWORD getMethodAttribs( + CORINFO_METHOD_HANDLE ftn); + +void setMethodAttribs( + CORINFO_METHOD_HANDLE ftn, + CorInfoMethodRuntimeFlags attribs); + +void getMethodSig( + CORINFO_METHOD_HANDLE ftn, + CORINFO_SIG_INFO* sig, + CORINFO_CLASS_HANDLE memberParent); + +bool getMethodInfo( + CORINFO_METHOD_HANDLE ftn, + CORINFO_METHOD_INFO* info); + +CorInfoInline canInline( + CORINFO_METHOD_HANDLE callerHnd, + CORINFO_METHOD_HANDLE calleeHnd, + DWORD* pRestrictions); + +void reportInliningDecision( + CORINFO_METHOD_HANDLE inlinerHnd, + CORINFO_METHOD_HANDLE inlineeHnd, + CorInfoInline inlineResult, + const char* reason); + +bool canTailCall( + CORINFO_METHOD_HANDLE callerHnd, + CORINFO_METHOD_HANDLE declaredCalleeHnd, + CORINFO_METHOD_HANDLE exactCalleeHnd, + bool fIsTailPrefix); + +void reportTailCallDecision( + CORINFO_METHOD_HANDLE callerHnd, + CORINFO_METHOD_HANDLE calleeHnd, + bool fIsTailPrefix, + CorInfoTailCall tailCallResult, + const char* reason); + +void getEHinfo( + CORINFO_METHOD_HANDLE ftn, + unsigned EHnumber, + CORINFO_EH_CLAUSE* clause); + +CORINFO_CLASS_HANDLE getMethodClass( + CORINFO_METHOD_HANDLE method); + +CORINFO_MODULE_HANDLE getMethodModule( + CORINFO_METHOD_HANDLE method); + +void getMethodVTableOffset( + CORINFO_METHOD_HANDLE method, + unsigned* offsetOfIndirection, + unsigned* offsetAfterIndirection, + bool* isRelative); + +CORINFO_METHOD_HANDLE resolveVirtualMethod( + CORINFO_METHOD_HANDLE virtualMethod, + CORINFO_CLASS_HANDLE implementingClass, + CORINFO_CONTEXT_HANDLE ownerType); -// Given a method descriptor ftnHnd, extract signature information into sigInfo -// -// 'memberParent' is typically only set when verifying. It should be the -// result of calling getMemberParent. -void getMethodSig(CORINFO_METHOD_HANDLE ftn, /* IN */ - CORINFO_SIG_INFO* sig, /* OUT */ - CORINFO_CLASS_HANDLE memberParent = NULL /* IN */ - ); - -/********************************************************************* - * Note the following methods can only be used on functions known - * to be IL. This includes the method being compiled and any method - * that 'getMethodInfo' returns true for - *********************************************************************/ - -// return information about a method private to the implementation -// returns false if method is not IL, or is otherwise unavailable. -// This method is used to fetch data needed to inline functions -bool getMethodInfo(CORINFO_METHOD_HANDLE ftn, /* IN */ - CORINFO_METHOD_INFO* info /* OUT */ - ); - -// Decides if you have any limitations for inlining. If everything's OK, it will return -// INLINE_PASS and will fill out pRestrictions with a mask of restrictions the caller of this -// function must respect. If caller passes pRestrictions = NULL, if there are any restrictions -// INLINE_FAIL will be returned -// -// The callerHnd must be the immediate caller (i.e. when we have a chain of inlined calls) -// -// The inlined method need not be verified - -CorInfoInline canInline(CORINFO_METHOD_HANDLE callerHnd, /* IN */ - CORINFO_METHOD_HANDLE calleeHnd, /* IN */ - DWORD* pRestrictions /* OUT */ - ); - -// Reports whether or not a method can be inlined, and why. canInline is responsible for reporting all -// inlining results when it returns INLINE_FAIL and INLINE_NEVER. All other results are reported by the -// JIT. -void reportInliningDecision(CORINFO_METHOD_HANDLE inlinerHnd, - CORINFO_METHOD_HANDLE inlineeHnd, - CorInfoInline inlineResult, - const char* reason); - -// Returns false if the call is across security boundaries thus we cannot tailcall -// -// The callerHnd must be the immediate caller (i.e. when we have a chain of inlined calls) -bool canTailCall(CORINFO_METHOD_HANDLE callerHnd, /* IN */ - CORINFO_METHOD_HANDLE declaredCalleeHnd, /* IN */ - CORINFO_METHOD_HANDLE exactCalleeHnd, /* IN */ - bool fIsTailPrefix /* IN */ - ); - -// Reports whether or not a method can be tail called, and why. -// canTailCall is responsible for reporting all results when it returns -// false. All other results are reported by the JIT. -void reportTailCallDecision(CORINFO_METHOD_HANDLE callerHnd, - CORINFO_METHOD_HANDLE calleeHnd, - bool fIsTailPrefix, - CorInfoTailCall tailCallResult, - const char* reason); - -// get individual exception handler -void getEHinfo(CORINFO_METHOD_HANDLE ftn, /* IN */ - unsigned EHnumber, /* IN */ - CORINFO_EH_CLAUSE* clause /* OUT */ - ); - -// return class it belongs to -CORINFO_CLASS_HANDLE getMethodClass(CORINFO_METHOD_HANDLE method); - -// return module it belongs to -CORINFO_MODULE_HANDLE getMethodModule(CORINFO_METHOD_HANDLE method); - -// This function returns the offset of the specified method in the -// vtable of it's owning class or interface. -void getMethodVTableOffset(CORINFO_METHOD_HANDLE method, /* IN */ - unsigned* offsetOfIndirection, /* OUT */ - unsigned* offsetAfterIndirection,/* OUT */ - bool* isRelative /* OUT */ - ); - -// Find the virtual method in implementingClass that overrides virtualMethod. -// Return null if devirtualization is not possible. -CORINFO_METHOD_HANDLE resolveVirtualMethod(CORINFO_METHOD_HANDLE virtualMethod, - CORINFO_CLASS_HANDLE implementingClass, - CORINFO_CONTEXT_HANDLE ownerType); - -// Get the unboxed entry point for a method, if possible. CORINFO_METHOD_HANDLE getUnboxedEntry( - CORINFO_METHOD_HANDLE ftn, - bool* requiresInstMethodTableArg /* OUT */); - -// Given T, return the type of the default EqualityComparer. -// Returns null if the type can't be determined exactly. -CORINFO_CLASS_HANDLE getDefaultEqualityComparerClass(CORINFO_CLASS_HANDLE elemType); - -// 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 -// how the handle should be looked up at runtime. + CORINFO_METHOD_HANDLE ftn, + bool* requiresInstMethodTableArg); + +CORINFO_CLASS_HANDLE getDefaultEqualityComparerClass( + CORINFO_CLASS_HANDLE elemType); + void expandRawHandleIntrinsic( - CORINFO_RESOLVED_TOKEN * pResolvedToken, - CORINFO_GENERICHANDLE_RESULT * pResult); - -// If a method's attributes have (getMethodAttribs) CORINFO_FLG_INTRINSIC set, -// getIntrinsicID() returns the intrinsic ID. -// *pMustExpand tells whether or not JIT must expand the intrinsic. -CorInfoIntrinsics getIntrinsicID(CORINFO_METHOD_HANDLE method, bool* pMustExpand = NULL /* OUT */); - -// Is the given type in System.Private.Corelib and marked with IntrinsicAttribute? -bool isIntrinsicType(CORINFO_CLASS_HANDLE classHnd); - -// return the unmanaged calling convention for a PInvoke -CorInfoUnmanagedCallConv getUnmanagedCallConv(CORINFO_METHOD_HANDLE method); - -// return if any marshaling is required for PInvoke methods. Note that -// method == 0 => calli. The call site sig is only needed for the varargs or calli case -BOOL pInvokeMarshalingRequired(CORINFO_METHOD_HANDLE method, CORINFO_SIG_INFO* callSiteSig); - -// Check constraints on method type arguments (only). -// The parent class should be checked separately using satisfiesClassConstraints(parent). -BOOL satisfiesMethodConstraints(CORINFO_CLASS_HANDLE parent, // the exact parent of the method - CORINFO_METHOD_HANDLE method); - -// Given a delegate target class, a target method parent class, a target method, -// a delegate class, check if the method signature is compatible with the Invoke method of the delegate -// (under the typical instantiation of any free type variables in the memberref signatures). -BOOL isCompatibleDelegate(CORINFO_CLASS_HANDLE objCls, /* type of the delegate target, if any */ - CORINFO_CLASS_HANDLE methodParentCls, /* exact parent of the target method, if any */ - CORINFO_METHOD_HANDLE method, /* (representative) target method, if any */ - CORINFO_CLASS_HANDLE delegateCls, /* exact type of the delegate */ - BOOL* pfIsOpenDelegate /* is the delegate open */ - ); - -// load and restore the method -void methodMustBeLoadedBeforeCodeIsRun(CORINFO_METHOD_HANDLE method); - -CORINFO_METHOD_HANDLE mapMethodDeclToMethodImpl(CORINFO_METHOD_HANDLE method); - -// Returns the global cookie for the /GS unsafe buffer checks -// The cookie might be a constant value (JIT), or a handle to memory location (Ngen) -void getGSCookie(GSCookie* pCookieVal, // OUT - GSCookie** ppCookieVal // OUT - ); - -// Provide patchpoint info for the method currently being jitted. + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_GENERICHANDLE_RESULT* pResult); + +CorInfoIntrinsics getIntrinsicID( + CORINFO_METHOD_HANDLE method, + bool* pMustExpand); + +bool isIntrinsicType( + CORINFO_CLASS_HANDLE classHnd); + +CorInfoUnmanagedCallConv getUnmanagedCallConv( + CORINFO_METHOD_HANDLE method); + +BOOL pInvokeMarshalingRequired( + CORINFO_METHOD_HANDLE method, + CORINFO_SIG_INFO* callSiteSig); + +BOOL satisfiesMethodConstraints( + CORINFO_CLASS_HANDLE parent, + CORINFO_METHOD_HANDLE method); + +BOOL isCompatibleDelegate( + CORINFO_CLASS_HANDLE objCls, + CORINFO_CLASS_HANDLE methodParentCls, + CORINFO_METHOD_HANDLE method, + CORINFO_CLASS_HANDLE delegateCls, + BOOL* pfIsOpenDelegate); + +void methodMustBeLoadedBeforeCodeIsRun( + CORINFO_METHOD_HANDLE method); + +CORINFO_METHOD_HANDLE mapMethodDeclToMethodImpl( + CORINFO_METHOD_HANDLE method); + +void getGSCookie( + GSCookie* pCookieVal, + GSCookie** ppCookieVal); + void setPatchpointInfo( - PatchpointInfo* patchpointInfo - ); + PatchpointInfo* patchpointInfo); PatchpointInfo* getOSRInfo( - unsigned * ilOffset // OUT - ); + unsigned* ilOffset); -/**********************************************************************************/ -// -// ICorModuleInfo -// -/**********************************************************************************/ +void resolveToken( + CORINFO_RESOLVED_TOKEN* pResolvedToken); -// Resolve metadata token into runtime method handles. This function may not -// return normally (e.g. it may throw) if it encounters invalid metadata or other -// failures during token resolution. -void resolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN* pResolvedToken); - -// Attempt to resolve a metadata token into a runtime method handle. Returns true -// if resolution succeeded and false otherwise (e.g. if it encounters invalid metadata -// during token reoslution). This method should be used instead of `resolveToken` in -// situations that need to be resilient to invalid metadata. -bool tryResolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN* pResolvedToken); - -// Signature information about the call sig -void findSig(CORINFO_MODULE_HANDLE module, /* IN */ - unsigned sigTOK, /* IN */ - CORINFO_CONTEXT_HANDLE context, /* IN */ - CORINFO_SIG_INFO* sig /* OUT */ - ); - -// for Varargs, the signature at the call site may differ from -// the signature at the definition. Thus we need a way of -// fetching the call site information -void findCallSiteSig(CORINFO_MODULE_HANDLE module, /* IN */ - unsigned methTOK, /* IN */ - CORINFO_CONTEXT_HANDLE context, /* IN */ - CORINFO_SIG_INFO* sig /* OUT */ - ); - -CORINFO_CLASS_HANDLE getTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken /* IN */); - -// Checks if the given metadata token is valid -BOOL isValidToken(CORINFO_MODULE_HANDLE module, /* IN */ - unsigned metaTOK /* IN */ - ); - -// Checks if the given metadata token is valid StringRef -BOOL isValidStringRef(CORINFO_MODULE_HANDLE module, /* IN */ - unsigned metaTOK /* IN */ - ); - -LPCWSTR getStringLiteral(CORINFO_MODULE_HANDLE module, /* IN */ - unsigned metaTOK, /* IN */ - int* length /* OUT */ - ); +bool tryResolveToken( + CORINFO_RESOLVED_TOKEN* pResolvedToken); -/**********************************************************************************/ -// -// ICorClassInfo -// -/**********************************************************************************/ +void findSig( + CORINFO_MODULE_HANDLE module, + unsigned sigTOK, + CORINFO_CONTEXT_HANDLE context, + CORINFO_SIG_INFO* sig); -// If the value class 'cls' is isomorphic to a primitive type it will -// return that type, otherwise it will return CORINFO_TYPE_VALUECLASS -CorInfoType asCorInfoType(CORINFO_CLASS_HANDLE cls); +void findCallSiteSig( + CORINFO_MODULE_HANDLE module, + unsigned methTOK, + CORINFO_CONTEXT_HANDLE context, + CORINFO_SIG_INFO* sig); -// for completeness -const char* getClassName(CORINFO_CLASS_HANDLE cls); +CORINFO_CLASS_HANDLE getTokenTypeAsHandle( + CORINFO_RESOLVED_TOKEN* pResolvedToken); -const char* getClassNameFromMetadata(CORINFO_CLASS_HANDLE cls, const char** namespaceName); +BOOL isValidToken( + CORINFO_MODULE_HANDLE module, + unsigned metaTOK); -CORINFO_CLASS_HANDLE getTypeInstantiationArgument(CORINFO_CLASS_HANDLE cls, unsigned index); +BOOL isValidStringRef( + CORINFO_MODULE_HANDLE module, + unsigned metaTOK); -// 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 -// If fFullInst=TRUE (regardless of fNamespace and fAssembly), include namespace and assembly for any type parameters -// If fAssembly=TRUE, suffix with a comma and the full assembly qualification -// return size of representation -int appendClassName(__deref_inout_ecount(*pnBufLen) WCHAR** ppBuf, - int* pnBufLen, - CORINFO_CLASS_HANDLE cls, - BOOL fNamespace, - BOOL fFullInst, - BOOL fAssembly); - -// Quick check whether the type is a value class. Returns the same value as getClassAttribs(cls) & -// CORINFO_FLG_VALUECLASS, except faster. -BOOL isValueClass(CORINFO_CLASS_HANDLE cls); - -// Decides how the JIT should do the optimization to inline the check for -// GetTypeFromHandle(handle) == obj.GetType() (for CORINFO_INLINE_TYPECHECK_SOURCE_VTABLE) -// GetTypeFromHandle(X) == GetTypeFromHandle(Y) (for CORINFO_INLINE_TYPECHECK_SOURCE_TOKEN) -CorInfoInlineTypeCheck canInlineTypeCheck(CORINFO_CLASS_HANDLE cls, CorInfoInlineTypeCheckSource source); - -// return flags (defined above, CORINFO_FLG_PUBLIC ...) -DWORD getClassAttribs(CORINFO_CLASS_HANDLE cls); - -// 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 -// 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 -// buffers do not require GC write barriers. -BOOL isStructRequiringStackAllocRetBuf(CORINFO_CLASS_HANDLE cls); - -CORINFO_MODULE_HANDLE getClassModule(CORINFO_CLASS_HANDLE cls); - -// Returns the assembly that contains the module "mod". -CORINFO_ASSEMBLY_HANDLE getModuleAssembly(CORINFO_MODULE_HANDLE mod); - -// Returns the name of the assembly "assem". -const char* getAssemblyName(CORINFO_ASSEMBLY_HANDLE assem); - -// Allocate and delete process-lifetime objects. Should only be -// referred to from static fields, lest a leak occur. -// Note that "LongLifetimeFree" does not execute destructors, if "obj" -// is an array of a struct type with a destructor. -void* LongLifetimeMalloc(size_t sz); -void LongLifetimeFree(void* obj); - -size_t getClassModuleIdForStatics(CORINFO_CLASS_HANDLE cls, CORINFO_MODULE_HANDLE* pModule, void** ppIndirection); - -// return the number of bytes needed by an instance of the class -unsigned getClassSize(CORINFO_CLASS_HANDLE cls); - -// return the number of bytes needed by an instance of the class allocated on the heap -unsigned getHeapClassSize(CORINFO_CLASS_HANDLE cls); - -BOOL canAllocateOnStack(CORINFO_CLASS_HANDLE cls); - -unsigned getClassAlignmentRequirement(CORINFO_CLASS_HANDLE cls, BOOL fDoubleAlignHint = FALSE); - -// This is only called for Value classes. It returns a boolean array -// in representing of 'cls' from a GC perspective. The class is -// assumed to be an array of machine words -// (of length // getClassSize(cls) / sizeof(void*)), -// 'gcPtrs' is a pointer to an array of BYTEs of this length. -// getClassGClayout fills in this array so that gcPtrs[i] is set -// to one of the CorInfoGCType values which is the GC type of -// the i-th machine word of an object of type 'cls' -// returns the number of GC pointers in the array -unsigned getClassGClayout(CORINFO_CLASS_HANDLE cls, /* IN */ - BYTE* gcPtrs /* OUT */ - ); - -// returns the number of instance fields in a class -unsigned getClassNumInstanceFields(CORINFO_CLASS_HANDLE cls /* IN */ - ); - -CORINFO_FIELD_HANDLE getFieldInClass(CORINFO_CLASS_HANDLE clsHnd, INT num); - -BOOL checkMethodModifier(CORINFO_METHOD_HANDLE hMethod, LPCSTR modifier, BOOL fOptional); - -// returns the "NEW" helper optimized for "newCls." -CorInfoHelpFunc getNewHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_METHOD_HANDLE callerHandle, bool* pHasSideEffects = NULL /* OUT */); - -// returns the newArr (1-Dim array) helper optimized for "arrayCls." -CorInfoHelpFunc getNewArrHelper(CORINFO_CLASS_HANDLE arrayCls); - -// returns the optimized "IsInstanceOf" or "ChkCast" helper -CorInfoHelpFunc getCastingHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool fThrowing); - -// returns helper to trigger static constructor -CorInfoHelpFunc getSharedCCtorHelper(CORINFO_CLASS_HANDLE clsHnd); - -// This is not pretty. Boxing nullable actually returns -// a boxed not a boxed Nullable. This call allows the verifier -// to call back to the EE on the 'box' instruction and get the transformed -// type to use for verification. -CORINFO_CLASS_HANDLE getTypeForBox(CORINFO_CLASS_HANDLE cls); - -// returns the correct box helper for a particular class. Note -// that if this returns CORINFO_HELP_BOX, the JIT can assume -// 'standard' boxing (allocate object and copy), and optimize -CorInfoHelpFunc getBoxHelper(CORINFO_CLASS_HANDLE cls); - -// 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 -// 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. - -CorInfoHelpFunc getUnBoxHelper(CORINFO_CLASS_HANDLE cls); - -bool getReadyToRunHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, - CORINFO_LOOKUP_KIND* pGenericLookupKind, - CorInfoHelpFunc id, - CORINFO_CONST_LOOKUP* pLookup); - -void getReadyToRunDelegateCtorHelper(CORINFO_RESOLVED_TOKEN* pTargetMethod, - CORINFO_CLASS_HANDLE delegateType, - CORINFO_LOOKUP* pLookup); - -const char* getHelperName(CorInfoHelpFunc); - -// This function tries to initialize the class (run the class constructor). -// this function returns whether the JIT must insert helper calls before -// accessing static field or method. -// -// See code:ICorClassInfo#ClassConstruction. -CorInfoInitClassResult initClass(CORINFO_FIELD_HANDLE field, // Non-NULL - inquire about cctor trigger before static - // field access NULL - inquire about cctor trigger in - // method prolog - CORINFO_METHOD_HANDLE method, // Method referencing the field or prolog - CORINFO_CONTEXT_HANDLE context // Exact context of method - ); - -// This used to be called "loadClass". This records the fact -// that the class must be loaded (including restored if necessary) before we execute the -// code that we are currently generating. When jitting code -// the function loads the class immediately. When zapping code -// the zapper will if necessary use the call to record the fact that we have -// to do a fixup/restore before running the method currently being generated. -// -// This is typically used to ensure value types are loaded before zapped -// code that manipulates them is executed, so that the GC can access information -// about those value types. -void classMustBeLoadedBeforeCodeIsRun(CORINFO_CLASS_HANDLE cls); +LPCWSTR getStringLiteral( + CORINFO_MODULE_HANDLE module, + unsigned metaTOK, + int* length); -// returns the class handle for the special builtin classes -CORINFO_CLASS_HANDLE getBuiltinClass(CorInfoClassId classId); +CorInfoType asCorInfoType( + CORINFO_CLASS_HANDLE cls); -// "System.Int32" ==> CORINFO_TYPE_INT.. -CorInfoType getTypeForPrimitiveValueClass(CORINFO_CLASS_HANDLE cls); +const char* getClassName( + CORINFO_CLASS_HANDLE cls); -// "System.Int32" ==> CORINFO_TYPE_INT.. -// "System.UInt32" ==> CORINFO_TYPE_UINT.. -CorInfoType getTypeForPrimitiveNumericClass(CORINFO_CLASS_HANDLE cls); +const char* getClassNameFromMetadata( + CORINFO_CLASS_HANDLE cls, + const char** namespaceName); -// TRUE if child is a subtype of parent -// if parent is an interface, then does child implement / extend parent -BOOL canCast(CORINFO_CLASS_HANDLE child, // subtype (extends parent) - CORINFO_CLASS_HANDLE parent // base type - ); +CORINFO_CLASS_HANDLE getTypeInstantiationArgument( + CORINFO_CLASS_HANDLE cls, + unsigned index); -// TRUE if cls1 and cls2 are considered equivalent types. -BOOL areTypesEquivalent(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2); +int appendClassName( + WCHAR** ppBuf, + int* pnBufLen, + CORINFO_CLASS_HANDLE cls, + BOOL fNamespace, + BOOL fFullInst, + BOOL fAssembly); -// See if a cast from fromClass to toClass will succeed, fail, or needs -// to be resolved at runtime. -TypeCompareState compareTypesForCast(CORINFO_CLASS_HANDLE fromClass, CORINFO_CLASS_HANDLE toClass); +BOOL isValueClass( + CORINFO_CLASS_HANDLE cls); -// See if types represented by cls1 and cls2 compare equal, not -// equal, or the comparison needs to be resolved at runtime. -TypeCompareState compareTypesForEquality(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2); +CorInfoInlineTypeCheck canInlineTypeCheck( + CORINFO_CLASS_HANDLE cls, + CorInfoInlineTypeCheckSource source); -// returns the intersection of cls1 and cls2. -CORINFO_CLASS_HANDLE mergeClasses(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2); +DWORD getClassAttribs( + CORINFO_CLASS_HANDLE cls); -// Returns true if cls2 is known to be a more specific type than cls1. -BOOL isMoreSpecificType(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2); +BOOL isStructRequiringStackAllocRetBuf( + CORINFO_CLASS_HANDLE cls); -// Given a class handle, returns the Parent type. -// For COMObjectType, it returns Class Handle of System.Object. -// Returns 0 if System.Object is passed in. -CORINFO_CLASS_HANDLE getParentType(CORINFO_CLASS_HANDLE cls); +CORINFO_MODULE_HANDLE getClassModule( + CORINFO_CLASS_HANDLE cls); -// Returns the CorInfoType of the "child type". If the child type is -// not a primitive type, *clsRet will be set. -// Given an Array of Type Foo, returns Foo. -// Given BYREF Foo, returns Foo -CorInfoType getChildType(CORINFO_CLASS_HANDLE clsHnd, CORINFO_CLASS_HANDLE* clsRet); +CORINFO_ASSEMBLY_HANDLE getModuleAssembly( + CORINFO_MODULE_HANDLE mod); -// Check constraints on type arguments of this class and parent classes -BOOL satisfiesClassConstraints(CORINFO_CLASS_HANDLE cls); +const char* getAssemblyName( + CORINFO_ASSEMBLY_HANDLE assem); -// Check if this is a single dimensional array type -BOOL isSDArray(CORINFO_CLASS_HANDLE cls); +void* LongLifetimeMalloc( + size_t sz); -// Get the numbmer of dimensions in an array -unsigned getArrayRank(CORINFO_CLASS_HANDLE cls); +void LongLifetimeFree( + void* obj); -// Get static field data for an array -void* getArrayInitializationData(CORINFO_FIELD_HANDLE field, DWORD size); +size_t getClassModuleIdForStatics( + CORINFO_CLASS_HANDLE cls, + CORINFO_MODULE_HANDLE* pModule, + void** ppIndirection); -// Check Visibility rules. -CorInfoIsAccessAllowedResult canAccessClass(CORINFO_RESOLVED_TOKEN* pResolvedToken, - CORINFO_METHOD_HANDLE callerHandle, - CORINFO_HELPER_DESC* pAccessHelper /* If canAccessMethod returns something - other than ALLOWED, then this is - filled in. */ - ); +unsigned getClassSize( + CORINFO_CLASS_HANDLE cls); -/**********************************************************************************/ -// -// ICorFieldInfo -// -/**********************************************************************************/ +unsigned getHeapClassSize( + CORINFO_CLASS_HANDLE cls); -// this function is for debugging only. It returns the field name -// and if 'moduleName' is non-null, it sets it to something that will -// says which method (a class name, or a module name) -const char* getFieldName(CORINFO_FIELD_HANDLE ftn, /* IN */ - const char** moduleName /* OUT */ - ); +BOOL canAllocateOnStack( + CORINFO_CLASS_HANDLE cls); -// return class it belongs to -CORINFO_CLASS_HANDLE getFieldClass(CORINFO_FIELD_HANDLE field); +unsigned getClassAlignmentRequirement( + CORINFO_CLASS_HANDLE cls, + BOOL fDoubleAlignHint); -// Return the field's type, if it is CORINFO_TYPE_VALUECLASS 'structType' is set -// the field's value class (if 'structType' == 0, then don't bother -// the structure info). -// -// 'memberParent' is typically only set when verifying. It should be the -// result of calling getMemberParent. -CorInfoType getFieldType(CORINFO_FIELD_HANDLE field, - CORINFO_CLASS_HANDLE* structType = NULL, - CORINFO_CLASS_HANDLE memberParent = NULL /* IN */ - ); +unsigned getClassGClayout( + CORINFO_CLASS_HANDLE cls, + BYTE* gcPtrs); -// return the data member's instance offset -unsigned getFieldOffset(CORINFO_FIELD_HANDLE field); +unsigned getClassNumInstanceFields( + CORINFO_CLASS_HANDLE cls); -void getFieldInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken, - CORINFO_METHOD_HANDLE callerHandle, - CORINFO_ACCESS_FLAGS flags, - CORINFO_FIELD_INFO* pResult); +CORINFO_FIELD_HANDLE getFieldInClass( + CORINFO_CLASS_HANDLE clsHnd, + INT num); -// Returns true iff "fldHnd" represents a static field. -bool isFieldStatic(CORINFO_FIELD_HANDLE fldHnd); +BOOL checkMethodModifier( + CORINFO_METHOD_HANDLE hMethod, + LPCSTR modifier, + BOOL fOptional); -/*********************************************************************************/ -// -// ICorDebugInfo -// -/*********************************************************************************/ +CorInfoHelpFunc getNewHelper( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_METHOD_HANDLE callerHandle, + bool* pHasSideEffects); + +CorInfoHelpFunc getNewArrHelper( + CORINFO_CLASS_HANDLE arrayCls); + +CorInfoHelpFunc getCastingHelper( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + bool fThrowing); + +CorInfoHelpFunc getSharedCCtorHelper( + CORINFO_CLASS_HANDLE clsHnd); + +CORINFO_CLASS_HANDLE getTypeForBox( + CORINFO_CLASS_HANDLE cls); + +CorInfoHelpFunc getBoxHelper( + CORINFO_CLASS_HANDLE cls); + +CorInfoHelpFunc getUnBoxHelper( + CORINFO_CLASS_HANDLE cls); + +bool getReadyToRunHelper( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_LOOKUP_KIND* pGenericLookupKind, + CorInfoHelpFunc id, + CORINFO_CONST_LOOKUP* pLookup); + +void getReadyToRunDelegateCtorHelper( + CORINFO_RESOLVED_TOKEN* pTargetMethod, + CORINFO_CLASS_HANDLE delegateType, + CORINFO_LOOKUP* pLookup); + +const char* getHelperName( + CorInfoHelpFunc helpFunc); + +CorInfoInitClassResult initClass( + CORINFO_FIELD_HANDLE field, + CORINFO_METHOD_HANDLE method, + CORINFO_CONTEXT_HANDLE context); + +void classMustBeLoadedBeforeCodeIsRun( + CORINFO_CLASS_HANDLE cls); + +CORINFO_CLASS_HANDLE getBuiltinClass( + CorInfoClassId classId); + +CorInfoType getTypeForPrimitiveValueClass( + CORINFO_CLASS_HANDLE cls); + +CorInfoType getTypeForPrimitiveNumericClass( + CORINFO_CLASS_HANDLE cls); + +BOOL canCast( + CORINFO_CLASS_HANDLE child, + CORINFO_CLASS_HANDLE parent); + +BOOL areTypesEquivalent( + CORINFO_CLASS_HANDLE cls1, + CORINFO_CLASS_HANDLE cls2); + +TypeCompareState compareTypesForCast( + CORINFO_CLASS_HANDLE fromClass, + CORINFO_CLASS_HANDLE toClass); + +TypeCompareState compareTypesForEquality( + CORINFO_CLASS_HANDLE cls1, + CORINFO_CLASS_HANDLE cls2); + +CORINFO_CLASS_HANDLE mergeClasses( + CORINFO_CLASS_HANDLE cls1, + CORINFO_CLASS_HANDLE cls2); + +BOOL isMoreSpecificType( + CORINFO_CLASS_HANDLE cls1, + CORINFO_CLASS_HANDLE cls2); + +CORINFO_CLASS_HANDLE getParentType( + CORINFO_CLASS_HANDLE cls); + +CorInfoType getChildType( + CORINFO_CLASS_HANDLE clsHnd, + CORINFO_CLASS_HANDLE* clsRet); + +BOOL satisfiesClassConstraints( + CORINFO_CLASS_HANDLE cls); + +BOOL isSDArray( + CORINFO_CLASS_HANDLE cls); + +unsigned getArrayRank( + CORINFO_CLASS_HANDLE cls); + +void* getArrayInitializationData( + CORINFO_FIELD_HANDLE field, + DWORD size); + +CorInfoIsAccessAllowedResult canAccessClass( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_METHOD_HANDLE callerHandle, + CORINFO_HELPER_DESC* pAccessHelper); + +const char* getFieldName( + CORINFO_FIELD_HANDLE ftn, + const char** moduleName); + +CORINFO_CLASS_HANDLE getFieldClass( + CORINFO_FIELD_HANDLE field); + +CorInfoType getFieldType( + CORINFO_FIELD_HANDLE field, + CORINFO_CLASS_HANDLE* structType, + CORINFO_CLASS_HANDLE memberParent); + +unsigned getFieldOffset( + CORINFO_FIELD_HANDLE field); + +void getFieldInfo( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_METHOD_HANDLE callerHandle, + CORINFO_ACCESS_FLAGS flags, + CORINFO_FIELD_INFO* pResult); + +bool isFieldStatic( + CORINFO_FIELD_HANDLE fldHnd); + +void getBoundaries( + CORINFO_METHOD_HANDLE ftn, + unsigned int* cILOffsets, + DWORD** pILOffsets, + ICorDebugInfo::BoundaryTypes* implictBoundaries); + +void setBoundaries( + CORINFO_METHOD_HANDLE ftn, + ULONG32 cMap, + ICorDebugInfo::OffsetMapping* pMap); + +void getVars( + CORINFO_METHOD_HANDLE ftn, + ULONG32* cVars, + ICorDebugInfo::ILVarInfo** vars, + bool* extendOthers); + +void setVars( + CORINFO_METHOD_HANDLE ftn, + ULONG32 cVars, + ICorDebugInfo::NativeVarInfo* vars); + +void* allocateArray( + size_t cBytes); + +void freeArray( + void* array); + +CORINFO_ARG_LIST_HANDLE getArgNext( + CORINFO_ARG_LIST_HANDLE args); + +CorInfoTypeWithMod getArgType( + CORINFO_SIG_INFO* sig, + CORINFO_ARG_LIST_HANDLE args, + CORINFO_CLASS_HANDLE* vcTypeRet); + +CORINFO_CLASS_HANDLE getArgClass( + CORINFO_SIG_INFO* sig, + CORINFO_ARG_LIST_HANDLE args); + +CorInfoHFAElemType getHFAType( + CORINFO_CLASS_HANDLE hClass); + +HRESULT GetErrorHRESULT( + struct _EXCEPTION_POINTERS* pExceptionPointers); + +ULONG GetErrorMessage( + LPWSTR buffer, + ULONG bufferLength); + +int FilterException( + struct _EXCEPTION_POINTERS* pExceptionPointers); + +void HandleException( + struct _EXCEPTION_POINTERS* pExceptionPointers); + +void ThrowExceptionForJitResult( + HRESULT result); + +void ThrowExceptionForHelper( + const CORINFO_HELPER_DESC* throwHelper); + +bool runWithErrorTrap( + ICorJitInfo::errorTrapFunction function, + void* parameter); + +void getEEInfo( + CORINFO_EE_INFO* pEEInfoOut); -// Query the EE to find out where interesting break points -// in the code are. The native compiler will ensure that these places -// have a corresponding break point in native code. -// -// Note that unless CORJIT_FLAG_DEBUG_CODE is specified, this function will -// be used only as a hint and the native compiler should not change its -// code generation. -void getBoundaries(CORINFO_METHOD_HANDLE ftn, // [IN] method of interest - unsigned int* cILOffsets, // [OUT] size of pILOffsets - DWORD** pILOffsets, // [OUT] IL offsets of interest - // jit MUST free with freeArray! - ICorDebugInfo::BoundaryTypes* implictBoundaries // [OUT] tell jit, all boundries of this type - ); - -// Report back the mapping from IL to native code, -// this map should include all boundaries that 'getBoundaries' -// reported as interesting to the debugger. - -// Note that debugger (and profiler) is assuming that all of the -// offsets form a contiguous block of memory, and that the -// OffsetMapping is sorted in order of increasing native offset. -void setBoundaries(CORINFO_METHOD_HANDLE ftn, // [IN] method of interest - ULONG32 cMap, // [IN] size of pMap - ICorDebugInfo::OffsetMapping* pMap // [IN] map including all points of interest. - // jit allocated with allocateArray, EE frees - ); - -// Query the EE to find out the scope of local varables. -// normally the JIT would trash variables after last use, but -// under debugging, the JIT needs to keep them live over their -// entire scope so that they can be inspected. -// -// Note that unless CORJIT_FLAG_DEBUG_CODE is specified, this function will -// be used only as a hint and the native compiler should not change its -// code generation. -void getVars(CORINFO_METHOD_HANDLE ftn, // [IN] method of interest - ULONG32* cVars, // [OUT] size of 'vars' - ICorDebugInfo::ILVarInfo** vars, // [OUT] scopes of variables of interest - // jit MUST free with freeArray! - bool* extendOthers // [OUT] it TRUE, then assume the scope - // of unmentioned vars is entire method - ); - -// Report back to the EE the location of every variable. -// note that the JIT might split lifetimes into different -// locations etc. - -void setVars(CORINFO_METHOD_HANDLE ftn, // [IN] method of interest - ULONG32 cVars, // [IN] size of 'vars' - ICorDebugInfo::NativeVarInfo* vars // [IN] map telling where local vars are stored at what points - // jit allocated with allocateArray, EE frees - ); - -/*-------------------------- Misc ---------------------------------------*/ - -// Used to allocate memory that needs to handed to the EE. -// For eg, use this to allocated memory for reporting debug info, -// which will be handed to the EE by setVars() and setBoundaries() -void* allocateArray(size_t cBytes); - -// JitCompiler will free arrays passed by the EE using this -// For eg, The EE returns memory in getVars() and getBoundaries() -// to the JitCompiler, which the JitCompiler should release using -// freeArray() -void freeArray(void* array); - -/*********************************************************************************/ -// -// ICorArgInfo -// -/*********************************************************************************/ - -// advance the pointer to the argument list. -// a ptr of 0, is special and always means the first argument -CORINFO_ARG_LIST_HANDLE getArgNext(CORINFO_ARG_LIST_HANDLE args /* IN */ - ); - -// Get the type of a particular argument -// CORINFO_TYPE_UNDEF is returned when there are no more arguments -// If the type returned is a primitive type (or an enum) *vcTypeRet set to NULL -// otherwise it is set to the TypeHandle associted with the type -// Enumerations will always look their underlying type (probably should fix this) -// Otherwise vcTypeRet is the type as would be seen by the IL, -// The return value is the type that is used for calling convention purposes -// (Thus if the EE wants a value class to be passed like an int, then it will -// return CORINFO_TYPE_INT -CorInfoTypeWithMod getArgType(CORINFO_SIG_INFO* sig, /* IN */ - CORINFO_ARG_LIST_HANDLE args, /* IN */ - CORINFO_CLASS_HANDLE* vcTypeRet /* OUT */ - ); - -// If the Arg is a CORINFO_TYPE_CLASS fetch the class handle associated with it -CORINFO_CLASS_HANDLE getArgClass(CORINFO_SIG_INFO* sig, /* IN */ - CORINFO_ARG_LIST_HANDLE args /* IN */ - ); - -// Returns type of HFA for valuetype -CorInfoHFAElemType getHFAType(CORINFO_CLASS_HANDLE hClass); - -/***************************************************************************** -* ICorErrorInfo contains methods to deal with SEH exceptions being thrown -* from the corinfo interface. These methods may be called when an exception -* with code EXCEPTION_COMPLUS is caught. -*****************************************************************************/ - -// Returns the HRESULT of the current exception -HRESULT GetErrorHRESULT(struct _EXCEPTION_POINTERS* pExceptionPointers); - -// Fetches the message of the current exception -// Returns the size of the message (including terminating null). This can be -// greater than bufferLength if the buffer is insufficient. -ULONG GetErrorMessage(__inout_ecount(bufferLength) LPWSTR buffer, ULONG bufferLength); - -// returns EXCEPTION_EXECUTE_HANDLER if it is OK for the compile to handle the -// exception, abort some work (like the inlining) and continue compilation -// returns EXCEPTION_CONTINUE_SEARCH if exception must always be handled by the EE -// things like ThreadStoppedException ... -// returns EXCEPTION_CONTINUE_EXECUTION if exception is fixed up by the EE - -int FilterException(struct _EXCEPTION_POINTERS* pExceptionPointers); - -// Cleans up internal EE tracking when an exception is caught. -void HandleException(struct _EXCEPTION_POINTERS* pExceptionPointers); - -void ThrowExceptionForJitResult(HRESULT result); - -// Throws an exception defined by the given throw helper. -void ThrowExceptionForHelper(const CORINFO_HELPER_DESC* throwHelper); - -// Runs the given function under an error trap. This allows the JIT to make calls -// to interface functions that may throw exceptions without needing to be aware of -// the EH ABI, exception types, etc. Returns true if the given function completed -// successfully and false otherwise. -bool runWithErrorTrap(void (*function)(void*), // The function to run - void* parameter // The context parameter that will be passed to the function and the handler - ); - -/***************************************************************************** - * ICorStaticInfo contains EE interface methods which return values that are - * constant from invocation to invocation. Thus they may be embedded in - * persisted information like statically generated code. (This is of course - * assuming that all code versions are identical each time.) - *****************************************************************************/ - -// Return details about EE internal data structures -void getEEInfo(CORINFO_EE_INFO* pEEInfoOut); - -// Returns name of the JIT timer log LPCWSTR getJitTimeLogFilename(); -/*********************************************************************************/ -// -// Diagnostic methods -// -/*********************************************************************************/ - -// this function is for debugging only. Returns method token. -// Returns mdMethodDefNil for dynamic methods. -mdMethodDef getMethodDefFromMethod(CORINFO_METHOD_HANDLE hMethod); - -// this function is for debugging only. It returns the method name -// and if 'moduleName' is non-null, it sets it to something that will -// says which method (a class name, or a module name) -const char* getMethodName(CORINFO_METHOD_HANDLE ftn, /* IN */ - const char** moduleName /* OUT */ - ); - -// Return method name as in metadata, or nullptr if there is none, -// and optionally return the class name as in metadata. -// Suitable for non-debugging use. -const char* getMethodNameFromMetadata(CORINFO_METHOD_HANDLE ftn, /* IN */ - const char** className, /* OUT */ - const char** namespaceName, /* OUT */ - const char** enclosingClassName /* OUT */ - ); - -// this function is for debugging only. It returns a value that -// is will always be the same for a given method. It is used -// to implement the 'jitRange' functionality -unsigned getMethodHash(CORINFO_METHOD_HANDLE ftn /* IN */ - ); - -// this function is for debugging only. -size_t findNameOfToken(CORINFO_MODULE_HANDLE module, /* IN */ - mdToken metaTOK, /* IN */ - __out_ecount(FQNameCapacity) char* szFQName, /* OUT */ - size_t FQNameCapacity /* IN */ - ); - -// returns whether the struct is enregisterable. Only valid on a System V VM. Returns true on success, false on failure. +mdMethodDef getMethodDefFromMethod( + CORINFO_METHOD_HANDLE hMethod); + +const char* getMethodName( + CORINFO_METHOD_HANDLE ftn, + const char** moduleName); + +const char* getMethodNameFromMetadata( + CORINFO_METHOD_HANDLE ftn, + const char** className, + const char** namespaceName, + const char** enclosingClassName); + +unsigned getMethodHash( + CORINFO_METHOD_HANDLE ftn); + +size_t findNameOfToken( + CORINFO_MODULE_HANDLE moduleHandle, + mdToken token, + char* szFQName, + size_t FQNameCapacity); + bool getSystemVAmd64PassStructInRegisterDescriptor( - /* IN */ CORINFO_CLASS_HANDLE structHnd, - /* OUT */ SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr); + CORINFO_CLASS_HANDLE structHnd, + SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr); -/***************************************************************************** - * ICorDynamicInfo contains EE interface methods which return values that may - * change from invocation to invocation. They cannot be embedded in persisted - * data; they must be requeried each time the EE is run. - *****************************************************************************/ +DWORD getThreadTLSIndex( + void** ppIndirection); -// -// These methods return values to the JIT which are not constant -// from session to session. -// -// These methods take an extra parameter : void **ppIndirection. -// If a JIT supports generation of prejit code (install-o-jit), it -// must pass a non-null value for this parameter, and check the -// resulting value. If *ppIndirection is NULL, code should be -// generated normally. If non-null, then the value of -// *ppIndirection is an address in the cookie table, and the code -// generator needs to generate an indirection through the table to -// get the resulting value. In this case, the return result of the -// function must NOT be directly embedded in the generated code. -// -// Note that if a JIT does not support prejit code generation, it -// may ignore the extra parameter & pass the default of NULL - the -// prejit ICorDynamicInfo implementation will see this & generate -// an error if the jitter is used in a prejit scenario. -// +const void* getInlinedCallFrameVptr( + void** ppIndirection); -// Return details about EE internal data structures +LONG* getAddrOfCaptureThreadGlobal( + void** ppIndirection); -DWORD getThreadTLSIndex(void** ppIndirection = NULL); +void* getHelperFtn( + CorInfoHelpFunc ftnNum, + void** ppIndirection); -const void* getInlinedCallFrameVptr(void** ppIndirection = NULL); +void getFunctionEntryPoint( + CORINFO_METHOD_HANDLE ftn, + CORINFO_CONST_LOOKUP* pResult, + CORINFO_ACCESS_FLAGS accessFlags); -LONG* getAddrOfCaptureThreadGlobal(void** ppIndirection = NULL); +void getFunctionFixedEntryPoint( + CORINFO_METHOD_HANDLE ftn, + CORINFO_CONST_LOOKUP* pResult); -// return the native entry point to an EE helper (see CorInfoHelpFunc) -void* getHelperFtn(CorInfoHelpFunc ftnNum, void** ppIndirection = NULL); +void* getMethodSync( + CORINFO_METHOD_HANDLE ftn, + void** ppIndirection); -// return a callable address of the function (native code). This function -// may return a different value (depending on whether the method has -// been JITed or not. -void getFunctionEntryPoint(CORINFO_METHOD_HANDLE ftn, /* IN */ - CORINFO_CONST_LOOKUP* pResult, /* OUT */ - CORINFO_ACCESS_FLAGS accessFlags = CORINFO_ACCESS_ANY); +CorInfoHelpFunc getLazyStringLiteralHelper( + CORINFO_MODULE_HANDLE handle); -// return a directly callable address. This can be used similarly to the -// value returned by getFunctionEntryPoint() except that it is -// guaranteed to be multi callable entrypoint. -void getFunctionFixedEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_CONST_LOOKUP* pResult); +CORINFO_MODULE_HANDLE embedModuleHandle( + CORINFO_MODULE_HANDLE handle, + void** ppIndirection); -// get the synchronization handle that is passed to monXstatic function -void* getMethodSync(CORINFO_METHOD_HANDLE ftn, void** ppIndirection = NULL); +CORINFO_CLASS_HANDLE embedClassHandle( + CORINFO_CLASS_HANDLE handle, + void** ppIndirection); -// get slow lazy string literal helper to use (CORINFO_HELP_STRCNS*). -// Returns CORINFO_HELP_UNDEF if lazy string literal helper cannot be used. -CorInfoHelpFunc getLazyStringLiteralHelper(CORINFO_MODULE_HANDLE handle); +CORINFO_METHOD_HANDLE embedMethodHandle( + CORINFO_METHOD_HANDLE handle, + void** ppIndirection); -CORINFO_MODULE_HANDLE embedModuleHandle(CORINFO_MODULE_HANDLE handle, void** ppIndirection = NULL); +CORINFO_FIELD_HANDLE embedFieldHandle( + CORINFO_FIELD_HANDLE handle, + void** ppIndirection); -CORINFO_CLASS_HANDLE embedClassHandle(CORINFO_CLASS_HANDLE handle, void** ppIndirection = NULL); +void embedGenericHandle( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + BOOL fEmbedParent, + CORINFO_GENERICHANDLE_RESULT* pResult); -CORINFO_METHOD_HANDLE embedMethodHandle(CORINFO_METHOD_HANDLE handle, void** ppIndirection = NULL); +void getLocationOfThisType( + CORINFO_METHOD_HANDLE context, + CORINFO_LOOKUP_KIND* pLookupKind); -CORINFO_FIELD_HANDLE embedFieldHandle(CORINFO_FIELD_HANDLE handle, void** ppIndirection = NULL); +void getAddressOfPInvokeTarget( + CORINFO_METHOD_HANDLE method, + CORINFO_CONST_LOOKUP* pLookup); -// Given a module scope (module), a method handle (context) and -// a metadata token (metaTOK), fetch the handle -// (type, field or method) 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 how the handle should be looked up at run-time. -// -void embedGenericHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken, - BOOL fEmbedParent, // TRUE - embeds parent type handle of the field/method handle - CORINFO_GENERICHANDLE_RESULT* pResult); - -// Return information used to locate the exact enclosing type of the current method. -// Used only to invoke .cctor method from code shared across generic instantiations -// !needsRuntimeLookup statically known (enclosing type of method itself) -// needsRuntimeLookup: -// 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 -void getLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND* pLookupKind); - -// return the address of the PInvoke target. May be a fixup area in the -// case of late-bound PInvoke calls. -void getAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP* pLookup); - -// Generate a cookie based on the signature that would needs to be passed -// to CORINFO_HELP_PINVOKE_CALLI -LPVOID GetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, void** ppIndirection = NULL); - -// returns true if a VM cookie can be generated for it (might be false due to cross-module -// inlining, in which case the inlining should be aborted) -bool canGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig); - -// Gets a handle that is checked to see if the current method is -// included in "JustMyCode" -CORINFO_JUST_MY_CODE_HANDLE getJustMyCodeHandle(CORINFO_METHOD_HANDLE method, - CORINFO_JUST_MY_CODE_HANDLE** ppIndirection = NULL); - -// Gets a method handle that can be used to correlate profiling data. -// This is the IP of a native method, or the address of the descriptor struct -// for IL. Always guaranteed to be unique per process, and not to move. */ -void GetProfilingHandle(BOOL* pbHookFunction, void** pProfilerHandle, BOOL* pbIndirectedHandles); - -// Returns instructions on how to make the call. See code:CORINFO_CALL_INFO for possible return values. -void getCallInfo( - // Token info - CORINFO_RESOLVED_TOKEN* pResolvedToken, +LPVOID GetCookieForPInvokeCalliSig( + CORINFO_SIG_INFO* szMetaSig, + void** ppIndirection); - // Generics info - CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken, +bool canGetCookieForPInvokeCalliSig( + CORINFO_SIG_INFO* szMetaSig); - // Security info - CORINFO_METHOD_HANDLE callerHandle, +CORINFO_JUST_MY_CODE_HANDLE getJustMyCodeHandle( + CORINFO_METHOD_HANDLE method, + CORINFO_JUST_MY_CODE_HANDLE** ppIndirection); - // Jit info - CORINFO_CALLINFO_FLAGS flags, +void GetProfilingHandle( + BOOL* pbHookFunction, + void** pProfilerHandle, + BOOL* pbIndirectedHandles); - // out params - CORINFO_CALL_INFO* pResult); +void getCallInfo( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken, + CORINFO_METHOD_HANDLE callerHandle, + CORINFO_CALLINFO_FLAGS flags, + CORINFO_CALL_INFO* pResult); -BOOL canAccessFamily(CORINFO_METHOD_HANDLE hCaller, CORINFO_CLASS_HANDLE hInstanceType); +BOOL canAccessFamily( + CORINFO_METHOD_HANDLE hCaller, + CORINFO_CLASS_HANDLE hInstanceType); -// Returns TRUE if the Class Domain ID is the RID of the class (currently true for every class -// except reflection emitted classes and generics) -BOOL isRIDClassDomainID(CORINFO_CLASS_HANDLE cls); +BOOL isRIDClassDomainID( + CORINFO_CLASS_HANDLE cls); -// returns the class's domain ID for accessing shared statics -unsigned getClassDomainID(CORINFO_CLASS_HANDLE cls, void** ppIndirection = NULL); +unsigned getClassDomainID( + CORINFO_CLASS_HANDLE cls, + void** ppIndirection); -// return the data's address (for static fields only) -void* getFieldAddress(CORINFO_FIELD_HANDLE field, void** ppIndirection = NULL); +void* getFieldAddress( + CORINFO_FIELD_HANDLE field, + void** ppIndirection); -// return the class handle for the current value of a static field -CORINFO_CLASS_HANDLE getStaticFieldCurrentClass(CORINFO_FIELD_HANDLE field, bool *pIsSpeculative); +CORINFO_CLASS_HANDLE getStaticFieldCurrentClass( + CORINFO_FIELD_HANDLE field, + bool* pIsSpeculative); -// registers a vararg sig & returns a VM cookie for it (which can contain other stuff) -CORINFO_VARARGS_HANDLE getVarArgsHandle(CORINFO_SIG_INFO* pSig, void** ppIndirection = NULL); +CORINFO_VARARGS_HANDLE getVarArgsHandle( + CORINFO_SIG_INFO* pSig, + void** ppIndirection); -// returns true if a VM cookie can be generated for it (might be false due to cross-module -// inlining, in which case the inlining should be aborted) -bool canGetVarArgsHandle(CORINFO_SIG_INFO* pSig); +bool canGetVarArgsHandle( + CORINFO_SIG_INFO* pSig); -// Allocate a string literal on the heap and return a handle to it -InfoAccessType constructStringLiteral(CORINFO_MODULE_HANDLE module, mdToken metaTok, void** ppValue); +InfoAccessType constructStringLiteral( + CORINFO_MODULE_HANDLE module, + mdToken metaTok, + void** ppValue); -InfoAccessType emptyStringLiteral(void** ppValue); +InfoAccessType emptyStringLiteral( + void** ppValue); -// (static fields only) given that 'field' refers to thread local store, -// 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. -DWORD getFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, void** ppIndirection = NULL); +DWORD getFieldThreadLocalStoreID( + CORINFO_FIELD_HANDLE field, + void** ppIndirection); -// Sets another object to intercept calls to "self" and current method being compiled -void setOverride(ICorDynamicInfo* pOverride, CORINFO_METHOD_HANDLE currentMethod); +void setOverride( + ICorDynamicInfo* pOverride, + CORINFO_METHOD_HANDLE currentMethod); -// Adds an active dependency from the context method's module to the given module -// This is internal callback for the EE. JIT should not call it directly. -void addActiveDependency(CORINFO_MODULE_HANDLE moduleFrom, CORINFO_MODULE_HANDLE moduleTo); +void addActiveDependency( + CORINFO_MODULE_HANDLE moduleFrom, + CORINFO_MODULE_HANDLE moduleTo); -CORINFO_METHOD_HANDLE GetDelegateCtor(CORINFO_METHOD_HANDLE methHnd, - CORINFO_CLASS_HANDLE clsHnd, - CORINFO_METHOD_HANDLE targetMethodHnd, - DelegateCtorArgs* pCtorData); +CORINFO_METHOD_HANDLE GetDelegateCtor( + CORINFO_METHOD_HANDLE methHnd, + CORINFO_CLASS_HANDLE clsHnd, + CORINFO_METHOD_HANDLE targetMethodHnd, + DelegateCtorArgs* pCtorData); -void MethodCompileComplete(CORINFO_METHOD_HANDLE methHnd); +void MethodCompileComplete( + CORINFO_METHOD_HANDLE methHnd); bool getTailCallHelpers( - CORINFO_RESOLVED_TOKEN* callToken, - CORINFO_SIG_INFO* sig, - CORINFO_GET_TAILCALL_HELPERS_FLAGS flags, - CORINFO_TAILCALL_HELPERS* pResult); - -bool convertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN * pResolvedToken, bool fMustConvert); - -// get a block of memory for the code, readonly data, and read-write data -void allocMem(ULONG hotCodeSize, /* IN */ - ULONG coldCodeSize, /* IN */ - ULONG roDataSize, /* IN */ - ULONG xcptnsCount, /* IN */ - CorJitAllocMemFlag flag, /* IN */ - void** hotCodeBlock, /* OUT */ - void** coldCodeBlock, /* OUT */ - void** roDataBlock /* OUT */ - ); - -// Reserve memory for the method/funclet's unwind information. -// Note that this must be called before allocMem. It should be -// called once for the main method, once for every funclet, and -// once for every block of cold code for which allocUnwindInfo -// will be called. -// -// This is necessary because jitted code must allocate all the -// memory needed for the unwindInfo at the allocMem call. -// For prejitted code we split up the unwinding information into -// separate sections .rdata and .pdata. -// -void reserveUnwindInfo(BOOL isFunclet, /* IN */ - BOOL isColdCode, /* IN */ - ULONG unwindSize /* IN */ - ); - -// Allocate and initialize the .rdata and .pdata for this method or -// funclet, and get the block of memory needed for the machine-specific -// unwind information (the info for crawling the stack frame). -// Note that allocMem must be called first. -// -// Parameters: -// -// pHotCode main method code buffer, always filled in -// 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). -// endOffset end of code block, relative to appropriate code buffer -// unwindSize size of unwind info pointed to by pUnwindBlock -// pUnwindBlock pointer to unwind info -// funcKind type of funclet (main method code, handler, filter) -// -void allocUnwindInfo(BYTE* pHotCode, /* IN */ - BYTE* pColdCode, /* IN */ - ULONG startOffset, /* IN */ - ULONG endOffset, /* IN */ - ULONG unwindSize, /* IN */ - BYTE* pUnwindBlock, /* IN */ - CorJitFuncKind funcKind /* IN */ - ); - -// Get a block of memory needed for the code manager information, -// (the info for enumerating the GC pointers while crawling the -// stack frame). -// Note that allocMem must be called first -void* allocGCInfo(size_t size /* IN */ - ); - -// 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. -void setEHcount(unsigned cEH /* IN */ - ); - -// Set the values for one particular exception handler block. -// -// Handler regions should be lexically contiguous. -// This is because FinallyIsUnwinding() uses lexicality to -// determine if a "finally" clause is executing. -void setEHinfo(unsigned EHnumber, /* IN */ - const CORINFO_EH_CLAUSE* clause /* IN */ - ); - -// Level -> fatalError, Level 2 -> Error, Level 3 -> Warning -// Level 4 means happens 10 times in a run, level 5 means 100, level 6 means 1000 ... -// returns non-zero if the logging succeeded -BOOL logMsg(unsigned level, const char* fmt, va_list args); - -// do an assert. will return true if the code should retry (DebugBreak) -// returns false, if the assert should be igored. -int doAssert(const char* szFile, int iLine, const char* szExpr); - -void reportFatalError(CorJitResult result); - -/* -struct BlockCounts // Also defined here: code:CORBBTPROF_BLOCK_DATA -{ - UINT32 ILOffset; - UINT32 ExecutionCount; -}; - -// Data structure for a single class probe. -// -// ILOffset is the IL offset in the method for the call site being probed. -// Currently it must be ORed with CLASS_FLAG and (for interface calls) -// INTERFACE_FLAG. -// -// Count is the number of times a call was made at that call site. -// -// SIZE is the number of entries in the table. -// -// SAMPLE_INTERVAL must be >= SIZE. SAMPLE_INTERVAL / SIZE -// gives the average number of calls between table updates. -// -struct ClassProfile -{ - enum { - SIZE = 8, - SAMPLE_INTERVAL = 32, - CLASS_FLAG = 0x80000000, - INTERFACE_FLAG = 0x40000000, - OFFSET_MASK = 0x3FFFFFFF - }; - - UINT32 ILOffset; - UINT32 Count; - CORINFO_CLASS_HANDLE ClassTable[SIZE]; -}; -*/ - -// allocate a basic block profile buffer where execution counts will be stored -// for jitted basic blocks. -HRESULT allocMethodBlockCounts(UINT32 count, // The number of basic blocks that we have - BlockCounts** pBlockCounts); - -// get profile information to be used for optimizing the current method. The format -// of the buffer is the same as the format the JIT passes to allocMethodBlockCounts. -HRESULT getMethodBlockCounts(CORINFO_METHOD_HANDLE ftnHnd, - UINT32 * pCount, // The number of basic blocks that we have - BlockCounts** pBlockCounts, - UINT32 * pNumRuns); - -// Get the likely implementing class for a virtual call or interface call made by ftnHnd -// at the indicated IL offset. baseHnd is the interface class or base class for the method -// being called. -CORINFO_CLASS_HANDLE getLikelyClass(CORINFO_METHOD_HANDLE ftnHnd, - CORINFO_CLASS_HANDLE baseHnd, - UINT32 ilOffset, - UINT32* pLikelihood, - UINT32* pNumberOfCases); - -// Associates a native call site, identified by its offset in the native code stream, with -// the signature information and method handle the JIT used to lay out the call site. If -// the call site has no signature information (e.g. a helper call) or has no method handle -// (e.g. a CALLI P/Invoke), then null should be passed instead. -void recordCallSite(ULONG instrOffset, /* IN */ - CORINFO_SIG_INFO* callSig, /* IN */ - CORINFO_METHOD_HANDLE methodHandle /* IN */ - ); - -// A relocation is recorded if we are pre-jitting. -// A jump thunk may be inserted if we are jitting -void recordRelocation(void* location, /* IN */ - void* target, /* IN */ - WORD fRelocType, /* IN */ - WORD slotNum, /* IN */ - INT32 addlDelta /* IN */ - ); - -WORD getRelocTypeHint(void* target); - -// 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. -// + CORINFO_RESOLVED_TOKEN* callToken, + CORINFO_SIG_INFO* sig, + CORINFO_GET_TAILCALL_HELPERS_FLAGS flags, + CORINFO_TAILCALL_HELPERS* pResult); + +bool convertPInvokeCalliToCall( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + bool mustConvert); + +void notifyInstructionSetUsage( + CORINFO_InstructionSet instructionSet, + bool supportEnabled); + +void allocMem( + ULONG hotCodeSize, + ULONG coldCodeSize, + ULONG roDataSize, + ULONG xcptnsCount, + CorJitAllocMemFlag flag, + void** hotCodeBlock, + void** coldCodeBlock, + void** roDataBlock); + +void reserveUnwindInfo( + BOOL isFunclet, + BOOL isColdCode, + ULONG unwindSize); + +void allocUnwindInfo( + BYTE* pHotCode, + BYTE* pColdCode, + ULONG startOffset, + ULONG endOffset, + ULONG unwindSize, + BYTE* pUnwindBlock, + CorJitFuncKind funcKind); + +void* allocGCInfo( + size_t size); + +void setEHcount( + unsigned cEH); + +void setEHinfo( + unsigned EHnumber, + const CORINFO_EH_CLAUSE* clause); + +BOOL logMsg( + unsigned level, + const char* fmt, + va_list args); + +int doAssert( + const char* szFile, + int iLine, + const char* szExpr); + +void reportFatalError( + CorJitResult result); + +HRESULT allocMethodBlockCounts( + UINT32 count, + ICorJitInfo::BlockCounts** pBlockCounts); + +HRESULT getMethodBlockCounts( + CORINFO_METHOD_HANDLE ftnHnd, + UINT32* pCount, + ICorJitInfo::BlockCounts** pBlockCounts, + UINT32* pNumRuns); + +CORINFO_CLASS_HANDLE getLikelyClass( + CORINFO_METHOD_HANDLE ftnHnd, + CORINFO_CLASS_HANDLE baseHnd, + UINT32 ilOffset, + UINT32* pLikelihood, + UINT32* pNumberOfClasses); + +void recordCallSite( + ULONG instrOffset, + CORINFO_SIG_INFO* callSig, + CORINFO_METHOD_HANDLE methodHandle); + +void recordRelocation( + void* location, + void* target, + WORD fRelocType, + WORD slotNum, + INT32 addlDelta); + +WORD getRelocTypeHint( + void* target); + DWORD getExpectedTargetArchitecture(); -// Fetches extended flags for a particular compilation instance. Returns -// the number of bytes written to the provided buffer. -DWORD getJitFlags(CORJIT_FLAGS* flags, /* IN: Points to a buffer that will hold the extended flags. */ - DWORD sizeInBytes /* IN: The size of the buffer. Note that this is effectively a - version number for the CORJIT_FLAGS value. */ - ); +DWORD getJitFlags( + CORJIT_FLAGS* flags, + DWORD sizeInBytes); -void notifyInstructionSetUsage(CORINFO_InstructionSet instructionSet, bool supported); #endif // _ICorJitInfoImpl +/**********************************************************************************/ +// clang-format on +/**********************************************************************************/ diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp index 496dd3d..a4ff0b0 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp @@ -1,7 +1,9 @@ -// -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// DO NOT EDIT THIS FILE! IT IS AUTOGENERATED +// To regenerate run the gen script in src/coreclr/src/tools/Common/JitInterface/ThunkGenerator +// and follow the instructions in docs/project/updating-jitinterface.md #include "standardpch.h" #include "icorjitinfo.h" @@ -9,1678 +11,1380 @@ #include "icorjitcompiler.h" #include "spmiutil.h" -// Stuff on ICorStaticInfo -/**********************************************************************************/ -// -// ICorMethodInfo -// -/**********************************************************************************/ -// return flags (defined above, CORINFO_FLG_PUBLIC ...) -DWORD interceptor_ICJI::getMethodAttribs(CORINFO_METHOD_HANDLE ftn /* IN */) + +DWORD interceptor_ICJI::getMethodAttribs( + CORINFO_METHOD_HANDLE ftn) { mcs->AddCall("getMethodAttribs"); return original_ICorJitInfo->getMethodAttribs(ftn); } -// sets private JIT flags, which can be, retrieved using getAttrib. -void interceptor_ICJI::setMethodAttribs(CORINFO_METHOD_HANDLE ftn, /* IN */ - CorInfoMethodRuntimeFlags attribs /* IN */) +void interceptor_ICJI::setMethodAttribs( + CORINFO_METHOD_HANDLE ftn, + CorInfoMethodRuntimeFlags attribs) { mcs->AddCall("setMethodAttribs"); original_ICorJitInfo->setMethodAttribs(ftn, attribs); } -// Given a method descriptor ftnHnd, extract signature information into sigInfo -// -// 'memberParent' is typically only set when verifying. It should be the -// result of calling getMemberParent. -void interceptor_ICJI::getMethodSig(CORINFO_METHOD_HANDLE ftn, /* IN */ - CORINFO_SIG_INFO* sig, /* OUT */ - CORINFO_CLASS_HANDLE memberParent /* IN */ - ) +void interceptor_ICJI::getMethodSig( + CORINFO_METHOD_HANDLE ftn, + CORINFO_SIG_INFO* sig, + CORINFO_CLASS_HANDLE memberParent) { mcs->AddCall("getMethodSig"); original_ICorJitInfo->getMethodSig(ftn, sig, memberParent); } -/********************************************************************* -* Note the following methods can only be used on functions known -* to be IL. This includes the method being compiled and any method -* that 'getMethodInfo' returns true for -*********************************************************************/ - -// return information about a method private to the implementation -// returns false if method is not IL, or is otherwise unavailable. -// This method is used to fetch data needed to inline functions -bool interceptor_ICJI::getMethodInfo(CORINFO_METHOD_HANDLE ftn, /* IN */ - CORINFO_METHOD_INFO* info /* OUT */ - ) +bool interceptor_ICJI::getMethodInfo( + CORINFO_METHOD_HANDLE ftn, + CORINFO_METHOD_INFO* info) { mcs->AddCall("getMethodInfo"); return original_ICorJitInfo->getMethodInfo(ftn, info); } -// Decides if you have any limitations for inlining. If everything's OK, it will return -// INLINE_PASS and will fill out pRestrictions with a mask of restrictions the caller of this -// function must respect. If caller passes pRestrictions = nullptr, if there are any restrictions -// INLINE_FAIL will be returned -// -// The callerHnd must be the immediate caller (i.e. when we have a chain of inlined calls) -// -// The inlined method need not be verified - -CorInfoInline interceptor_ICJI::canInline(CORINFO_METHOD_HANDLE callerHnd, /* IN */ - CORINFO_METHOD_HANDLE calleeHnd, /* IN */ - DWORD* pRestrictions /* OUT */ - ) +CorInfoInline interceptor_ICJI::canInline( + CORINFO_METHOD_HANDLE callerHnd, + CORINFO_METHOD_HANDLE calleeHnd, + DWORD* pRestrictions) { mcs->AddCall("canInline"); return original_ICorJitInfo->canInline(callerHnd, calleeHnd, pRestrictions); } -// Reports whether or not a method can be inlined, and why. canInline is responsible for reporting all -// inlining results when it returns INLINE_FAIL and INLINE_NEVER. All other results are reported by the -// JIT. -void interceptor_ICJI::reportInliningDecision(CORINFO_METHOD_HANDLE inlinerHnd, - CORINFO_METHOD_HANDLE inlineeHnd, - CorInfoInline inlineResult, - const char* reason) +void interceptor_ICJI::reportInliningDecision( + CORINFO_METHOD_HANDLE inlinerHnd, + CORINFO_METHOD_HANDLE inlineeHnd, + CorInfoInline inlineResult, + const char* reason) { mcs->AddCall("reportInliningDecision"); original_ICorJitInfo->reportInliningDecision(inlinerHnd, inlineeHnd, inlineResult, reason); } -// Returns false if the call is across security boundaries thus we cannot tailcall -// -// The callerHnd must be the immediate caller (i.e. when we have a chain of inlined calls) -bool interceptor_ICJI::canTailCall(CORINFO_METHOD_HANDLE callerHnd, /* IN */ - CORINFO_METHOD_HANDLE declaredCalleeHnd, /* IN */ - CORINFO_METHOD_HANDLE exactCalleeHnd, /* IN */ - bool fIsTailPrefix /* IN */ - ) +bool interceptor_ICJI::canTailCall( + CORINFO_METHOD_HANDLE callerHnd, + CORINFO_METHOD_HANDLE declaredCalleeHnd, + CORINFO_METHOD_HANDLE exactCalleeHnd, + bool fIsTailPrefix) { mcs->AddCall("canTailCall"); return original_ICorJitInfo->canTailCall(callerHnd, declaredCalleeHnd, exactCalleeHnd, fIsTailPrefix); } -// Reports whether or not a method can be tail called, and why. -// canTailCall is responsible for reporting all results when it returns -// false. All other results are reported by the JIT. -void interceptor_ICJI::reportTailCallDecision(CORINFO_METHOD_HANDLE callerHnd, - CORINFO_METHOD_HANDLE calleeHnd, - bool fIsTailPrefix, - CorInfoTailCall tailCallResult, - const char* reason) +void interceptor_ICJI::reportTailCallDecision( + CORINFO_METHOD_HANDLE callerHnd, + CORINFO_METHOD_HANDLE calleeHnd, + bool fIsTailPrefix, + CorInfoTailCall tailCallResult, + const char* reason) { mcs->AddCall("reportTailCallDecision"); original_ICorJitInfo->reportTailCallDecision(callerHnd, calleeHnd, fIsTailPrefix, tailCallResult, reason); } -// get individual exception handler -void interceptor_ICJI::getEHinfo(CORINFO_METHOD_HANDLE ftn, /* IN */ - unsigned EHnumber, /* IN */ - CORINFO_EH_CLAUSE* clause /* OUT */ - ) +void interceptor_ICJI::getEHinfo( + CORINFO_METHOD_HANDLE ftn, + unsigned EHnumber, + CORINFO_EH_CLAUSE* clause) { mcs->AddCall("getEHinfo"); original_ICorJitInfo->getEHinfo(ftn, EHnumber, clause); } -// return class it belongs to -CORINFO_CLASS_HANDLE interceptor_ICJI::getMethodClass(CORINFO_METHOD_HANDLE method) +CORINFO_CLASS_HANDLE interceptor_ICJI::getMethodClass( + CORINFO_METHOD_HANDLE method) { mcs->AddCall("getMethodClass"); return original_ICorJitInfo->getMethodClass(method); } -// return module it belongs to -CORINFO_MODULE_HANDLE interceptor_ICJI::getMethodModule(CORINFO_METHOD_HANDLE method) +CORINFO_MODULE_HANDLE interceptor_ICJI::getMethodModule( + CORINFO_METHOD_HANDLE method) { mcs->AddCall("getMethodModule"); return original_ICorJitInfo->getMethodModule(method); } -// This function returns the offset of the specified method in the -// vtable of it's owning class or interface. -void interceptor_ICJI::getMethodVTableOffset(CORINFO_METHOD_HANDLE method, /* IN */ - unsigned* offsetOfIndirection, /* OUT */ - unsigned* offsetAfterIndirection, /* OUT */ - bool* isRelative /* OUT */ - ) +void interceptor_ICJI::getMethodVTableOffset( + CORINFO_METHOD_HANDLE method, + unsigned* offsetOfIndirection, + unsigned* offsetAfterIndirection, + bool* isRelative) { mcs->AddCall("getMethodVTableOffset"); original_ICorJitInfo->getMethodVTableOffset(method, offsetOfIndirection, offsetAfterIndirection, isRelative); } -// Find the virtual method in implementingClass that overrides virtualMethod. -// Return null if devirtualization is not possible. -CORINFO_METHOD_HANDLE interceptor_ICJI::resolveVirtualMethod(CORINFO_METHOD_HANDLE virtualMethod, - CORINFO_CLASS_HANDLE implementingClass, - CORINFO_CONTEXT_HANDLE ownerType) +CORINFO_METHOD_HANDLE interceptor_ICJI::resolveVirtualMethod( + CORINFO_METHOD_HANDLE virtualMethod, + CORINFO_CLASS_HANDLE implementingClass, + CORINFO_CONTEXT_HANDLE ownerType) { mcs->AddCall("resolveVirtualMethod"); return original_ICorJitInfo->resolveVirtualMethod(virtualMethod, implementingClass, ownerType); } -// Get the unboxed entry point for a method, if possible. -CORINFO_METHOD_HANDLE interceptor_ICJI::getUnboxedEntry(CORINFO_METHOD_HANDLE ftn, bool* requiresInstMethodTableArg) +CORINFO_METHOD_HANDLE interceptor_ICJI::getUnboxedEntry( + CORINFO_METHOD_HANDLE ftn, + bool* requiresInstMethodTableArg) { mcs->AddCall("getUnboxedEntry"); return original_ICorJitInfo->getUnboxedEntry(ftn, requiresInstMethodTableArg); } -// Given T, return the type of the default EqualityComparer. -// Returns null if the type can't be determined exactly. -CORINFO_CLASS_HANDLE interceptor_ICJI::getDefaultEqualityComparerClass(CORINFO_CLASS_HANDLE cls) +CORINFO_CLASS_HANDLE interceptor_ICJI::getDefaultEqualityComparerClass( + CORINFO_CLASS_HANDLE elemType) { mcs->AddCall("getDefaultEqualityComparerClass"); - return original_ICorJitInfo->getDefaultEqualityComparerClass(cls); + return original_ICorJitInfo->getDefaultEqualityComparerClass(elemType); } -void interceptor_ICJI::expandRawHandleIntrinsic(CORINFO_RESOLVED_TOKEN* pResolvedToken, - CORINFO_GENERICHANDLE_RESULT* pResult) +void interceptor_ICJI::expandRawHandleIntrinsic( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_GENERICHANDLE_RESULT* pResult) { mcs->AddCall("expandRawHandleIntrinsic"); original_ICorJitInfo->expandRawHandleIntrinsic(pResolvedToken, pResult); } -// If a method's attributes have (getMethodAttribs) CORINFO_FLG_INTRINSIC set, -// getIntrinsicID() returns the intrinsic ID. -CorInfoIntrinsics interceptor_ICJI::getIntrinsicID(CORINFO_METHOD_HANDLE method, bool* pMustExpand /* OUT */ - ) +CorInfoIntrinsics interceptor_ICJI::getIntrinsicID( + CORINFO_METHOD_HANDLE method, + bool* pMustExpand) { mcs->AddCall("getIntrinsicID"); return original_ICorJitInfo->getIntrinsicID(method, pMustExpand); } -// Is the given type in System.Private.Corelib and marked with IntrinsicAttribute? -bool interceptor_ICJI::isIntrinsicType(CORINFO_CLASS_HANDLE classHnd) +bool interceptor_ICJI::isIntrinsicType( + CORINFO_CLASS_HANDLE classHnd) { mcs->AddCall("isIntrinsicType"); return original_ICorJitInfo->isIntrinsicType(classHnd); } -// return the unmanaged calling convention for a PInvoke -CorInfoUnmanagedCallConv interceptor_ICJI::getUnmanagedCallConv(CORINFO_METHOD_HANDLE method) +CorInfoUnmanagedCallConv interceptor_ICJI::getUnmanagedCallConv( + CORINFO_METHOD_HANDLE method) { mcs->AddCall("getUnmanagedCallConv"); return original_ICorJitInfo->getUnmanagedCallConv(method); } -// return if any marshaling is required for PInvoke methods. Note that -// method == 0 => calli. The call site sig is only needed for the varargs or calli case -BOOL interceptor_ICJI::pInvokeMarshalingRequired(CORINFO_METHOD_HANDLE method, CORINFO_SIG_INFO* callSiteSig) +BOOL interceptor_ICJI::pInvokeMarshalingRequired( + CORINFO_METHOD_HANDLE method, + CORINFO_SIG_INFO* callSiteSig) { mcs->AddCall("pInvokeMarshalingRequired"); return original_ICorJitInfo->pInvokeMarshalingRequired(method, callSiteSig); } -// Check constraints on method type arguments (only). -// The parent class should be checked separately using satisfiesClassConstraints(parent). -BOOL interceptor_ICJI::satisfiesMethodConstraints(CORINFO_CLASS_HANDLE parent, // the exact parent of the method - CORINFO_METHOD_HANDLE method) +BOOL interceptor_ICJI::satisfiesMethodConstraints( + CORINFO_CLASS_HANDLE parent, + CORINFO_METHOD_HANDLE method) { mcs->AddCall("satisfiesMethodConstraints"); return original_ICorJitInfo->satisfiesMethodConstraints(parent, method); } -// Given a delegate target class, a target method parent class, a target method, -// a delegate class, check if the method signature is compatible with the Invoke method of the delegate -// (under the typical instantiation of any free type variables in the memberref signatures). BOOL interceptor_ICJI::isCompatibleDelegate( - CORINFO_CLASS_HANDLE objCls, /* type of the delegate target, if any */ - CORINFO_CLASS_HANDLE methodParentCls, /* exact parent of the target method, if any */ - CORINFO_METHOD_HANDLE method, /* (representative) target method, if any */ - CORINFO_CLASS_HANDLE delegateCls, /* exact type of the delegate */ - BOOL* pfIsOpenDelegate /* is the delegate open */ - ) + CORINFO_CLASS_HANDLE objCls, + CORINFO_CLASS_HANDLE methodParentCls, + CORINFO_METHOD_HANDLE method, + CORINFO_CLASS_HANDLE delegateCls, + BOOL* pfIsOpenDelegate) { mcs->AddCall("isCompatibleDelegate"); return original_ICorJitInfo->isCompatibleDelegate(objCls, methodParentCls, method, delegateCls, pfIsOpenDelegate); } -// load and restore the method -void interceptor_ICJI::methodMustBeLoadedBeforeCodeIsRun(CORINFO_METHOD_HANDLE method) +void interceptor_ICJI::methodMustBeLoadedBeforeCodeIsRun( + CORINFO_METHOD_HANDLE method) { mcs->AddCall("methodMustBeLoadedBeforeCodeIsRun"); original_ICorJitInfo->methodMustBeLoadedBeforeCodeIsRun(method); } -CORINFO_METHOD_HANDLE interceptor_ICJI::mapMethodDeclToMethodImpl(CORINFO_METHOD_HANDLE method) +CORINFO_METHOD_HANDLE interceptor_ICJI::mapMethodDeclToMethodImpl( + CORINFO_METHOD_HANDLE method) { mcs->AddCall("mapMethodDeclToMethodImpl"); return original_ICorJitInfo->mapMethodDeclToMethodImpl(method); } -// Returns the global cookie for the /GS unsafe buffer checks -// The cookie might be a constant value (JIT), or a handle to memory location (Ngen) -void interceptor_ICJI::getGSCookie(GSCookie* pCookieVal, // OUT - GSCookie** ppCookieVal // OUT - ) +void interceptor_ICJI::getGSCookie( + GSCookie* pCookieVal, + GSCookie** ppCookieVal) { mcs->AddCall("getGSCookie"); original_ICorJitInfo->getGSCookie(pCookieVal, ppCookieVal); } -// Provide patchpoint info for the method currently being jitted. -void interceptor_ICJI::setPatchpointInfo(PatchpointInfo* patchpointInfo) +void interceptor_ICJI::setPatchpointInfo( + PatchpointInfo* patchpointInfo) { mcs->AddCall("setPatchpointInfo"); original_ICorJitInfo->setPatchpointInfo(patchpointInfo); } -// Get OSR info for the method currently being jitted -PatchpointInfo* interceptor_ICJI::getOSRInfo(unsigned* ilOffset) +PatchpointInfo* interceptor_ICJI::getOSRInfo( + unsigned* ilOffset) { mcs->AddCall("getOSRInfo"); return original_ICorJitInfo->getOSRInfo(ilOffset); } -/**********************************************************************************/ -// -// ICorModuleInfo -// -/**********************************************************************************/ - -// Resolve metadata token into runtime method handles. -void interceptor_ICJI::resolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN* pResolvedToken) +void interceptor_ICJI::resolveToken( + CORINFO_RESOLVED_TOKEN* pResolvedToken) { mcs->AddCall("resolveToken"); original_ICorJitInfo->resolveToken(pResolvedToken); } -bool interceptor_ICJI::tryResolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN* pResolvedToken) +bool interceptor_ICJI::tryResolveToken( + CORINFO_RESOLVED_TOKEN* pResolvedToken) { mcs->AddCall("tryResolveToken"); return original_ICorJitInfo->tryResolveToken(pResolvedToken); } -// Signature information about the call sig -void interceptor_ICJI::findSig(CORINFO_MODULE_HANDLE module, /* IN */ - unsigned sigTOK, /* IN */ - CORINFO_CONTEXT_HANDLE context, /* IN */ - CORINFO_SIG_INFO* sig /* OUT */ - ) +void interceptor_ICJI::findSig( + CORINFO_MODULE_HANDLE module, + unsigned sigTOK, + CORINFO_CONTEXT_HANDLE context, + CORINFO_SIG_INFO* sig) { mcs->AddCall("findSig"); original_ICorJitInfo->findSig(module, sigTOK, context, sig); } -// for Varargs, the signature at the call site may differ from -// the signature at the definition. Thus we need a way of -// fetching the call site information -void interceptor_ICJI::findCallSiteSig(CORINFO_MODULE_HANDLE module, /* IN */ - unsigned methTOK, /* IN */ - CORINFO_CONTEXT_HANDLE context, /* IN */ - CORINFO_SIG_INFO* sig /* OUT */ - ) +void interceptor_ICJI::findCallSiteSig( + CORINFO_MODULE_HANDLE module, + unsigned methTOK, + CORINFO_CONTEXT_HANDLE context, + CORINFO_SIG_INFO* sig) { mcs->AddCall("findCallSiteSig"); original_ICorJitInfo->findCallSiteSig(module, methTOK, context, sig); } -CORINFO_CLASS_HANDLE interceptor_ICJI::getTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken /* IN */) +CORINFO_CLASS_HANDLE interceptor_ICJI::getTokenTypeAsHandle( + CORINFO_RESOLVED_TOKEN* pResolvedToken) { mcs->AddCall("getTokenTypeAsHandle"); return original_ICorJitInfo->getTokenTypeAsHandle(pResolvedToken); } -// 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. -// - -// Checks if the given metadata token is valid -BOOL interceptor_ICJI::isValidToken(CORINFO_MODULE_HANDLE module, /* IN */ - unsigned metaTOK /* IN */ - ) +BOOL interceptor_ICJI::isValidToken( + CORINFO_MODULE_HANDLE module, + unsigned metaTOK) { mcs->AddCall("isValidToken"); return original_ICorJitInfo->isValidToken(module, metaTOK); } -// Checks if the given metadata token is valid StringRef -BOOL interceptor_ICJI::isValidStringRef(CORINFO_MODULE_HANDLE module, /* IN */ - unsigned metaTOK /* IN */ - ) +BOOL interceptor_ICJI::isValidStringRef( + CORINFO_MODULE_HANDLE module, + unsigned metaTOK) { mcs->AddCall("isValidStringRef"); return original_ICorJitInfo->isValidStringRef(module, metaTOK); } -LPCWSTR interceptor_ICJI::getStringLiteral(CORINFO_MODULE_HANDLE module, /* IN */ - unsigned metaTOK, /* IN */ - int* length /* OUT */ - ) +LPCWSTR interceptor_ICJI::getStringLiteral( + CORINFO_MODULE_HANDLE module, + unsigned metaTOK, + int* length) { mcs->AddCall("getStringLiteral"); return original_ICorJitInfo->getStringLiteral(module, metaTOK, length); } -/**********************************************************************************/ -// -// ICorClassInfo -// -/**********************************************************************************/ - -// If the value class 'cls' is isomorphic to a primitive type it will -// return that type, otherwise it will return CORINFO_TYPE_VALUECLASS -CorInfoType interceptor_ICJI::asCorInfoType(CORINFO_CLASS_HANDLE cls) +CorInfoType interceptor_ICJI::asCorInfoType( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("asCorInfoType"); return original_ICorJitInfo->asCorInfoType(cls); } -// for completeness -const char* interceptor_ICJI::getClassName(CORINFO_CLASS_HANDLE cls) +const char* interceptor_ICJI::getClassName( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("getClassName"); return original_ICorJitInfo->getClassName(cls); } -const char* interceptor_ICJI::getClassNameFromMetadata(CORINFO_CLASS_HANDLE cls, const char** namespaceName) +const char* interceptor_ICJI::getClassNameFromMetadata( + CORINFO_CLASS_HANDLE cls, + const char** namespaceName) { mcs->AddCall("getClassNameFromMetadata"); return original_ICorJitInfo->getClassNameFromMetadata(cls, namespaceName); } -CORINFO_CLASS_HANDLE interceptor_ICJI::getTypeInstantiationArgument(CORINFO_CLASS_HANDLE cls, unsigned index) +CORINFO_CLASS_HANDLE interceptor_ICJI::getTypeInstantiationArgument( + CORINFO_CLASS_HANDLE cls, + unsigned index) { mcs->AddCall("getTypeInstantiationArgument"); return original_ICorJitInfo->getTypeInstantiationArgument(cls, index); } -// 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 -// If fFullInst=TRUE (regardless of fNamespace and fAssembly), include namespace and assembly for any type parameters -// If fAssembly=TRUE, suffix with a comma and the full assembly qualification -// return size of representation -int interceptor_ICJI::appendClassName(__deref_inout_ecount(*pnBufLen) WCHAR** ppBuf, - int* pnBufLen, - CORINFO_CLASS_HANDLE cls, - BOOL fNamespace, - BOOL fFullInst, - BOOL fAssembly) +int interceptor_ICJI::appendClassName( + WCHAR** ppBuf, + int* pnBufLen, + CORINFO_CLASS_HANDLE cls, + BOOL fNamespace, + BOOL fFullInst, + BOOL fAssembly) { mcs->AddCall("appendClassName"); return original_ICorJitInfo->appendClassName(ppBuf, pnBufLen, cls, fNamespace, fFullInst, fAssembly); } -// Quick check whether the type is a value class. Returns the same value as getClassAttribs(cls) & -// CORINFO_FLG_VALUECLASS, except faster. -BOOL interceptor_ICJI::isValueClass(CORINFO_CLASS_HANDLE cls) +BOOL interceptor_ICJI::isValueClass( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("isValueClass"); return original_ICorJitInfo->isValueClass(cls); } -// Decides how the JIT should do the optimization to inline the check for -// GetTypeFromHandle(handle) == obj.GetType() (for CORINFO_INLINE_TYPECHECK_SOURCE_VTABLE) -// GetTypeFromHandle(X) == GetTypeFromHandle(Y) (for CORINFO_INLINE_TYPECHECK_SOURCE_TOKEN) -CorInfoInlineTypeCheck interceptor_ICJI::canInlineTypeCheck(CORINFO_CLASS_HANDLE cls, - CorInfoInlineTypeCheckSource source) +CorInfoInlineTypeCheck interceptor_ICJI::canInlineTypeCheck( + CORINFO_CLASS_HANDLE cls, + CorInfoInlineTypeCheckSource source) { mcs->AddCall("canInlineTypeCheck"); return original_ICorJitInfo->canInlineTypeCheck(cls, source); } -// return flags (defined above, CORINFO_FLG_PUBLIC ...) -DWORD interceptor_ICJI::getClassAttribs(CORINFO_CLASS_HANDLE cls) +DWORD interceptor_ICJI::getClassAttribs( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("getClassAttribs"); return original_ICorJitInfo->getClassAttribs(cls); } -// 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 -// 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 -// buffers do not require GC write barriers. -BOOL interceptor_ICJI::isStructRequiringStackAllocRetBuf(CORINFO_CLASS_HANDLE cls) +BOOL interceptor_ICJI::isStructRequiringStackAllocRetBuf( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("isStructRequiringStackAllocRetBuf"); return original_ICorJitInfo->isStructRequiringStackAllocRetBuf(cls); } -CORINFO_MODULE_HANDLE interceptor_ICJI::getClassModule(CORINFO_CLASS_HANDLE cls) +CORINFO_MODULE_HANDLE interceptor_ICJI::getClassModule( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("getClassModule"); return original_ICorJitInfo->getClassModule(cls); } -// Returns the assembly that contains the module "mod". -CORINFO_ASSEMBLY_HANDLE interceptor_ICJI::getModuleAssembly(CORINFO_MODULE_HANDLE mod) +CORINFO_ASSEMBLY_HANDLE interceptor_ICJI::getModuleAssembly( + CORINFO_MODULE_HANDLE mod) { mcs->AddCall("getModuleAssembly"); return original_ICorJitInfo->getModuleAssembly(mod); } -// Returns the name of the assembly "assem". -const char* interceptor_ICJI::getAssemblyName(CORINFO_ASSEMBLY_HANDLE assem) +const char* interceptor_ICJI::getAssemblyName( + CORINFO_ASSEMBLY_HANDLE assem) { mcs->AddCall("getAssemblyName"); return original_ICorJitInfo->getAssemblyName(assem); } -// Allocate and delete process-lifetime objects. Should only be -// referred to from static fields, lest a leak occur. -// Note that "LongLifetimeFree" does not execute destructors, if "obj" -// is an array of a struct type with a destructor. -void* interceptor_ICJI::LongLifetimeMalloc(size_t sz) +void* interceptor_ICJI::LongLifetimeMalloc( + size_t sz) { mcs->AddCall("LongLifetimeMalloc"); return original_ICorJitInfo->LongLifetimeMalloc(sz); } -void interceptor_ICJI::LongLifetimeFree(void* obj) +void interceptor_ICJI::LongLifetimeFree( + void* obj) { mcs->AddCall("LongLifetimeFree"); original_ICorJitInfo->LongLifetimeFree(obj); } -size_t interceptor_ICJI::getClassModuleIdForStatics(CORINFO_CLASS_HANDLE cls, - CORINFO_MODULE_HANDLE* pModule, - void** ppIndirection) +size_t interceptor_ICJI::getClassModuleIdForStatics( + CORINFO_CLASS_HANDLE cls, + CORINFO_MODULE_HANDLE* pModule, + void** ppIndirection) { mcs->AddCall("getClassModuleIdForStatics"); return original_ICorJitInfo->getClassModuleIdForStatics(cls, pModule, ppIndirection); } -// return the number of bytes needed by an instance of the class -unsigned interceptor_ICJI::getClassSize(CORINFO_CLASS_HANDLE cls) +unsigned interceptor_ICJI::getClassSize( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("getClassSize"); return original_ICorJitInfo->getClassSize(cls); } -// return the number of bytes needed by an instance of the class allocated on the heap -unsigned interceptor_ICJI::getHeapClassSize(CORINFO_CLASS_HANDLE cls) +unsigned interceptor_ICJI::getHeapClassSize( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("getHeapClassSize"); return original_ICorJitInfo->getHeapClassSize(cls); } -BOOL interceptor_ICJI::canAllocateOnStack(CORINFO_CLASS_HANDLE cls) +BOOL interceptor_ICJI::canAllocateOnStack( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("canAllocateOnStack"); return original_ICorJitInfo->canAllocateOnStack(cls); } -unsigned interceptor_ICJI::getClassAlignmentRequirement(CORINFO_CLASS_HANDLE cls, BOOL fDoubleAlignHint) +unsigned interceptor_ICJI::getClassAlignmentRequirement( + CORINFO_CLASS_HANDLE cls, + BOOL fDoubleAlignHint) { mcs->AddCall("getClassAlignmentRequirement"); return original_ICorJitInfo->getClassAlignmentRequirement(cls, fDoubleAlignHint); } -// This is only called for Value classes. It returns a boolean array -// in representing of 'cls' from a GC perspective. The class is -// assumed to be an array of machine words -// (of length // getClassSize(cls) / sizeof(void*)), -// 'gcPtrs' is a pointer to an array of BYTEs of this length. -// getClassGClayout fills in this array so that gcPtrs[i] is set -// to one of the CorInfoGCType values which is the GC type of -// the i-th machine word of an object of type 'cls' -// returns the number of GC pointers in the array -unsigned interceptor_ICJI::getClassGClayout(CORINFO_CLASS_HANDLE cls, /* IN */ - BYTE* gcPtrs /* OUT */ - ) +unsigned interceptor_ICJI::getClassGClayout( + CORINFO_CLASS_HANDLE cls, + BYTE* gcPtrs) { mcs->AddCall("getClassGClayout"); return original_ICorJitInfo->getClassGClayout(cls, gcPtrs); } -// returns the number of instance fields in a class -unsigned interceptor_ICJI::getClassNumInstanceFields(CORINFO_CLASS_HANDLE cls /* IN */ - ) +unsigned interceptor_ICJI::getClassNumInstanceFields( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("getClassNumInstanceFields"); return original_ICorJitInfo->getClassNumInstanceFields(cls); } -CORINFO_FIELD_HANDLE interceptor_ICJI::getFieldInClass(CORINFO_CLASS_HANDLE clsHnd, INT num) +CORINFO_FIELD_HANDLE interceptor_ICJI::getFieldInClass( + CORINFO_CLASS_HANDLE clsHnd, + INT num) { mcs->AddCall("getFieldInClass"); return original_ICorJitInfo->getFieldInClass(clsHnd, num); } -BOOL interceptor_ICJI::checkMethodModifier(CORINFO_METHOD_HANDLE hMethod, LPCSTR modifier, BOOL fOptional) +BOOL interceptor_ICJI::checkMethodModifier( + CORINFO_METHOD_HANDLE hMethod, + LPCSTR modifier, + BOOL fOptional) { mcs->AddCall("checkMethodModifier"); return original_ICorJitInfo->checkMethodModifier(hMethod, modifier, fOptional); } -// returns the "NEW" helper optimized for "newCls." -CorInfoHelpFunc interceptor_ICJI::getNewHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, - CORINFO_METHOD_HANDLE callerHandle, - bool* pHasSideEffects) +CorInfoHelpFunc interceptor_ICJI::getNewHelper( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_METHOD_HANDLE callerHandle, + bool* pHasSideEffects) { mcs->AddCall("getNewHelper"); return original_ICorJitInfo->getNewHelper(pResolvedToken, callerHandle, pHasSideEffects); } -// returns the newArr (1-Dim array) helper optimized for "arrayCls." -CorInfoHelpFunc interceptor_ICJI::getNewArrHelper(CORINFO_CLASS_HANDLE arrayCls) +CorInfoHelpFunc interceptor_ICJI::getNewArrHelper( + CORINFO_CLASS_HANDLE arrayCls) { mcs->AddCall("getNewArrHelper"); return original_ICorJitInfo->getNewArrHelper(arrayCls); } -// returns the optimized "IsInstanceOf" or "ChkCast" helper -CorInfoHelpFunc interceptor_ICJI::getCastingHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool fThrowing) +CorInfoHelpFunc interceptor_ICJI::getCastingHelper( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + bool fThrowing) { mcs->AddCall("getCastingHelper"); return original_ICorJitInfo->getCastingHelper(pResolvedToken, fThrowing); } -// returns helper to trigger static constructor -CorInfoHelpFunc interceptor_ICJI::getSharedCCtorHelper(CORINFO_CLASS_HANDLE clsHnd) +CorInfoHelpFunc interceptor_ICJI::getSharedCCtorHelper( + CORINFO_CLASS_HANDLE clsHnd) { mcs->AddCall("getSharedCCtorHelper"); return original_ICorJitInfo->getSharedCCtorHelper(clsHnd); } -// This is not pretty. Boxing nullable actually returns -// a boxed not a boxed Nullable. This call allows the verifier -// to call back to the EE on the 'box' instruction and get the transformed -// type to use for verification. -CORINFO_CLASS_HANDLE interceptor_ICJI::getTypeForBox(CORINFO_CLASS_HANDLE cls) +CORINFO_CLASS_HANDLE interceptor_ICJI::getTypeForBox( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("getTypeForBox"); return original_ICorJitInfo->getTypeForBox(cls); } -// returns the correct box helper for a particular class. Note -// that if this returns CORINFO_HELP_BOX, the JIT can assume -// 'standard' boxing (allocate object and copy), and optimize -CorInfoHelpFunc interceptor_ICJI::getBoxHelper(CORINFO_CLASS_HANDLE cls) +CorInfoHelpFunc interceptor_ICJI::getBoxHelper( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("getBoxHelper"); return original_ICorJitInfo->getBoxHelper(cls); } -// 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 -// 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. - -CorInfoHelpFunc interceptor_ICJI::getUnBoxHelper(CORINFO_CLASS_HANDLE cls) +CorInfoHelpFunc interceptor_ICJI::getUnBoxHelper( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("getUnBoxHelper"); return original_ICorJitInfo->getUnBoxHelper(cls); } -bool interceptor_ICJI::getReadyToRunHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, - CORINFO_LOOKUP_KIND* pGenericLookupKind, - CorInfoHelpFunc id, - CORINFO_CONST_LOOKUP* pLookup) +bool interceptor_ICJI::getReadyToRunHelper( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_LOOKUP_KIND* pGenericLookupKind, + CorInfoHelpFunc id, + CORINFO_CONST_LOOKUP* pLookup) { mcs->AddCall("getReadyToRunHelper"); return original_ICorJitInfo->getReadyToRunHelper(pResolvedToken, pGenericLookupKind, id, pLookup); } -void interceptor_ICJI::getReadyToRunDelegateCtorHelper(CORINFO_RESOLVED_TOKEN* pTargetMethod, - CORINFO_CLASS_HANDLE delegateType, - CORINFO_LOOKUP* pLookup) +void interceptor_ICJI::getReadyToRunDelegateCtorHelper( + CORINFO_RESOLVED_TOKEN* pTargetMethod, + CORINFO_CLASS_HANDLE delegateType, + CORINFO_LOOKUP* pLookup) { mcs->AddCall("getReadyToRunDelegateCtorHelper"); original_ICorJitInfo->getReadyToRunDelegateCtorHelper(pTargetMethod, delegateType, pLookup); } -const char* interceptor_ICJI::getHelperName(CorInfoHelpFunc funcNum) +const char* interceptor_ICJI::getHelperName( + CorInfoHelpFunc helpFunc) { mcs->AddCall("getHelperName"); - return original_ICorJitInfo->getHelperName(funcNum); + return original_ICorJitInfo->getHelperName(helpFunc); } -// This function tries to initialize the class (run the class constructor). -// this function returns whether the JIT must insert helper calls before -// accessing static field or method. -// -// See code:ICorClassInfo#ClassConstruction. CorInfoInitClassResult interceptor_ICJI::initClass( - CORINFO_FIELD_HANDLE field, // Non-nullptr - inquire about cctor trigger before static field access - // nullptr - inquire about cctor trigger in method prolog - CORINFO_METHOD_HANDLE method, // Method referencing the field or prolog - CORINFO_CONTEXT_HANDLE context // Exact context of method - ) + CORINFO_FIELD_HANDLE field, + CORINFO_METHOD_HANDLE method, + CORINFO_CONTEXT_HANDLE context) { mcs->AddCall("initClass"); return original_ICorJitInfo->initClass(field, method, context); } -// This used to be called "loadClass". This records the fact -// that the class must be loaded (including restored if necessary) before we execute the -// code that we are currently generating. When jitting code -// the function loads the class immediately. When zapping code -// the zapper will if necessary use the call to record the fact that we have -// to do a fixup/restore before running the method currently being generated. -// -// This is typically used to ensure value types are loaded before zapped -// code that manipulates them is executed, so that the GC can access information -// about those value types. -void interceptor_ICJI::classMustBeLoadedBeforeCodeIsRun(CORINFO_CLASS_HANDLE cls) +void interceptor_ICJI::classMustBeLoadedBeforeCodeIsRun( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("classMustBeLoadedBeforeCodeIsRun"); original_ICorJitInfo->classMustBeLoadedBeforeCodeIsRun(cls); } -// returns the class handle for the special builtin classes -CORINFO_CLASS_HANDLE interceptor_ICJI::getBuiltinClass(CorInfoClassId classId) +CORINFO_CLASS_HANDLE interceptor_ICJI::getBuiltinClass( + CorInfoClassId classId) { mcs->AddCall("getBuiltinClass"); return original_ICorJitInfo->getBuiltinClass(classId); } -// "System.Int32" ==> CORINFO_TYPE_INT.. -CorInfoType interceptor_ICJI::getTypeForPrimitiveValueClass(CORINFO_CLASS_HANDLE cls) +CorInfoType interceptor_ICJI::getTypeForPrimitiveValueClass( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("getTypeForPrimitiveValueClass"); return original_ICorJitInfo->getTypeForPrimitiveValueClass(cls); } -// "System.Int32" ==> CORINFO_TYPE_INT.. -// "System.UInt32" ==> CORINFO_TYPE_UINT.. -CorInfoType interceptor_ICJI::getTypeForPrimitiveNumericClass(CORINFO_CLASS_HANDLE cls) +CorInfoType interceptor_ICJI::getTypeForPrimitiveNumericClass( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("getTypeForPrimitiveNumericClass"); return original_ICorJitInfo->getTypeForPrimitiveNumericClass(cls); } -// TRUE if child is a subtype of parent -// if parent is an interface, then does child implement / extend parent -BOOL interceptor_ICJI::canCast(CORINFO_CLASS_HANDLE child, // subtype (extends parent) - CORINFO_CLASS_HANDLE parent // base type - ) +BOOL interceptor_ICJI::canCast( + CORINFO_CLASS_HANDLE child, + CORINFO_CLASS_HANDLE parent) { mcs->AddCall("canCast"); return original_ICorJitInfo->canCast(child, parent); } -// TRUE if cls1 and cls2 are considered equivalent types. -BOOL interceptor_ICJI::areTypesEquivalent(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) +BOOL interceptor_ICJI::areTypesEquivalent( + CORINFO_CLASS_HANDLE cls1, + CORINFO_CLASS_HANDLE cls2) { mcs->AddCall("areTypesEquivalent"); return original_ICorJitInfo->areTypesEquivalent(cls1, cls2); } -// See if a cast from fromClass to toClass will succeed, fail, or needs -// to be resolved at runtime. -TypeCompareState interceptor_ICJI::compareTypesForCast(CORINFO_CLASS_HANDLE fromClass, CORINFO_CLASS_HANDLE toClass) +TypeCompareState interceptor_ICJI::compareTypesForCast( + CORINFO_CLASS_HANDLE fromClass, + CORINFO_CLASS_HANDLE toClass) { mcs->AddCall("compareTypesForCast"); return original_ICorJitInfo->compareTypesForCast(fromClass, toClass); } -// See if types represented by cls1 and cls2 compare equal, not -// equal, or the comparison needs to be resolved at runtime. -TypeCompareState interceptor_ICJI::compareTypesForEquality(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) +TypeCompareState interceptor_ICJI::compareTypesForEquality( + CORINFO_CLASS_HANDLE cls1, + CORINFO_CLASS_HANDLE cls2) { mcs->AddCall("compareTypesForEquality"); return original_ICorJitInfo->compareTypesForEquality(cls1, cls2); } -// returns is the intersection of cls1 and cls2. -CORINFO_CLASS_HANDLE interceptor_ICJI::mergeClasses(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) +CORINFO_CLASS_HANDLE interceptor_ICJI::mergeClasses( + CORINFO_CLASS_HANDLE cls1, + CORINFO_CLASS_HANDLE cls2) { mcs->AddCall("mergeClasses"); return original_ICorJitInfo->mergeClasses(cls1, cls2); } -// Returns true if cls2 is known to be a more specific type than cls1. -BOOL interceptor_ICJI::isMoreSpecificType(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) +BOOL interceptor_ICJI::isMoreSpecificType( + CORINFO_CLASS_HANDLE cls1, + CORINFO_CLASS_HANDLE cls2) { mcs->AddCall("isMoreSpecificType"); return original_ICorJitInfo->isMoreSpecificType(cls1, cls2); } -// Given a class handle, returns the Parent type. -// For COMObjectType, it returns Class Handle of System.Object. -// Returns 0 if System.Object is passed in. -CORINFO_CLASS_HANDLE interceptor_ICJI::getParentType(CORINFO_CLASS_HANDLE cls) +CORINFO_CLASS_HANDLE interceptor_ICJI::getParentType( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("getParentType"); return original_ICorJitInfo->getParentType(cls); } -// Returns the CorInfoType of the "child type". If the child type is -// not a primitive type, *clsRet will be set. -// Given an Array of Type Foo, returns Foo. -// Given BYREF Foo, returns Foo -CorInfoType interceptor_ICJI::getChildType(CORINFO_CLASS_HANDLE clsHnd, CORINFO_CLASS_HANDLE* clsRet) +CorInfoType interceptor_ICJI::getChildType( + CORINFO_CLASS_HANDLE clsHnd, + CORINFO_CLASS_HANDLE* clsRet) { mcs->AddCall("getChildType"); return original_ICorJitInfo->getChildType(clsHnd, clsRet); } -// Check constraints on type arguments of this class and parent classes -BOOL interceptor_ICJI::satisfiesClassConstraints(CORINFO_CLASS_HANDLE cls) +BOOL interceptor_ICJI::satisfiesClassConstraints( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("satisfiesClassConstraints"); return original_ICorJitInfo->satisfiesClassConstraints(cls); } -// Check if this is a single dimensional array type -BOOL interceptor_ICJI::isSDArray(CORINFO_CLASS_HANDLE cls) +BOOL interceptor_ICJI::isSDArray( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("isSDArray"); return original_ICorJitInfo->isSDArray(cls); } -// Get the numbmer of dimensions in an array -unsigned interceptor_ICJI::getArrayRank(CORINFO_CLASS_HANDLE cls) +unsigned interceptor_ICJI::getArrayRank( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("getArrayRank"); return original_ICorJitInfo->getArrayRank(cls); } -// Get static field data for an array -void* interceptor_ICJI::getArrayInitializationData(CORINFO_FIELD_HANDLE field, DWORD size) +void* interceptor_ICJI::getArrayInitializationData( + CORINFO_FIELD_HANDLE field, + DWORD size) { mcs->AddCall("getArrayInitializationData"); return original_ICorJitInfo->getArrayInitializationData(field, size); } -// Check Visibility rules. CorInfoIsAccessAllowedResult interceptor_ICJI::canAccessClass( - CORINFO_RESOLVED_TOKEN* pResolvedToken, - CORINFO_METHOD_HANDLE callerHandle, - CORINFO_HELPER_DESC* pAccessHelper /* If canAccessMethod returns something other - than ALLOWED, then this is filled in. */ - ) + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_METHOD_HANDLE callerHandle, + CORINFO_HELPER_DESC* pAccessHelper) { mcs->AddCall("canAccessClass"); return original_ICorJitInfo->canAccessClass(pResolvedToken, callerHandle, pAccessHelper); } -/**********************************************************************************/ -// -// ICorFieldInfo -// -/**********************************************************************************/ - -// this function is for debugging only. It returns the field name -// and if 'moduleName' is non-null, it sets it to something that will -// says which method (a class name, or a module name) -const char* interceptor_ICJI::getFieldName(CORINFO_FIELD_HANDLE ftn, /* IN */ - const char** moduleName /* OUT */ - ) +const char* interceptor_ICJI::getFieldName( + CORINFO_FIELD_HANDLE ftn, + const char** moduleName) { mcs->AddCall("getFieldName"); return original_ICorJitInfo->getFieldName(ftn, moduleName); } -// return class it belongs to -CORINFO_CLASS_HANDLE interceptor_ICJI::getFieldClass(CORINFO_FIELD_HANDLE field) +CORINFO_CLASS_HANDLE interceptor_ICJI::getFieldClass( + CORINFO_FIELD_HANDLE field) { mcs->AddCall("getFieldClass"); return original_ICorJitInfo->getFieldClass(field); } -// Return the field's type, if it is CORINFO_TYPE_VALUECLASS 'structType' is set -// the field's value class (if 'structType' == 0, then don't bother -// the structure info). -// -// 'memberParent' is typically only set when verifying. It should be the -// result of calling getMemberParent. -CorInfoType interceptor_ICJI::getFieldType(CORINFO_FIELD_HANDLE field, - CORINFO_CLASS_HANDLE* structType, - CORINFO_CLASS_HANDLE memberParent /* IN */ - ) +CorInfoType interceptor_ICJI::getFieldType( + CORINFO_FIELD_HANDLE field, + CORINFO_CLASS_HANDLE* structType, + CORINFO_CLASS_HANDLE memberParent) { mcs->AddCall("getFieldType"); return original_ICorJitInfo->getFieldType(field, structType, memberParent); } -// return the data member's instance offset -unsigned interceptor_ICJI::getFieldOffset(CORINFO_FIELD_HANDLE field) +unsigned interceptor_ICJI::getFieldOffset( + CORINFO_FIELD_HANDLE field) { mcs->AddCall("getFieldOffset"); return original_ICorJitInfo->getFieldOffset(field); } -void interceptor_ICJI::getFieldInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken, - CORINFO_METHOD_HANDLE callerHandle, - CORINFO_ACCESS_FLAGS flags, - CORINFO_FIELD_INFO* pResult) +void interceptor_ICJI::getFieldInfo( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_METHOD_HANDLE callerHandle, + CORINFO_ACCESS_FLAGS flags, + CORINFO_FIELD_INFO* pResult) { mcs->AddCall("getFieldInfo"); original_ICorJitInfo->getFieldInfo(pResolvedToken, callerHandle, flags, pResult); } -// Returns true iff "fldHnd" represents a static field. -bool interceptor_ICJI::isFieldStatic(CORINFO_FIELD_HANDLE fldHnd) +bool interceptor_ICJI::isFieldStatic( + CORINFO_FIELD_HANDLE fldHnd) { mcs->AddCall("isFieldStatic"); return original_ICorJitInfo->isFieldStatic(fldHnd); } -/*********************************************************************************/ -// -// ICorDebugInfo -// -/*********************************************************************************/ - -// Query the EE to find out where interesting break points -// in the code are. The native compiler will ensure that these places -// have a corresponding break point in native code. -// -// Note that unless CORJIT_FLAG_DEBUG_CODE is specified, this function will -// be used only as a hint and the native compiler should not change its -// code generation. -void interceptor_ICJI::getBoundaries(CORINFO_METHOD_HANDLE ftn, // [IN] method of interest - unsigned int* cILOffsets, // [OUT] size of pILOffsets - DWORD** pILOffsets, // [OUT] IL offsets of interest - // jit MUST free with freeArray! - ICorDebugInfo::BoundaryTypes* implictBoundaries // [OUT] tell jit, all boundries of - // this type - ) +void interceptor_ICJI::getBoundaries( + CORINFO_METHOD_HANDLE ftn, + unsigned int* cILOffsets, + DWORD** pILOffsets, + ICorDebugInfo::BoundaryTypes* implictBoundaries) { mcs->AddCall("getBoundaries"); original_ICorJitInfo->getBoundaries(ftn, cILOffsets, pILOffsets, implictBoundaries); } -// Report back the mapping from IL to native code, -// this map should include all boundaries that 'getBoundaries' -// reported as interesting to the debugger. - -// Note that debugger (and profiler) is assuming that all of the -// offsets form a contiguous block of memory, and that the -// OffsetMapping is sorted in order of increasing native offset. -void interceptor_ICJI::setBoundaries(CORINFO_METHOD_HANDLE ftn, // [IN] method of interest - ULONG32 cMap, // [IN] size of pMap - ICorDebugInfo::OffsetMapping* pMap // [IN] map including all points of interest. - // jit allocated with allocateArray, EE - // frees - ) +void interceptor_ICJI::setBoundaries( + CORINFO_METHOD_HANDLE ftn, + ULONG32 cMap, + ICorDebugInfo::OffsetMapping* pMap) { mcs->AddCall("setBoundaries"); original_ICorJitInfo->setBoundaries(ftn, cMap, pMap); } -// Query the EE to find out the scope of local varables. -// normally the JIT would trash variables after last use, but -// under debugging, the JIT needs to keep them live over their -// entire scope so that they can be inspected. -// -// Note that unless CORJIT_FLAG_DEBUG_CODE is specified, this function will -// be used only as a hint and the native compiler should not change its -// code generation. -void interceptor_ICJI::getVars(CORINFO_METHOD_HANDLE ftn, // [IN] method of interest - ULONG32* cVars, // [OUT] size of 'vars' - ICorDebugInfo::ILVarInfo** vars, // [OUT] scopes of variables of interest - // jit MUST free with freeArray! - bool* extendOthers // [OUT] it TRUE, then assume the scope - // of unmentioned vars is entire method - ) +void interceptor_ICJI::getVars( + CORINFO_METHOD_HANDLE ftn, + ULONG32* cVars, + ICorDebugInfo::ILVarInfo** vars, + bool* extendOthers) { mcs->AddCall("getVars"); original_ICorJitInfo->getVars(ftn, cVars, vars, extendOthers); } -// Report back to the EE the location of every variable. -// note that the JIT might split lifetimes into different -// locations etc. - -void interceptor_ICJI::setVars(CORINFO_METHOD_HANDLE ftn, // [IN] method of interest - ULONG32 cVars, // [IN] size of 'vars' - ICorDebugInfo::NativeVarInfo* vars // [IN] map telling where local vars are stored at - // what points - // jit allocated with allocateArray, EE frees - ) +void interceptor_ICJI::setVars( + CORINFO_METHOD_HANDLE ftn, + ULONG32 cVars, + ICorDebugInfo::NativeVarInfo* vars) { mcs->AddCall("setVars"); original_ICorJitInfo->setVars(ftn, cVars, vars); } -/*-------------------------- Misc ---------------------------------------*/ - -// Used to allocate memory that needs to handed to the EE. -// For eg, use this to allocated memory for reporting debug info, -// which will be handed to the EE by setVars() and setBoundaries() -void* interceptor_ICJI::allocateArray(size_t cBytes) +void* interceptor_ICJI::allocateArray( + size_t cBytes) { mcs->AddCall("allocateArray"); return original_ICorJitInfo->allocateArray(cBytes); } -// JitCompiler will free arrays passed by the EE using this -// For eg, The EE returns memory in getVars() and getBoundaries() -// to the JitCompiler, which the JitCompiler should release using -// freeArray() -void interceptor_ICJI::freeArray(void* array) +void interceptor_ICJI::freeArray( + void* array) { mcs->AddCall("freeArray"); original_ICorJitInfo->freeArray(array); } -/*********************************************************************************/ -// -// ICorArgInfo -// -/*********************************************************************************/ - -// advance the pointer to the argument list. -// a ptr of 0, is special and always means the first argument -CORINFO_ARG_LIST_HANDLE interceptor_ICJI::getArgNext(CORINFO_ARG_LIST_HANDLE args /* IN */ - ) +CORINFO_ARG_LIST_HANDLE interceptor_ICJI::getArgNext( + CORINFO_ARG_LIST_HANDLE args) { mcs->AddCall("getArgNext"); return original_ICorJitInfo->getArgNext(args); } -// Get the type of a particular argument -// CORINFO_TYPE_UNDEF is returned when there are no more arguments -// If the type returned is a primitive type (or an enum) *vcTypeRet set to nullptr -// otherwise it is set to the TypeHandle associted with the type -// Enumerations will always look their underlying type (probably should fix this) -// Otherwise vcTypeRet is the type as would be seen by the IL, -// The return value is the type that is used for calling convention purposes -// (Thus if the EE wants a value class to be passed like an int, then it will -// return CORINFO_TYPE_INT -CorInfoTypeWithMod interceptor_ICJI::getArgType(CORINFO_SIG_INFO* sig, /* IN */ - CORINFO_ARG_LIST_HANDLE args, /* IN */ - CORINFO_CLASS_HANDLE* vcTypeRet /* OUT */ - ) +CorInfoTypeWithMod interceptor_ICJI::getArgType( + CORINFO_SIG_INFO* sig, + CORINFO_ARG_LIST_HANDLE args, + CORINFO_CLASS_HANDLE* vcTypeRet) { mcs->AddCall("getArgType"); return original_ICorJitInfo->getArgType(sig, args, vcTypeRet); } -// If the Arg is a CORINFO_TYPE_CLASS fetch the class handle associated with it -CORINFO_CLASS_HANDLE interceptor_ICJI::getArgClass(CORINFO_SIG_INFO* sig, /* IN */ - CORINFO_ARG_LIST_HANDLE args /* IN */ - ) +CORINFO_CLASS_HANDLE interceptor_ICJI::getArgClass( + CORINFO_SIG_INFO* sig, + CORINFO_ARG_LIST_HANDLE args) { mcs->AddCall("getArgClass"); return original_ICorJitInfo->getArgClass(sig, args); } -// Returns type of HFA for valuetype -CorInfoHFAElemType interceptor_ICJI::getHFAType(CORINFO_CLASS_HANDLE hClass) +CorInfoHFAElemType interceptor_ICJI::getHFAType( + CORINFO_CLASS_HANDLE hClass) { mcs->AddCall("getHFAType"); return original_ICorJitInfo->getHFAType(hClass); } -/***************************************************************************** -* ICorErrorInfo contains methods to deal with SEH exceptions being thrown -* from the corinfo interface. These methods may be called when an exception -* with code EXCEPTION_COMPLUS is caught. -*****************************************************************************/ - -// Returns the HRESULT of the current exception -HRESULT interceptor_ICJI::GetErrorHRESULT(struct _EXCEPTION_POINTERS* pExceptionPointers) +HRESULT interceptor_ICJI::GetErrorHRESULT( + struct _EXCEPTION_POINTERS* pExceptionPointers) { mcs->AddCall("GetErrorHRESULT"); return original_ICorJitInfo->GetErrorHRESULT(pExceptionPointers); } -// Fetches the message of the current exception -// Returns the size of the message (including terminating null). This can be -// greater than bufferLength if the buffer is insufficient. -ULONG interceptor_ICJI::GetErrorMessage(__inout_ecount(bufferLength) LPWSTR buffer, ULONG bufferLength) +ULONG interceptor_ICJI::GetErrorMessage( + LPWSTR buffer, + ULONG bufferLength) { mcs->AddCall("GetErrorMessage"); return original_ICorJitInfo->GetErrorMessage(buffer, bufferLength); } -// returns EXCEPTION_EXECUTE_HANDLER if it is OK for the compile to handle the -// exception, abort some work (like the inlining) and continue compilation -// returns EXCEPTION_CONTINUE_SEARCH if exception must always be handled by the EE -// things like ThreadStoppedException ... -// returns EXCEPTION_CONTINUE_EXECUTION if exception is fixed up by the EE - -int interceptor_ICJI::FilterException(struct _EXCEPTION_POINTERS* pExceptionPointers) +int interceptor_ICJI::FilterException( + struct _EXCEPTION_POINTERS* pExceptionPointers) { mcs->AddCall("FilterException"); return original_ICorJitInfo->FilterException(pExceptionPointers); } -// Cleans up internal EE tracking when an exception is caught. -void interceptor_ICJI::HandleException(struct _EXCEPTION_POINTERS* pExceptionPointers) +void interceptor_ICJI::HandleException( + struct _EXCEPTION_POINTERS* pExceptionPointers) { mcs->AddCall("HandleException"); original_ICorJitInfo->HandleException(pExceptionPointers); } -void interceptor_ICJI::ThrowExceptionForJitResult(HRESULT result) +void interceptor_ICJI::ThrowExceptionForJitResult( + HRESULT result) { mcs->AddCall("ThrowExceptionForJitResult"); original_ICorJitInfo->ThrowExceptionForJitResult(result); } -// Throws an exception defined by the given throw helper. -void interceptor_ICJI::ThrowExceptionForHelper(const CORINFO_HELPER_DESC* throwHelper) +void interceptor_ICJI::ThrowExceptionForHelper( + const CORINFO_HELPER_DESC* throwHelper) { mcs->AddCall("ThrowExceptionForHelper"); original_ICorJitInfo->ThrowExceptionForHelper(throwHelper); } -/***************************************************************************** - * ICorStaticInfo contains EE interface methods which return values that are - * constant from invocation to invocation. Thus they may be embedded in - * persisted information like statically generated code. (This is of course - * assuming that all code versions are identical each time.) - *****************************************************************************/ +bool interceptor_ICJI::runWithErrorTrap( + ICorJitInfo::errorTrapFunction function, + void* parameter) +{ + mcs->AddCall("runWithErrorTrap"); + return original_ICorJitInfo->runWithErrorTrap(function, parameter); +} -// Return details about EE internal data structures -void interceptor_ICJI::getEEInfo(CORINFO_EE_INFO* pEEInfoOut) +void interceptor_ICJI::getEEInfo( + CORINFO_EE_INFO* pEEInfoOut) { mcs->AddCall("getEEInfo"); original_ICorJitInfo->getEEInfo(pEEInfoOut); } -// Returns name of the JIT timer log LPCWSTR interceptor_ICJI::getJitTimeLogFilename() { mcs->AddCall("getJitTimeLogFilename"); return original_ICorJitInfo->getJitTimeLogFilename(); } -/*********************************************************************************/ -// -// Diagnostic methods -// -/*********************************************************************************/ - -// this function is for debugging only. Returns method token. -// Returns mdMethodDefNil for dynamic methods. -mdMethodDef interceptor_ICJI::getMethodDefFromMethod(CORINFO_METHOD_HANDLE hMethod) +mdMethodDef interceptor_ICJI::getMethodDefFromMethod( + CORINFO_METHOD_HANDLE hMethod) { mcs->AddCall("getMethodDefFromMethod"); return original_ICorJitInfo->getMethodDefFromMethod(hMethod); } -// this function is for debugging only. It returns the method name -// and if 'moduleName' is non-null, it sets it to something that will -// says which method (a class name, or a module name) -const char* interceptor_ICJI::getMethodName(CORINFO_METHOD_HANDLE ftn, /* IN */ - const char** moduleName /* OUT */ - ) +const char* interceptor_ICJI::getMethodName( + CORINFO_METHOD_HANDLE ftn, + const char** moduleName) { mcs->AddCall("getMethodName"); return original_ICorJitInfo->getMethodName(ftn, moduleName); } -const char* interceptor_ICJI::getMethodNameFromMetadata(CORINFO_METHOD_HANDLE ftn, /* IN */ - const char** className, /* OUT */ - const char** namespaceName, /* OUT */ - const char** enclosingClassName /* OUT */ - ) +const char* interceptor_ICJI::getMethodNameFromMetadata( + CORINFO_METHOD_HANDLE ftn, + const char** className, + const char** namespaceName, + const char** enclosingClassName) { mcs->AddCall("getMethodNameFromMetadata"); return original_ICorJitInfo->getMethodNameFromMetadata(ftn, className, namespaceName, enclosingClassName); } -// this function is for debugging only. It returns a value that -// is will always be the same for a given method. It is used -// to implement the 'jitRange' functionality -unsigned interceptor_ICJI::getMethodHash(CORINFO_METHOD_HANDLE ftn /* IN */ - ) +unsigned interceptor_ICJI::getMethodHash( + CORINFO_METHOD_HANDLE ftn) { mcs->AddCall("getMethodHash"); return original_ICorJitInfo->getMethodHash(ftn); } -// this function is for debugging only. -size_t interceptor_ICJI::findNameOfToken(CORINFO_MODULE_HANDLE module, /* IN */ - mdToken metaTOK, /* IN */ - __out_ecount(FQNameCapacity) char* szFQName, /* OUT */ - size_t FQNameCapacity /* IN */ - ) +size_t interceptor_ICJI::findNameOfToken( + CORINFO_MODULE_HANDLE moduleHandle, + mdToken token, + char* szFQName, + size_t FQNameCapacity) { mcs->AddCall("findNameOfToken"); - return original_ICorJitInfo->findNameOfToken(module, metaTOK, szFQName, FQNameCapacity); + return original_ICorJitInfo->findNameOfToken(moduleHandle, token, szFQName, FQNameCapacity); } bool interceptor_ICJI::getSystemVAmd64PassStructInRegisterDescriptor( - /* IN */ CORINFO_CLASS_HANDLE structHnd, - /* OUT */ SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr) + CORINFO_CLASS_HANDLE structHnd, + SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr) { mcs->AddCall("getSystemVAmd64PassStructInRegisterDescriptor"); return original_ICorJitInfo->getSystemVAmd64PassStructInRegisterDescriptor(structHnd, structPassInRegDescPtr); } -// Stuff on ICorDynamicInfo -DWORD interceptor_ICJI::getThreadTLSIndex(void** ppIndirection) +DWORD interceptor_ICJI::getThreadTLSIndex( + void** ppIndirection) { mcs->AddCall("getThreadTLSIndex"); return original_ICorJitInfo->getThreadTLSIndex(ppIndirection); } -const void* interceptor_ICJI::getInlinedCallFrameVptr(void** ppIndirection) +const void* interceptor_ICJI::getInlinedCallFrameVptr( + void** ppIndirection) { mcs->AddCall("getInlinedCallFrameVptr"); return original_ICorJitInfo->getInlinedCallFrameVptr(ppIndirection); } -LONG* interceptor_ICJI::getAddrOfCaptureThreadGlobal(void** ppIndirection) +LONG* interceptor_ICJI::getAddrOfCaptureThreadGlobal( + void** ppIndirection) { mcs->AddCall("getAddrOfCaptureThreadGlobal"); return original_ICorJitInfo->getAddrOfCaptureThreadGlobal(ppIndirection); } -// return the native entry point to an EE helper (see CorInfoHelpFunc) -void* interceptor_ICJI::getHelperFtn(CorInfoHelpFunc ftnNum, void** ppIndirection) +void* interceptor_ICJI::getHelperFtn( + CorInfoHelpFunc ftnNum, + void** ppIndirection) { mcs->AddCall("getHelperFtn"); return original_ICorJitInfo->getHelperFtn(ftnNum, ppIndirection); } -// return a callable address of the function (native code). This function -// may return a different value (depending on whether the method has -// been JITed or not. -void interceptor_ICJI::getFunctionEntryPoint(CORINFO_METHOD_HANDLE ftn, /* IN */ - CORINFO_CONST_LOOKUP* pResult, /* OUT */ - CORINFO_ACCESS_FLAGS accessFlags) +void interceptor_ICJI::getFunctionEntryPoint( + CORINFO_METHOD_HANDLE ftn, + CORINFO_CONST_LOOKUP* pResult, + CORINFO_ACCESS_FLAGS accessFlags) { mcs->AddCall("getFunctionEntryPoint"); original_ICorJitInfo->getFunctionEntryPoint(ftn, pResult, accessFlags); } -// return a directly callable address. This can be used similarly to the -// value returned by getFunctionEntryPoint() except that it is -// guaranteed to be multi callable entrypoint. -void interceptor_ICJI::getFunctionFixedEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_CONST_LOOKUP* pResult) +void interceptor_ICJI::getFunctionFixedEntryPoint( + CORINFO_METHOD_HANDLE ftn, + CORINFO_CONST_LOOKUP* pResult) { mcs->AddCall("getFunctionFixedEntryPoint"); original_ICorJitInfo->getFunctionFixedEntryPoint(ftn, pResult); } -// get the synchronization handle that is passed to monXstatic function -void* interceptor_ICJI::getMethodSync(CORINFO_METHOD_HANDLE ftn, void** ppIndirection) +void* interceptor_ICJI::getMethodSync( + CORINFO_METHOD_HANDLE ftn, + void** ppIndirection) { mcs->AddCall("getMethodSync"); return original_ICorJitInfo->getMethodSync(ftn, ppIndirection); } -// These entry points must be called if a handle is being embedded in -// the code to be passed to a JIT helper function. (as opposed to just -// being passed back into the ICorInfo interface.) - -// get slow lazy string literal helper to use (CORINFO_HELP_STRCNS*). -// Returns CORINFO_HELP_UNDEF if lazy string literal helper cannot be used. -CorInfoHelpFunc interceptor_ICJI::getLazyStringLiteralHelper(CORINFO_MODULE_HANDLE handle) +CorInfoHelpFunc interceptor_ICJI::getLazyStringLiteralHelper( + CORINFO_MODULE_HANDLE handle) { mcs->AddCall("getLazyStringLiteralHelper"); return original_ICorJitInfo->getLazyStringLiteralHelper(handle); } -CORINFO_MODULE_HANDLE interceptor_ICJI::embedModuleHandle(CORINFO_MODULE_HANDLE handle, void** ppIndirection) +CORINFO_MODULE_HANDLE interceptor_ICJI::embedModuleHandle( + CORINFO_MODULE_HANDLE handle, + void** ppIndirection) { mcs->AddCall("embedModuleHandle"); return original_ICorJitInfo->embedModuleHandle(handle, ppIndirection); } -CORINFO_CLASS_HANDLE interceptor_ICJI::embedClassHandle(CORINFO_CLASS_HANDLE handle, void** ppIndirection) +CORINFO_CLASS_HANDLE interceptor_ICJI::embedClassHandle( + CORINFO_CLASS_HANDLE handle, + void** ppIndirection) { mcs->AddCall("embedClassHandle"); return original_ICorJitInfo->embedClassHandle(handle, ppIndirection); } -CORINFO_METHOD_HANDLE interceptor_ICJI::embedMethodHandle(CORINFO_METHOD_HANDLE handle, void** ppIndirection) +CORINFO_METHOD_HANDLE interceptor_ICJI::embedMethodHandle( + CORINFO_METHOD_HANDLE handle, + void** ppIndirection) { mcs->AddCall("embedMethodHandle"); return original_ICorJitInfo->embedMethodHandle(handle, ppIndirection); } -CORINFO_FIELD_HANDLE interceptor_ICJI::embedFieldHandle(CORINFO_FIELD_HANDLE handle, void** ppIndirection) +CORINFO_FIELD_HANDLE interceptor_ICJI::embedFieldHandle( + CORINFO_FIELD_HANDLE handle, + void** ppIndirection) { mcs->AddCall("embedFieldHandle"); return original_ICorJitInfo->embedFieldHandle(handle, ppIndirection); } -// Given a module scope (module), a method handle (context) and -// a metadata token (metaTOK), fetch the handle -// (type, field or method) 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 how the handle should be looked up at run-time. -// -void interceptor_ICJI::embedGenericHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken, - BOOL fEmbedParent, // TRUE - embeds parent type handle of the field/method - // handle - CORINFO_GENERICHANDLE_RESULT* pResult) +void interceptor_ICJI::embedGenericHandle( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + BOOL fEmbedParent, + CORINFO_GENERICHANDLE_RESULT* pResult) { mcs->AddCall("embedGenericHandle"); original_ICorJitInfo->embedGenericHandle(pResolvedToken, fEmbedParent, pResult); } -// Return information used to locate the exact enclosing type of the current method. -// Used only to invoke .cctor method from code shared across generic instantiations -// !needsRuntimeLookup statically known (enclosing type of method itself) -// needsRuntimeLookup: -// 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 -void interceptor_ICJI::getLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND* pLookupKind) +void interceptor_ICJI::getLocationOfThisType( + CORINFO_METHOD_HANDLE context, + CORINFO_LOOKUP_KIND* pLookupKind) { mcs->AddCall("getLocationOfThisType"); original_ICorJitInfo->getLocationOfThisType(context, pLookupKind); } -// return address of fixup area for late-bound PInvoke calls. -void interceptor_ICJI::getAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP* pLookup) +void interceptor_ICJI::getAddressOfPInvokeTarget( + CORINFO_METHOD_HANDLE method, + CORINFO_CONST_LOOKUP* pLookup) { mcs->AddCall("getAddressOfPInvokeTarget"); original_ICorJitInfo->getAddressOfPInvokeTarget(method, pLookup); } -// Generate a cookie based on the signature that would needs to be passed -// to CORINFO_HELP_PINVOKE_CALLI -LPVOID interceptor_ICJI::GetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, void** ppIndirection) +LPVOID interceptor_ICJI::GetCookieForPInvokeCalliSig( + CORINFO_SIG_INFO* szMetaSig, + void** ppIndirection) { mcs->AddCall("GetCookieForPInvokeCalliSig"); return original_ICorJitInfo->GetCookieForPInvokeCalliSig(szMetaSig, ppIndirection); } -// returns true if a VM cookie can be generated for it (might be false due to cross-module -// inlining, in which case the inlining should be aborted) -bool interceptor_ICJI::canGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig) +bool interceptor_ICJI::canGetCookieForPInvokeCalliSig( + CORINFO_SIG_INFO* szMetaSig) { mcs->AddCall("canGetCookieForPInvokeCalliSig"); return original_ICorJitInfo->canGetCookieForPInvokeCalliSig(szMetaSig); } -// Gets a handle that is checked to see if the current method is -// included in "JustMyCode" -CORINFO_JUST_MY_CODE_HANDLE interceptor_ICJI::getJustMyCodeHandle(CORINFO_METHOD_HANDLE method, - CORINFO_JUST_MY_CODE_HANDLE** ppIndirection) +CORINFO_JUST_MY_CODE_HANDLE interceptor_ICJI::getJustMyCodeHandle( + CORINFO_METHOD_HANDLE method, + CORINFO_JUST_MY_CODE_HANDLE** ppIndirection) { mcs->AddCall("getJustMyCodeHandle"); return original_ICorJitInfo->getJustMyCodeHandle(method, ppIndirection); } -// Gets a method handle that can be used to correlate profiling data. -// This is the IP of a native method, or the address of the descriptor struct -// for IL. Always guaranteed to be unique per process, and not to move. */ -void interceptor_ICJI::GetProfilingHandle(BOOL* pbHookFunction, void** pProfilerHandle, BOOL* pbIndirectedHandles) +void interceptor_ICJI::GetProfilingHandle( + BOOL* pbHookFunction, + void** pProfilerHandle, + BOOL* pbIndirectedHandles) { mcs->AddCall("GetProfilingHandle"); original_ICorJitInfo->GetProfilingHandle(pbHookFunction, pProfilerHandle, pbIndirectedHandles); } -// Returns instructions on how to make the call. See code:CORINFO_CALL_INFO for possible return values. void interceptor_ICJI::getCallInfo( - // Token info - CORINFO_RESOLVED_TOKEN* pResolvedToken, - - // Generics info - CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken, - - // Security info - CORINFO_METHOD_HANDLE callerHandle, - - // Jit info - CORINFO_CALLINFO_FLAGS flags, - - // out params - CORINFO_CALL_INFO* pResult) + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken, + CORINFO_METHOD_HANDLE callerHandle, + CORINFO_CALLINFO_FLAGS flags, + CORINFO_CALL_INFO* pResult) { mcs->AddCall("getCallInfo"); original_ICorJitInfo->getCallInfo(pResolvedToken, pConstrainedResolvedToken, callerHandle, flags, pResult); } -BOOL interceptor_ICJI::canAccessFamily(CORINFO_METHOD_HANDLE hCaller, CORINFO_CLASS_HANDLE hInstanceType) - +BOOL interceptor_ICJI::canAccessFamily( + CORINFO_METHOD_HANDLE hCaller, + CORINFO_CLASS_HANDLE hInstanceType) { mcs->AddCall("canAccessFamily"); return original_ICorJitInfo->canAccessFamily(hCaller, hInstanceType); } -// Returns TRUE if the Class Domain ID is the RID of the class (currently true for every class -// except reflection emitted classes and generics) -BOOL interceptor_ICJI::isRIDClassDomainID(CORINFO_CLASS_HANDLE cls) + +BOOL interceptor_ICJI::isRIDClassDomainID( + CORINFO_CLASS_HANDLE cls) { mcs->AddCall("isRIDClassDomainID"); return original_ICorJitInfo->isRIDClassDomainID(cls); } -// returns the class's domain ID for accessing shared statics -unsigned interceptor_ICJI::getClassDomainID(CORINFO_CLASS_HANDLE cls, void** ppIndirection) +unsigned interceptor_ICJI::getClassDomainID( + CORINFO_CLASS_HANDLE cls, + void** ppIndirection) { mcs->AddCall("getClassDomainID"); return original_ICorJitInfo->getClassDomainID(cls, ppIndirection); } -// return the data's address (for static fields only) -void* interceptor_ICJI::getFieldAddress(CORINFO_FIELD_HANDLE field, void** ppIndirection) +void* interceptor_ICJI::getFieldAddress( + CORINFO_FIELD_HANDLE field, + void** ppIndirection) { mcs->AddCall("getFieldAddress"); return original_ICorJitInfo->getFieldAddress(field, ppIndirection); } -// return the class handle for the current value of a static field -CORINFO_CLASS_HANDLE interceptor_ICJI::getStaticFieldCurrentClass(CORINFO_FIELD_HANDLE field, bool* pIsSpeculative) +CORINFO_CLASS_HANDLE interceptor_ICJI::getStaticFieldCurrentClass( + CORINFO_FIELD_HANDLE field, + bool* pIsSpeculative) { mcs->AddCall("getStaticFieldCurrentClass"); return original_ICorJitInfo->getStaticFieldCurrentClass(field, pIsSpeculative); } -// registers a vararg sig & returns a VM cookie for it (which can contain other stuff) -CORINFO_VARARGS_HANDLE interceptor_ICJI::getVarArgsHandle(CORINFO_SIG_INFO* pSig, void** ppIndirection) +CORINFO_VARARGS_HANDLE interceptor_ICJI::getVarArgsHandle( + CORINFO_SIG_INFO* pSig, + void** ppIndirection) { mcs->AddCall("getVarArgsHandle"); return original_ICorJitInfo->getVarArgsHandle(pSig, ppIndirection); } -// returns true if a VM cookie can be generated for it (might be false due to cross-module -// inlining, in which case the inlining should be aborted) -bool interceptor_ICJI::canGetVarArgsHandle(CORINFO_SIG_INFO* pSig) +bool interceptor_ICJI::canGetVarArgsHandle( + CORINFO_SIG_INFO* pSig) { mcs->AddCall("canGetVarArgsHandle"); return original_ICorJitInfo->canGetVarArgsHandle(pSig); } -// Allocate a string literal on the heap and return a handle to it -InfoAccessType interceptor_ICJI::constructStringLiteral(CORINFO_MODULE_HANDLE module, mdToken metaTok, void** ppValue) +InfoAccessType interceptor_ICJI::constructStringLiteral( + CORINFO_MODULE_HANDLE module, + mdToken metaTok, + void** ppValue) { mcs->AddCall("constructStringLiteral"); return original_ICorJitInfo->constructStringLiteral(module, metaTok, ppValue); } -bool interceptor_ICJI::convertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool fMustConvert) -{ - mcs->AddCall("convertPInvokeCalliToCall"); - return original_ICorJitInfo->convertPInvokeCalliToCall(pResolvedToken, fMustConvert); -} - -InfoAccessType interceptor_ICJI::emptyStringLiteral(void** ppValue) +InfoAccessType interceptor_ICJI::emptyStringLiteral( + void** ppValue) { mcs->AddCall("emptyStringLiteral"); return original_ICorJitInfo->emptyStringLiteral(ppValue); } -// (static fields only) given that 'field' refers to thread local store, -// 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. -DWORD interceptor_ICJI::getFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, void** ppIndirection) +DWORD interceptor_ICJI::getFieldThreadLocalStoreID( + CORINFO_FIELD_HANDLE field, + void** ppIndirection) { mcs->AddCall("getFieldThreadLocalStoreID"); return original_ICorJitInfo->getFieldThreadLocalStoreID(field, ppIndirection); } -// Sets another object to intercept calls to "self" and current method being compiled -void interceptor_ICJI::setOverride(ICorDynamicInfo* pOverride, CORINFO_METHOD_HANDLE currentMethod) +void interceptor_ICJI::setOverride( + ICorDynamicInfo* pOverride, + CORINFO_METHOD_HANDLE currentMethod) { mcs->AddCall("setOverride"); original_ICorJitInfo->setOverride(pOverride, currentMethod); } -// Adds an active dependency from the context method's module to the given module -// This is internal callback for the EE. JIT should not call it directly. -void interceptor_ICJI::addActiveDependency(CORINFO_MODULE_HANDLE moduleFrom, CORINFO_MODULE_HANDLE moduleTo) +void interceptor_ICJI::addActiveDependency( + CORINFO_MODULE_HANDLE moduleFrom, + CORINFO_MODULE_HANDLE moduleTo) { mcs->AddCall("addActiveDependency"); original_ICorJitInfo->addActiveDependency(moduleFrom, moduleTo); } -CORINFO_METHOD_HANDLE interceptor_ICJI::GetDelegateCtor(CORINFO_METHOD_HANDLE methHnd, - CORINFO_CLASS_HANDLE clsHnd, - CORINFO_METHOD_HANDLE targetMethodHnd, - DelegateCtorArgs* pCtorData) +CORINFO_METHOD_HANDLE interceptor_ICJI::GetDelegateCtor( + CORINFO_METHOD_HANDLE methHnd, + CORINFO_CLASS_HANDLE clsHnd, + CORINFO_METHOD_HANDLE targetMethodHnd, + DelegateCtorArgs* pCtorData) { mcs->AddCall("GetDelegateCtor"); return original_ICorJitInfo->GetDelegateCtor(methHnd, clsHnd, targetMethodHnd, pCtorData); } -void interceptor_ICJI::MethodCompileComplete(CORINFO_METHOD_HANDLE methHnd) +void interceptor_ICJI::MethodCompileComplete( + CORINFO_METHOD_HANDLE methHnd) { mcs->AddCall("MethodCompileComplete"); original_ICorJitInfo->MethodCompileComplete(methHnd); } bool interceptor_ICJI::getTailCallHelpers( - CORINFO_RESOLVED_TOKEN* callToken, - CORINFO_SIG_INFO* sig, - CORINFO_GET_TAILCALL_HELPERS_FLAGS flags, - CORINFO_TAILCALL_HELPERS* pResult) + CORINFO_RESOLVED_TOKEN* callToken, + CORINFO_SIG_INFO* sig, + CORINFO_GET_TAILCALL_HELPERS_FLAGS flags, + CORINFO_TAILCALL_HELPERS* pResult) { mcs->AddCall("getTailCallHelpers"); return original_ICorJitInfo->getTailCallHelpers(callToken, sig, flags, pResult); } -// Stuff directly on ICorJitInfo - -// Returns extended flags for a particular compilation instance. -DWORD interceptor_ICJI::getJitFlags(CORJIT_FLAGS* jitFlags, DWORD sizeInBytes) +bool interceptor_ICJI::convertPInvokeCalliToCall( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + bool mustConvert) { - mcs->AddCall("getJitFlags"); - return original_ICorJitInfo->getJitFlags(jitFlags, sizeInBytes); + mcs->AddCall("convertPInvokeCalliToCall"); + return original_ICorJitInfo->convertPInvokeCalliToCall(pResolvedToken, mustConvert); } -// Runs the given function with the given parameter under an error trap -// and returns true if the function completes successfully. We don't -// record the results of the call: when this call gets played back, -// its result will depend on whether or not `function` calls something -// that throws at playback time rather than at capture time. -bool interceptor_ICJI::runWithErrorTrap(void (*function)(void*), void* param) +void interceptor_ICJI::notifyInstructionSetUsage( + CORINFO_InstructionSet instructionSet, + bool supportEnabled) { - mcs->AddCall("runWithErrorTrap"); - return original_ICorJitInfo->runWithErrorTrap(function, param); + mcs->AddCall("notifyInstructionSetUsage"); + original_ICorJitInfo->notifyInstructionSetUsage(instructionSet, supportEnabled); } -// get a block of memory for the code, readonly data, and read-write data -void interceptor_ICJI::allocMem(ULONG hotCodeSize, /* IN */ - ULONG coldCodeSize, /* IN */ - ULONG roDataSize, /* IN */ - ULONG xcptnsCount, /* IN */ - CorJitAllocMemFlag flag, /* IN */ - void** hotCodeBlock, /* OUT */ - void** coldCodeBlock, /* OUT */ - void** roDataBlock /* OUT */ - ) +void interceptor_ICJI::allocMem( + ULONG hotCodeSize, + ULONG coldCodeSize, + ULONG roDataSize, + ULONG xcptnsCount, + CorJitAllocMemFlag flag, + void** hotCodeBlock, + void** coldCodeBlock, + void** roDataBlock) { mcs->AddCall("allocMem"); - return original_ICorJitInfo->allocMem(hotCodeSize, coldCodeSize, roDataSize, xcptnsCount, flag, hotCodeBlock, - coldCodeBlock, roDataBlock); -} - -// Reserve memory for the method/funclet's unwind information. -// Note that this must be called before allocMem. It should be -// called once for the main method, once for every funclet, and -// once for every block of cold code for which allocUnwindInfo -// will be called. -// -// This is necessary because jitted code must allocate all the -// memory needed for the unwindInfo at the allocMem call. -// For prejitted code we split up the unwinding information into -// separate sections .rdata and .pdata. -// -void interceptor_ICJI::reserveUnwindInfo(BOOL isFunclet, /* IN */ - BOOL isColdCode, /* IN */ - ULONG unwindSize /* IN */ - ) + original_ICorJitInfo->allocMem(hotCodeSize, coldCodeSize, roDataSize, xcptnsCount, flag, hotCodeBlock, coldCodeBlock, roDataBlock); +} + +void interceptor_ICJI::reserveUnwindInfo( + BOOL isFunclet, + BOOL isColdCode, + ULONG unwindSize) { mcs->AddCall("reserveUnwindInfo"); original_ICorJitInfo->reserveUnwindInfo(isFunclet, isColdCode, unwindSize); } -// Allocate and initialize the .rdata and .pdata for this method or -// funclet, and get the block of memory needed for the machine-specific -// unwind information (the info for crawling the stack frame). -// Note that allocMem must be called first. -// -// Parameters: -// -// pHotCode main method code buffer, always filled in -// 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). -// endOffset end of code block, relative to appropriate code buffer -// unwindSize size of unwind info pointed to by pUnwindBlock -// pUnwindBlock pointer to unwind info -// funcKind type of funclet (main method code, handler, filter) -// -void interceptor_ICJI::allocUnwindInfo(BYTE* pHotCode, /* IN */ - BYTE* pColdCode, /* IN */ - ULONG startOffset, /* IN */ - ULONG endOffset, /* IN */ - ULONG unwindSize, /* IN */ - BYTE* pUnwindBlock, /* IN */ - CorJitFuncKind funcKind /* IN */ - ) +void interceptor_ICJI::allocUnwindInfo( + BYTE* pHotCode, + BYTE* pColdCode, + ULONG startOffset, + ULONG endOffset, + ULONG unwindSize, + BYTE* pUnwindBlock, + CorJitFuncKind funcKind) { mcs->AddCall("allocUnwindInfo"); - original_ICorJitInfo->allocUnwindInfo(pHotCode, pColdCode, startOffset, endOffset, unwindSize, pUnwindBlock, - funcKind); + original_ICorJitInfo->allocUnwindInfo(pHotCode, pColdCode, startOffset, endOffset, unwindSize, pUnwindBlock, funcKind); } -// Get a block of memory needed for the code manager information, -// (the info for enumerating the GC pointers while crawling the -// stack frame). -// Note that allocMem must be called first -void* interceptor_ICJI::allocGCInfo(size_t size /* IN */ - ) +void* interceptor_ICJI::allocGCInfo( + size_t size) { mcs->AddCall("allocGCInfo"); return original_ICorJitInfo->allocGCInfo(size); } -// 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. -void interceptor_ICJI::setEHcount(unsigned cEH /* IN */ - ) +void interceptor_ICJI::setEHcount( + unsigned cEH) { mcs->AddCall("setEHcount"); original_ICorJitInfo->setEHcount(cEH); } -// Set the values for one particular exception handler block. -// -// Handler regions should be lexically contiguous. -// This is because FinallyIsUnwinding() uses lexicality to -// determine if a "finally" clause is executing. -void interceptor_ICJI::setEHinfo(unsigned EHnumber, /* IN */ - const CORINFO_EH_CLAUSE* clause /* IN */ - ) +void interceptor_ICJI::setEHinfo( + unsigned EHnumber, + const CORINFO_EH_CLAUSE* clause) { mcs->AddCall("setEHinfo"); original_ICorJitInfo->setEHinfo(EHnumber, clause); } -// Level 1 -> fatalError, Level 2 -> Error, Level 3 -> Warning -// Level 4 means happens 10 times in a run, level 5 means 100, level 6 means 1000 ... -// returns non-zero if the logging succeeded -BOOL interceptor_ICJI::logMsg(unsigned level, const char* fmt, va_list args) +BOOL interceptor_ICJI::logMsg( + unsigned level, + const char* fmt, + va_list args) { mcs->AddCall("logMsg"); return original_ICorJitInfo->logMsg(level, fmt, args); } -// do an assert. will return true if the code should retry (DebugBreak) -// returns false, if the assert should be igored. -int interceptor_ICJI::doAssert(const char* szFile, int iLine, const char* szExpr) +int interceptor_ICJI::doAssert( + const char* szFile, + int iLine, + const char* szExpr) { mcs->AddCall("doAssert"); return original_ICorJitInfo->doAssert(szFile, iLine, szExpr); } -void interceptor_ICJI::reportFatalError(CorJitResult result) +void interceptor_ICJI::reportFatalError( + CorJitResult result) { mcs->AddCall("reportFatalError"); original_ICorJitInfo->reportFatalError(result); } -/* -struct BlockCounts // Also defined here: code:CORBBTPROF_BLOCK_DATA -{ - UINT32 ILOffset; - UINT32 ExecutionCount; -}; -*/ - -// allocate a basic block profile buffer where execution counts will be stored -// for jitted basic blocks. -HRESULT interceptor_ICJI::allocMethodBlockCounts(UINT32 count, // The number of basic blocks that we have - BlockCounts** pBlockCounts) +HRESULT interceptor_ICJI::allocMethodBlockCounts( + UINT32 count, + ICorJitInfo::BlockCounts** pBlockCounts) { mcs->AddCall("allocMethodBlockCounts"); return original_ICorJitInfo->allocMethodBlockCounts(count, pBlockCounts); } -// get profile information to be used for optimizing the current method. The format -// of the buffer is the same as the format the JIT passes to allocMethodBlockCounts. -HRESULT interceptor_ICJI::getMethodBlockCounts(CORINFO_METHOD_HANDLE ftnHnd, - UINT32 * pCount, // The number of basic blocks that we have - BlockCounts** pBlockCounts, - UINT32 * pNumRuns) +HRESULT interceptor_ICJI::getMethodBlockCounts( + CORINFO_METHOD_HANDLE ftnHnd, + UINT32* pCount, + ICorJitInfo::BlockCounts** pBlockCounts, + UINT32* pNumRuns) { mcs->AddCall("getMethodBlockCounts"); return original_ICorJitInfo->getMethodBlockCounts(ftnHnd, pCount, pBlockCounts, pNumRuns); } -// Get the likely implementing class for a virtual call or interface call made by ftnHnd -// at the indicated IL offset. baseHnd is the interface class or base class for the method -// being called. -CORINFO_CLASS_HANDLE interceptor_ICJI::getLikelyClass(CORINFO_METHOD_HANDLE ftnHnd, - CORINFO_CLASS_HANDLE baseHnd, - UINT32 ilOffset, - UINT32* pLikelihood, - UINT32* pNumberOfClasses) +CORINFO_CLASS_HANDLE interceptor_ICJI::getLikelyClass( + CORINFO_METHOD_HANDLE ftnHnd, + CORINFO_CLASS_HANDLE baseHnd, + UINT32 ilOffset, + UINT32* pLikelihood, + UINT32* pNumberOfClasses) { mcs->AddCall("getLikelyClass"); return original_ICorJitInfo->getLikelyClass(ftnHnd, baseHnd, ilOffset, pLikelihood, pNumberOfClasses); } -// Associates a native call site, identified by its offset in the native code stream, with -// the signature information and method handle the JIT used to lay out the call site. If -// the call site has no signature information (e.g. a helper call) or has no method handle -// (e.g. a CALLI P/Invoke), then null should be passed instead. -void interceptor_ICJI::recordCallSite(ULONG instrOffset, /* IN */ - CORINFO_SIG_INFO* callSig, /* IN */ - CORINFO_METHOD_HANDLE methodHandle /* IN */ - ) +void interceptor_ICJI::recordCallSite( + ULONG instrOffset, + CORINFO_SIG_INFO* callSig, + CORINFO_METHOD_HANDLE methodHandle) { mcs->AddCall("recordCallSite"); - return original_ICorJitInfo->recordCallSite(instrOffset, callSig, methodHandle); + original_ICorJitInfo->recordCallSite(instrOffset, callSig, methodHandle); } -// A relocation is recorded if we are pre-jitting. -// A jump thunk may be inserted if we are jitting -void interceptor_ICJI::recordRelocation(void* location, /* IN */ - void* target, /* IN */ - WORD fRelocType, /* IN */ - WORD slotNum, /* IN */ - INT32 addlDelta /* IN */ - ) +void interceptor_ICJI::recordRelocation( + void* location, + void* target, + WORD fRelocType, + WORD slotNum, + INT32 addlDelta) { mcs->AddCall("recordRelocation"); original_ICorJitInfo->recordRelocation(location, target, fRelocType, slotNum, addlDelta); } -WORD interceptor_ICJI::getRelocTypeHint(void* target) +WORD interceptor_ICJI::getRelocTypeHint( + void* target) { mcs->AddCall("getRelocTypeHint"); return original_ICorJitInfo->getRelocTypeHint(target); } -// 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. -// DWORD interceptor_ICJI::getExpectedTargetArchitecture() { mcs->AddCall("getExpectedTargetArchitecture"); return original_ICorJitInfo->getExpectedTargetArchitecture(); } -void interceptor_ICJI::notifyInstructionSetUsage(CORINFO_InstructionSet instructionSet, bool supported) +DWORD interceptor_ICJI::getJitFlags( + CORJIT_FLAGS* flags, + DWORD sizeInBytes) { - mcs->AddCall("notifyInstructionSetUsage"); - original_ICorJitInfo->notifyInstructionSetUsage(instructionSet, supported); + mcs->AddCall("getJitFlags"); + return original_ICorJitInfo->getJitFlags(flags, sizeInBytes); } + diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp index 613a299..e9aa02d 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp @@ -1,7 +1,9 @@ -// -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -// +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// DO NOT EDIT THIS FILE! IT IS AUTOGENERATED +// To regenerate run the gen script in src/coreclr/src/tools/Common/JitInterface/ThunkGenerator +// and follow the instructions in docs/project/updating-jitinterface.md #include "standardpch.h" #include "icorjitinfo.h" @@ -9,1490 +11,1209 @@ #include "icorjitcompiler.h" #include "spmiutil.h" -// Stuff on ICorStaticInfo -/**********************************************************************************/ -// -// ICorMethodInfo -// -/**********************************************************************************/ -// return flags (defined above, CORINFO_FLG_PUBLIC ...) -DWORD interceptor_ICJI::getMethodAttribs(CORINFO_METHOD_HANDLE ftn /* IN */) + +DWORD interceptor_ICJI::getMethodAttribs( + CORINFO_METHOD_HANDLE ftn) { return original_ICorJitInfo->getMethodAttribs(ftn); } -// sets private JIT flags, which can be, retrieved using getAttrib. -void interceptor_ICJI::setMethodAttribs(CORINFO_METHOD_HANDLE ftn, /* IN */ - CorInfoMethodRuntimeFlags attribs /* IN */) +void interceptor_ICJI::setMethodAttribs( + CORINFO_METHOD_HANDLE ftn, + CorInfoMethodRuntimeFlags attribs) { original_ICorJitInfo->setMethodAttribs(ftn, attribs); } -// Given a method descriptor ftnHnd, extract signature information into sigInfo -// -// 'memberParent' is typically only set when verifying. It should be the -// result of calling getMemberParent. -void interceptor_ICJI::getMethodSig(CORINFO_METHOD_HANDLE ftn, /* IN */ - CORINFO_SIG_INFO* sig, /* OUT */ - CORINFO_CLASS_HANDLE memberParent /* IN */ - ) +void interceptor_ICJI::getMethodSig( + CORINFO_METHOD_HANDLE ftn, + CORINFO_SIG_INFO* sig, + CORINFO_CLASS_HANDLE memberParent) { original_ICorJitInfo->getMethodSig(ftn, sig, memberParent); } -/********************************************************************* -* Note the following methods can only be used on functions known -* to be IL. This includes the method being compiled and any method -* that 'getMethodInfo' returns true for -*********************************************************************/ - -// return information about a method private to the implementation -// returns false if method is not IL, or is otherwise unavailable. -// This method is used to fetch data needed to inline functions -bool interceptor_ICJI::getMethodInfo(CORINFO_METHOD_HANDLE ftn, /* IN */ - CORINFO_METHOD_INFO* info /* OUT */ - ) +bool interceptor_ICJI::getMethodInfo( + CORINFO_METHOD_HANDLE ftn, + CORINFO_METHOD_INFO* info) { return original_ICorJitInfo->getMethodInfo(ftn, info); } -// Decides if you have any limitations for inlining. If everything's OK, it will return -// INLINE_PASS and will fill out pRestrictions with a mask of restrictions the caller of this -// function must respect. If caller passes pRestrictions = nullptr, if there are any restrictions -// INLINE_FAIL will be returned -// -// The callerHnd must be the immediate caller (i.e. when we have a chain of inlined calls) -// -// The inlined method need not be verified - -CorInfoInline interceptor_ICJI::canInline(CORINFO_METHOD_HANDLE callerHnd, /* IN */ - CORINFO_METHOD_HANDLE calleeHnd, /* IN */ - DWORD* pRestrictions /* OUT */ - ) +CorInfoInline interceptor_ICJI::canInline( + CORINFO_METHOD_HANDLE callerHnd, + CORINFO_METHOD_HANDLE calleeHnd, + DWORD* pRestrictions) { return original_ICorJitInfo->canInline(callerHnd, calleeHnd, pRestrictions); } -// Reports whether or not a method can be inlined, and why. canInline is responsible for reporting all -// inlining results when it returns INLINE_FAIL and INLINE_NEVER. All other results are reported by the -// JIT. -void interceptor_ICJI::reportInliningDecision(CORINFO_METHOD_HANDLE inlinerHnd, - CORINFO_METHOD_HANDLE inlineeHnd, - CorInfoInline inlineResult, - const char* reason) +void interceptor_ICJI::reportInliningDecision( + CORINFO_METHOD_HANDLE inlinerHnd, + CORINFO_METHOD_HANDLE inlineeHnd, + CorInfoInline inlineResult, + const char* reason) { original_ICorJitInfo->reportInliningDecision(inlinerHnd, inlineeHnd, inlineResult, reason); } -// Returns false if the call is across security boundaries thus we cannot tailcall -// -// The callerHnd must be the immediate caller (i.e. when we have a chain of inlined calls) -bool interceptor_ICJI::canTailCall(CORINFO_METHOD_HANDLE callerHnd, /* IN */ - CORINFO_METHOD_HANDLE declaredCalleeHnd, /* IN */ - CORINFO_METHOD_HANDLE exactCalleeHnd, /* IN */ - bool fIsTailPrefix /* IN */ - ) +bool interceptor_ICJI::canTailCall( + CORINFO_METHOD_HANDLE callerHnd, + CORINFO_METHOD_HANDLE declaredCalleeHnd, + CORINFO_METHOD_HANDLE exactCalleeHnd, + bool fIsTailPrefix) { return original_ICorJitInfo->canTailCall(callerHnd, declaredCalleeHnd, exactCalleeHnd, fIsTailPrefix); } -// Reports whether or not a method can be tail called, and why. -// canTailCall is responsible for reporting all results when it returns -// false. All other results are reported by the JIT. -void interceptor_ICJI::reportTailCallDecision(CORINFO_METHOD_HANDLE callerHnd, - CORINFO_METHOD_HANDLE calleeHnd, - bool fIsTailPrefix, - CorInfoTailCall tailCallResult, - const char* reason) +void interceptor_ICJI::reportTailCallDecision( + CORINFO_METHOD_HANDLE callerHnd, + CORINFO_METHOD_HANDLE calleeHnd, + bool fIsTailPrefix, + CorInfoTailCall tailCallResult, + const char* reason) { original_ICorJitInfo->reportTailCallDecision(callerHnd, calleeHnd, fIsTailPrefix, tailCallResult, reason); } -// get individual exception handler -void interceptor_ICJI::getEHinfo(CORINFO_METHOD_HANDLE ftn, /* IN */ - unsigned EHnumber, /* IN */ - CORINFO_EH_CLAUSE* clause /* OUT */ - ) +void interceptor_ICJI::getEHinfo( + CORINFO_METHOD_HANDLE ftn, + unsigned EHnumber, + CORINFO_EH_CLAUSE* clause) { original_ICorJitInfo->getEHinfo(ftn, EHnumber, clause); } -// return class it belongs to -CORINFO_CLASS_HANDLE interceptor_ICJI::getMethodClass(CORINFO_METHOD_HANDLE method) +CORINFO_CLASS_HANDLE interceptor_ICJI::getMethodClass( + CORINFO_METHOD_HANDLE method) { return original_ICorJitInfo->getMethodClass(method); } -// return module it belongs to -CORINFO_MODULE_HANDLE interceptor_ICJI::getMethodModule(CORINFO_METHOD_HANDLE method) +CORINFO_MODULE_HANDLE interceptor_ICJI::getMethodModule( + CORINFO_METHOD_HANDLE method) { return original_ICorJitInfo->getMethodModule(method); } -// This function returns the offset of the specified method in the -// vtable of it's owning class or interface. -void interceptor_ICJI::getMethodVTableOffset(CORINFO_METHOD_HANDLE method, /* IN */ - unsigned* offsetOfIndirection, /* OUT */ - unsigned* offsetAfterIndirection, /* OUT */ - bool* isRelative /* OUT */ - ) +void interceptor_ICJI::getMethodVTableOffset( + CORINFO_METHOD_HANDLE method, + unsigned* offsetOfIndirection, + unsigned* offsetAfterIndirection, + bool* isRelative) { original_ICorJitInfo->getMethodVTableOffset(method, offsetOfIndirection, offsetAfterIndirection, isRelative); } -// Get the unboxed entry point for a method, if possible. -CORINFO_METHOD_HANDLE interceptor_ICJI::getUnboxedEntry(CORINFO_METHOD_HANDLE ftn, bool* requiresInstMethodTableArg) +CORINFO_METHOD_HANDLE interceptor_ICJI::resolveVirtualMethod( + CORINFO_METHOD_HANDLE virtualMethod, + CORINFO_CLASS_HANDLE implementingClass, + CORINFO_CONTEXT_HANDLE ownerType) { - return original_ICorJitInfo->getUnboxedEntry(ftn, requiresInstMethodTableArg); + return original_ICorJitInfo->resolveVirtualMethod(virtualMethod, implementingClass, ownerType); } -// Find the virtual method in implementingClass that overrides virtualMethod. -// Return null if devirtualization is not possible. -CORINFO_METHOD_HANDLE interceptor_ICJI::resolveVirtualMethod(CORINFO_METHOD_HANDLE virtualMethod, - CORINFO_CLASS_HANDLE implementingClass, - CORINFO_CONTEXT_HANDLE ownerType) +CORINFO_METHOD_HANDLE interceptor_ICJI::getUnboxedEntry( + CORINFO_METHOD_HANDLE ftn, + bool* requiresInstMethodTableArg) { - return original_ICorJitInfo->resolveVirtualMethod(virtualMethod, implementingClass, ownerType); + return original_ICorJitInfo->getUnboxedEntry(ftn, requiresInstMethodTableArg); } -// Given T, return the type of the default EqualityComparer. -// Returns null if the type can't be determined exactly. -CORINFO_CLASS_HANDLE interceptor_ICJI::getDefaultEqualityComparerClass(CORINFO_CLASS_HANDLE cls) +CORINFO_CLASS_HANDLE interceptor_ICJI::getDefaultEqualityComparerClass( + CORINFO_CLASS_HANDLE elemType) { - return original_ICorJitInfo->getDefaultEqualityComparerClass(cls); + return original_ICorJitInfo->getDefaultEqualityComparerClass(elemType); } -void interceptor_ICJI::expandRawHandleIntrinsic(CORINFO_RESOLVED_TOKEN* pResolvedToken, - CORINFO_GENERICHANDLE_RESULT* pResult) +void interceptor_ICJI::expandRawHandleIntrinsic( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_GENERICHANDLE_RESULT* pResult) { - return original_ICorJitInfo->expandRawHandleIntrinsic(pResolvedToken, pResult); + original_ICorJitInfo->expandRawHandleIntrinsic(pResolvedToken, pResult); } -// If a method's attributes have (getMethodAttribs) CORINFO_FLG_INTRINSIC set, -// getIntrinsicID() returns the intrinsic ID. -CorInfoIntrinsics interceptor_ICJI::getIntrinsicID(CORINFO_METHOD_HANDLE method, bool* pMustExpand /* OUT */ - ) +CorInfoIntrinsics interceptor_ICJI::getIntrinsicID( + CORINFO_METHOD_HANDLE method, + bool* pMustExpand) { return original_ICorJitInfo->getIntrinsicID(method, pMustExpand); } -// Is the given type in System.Private.Corelib and marked with IntrinsicAttribute? -bool interceptor_ICJI::isIntrinsicType(CORINFO_CLASS_HANDLE classHnd) +bool interceptor_ICJI::isIntrinsicType( + CORINFO_CLASS_HANDLE classHnd) { return original_ICorJitInfo->isIntrinsicType(classHnd); } -// return the unmanaged calling convention for a PInvoke -CorInfoUnmanagedCallConv interceptor_ICJI::getUnmanagedCallConv(CORINFO_METHOD_HANDLE method) +CorInfoUnmanagedCallConv interceptor_ICJI::getUnmanagedCallConv( + CORINFO_METHOD_HANDLE method) { return original_ICorJitInfo->getUnmanagedCallConv(method); } -// return if any marshaling is required for PInvoke methods. Note that -// method == 0 => calli. The call site sig is only needed for the varargs or calli case -BOOL interceptor_ICJI::pInvokeMarshalingRequired(CORINFO_METHOD_HANDLE method, CORINFO_SIG_INFO* callSiteSig) +BOOL interceptor_ICJI::pInvokeMarshalingRequired( + CORINFO_METHOD_HANDLE method, + CORINFO_SIG_INFO* callSiteSig) { return original_ICorJitInfo->pInvokeMarshalingRequired(method, callSiteSig); } -// Check constraints on method type arguments (only). -// The parent class should be checked separately using satisfiesClassConstraints(parent). -BOOL interceptor_ICJI::satisfiesMethodConstraints(CORINFO_CLASS_HANDLE parent, // the exact parent of the method - CORINFO_METHOD_HANDLE method) +BOOL interceptor_ICJI::satisfiesMethodConstraints( + CORINFO_CLASS_HANDLE parent, + CORINFO_METHOD_HANDLE method) { return original_ICorJitInfo->satisfiesMethodConstraints(parent, method); } -// Given a delegate target class, a target method parent class, a target method, -// a delegate class, check if the method signature is compatible with the Invoke method of the delegate -// (under the typical instantiation of any free type variables in the memberref signatures). BOOL interceptor_ICJI::isCompatibleDelegate( - CORINFO_CLASS_HANDLE objCls, /* type of the delegate target, if any */ - CORINFO_CLASS_HANDLE methodParentCls, /* exact parent of the target method, if any */ - CORINFO_METHOD_HANDLE method, /* (representative) target method, if any */ - CORINFO_CLASS_HANDLE delegateCls, /* exact type of the delegate */ - BOOL* pfIsOpenDelegate /* is the delegate open */ - ) + CORINFO_CLASS_HANDLE objCls, + CORINFO_CLASS_HANDLE methodParentCls, + CORINFO_METHOD_HANDLE method, + CORINFO_CLASS_HANDLE delegateCls, + BOOL* pfIsOpenDelegate) { return original_ICorJitInfo->isCompatibleDelegate(objCls, methodParentCls, method, delegateCls, pfIsOpenDelegate); } -// load and restore the method -void interceptor_ICJI::methodMustBeLoadedBeforeCodeIsRun(CORINFO_METHOD_HANDLE method) +void interceptor_ICJI::methodMustBeLoadedBeforeCodeIsRun( + CORINFO_METHOD_HANDLE method) { original_ICorJitInfo->methodMustBeLoadedBeforeCodeIsRun(method); } -CORINFO_METHOD_HANDLE interceptor_ICJI::mapMethodDeclToMethodImpl(CORINFO_METHOD_HANDLE method) +CORINFO_METHOD_HANDLE interceptor_ICJI::mapMethodDeclToMethodImpl( + CORINFO_METHOD_HANDLE method) { return original_ICorJitInfo->mapMethodDeclToMethodImpl(method); } -// Returns the global cookie for the /GS unsafe buffer checks -// The cookie might be a constant value (JIT), or a handle to memory location (Ngen) -void interceptor_ICJI::getGSCookie(GSCookie* pCookieVal, // OUT - GSCookie** ppCookieVal // OUT - ) +void interceptor_ICJI::getGSCookie( + GSCookie* pCookieVal, + GSCookie** ppCookieVal) { original_ICorJitInfo->getGSCookie(pCookieVal, ppCookieVal); } - -// Provide patchpoint info for the method currently being jitted. -void interceptor_ICJI::setPatchpointInfo(PatchpointInfo* patchpointInfo) +void interceptor_ICJI::setPatchpointInfo( + PatchpointInfo* patchpointInfo) { original_ICorJitInfo->setPatchpointInfo(patchpointInfo); } -// Get OSR info for the method currently being jitted -PatchpointInfo* interceptor_ICJI::getOSRInfo(unsigned* ilOffset) +PatchpointInfo* interceptor_ICJI::getOSRInfo( + unsigned* ilOffset) { return original_ICorJitInfo->getOSRInfo(ilOffset); } -/**********************************************************************************/ -// -// ICorModuleInfo -// -/**********************************************************************************/ - -// Resolve metadata token into runtime method handles. -void interceptor_ICJI::resolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN* pResolvedToken) +void interceptor_ICJI::resolveToken( + CORINFO_RESOLVED_TOKEN* pResolvedToken) { original_ICorJitInfo->resolveToken(pResolvedToken); } -bool interceptor_ICJI::tryResolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN* pResolvedToken) +bool interceptor_ICJI::tryResolveToken( + CORINFO_RESOLVED_TOKEN* pResolvedToken) { return original_ICorJitInfo->tryResolveToken(pResolvedToken); } -// Signature information about the call sig -void interceptor_ICJI::findSig(CORINFO_MODULE_HANDLE module, /* IN */ - unsigned sigTOK, /* IN */ - CORINFO_CONTEXT_HANDLE context, /* IN */ - CORINFO_SIG_INFO* sig /* OUT */ - ) +void interceptor_ICJI::findSig( + CORINFO_MODULE_HANDLE module, + unsigned sigTOK, + CORINFO_CONTEXT_HANDLE context, + CORINFO_SIG_INFO* sig) { original_ICorJitInfo->findSig(module, sigTOK, context, sig); } -// for Varargs, the signature at the call site may differ from -// the signature at the definition. Thus we need a way of -// fetching the call site information -void interceptor_ICJI::findCallSiteSig(CORINFO_MODULE_HANDLE module, /* IN */ - unsigned methTOK, /* IN */ - CORINFO_CONTEXT_HANDLE context, /* IN */ - CORINFO_SIG_INFO* sig /* OUT */ - ) +void interceptor_ICJI::findCallSiteSig( + CORINFO_MODULE_HANDLE module, + unsigned methTOK, + CORINFO_CONTEXT_HANDLE context, + CORINFO_SIG_INFO* sig) { original_ICorJitInfo->findCallSiteSig(module, methTOK, context, sig); } -CORINFO_CLASS_HANDLE interceptor_ICJI::getTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken /* IN */) +CORINFO_CLASS_HANDLE interceptor_ICJI::getTokenTypeAsHandle( + CORINFO_RESOLVED_TOKEN* pResolvedToken) { return original_ICorJitInfo->getTokenTypeAsHandle(pResolvedToken); } -// Checks if the given metadata token is valid -BOOL interceptor_ICJI::isValidToken(CORINFO_MODULE_HANDLE module, /* IN */ - unsigned metaTOK /* IN */ - ) +BOOL interceptor_ICJI::isValidToken( + CORINFO_MODULE_HANDLE module, + unsigned metaTOK) { return original_ICorJitInfo->isValidToken(module, metaTOK); } -// Checks if the given metadata token is valid StringRef -BOOL interceptor_ICJI::isValidStringRef(CORINFO_MODULE_HANDLE module, /* IN */ - unsigned metaTOK /* IN */ - ) +BOOL interceptor_ICJI::isValidStringRef( + CORINFO_MODULE_HANDLE module, + unsigned metaTOK) { return original_ICorJitInfo->isValidStringRef(module, metaTOK); } -LPCWSTR interceptor_ICJI::getStringLiteral(CORINFO_MODULE_HANDLE module, /* IN */ - unsigned metaTOK, /* IN */ - int* length /* OUT */ - ) +LPCWSTR interceptor_ICJI::getStringLiteral( + CORINFO_MODULE_HANDLE module, + unsigned metaTOK, + int* length) { return original_ICorJitInfo->getStringLiteral(module, metaTOK, length); } -/**********************************************************************************/ -// -// ICorClassInfo -// -/**********************************************************************************/ - -// If the value class 'cls' is isomorphic to a primitive type it will -// return that type, otherwise it will return CORINFO_TYPE_VALUECLASS -CorInfoType interceptor_ICJI::asCorInfoType(CORINFO_CLASS_HANDLE cls) +CorInfoType interceptor_ICJI::asCorInfoType( + CORINFO_CLASS_HANDLE cls) { return original_ICorJitInfo->asCorInfoType(cls); } -// for completeness -const char* interceptor_ICJI::getClassName(CORINFO_CLASS_HANDLE cls) +const char* interceptor_ICJI::getClassName( + CORINFO_CLASS_HANDLE cls) { return original_ICorJitInfo->getClassName(cls); } -const char* interceptor_ICJI::getClassNameFromMetadata(CORINFO_CLASS_HANDLE cls, const char** namespaceName) +const char* interceptor_ICJI::getClassNameFromMetadata( + CORINFO_CLASS_HANDLE cls, + const char** namespaceName) { return original_ICorJitInfo->getClassNameFromMetadata(cls, namespaceName); } -CORINFO_CLASS_HANDLE interceptor_ICJI::getTypeInstantiationArgument(CORINFO_CLASS_HANDLE cls, unsigned index) +CORINFO_CLASS_HANDLE interceptor_ICJI::getTypeInstantiationArgument( + CORINFO_CLASS_HANDLE cls, + unsigned index) { return original_ICorJitInfo->getTypeInstantiationArgument(cls, index); } -// 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 -// If fFullInst=TRUE (regardless of fNamespace and fAssembly), include namespace and assembly for any type parameters -// If fAssembly=TRUE, suffix with a comma and the full assembly qualification -// return size of representation -int interceptor_ICJI::appendClassName(__deref_inout_ecount(*pnBufLen) WCHAR** ppBuf, - int* pnBufLen, - CORINFO_CLASS_HANDLE cls, - BOOL fNamespace, - BOOL fFullInst, - BOOL fAssembly) +int interceptor_ICJI::appendClassName( + WCHAR** ppBuf, + int* pnBufLen, + CORINFO_CLASS_HANDLE cls, + BOOL fNamespace, + BOOL fFullInst, + BOOL fAssembly) { return original_ICorJitInfo->appendClassName(ppBuf, pnBufLen, cls, fNamespace, fFullInst, fAssembly); } -// Quick check whether the type is a value class. Returns the same value as getClassAttribs(cls) & -// CORINFO_FLG_VALUECLASS, except faster. -BOOL interceptor_ICJI::isValueClass(CORINFO_CLASS_HANDLE cls) +BOOL interceptor_ICJI::isValueClass( + CORINFO_CLASS_HANDLE cls) { return original_ICorJitInfo->isValueClass(cls); } -// Decides how the JIT should do the optimization to inline the check for -// GetTypeFromHandle(handle) == obj.GetType() (for CORINFO_INLINE_TYPECHECK_SOURCE_VTABLE) -// GetTypeFromHandle(X) == GetTypeFromHandle(Y) (for CORINFO_INLINE_TYPECHECK_SOURCE_TOKEN) -CorInfoInlineTypeCheck interceptor_ICJI::canInlineTypeCheck(CORINFO_CLASS_HANDLE cls, - CorInfoInlineTypeCheckSource source) +CorInfoInlineTypeCheck interceptor_ICJI::canInlineTypeCheck( + CORINFO_CLASS_HANDLE cls, + CorInfoInlineTypeCheckSource source) { return original_ICorJitInfo->canInlineTypeCheck(cls, source); } -// return flags (defined above, CORINFO_FLG_PUBLIC ...) -DWORD interceptor_ICJI::getClassAttribs(CORINFO_CLASS_HANDLE cls) +DWORD interceptor_ICJI::getClassAttribs( + CORINFO_CLASS_HANDLE cls) { return original_ICorJitInfo->getClassAttribs(cls); } -// 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 -// 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 -// buffers do not require GC write barriers. -BOOL interceptor_ICJI::isStructRequiringStackAllocRetBuf(CORINFO_CLASS_HANDLE cls) +BOOL interceptor_ICJI::isStructRequiringStackAllocRetBuf( + CORINFO_CLASS_HANDLE cls) { return original_ICorJitInfo->isStructRequiringStackAllocRetBuf(cls); } -CORINFO_MODULE_HANDLE interceptor_ICJI::getClassModule(CORINFO_CLASS_HANDLE cls) +CORINFO_MODULE_HANDLE interceptor_ICJI::getClassModule( + CORINFO_CLASS_HANDLE cls) { return original_ICorJitInfo->getClassModule(cls); } -// Returns the assembly that contains the module "mod". -CORINFO_ASSEMBLY_HANDLE interceptor_ICJI::getModuleAssembly(CORINFO_MODULE_HANDLE mod) +CORINFO_ASSEMBLY_HANDLE interceptor_ICJI::getModuleAssembly( + CORINFO_MODULE_HANDLE mod) { return original_ICorJitInfo->getModuleAssembly(mod); } -// Returns the name of the assembly "assem". -const char* interceptor_ICJI::getAssemblyName(CORINFO_ASSEMBLY_HANDLE assem) +const char* interceptor_ICJI::getAssemblyName( + CORINFO_ASSEMBLY_HANDLE assem) { return original_ICorJitInfo->getAssemblyName(assem); } -// Allocate and delete process-lifetime objects. Should only be -// referred to from static fields, lest a leak occur. -// Note that "LongLifetimeFree" does not execute destructors, if "obj" -// is an array of a struct type with a destructor. -void* interceptor_ICJI::LongLifetimeMalloc(size_t sz) +void* interceptor_ICJI::LongLifetimeMalloc( + size_t sz) { return original_ICorJitInfo->LongLifetimeMalloc(sz); } -void interceptor_ICJI::LongLifetimeFree(void* obj) +void interceptor_ICJI::LongLifetimeFree( + void* obj) { original_ICorJitInfo->LongLifetimeFree(obj); } -size_t interceptor_ICJI::getClassModuleIdForStatics(CORINFO_CLASS_HANDLE cls, - CORINFO_MODULE_HANDLE* pModule, - void** ppIndirection) +size_t interceptor_ICJI::getClassModuleIdForStatics( + CORINFO_CLASS_HANDLE cls, + CORINFO_MODULE_HANDLE* pModule, + void** ppIndirection) { return original_ICorJitInfo->getClassModuleIdForStatics(cls, pModule, ppIndirection); } -// return the number of bytes needed by an instance of the class -unsigned interceptor_ICJI::getClassSize(CORINFO_CLASS_HANDLE cls) +unsigned interceptor_ICJI::getClassSize( + CORINFO_CLASS_HANDLE cls) { return original_ICorJitInfo->getClassSize(cls); } -// return the number of bytes needed by an instance of the class allocated on the heap -unsigned interceptor_ICJI::getHeapClassSize(CORINFO_CLASS_HANDLE cls) +unsigned interceptor_ICJI::getHeapClassSize( + CORINFO_CLASS_HANDLE cls) { return original_ICorJitInfo->getHeapClassSize(cls); } -BOOL interceptor_ICJI::canAllocateOnStack(CORINFO_CLASS_HANDLE cls) +BOOL interceptor_ICJI::canAllocateOnStack( + CORINFO_CLASS_HANDLE cls) { return original_ICorJitInfo->canAllocateOnStack(cls); } -unsigned interceptor_ICJI::getClassAlignmentRequirement(CORINFO_CLASS_HANDLE cls, BOOL fDoubleAlignHint) +unsigned interceptor_ICJI::getClassAlignmentRequirement( + CORINFO_CLASS_HANDLE cls, + BOOL fDoubleAlignHint) { return original_ICorJitInfo->getClassAlignmentRequirement(cls, fDoubleAlignHint); } -// This is only called for Value classes. It returns a boolean array -// in representing of 'cls' from a GC perspective. The class is -// assumed to be an array of machine words -// (of length // getClassSize(cls) / sizeof(void*)), -// 'gcPtrs' is a pointer to an array of BYTEs of this length. -// getClassGClayout fills in this array so that gcPtrs[i] is set -// to one of the CorInfoGCType values which is the GC type of -// the i-th machine word of an object of type 'cls' -// returns the number of GC pointers in the array -unsigned interceptor_ICJI::getClassGClayout(CORINFO_CLASS_HANDLE cls, /* IN */ - BYTE* gcPtrs /* OUT */ - ) +unsigned interceptor_ICJI::getClassGClayout( + CORINFO_CLASS_HANDLE cls, + BYTE* gcPtrs) { return original_ICorJitInfo->getClassGClayout(cls, gcPtrs); } -// returns the number of instance fields in a class -unsigned interceptor_ICJI::getClassNumInstanceFields(CORINFO_CLASS_HANDLE cls /* IN */ - ) +unsigned interceptor_ICJI::getClassNumInstanceFields( + CORINFO_CLASS_HANDLE cls) { return original_ICorJitInfo->getClassNumInstanceFields(cls); } -CORINFO_FIELD_HANDLE interceptor_ICJI::getFieldInClass(CORINFO_CLASS_HANDLE clsHnd, INT num) +CORINFO_FIELD_HANDLE interceptor_ICJI::getFieldInClass( + CORINFO_CLASS_HANDLE clsHnd, + INT num) { return original_ICorJitInfo->getFieldInClass(clsHnd, num); } -BOOL interceptor_ICJI::checkMethodModifier(CORINFO_METHOD_HANDLE hMethod, LPCSTR modifier, BOOL fOptional) +BOOL interceptor_ICJI::checkMethodModifier( + CORINFO_METHOD_HANDLE hMethod, + LPCSTR modifier, + BOOL fOptional) { return original_ICorJitInfo->checkMethodModifier(hMethod, modifier, fOptional); } -// returns the "NEW" helper optimized for "newCls." -CorInfoHelpFunc interceptor_ICJI::getNewHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, - CORINFO_METHOD_HANDLE callerHandle, - bool* pHasSideEffects) +CorInfoHelpFunc interceptor_ICJI::getNewHelper( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_METHOD_HANDLE callerHandle, + bool* pHasSideEffects) { return original_ICorJitInfo->getNewHelper(pResolvedToken, callerHandle, pHasSideEffects); } -// returns the newArr (1-Dim array) helper optimized for "arrayCls." -CorInfoHelpFunc interceptor_ICJI::getNewArrHelper(CORINFO_CLASS_HANDLE arrayCls) +CorInfoHelpFunc interceptor_ICJI::getNewArrHelper( + CORINFO_CLASS_HANDLE arrayCls) { return original_ICorJitInfo->getNewArrHelper(arrayCls); } -// returns the optimized "IsInstanceOf" or "ChkCast" helper -CorInfoHelpFunc interceptor_ICJI::getCastingHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool fThrowing) +CorInfoHelpFunc interceptor_ICJI::getCastingHelper( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + bool fThrowing) { return original_ICorJitInfo->getCastingHelper(pResolvedToken, fThrowing); } -// returns helper to trigger static constructor -CorInfoHelpFunc interceptor_ICJI::getSharedCCtorHelper(CORINFO_CLASS_HANDLE clsHnd) +CorInfoHelpFunc interceptor_ICJI::getSharedCCtorHelper( + CORINFO_CLASS_HANDLE clsHnd) { return original_ICorJitInfo->getSharedCCtorHelper(clsHnd); } -// This is not pretty. Boxing nullable actually returns -// a boxed not a boxed Nullable. This call allows the verifier -// to call back to the EE on the 'box' instruction and get the transformed -// type to use for verification. -CORINFO_CLASS_HANDLE interceptor_ICJI::getTypeForBox(CORINFO_CLASS_HANDLE cls) +CORINFO_CLASS_HANDLE interceptor_ICJI::getTypeForBox( + CORINFO_CLASS_HANDLE cls) { return original_ICorJitInfo->getTypeForBox(cls); } -// returns the correct box helper for a particular class. Note -// that if this returns CORINFO_HELP_BOX, the JIT can assume -// 'standard' boxing (allocate object and copy), and optimize -CorInfoHelpFunc interceptor_ICJI::getBoxHelper(CORINFO_CLASS_HANDLE cls) +CorInfoHelpFunc interceptor_ICJI::getBoxHelper( + CORINFO_CLASS_HANDLE cls) { return original_ICorJitInfo->getBoxHelper(cls); } -// 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 -// 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. - -CorInfoHelpFunc interceptor_ICJI::getUnBoxHelper(CORINFO_CLASS_HANDLE cls) +CorInfoHelpFunc interceptor_ICJI::getUnBoxHelper( + CORINFO_CLASS_HANDLE cls) { return original_ICorJitInfo->getUnBoxHelper(cls); } -bool interceptor_ICJI::getReadyToRunHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, - CORINFO_LOOKUP_KIND* pGenericLookupKind, - CorInfoHelpFunc id, - CORINFO_CONST_LOOKUP* pLookup) +bool interceptor_ICJI::getReadyToRunHelper( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_LOOKUP_KIND* pGenericLookupKind, + CorInfoHelpFunc id, + CORINFO_CONST_LOOKUP* pLookup) { return original_ICorJitInfo->getReadyToRunHelper(pResolvedToken, pGenericLookupKind, id, pLookup); } -void interceptor_ICJI::getReadyToRunDelegateCtorHelper(CORINFO_RESOLVED_TOKEN* pTargetMethod, - CORINFO_CLASS_HANDLE delegateType, - CORINFO_LOOKUP* pLookup) +void interceptor_ICJI::getReadyToRunDelegateCtorHelper( + CORINFO_RESOLVED_TOKEN* pTargetMethod, + CORINFO_CLASS_HANDLE delegateType, + CORINFO_LOOKUP* pLookup) { original_ICorJitInfo->getReadyToRunDelegateCtorHelper(pTargetMethod, delegateType, pLookup); } -const char* interceptor_ICJI::getHelperName(CorInfoHelpFunc funcNum) +const char* interceptor_ICJI::getHelperName( + CorInfoHelpFunc helpFunc) { - return original_ICorJitInfo->getHelperName(funcNum); + return original_ICorJitInfo->getHelperName(helpFunc); } -// This function tries to initialize the class (run the class constructor). -// this function returns whether the JIT must insert helper calls before -// accessing static field or method. -// -// See code:ICorClassInfo#ClassConstruction. CorInfoInitClassResult interceptor_ICJI::initClass( - CORINFO_FIELD_HANDLE field, // Non-nullptr - inquire about cctor trigger before static field access - // nullptr - inquire about cctor trigger in method prolog - CORINFO_METHOD_HANDLE method, // Method referencing the field or prolog - CORINFO_CONTEXT_HANDLE context // Exact context of method - ) + CORINFO_FIELD_HANDLE field, + CORINFO_METHOD_HANDLE method, + CORINFO_CONTEXT_HANDLE context) { return original_ICorJitInfo->initClass(field, method, context); } -// This used to be called "loadClass". This records the fact -// that the class must be loaded (including restored if necessary) before we execute the -// code that we are currently generating. When jitting code -// the function loads the class immediately. When zapping code -// the zapper will if necessary use the call to record the fact that we have -// to do a fixup/restore before running the method currently being generated. -// -// This is typically used to ensure value types are loaded before zapped -// code that manipulates them is executed, so that the GC can access information -// about those value types. -void interceptor_ICJI::classMustBeLoadedBeforeCodeIsRun(CORINFO_CLASS_HANDLE cls) +void interceptor_ICJI::classMustBeLoadedBeforeCodeIsRun( + CORINFO_CLASS_HANDLE cls) { original_ICorJitInfo->classMustBeLoadedBeforeCodeIsRun(cls); } -// returns the class handle for the special builtin classes -CORINFO_CLASS_HANDLE interceptor_ICJI::getBuiltinClass(CorInfoClassId classId) +CORINFO_CLASS_HANDLE interceptor_ICJI::getBuiltinClass( + CorInfoClassId classId) { return original_ICorJitInfo->getBuiltinClass(classId); } -// "System.Int32" ==> CORINFO_TYPE_INT.. -CorInfoType interceptor_ICJI::getTypeForPrimitiveValueClass(CORINFO_CLASS_HANDLE cls) +CorInfoType interceptor_ICJI::getTypeForPrimitiveValueClass( + CORINFO_CLASS_HANDLE cls) { return original_ICorJitInfo->getTypeForPrimitiveValueClass(cls); } -// "System.Int32" ==> CORINFO_TYPE_INT.. -// "System.UInt32" ==> CORINFO_TYPE_UINT.. -CorInfoType interceptor_ICJI::getTypeForPrimitiveNumericClass(CORINFO_CLASS_HANDLE cls) +CorInfoType interceptor_ICJI::getTypeForPrimitiveNumericClass( + CORINFO_CLASS_HANDLE cls) { return original_ICorJitInfo->getTypeForPrimitiveNumericClass(cls); } -// TRUE if child is a subtype of parent -// if parent is an interface, then does child implement / extend parent -BOOL interceptor_ICJI::canCast(CORINFO_CLASS_HANDLE child, // subtype (extends parent) - CORINFO_CLASS_HANDLE parent // base type - ) +BOOL interceptor_ICJI::canCast( + CORINFO_CLASS_HANDLE child, + CORINFO_CLASS_HANDLE parent) { return original_ICorJitInfo->canCast(child, parent); } -// TRUE if cls1 and cls2 are considered equivalent types. -BOOL interceptor_ICJI::areTypesEquivalent(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) +BOOL interceptor_ICJI::areTypesEquivalent( + CORINFO_CLASS_HANDLE cls1, + CORINFO_CLASS_HANDLE cls2) { return original_ICorJitInfo->areTypesEquivalent(cls1, cls2); } -// See if a cast from fromClass to toClass will succeed, fail, or needs -// to be resolved at runtime. -TypeCompareState interceptor_ICJI::compareTypesForCast(CORINFO_CLASS_HANDLE fromClass, CORINFO_CLASS_HANDLE toClass) +TypeCompareState interceptor_ICJI::compareTypesForCast( + CORINFO_CLASS_HANDLE fromClass, + CORINFO_CLASS_HANDLE toClass) { return original_ICorJitInfo->compareTypesForCast(fromClass, toClass); } -// See if types represented by cls1 and cls2 compare equal, not -// equal, or the comparison needs to be resolved at runtime. -TypeCompareState interceptor_ICJI::compareTypesForEquality(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) +TypeCompareState interceptor_ICJI::compareTypesForEquality( + CORINFO_CLASS_HANDLE cls1, + CORINFO_CLASS_HANDLE cls2) { return original_ICorJitInfo->compareTypesForEquality(cls1, cls2); } -// returns is the intersection of cls1 and cls2. -CORINFO_CLASS_HANDLE interceptor_ICJI::mergeClasses(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) +CORINFO_CLASS_HANDLE interceptor_ICJI::mergeClasses( + CORINFO_CLASS_HANDLE cls1, + CORINFO_CLASS_HANDLE cls2) { return original_ICorJitInfo->mergeClasses(cls1, cls2); } -// Returns true if cls2 is known to be a more specific type than cls1. -BOOL interceptor_ICJI::isMoreSpecificType(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) +BOOL interceptor_ICJI::isMoreSpecificType( + CORINFO_CLASS_HANDLE cls1, + CORINFO_CLASS_HANDLE cls2) { return original_ICorJitInfo->isMoreSpecificType(cls1, cls2); } -// Given a class handle, returns the Parent type. -// For COMObjectType, it returns Class Handle of System.Object. -// Returns 0 if System.Object is passed in. -CORINFO_CLASS_HANDLE interceptor_ICJI::getParentType(CORINFO_CLASS_HANDLE cls) +CORINFO_CLASS_HANDLE interceptor_ICJI::getParentType( + CORINFO_CLASS_HANDLE cls) { return original_ICorJitInfo->getParentType(cls); } -// Returns the CorInfoType of the "child type". If the child type is -// not a primitive type, *clsRet will be set. -// Given an Array of Type Foo, returns Foo. -// Given BYREF Foo, returns Foo -CorInfoType interceptor_ICJI::getChildType(CORINFO_CLASS_HANDLE clsHnd, CORINFO_CLASS_HANDLE* clsRet) +CorInfoType interceptor_ICJI::getChildType( + CORINFO_CLASS_HANDLE clsHnd, + CORINFO_CLASS_HANDLE* clsRet) { return original_ICorJitInfo->getChildType(clsHnd, clsRet); } -// Check constraints on type arguments of this class and parent classes -BOOL interceptor_ICJI::satisfiesClassConstraints(CORINFO_CLASS_HANDLE cls) +BOOL interceptor_ICJI::satisfiesClassConstraints( + CORINFO_CLASS_HANDLE cls) { return original_ICorJitInfo->satisfiesClassConstraints(cls); } -// Check if this is a single dimensional array type -BOOL interceptor_ICJI::isSDArray(CORINFO_CLASS_HANDLE cls) +BOOL interceptor_ICJI::isSDArray( + CORINFO_CLASS_HANDLE cls) { return original_ICorJitInfo->isSDArray(cls); } -// Get the numbmer of dimensions in an array -unsigned interceptor_ICJI::getArrayRank(CORINFO_CLASS_HANDLE cls) +unsigned interceptor_ICJI::getArrayRank( + CORINFO_CLASS_HANDLE cls) { return original_ICorJitInfo->getArrayRank(cls); } -// Get static field data for an array -void* interceptor_ICJI::getArrayInitializationData(CORINFO_FIELD_HANDLE field, DWORD size) +void* interceptor_ICJI::getArrayInitializationData( + CORINFO_FIELD_HANDLE field, + DWORD size) { return original_ICorJitInfo->getArrayInitializationData(field, size); } -// Check Visibility rules. CorInfoIsAccessAllowedResult interceptor_ICJI::canAccessClass( - CORINFO_RESOLVED_TOKEN* pResolvedToken, - CORINFO_METHOD_HANDLE callerHandle, - CORINFO_HELPER_DESC* pAccessHelper /* If canAccessMethod returns something other - than ALLOWED, then this is filled in. */ - ) + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_METHOD_HANDLE callerHandle, + CORINFO_HELPER_DESC* pAccessHelper) { return original_ICorJitInfo->canAccessClass(pResolvedToken, callerHandle, pAccessHelper); } -/**********************************************************************************/ -// -// ICorFieldInfo -// -/**********************************************************************************/ - -// this function is for debugging only. It returns the field name -// and if 'moduleName' is non-null, it sets it to something that will -// says which method (a class name, or a module name) -const char* interceptor_ICJI::getFieldName(CORINFO_FIELD_HANDLE ftn, /* IN */ - const char** moduleName /* OUT */ - ) +const char* interceptor_ICJI::getFieldName( + CORINFO_FIELD_HANDLE ftn, + const char** moduleName) { return original_ICorJitInfo->getFieldName(ftn, moduleName); } -// return class it belongs to -CORINFO_CLASS_HANDLE interceptor_ICJI::getFieldClass(CORINFO_FIELD_HANDLE field) +CORINFO_CLASS_HANDLE interceptor_ICJI::getFieldClass( + CORINFO_FIELD_HANDLE field) { return original_ICorJitInfo->getFieldClass(field); } -// Return the field's type, if it is CORINFO_TYPE_VALUECLASS 'structType' is set -// the field's value class (if 'structType' == 0, then don't bother -// the structure info). -// -// 'memberParent' is typically only set when verifying. It should be the -// result of calling getMemberParent. -CorInfoType interceptor_ICJI::getFieldType(CORINFO_FIELD_HANDLE field, - CORINFO_CLASS_HANDLE* structType, - CORINFO_CLASS_HANDLE memberParent /* IN */ - ) +CorInfoType interceptor_ICJI::getFieldType( + CORINFO_FIELD_HANDLE field, + CORINFO_CLASS_HANDLE* structType, + CORINFO_CLASS_HANDLE memberParent) { return original_ICorJitInfo->getFieldType(field, structType, memberParent); } -// return the data member's instance offset -unsigned interceptor_ICJI::getFieldOffset(CORINFO_FIELD_HANDLE field) +unsigned interceptor_ICJI::getFieldOffset( + CORINFO_FIELD_HANDLE field) { return original_ICorJitInfo->getFieldOffset(field); } -void interceptor_ICJI::getFieldInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken, - CORINFO_METHOD_HANDLE callerHandle, - CORINFO_ACCESS_FLAGS flags, - CORINFO_FIELD_INFO* pResult) +void interceptor_ICJI::getFieldInfo( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_METHOD_HANDLE callerHandle, + CORINFO_ACCESS_FLAGS flags, + CORINFO_FIELD_INFO* pResult) { original_ICorJitInfo->getFieldInfo(pResolvedToken, callerHandle, flags, pResult); } -// Returns true iff "fldHnd" represents a static field. -bool interceptor_ICJI::isFieldStatic(CORINFO_FIELD_HANDLE fldHnd) +bool interceptor_ICJI::isFieldStatic( + CORINFO_FIELD_HANDLE fldHnd) { - // this method does exist in some forms of the jit interface... if trip into one we'll know about it - DebugBreakorAV(67); - return true; + return original_ICorJitInfo->isFieldStatic(fldHnd); } -/*********************************************************************************/ -// -// ICorDebugInfo -// -/*********************************************************************************/ - -// Query the EE to find out where interesting break points -// in the code are. The native compiler will ensure that these places -// have a corresponding break point in native code. -// -// Note that unless CORJIT_FLAG_DEBUG_CODE is specified, this function will -// be used only as a hint and the native compiler should not change its -// code generation. -void interceptor_ICJI::getBoundaries(CORINFO_METHOD_HANDLE ftn, // [IN] method of interest - unsigned int* cILOffsets, // [OUT] size of pILOffsets - DWORD** pILOffsets, // [OUT] IL offsets of interest - // jit MUST free with freeArray! - ICorDebugInfo::BoundaryTypes* implictBoundaries // [OUT] tell jit, all boundries of - // this type - ) +void interceptor_ICJI::getBoundaries( + CORINFO_METHOD_HANDLE ftn, + unsigned int* cILOffsets, + DWORD** pILOffsets, + ICorDebugInfo::BoundaryTypes* implictBoundaries) { original_ICorJitInfo->getBoundaries(ftn, cILOffsets, pILOffsets, implictBoundaries); } -// Report back the mapping from IL to native code, -// this map should include all boundaries that 'getBoundaries' -// reported as interesting to the debugger. - -// Note that debugger (and profiler) is assuming that all of the -// offsets form a contiguous block of memory, and that the -// OffsetMapping is sorted in order of increasing native offset. -void interceptor_ICJI::setBoundaries(CORINFO_METHOD_HANDLE ftn, // [IN] method of interest - ULONG32 cMap, // [IN] size of pMap - ICorDebugInfo::OffsetMapping* pMap // [IN] map including all points of interest. - // jit allocated with allocateArray, EE - // frees - ) +void interceptor_ICJI::setBoundaries( + CORINFO_METHOD_HANDLE ftn, + ULONG32 cMap, + ICorDebugInfo::OffsetMapping* pMap) { original_ICorJitInfo->setBoundaries(ftn, cMap, pMap); } -// Query the EE to find out the scope of local varables. -// normally the JIT would trash variables after last use, but -// under debugging, the JIT needs to keep them live over their -// entire scope so that they can be inspected. -// -// Note that unless CORJIT_FLAG_DEBUG_CODE is specified, this function will -// be used only as a hint and the native compiler should not change its -// code generation. -void interceptor_ICJI::getVars(CORINFO_METHOD_HANDLE ftn, // [IN] method of interest - ULONG32* cVars, // [OUT] size of 'vars' - ICorDebugInfo::ILVarInfo** vars, // [OUT] scopes of variables of interest - // jit MUST free with freeArray! - bool* extendOthers // [OUT] it TRUE, then assume the scope - // of unmentioned vars is entire method - ) +void interceptor_ICJI::getVars( + CORINFO_METHOD_HANDLE ftn, + ULONG32* cVars, + ICorDebugInfo::ILVarInfo** vars, + bool* extendOthers) { original_ICorJitInfo->getVars(ftn, cVars, vars, extendOthers); } -// Report back to the EE the location of every variable. -// note that the JIT might split lifetimes into different -// locations etc. - -void interceptor_ICJI::setVars(CORINFO_METHOD_HANDLE ftn, // [IN] method of interest - ULONG32 cVars, // [IN] size of 'vars' - ICorDebugInfo::NativeVarInfo* vars // [IN] map telling where local vars are stored at - // what points - // jit allocated with allocateArray, EE frees - ) +void interceptor_ICJI::setVars( + CORINFO_METHOD_HANDLE ftn, + ULONG32 cVars, + ICorDebugInfo::NativeVarInfo* vars) { original_ICorJitInfo->setVars(ftn, cVars, vars); } -/*-------------------------- Misc ---------------------------------------*/ - -// Used to allocate memory that needs to handed to the EE. -// For eg, use this to allocated memory for reporting debug info, -// which will be handed to the EE by setVars() and setBoundaries() -void* interceptor_ICJI::allocateArray(size_t cBytes) +void* interceptor_ICJI::allocateArray( + size_t cBytes) { return original_ICorJitInfo->allocateArray(cBytes); } -// JitCompiler will free arrays passed by the EE using this -// For eg, The EE returns memory in getVars() and getBoundaries() -// to the JitCompiler, which the JitCompiler should release using -// freeArray() -void interceptor_ICJI::freeArray(void* array) +void interceptor_ICJI::freeArray( + void* array) { original_ICorJitInfo->freeArray(array); } -/*********************************************************************************/ -// -// ICorArgInfo -// -/*********************************************************************************/ - -// advance the pointer to the argument list. -// a ptr of 0, is special and always means the first argument -CORINFO_ARG_LIST_HANDLE interceptor_ICJI::getArgNext(CORINFO_ARG_LIST_HANDLE args /* IN */ - ) +CORINFO_ARG_LIST_HANDLE interceptor_ICJI::getArgNext( + CORINFO_ARG_LIST_HANDLE args) { return original_ICorJitInfo->getArgNext(args); } -// Get the type of a particular argument -// CORINFO_TYPE_UNDEF is returned when there are no more arguments -// If the type returned is a primitive type (or an enum) *vcTypeRet set to nullptr -// otherwise it is set to the TypeHandle associted with the type -// Enumerations will always look their underlying type (probably should fix this) -// Otherwise vcTypeRet is the type as would be seen by the IL, -// The return value is the type that is used for calling convention purposes -// (Thus if the EE wants a value class to be passed like an int, then it will -// return CORINFO_TYPE_INT -CorInfoTypeWithMod interceptor_ICJI::getArgType(CORINFO_SIG_INFO* sig, /* IN */ - CORINFO_ARG_LIST_HANDLE args, /* IN */ - CORINFO_CLASS_HANDLE* vcTypeRet /* OUT */ - ) +CorInfoTypeWithMod interceptor_ICJI::getArgType( + CORINFO_SIG_INFO* sig, + CORINFO_ARG_LIST_HANDLE args, + CORINFO_CLASS_HANDLE* vcTypeRet) { return original_ICorJitInfo->getArgType(sig, args, vcTypeRet); } -// If the Arg is a CORINFO_TYPE_CLASS fetch the class handle associated with it -CORINFO_CLASS_HANDLE interceptor_ICJI::getArgClass(CORINFO_SIG_INFO* sig, /* IN */ - CORINFO_ARG_LIST_HANDLE args /* IN */ - ) +CORINFO_CLASS_HANDLE interceptor_ICJI::getArgClass( + CORINFO_SIG_INFO* sig, + CORINFO_ARG_LIST_HANDLE args) { return original_ICorJitInfo->getArgClass(sig, args); } -// Returns type of HFA for valuetype -CorInfoHFAElemType interceptor_ICJI::getHFAType(CORINFO_CLASS_HANDLE hClass) +CorInfoHFAElemType interceptor_ICJI::getHFAType( + CORINFO_CLASS_HANDLE hClass) { return original_ICorJitInfo->getHFAType(hClass); } -/***************************************************************************** -* ICorErrorInfo contains methods to deal with SEH exceptions being thrown -* from the corinfo interface. These methods may be called when an exception -* with code EXCEPTION_COMPLUS is caught. -*****************************************************************************/ - -// Returns the HRESULT of the current exception -HRESULT interceptor_ICJI::GetErrorHRESULT(struct _EXCEPTION_POINTERS* pExceptionPointers) +HRESULT interceptor_ICJI::GetErrorHRESULT( + struct _EXCEPTION_POINTERS* pExceptionPointers) { return original_ICorJitInfo->GetErrorHRESULT(pExceptionPointers); } -// Fetches the message of the current exception -// Returns the size of the message (including terminating null). This can be -// greater than bufferLength if the buffer is insufficient. -ULONG interceptor_ICJI::GetErrorMessage(__inout_ecount(bufferLength) LPWSTR buffer, ULONG bufferLength) +ULONG interceptor_ICJI::GetErrorMessage( + LPWSTR buffer, + ULONG bufferLength) { return original_ICorJitInfo->GetErrorMessage(buffer, bufferLength); } -// returns EXCEPTION_EXECUTE_HANDLER if it is OK for the compile to handle the -// exception, abort some work (like the inlining) and continue compilation -// returns EXCEPTION_CONTINUE_SEARCH if exception must always be handled by the EE -// things like ThreadStoppedException ... -// returns EXCEPTION_CONTINUE_EXECUTION if exception is fixed up by the EE - -int interceptor_ICJI::FilterException(struct _EXCEPTION_POINTERS* pExceptionPointers) +int interceptor_ICJI::FilterException( + struct _EXCEPTION_POINTERS* pExceptionPointers) { return original_ICorJitInfo->FilterException(pExceptionPointers); } -// Cleans up internal EE tracking when an exception is caught. -void interceptor_ICJI::HandleException(struct _EXCEPTION_POINTERS* pExceptionPointers) +void interceptor_ICJI::HandleException( + struct _EXCEPTION_POINTERS* pExceptionPointers) { original_ICorJitInfo->HandleException(pExceptionPointers); } -void interceptor_ICJI::ThrowExceptionForJitResult(HRESULT result) +void interceptor_ICJI::ThrowExceptionForJitResult( + HRESULT result) { original_ICorJitInfo->ThrowExceptionForJitResult(result); } -// Throws an exception defined by the given throw helper. -void interceptor_ICJI::ThrowExceptionForHelper(const CORINFO_HELPER_DESC* throwHelper) +void interceptor_ICJI::ThrowExceptionForHelper( + const CORINFO_HELPER_DESC* throwHelper) { original_ICorJitInfo->ThrowExceptionForHelper(throwHelper); } -/***************************************************************************** - * ICorStaticInfo contains EE interface methods which return values that are - * constant from invocation to invocation. Thus they may be embedded in - * persisted information like statically generated code. (This is of course - * assuming that all code versions are identical each time.) - *****************************************************************************/ +bool interceptor_ICJI::runWithErrorTrap( + ICorJitInfo::errorTrapFunction function, + void* parameter) +{ + return original_ICorJitInfo->runWithErrorTrap(function, parameter); +} -// Return details about EE internal data structures -void interceptor_ICJI::getEEInfo(CORINFO_EE_INFO* pEEInfoOut) +void interceptor_ICJI::getEEInfo( + CORINFO_EE_INFO* pEEInfoOut) { original_ICorJitInfo->getEEInfo(pEEInfoOut); } -// Returns name of the JIT timer log LPCWSTR interceptor_ICJI::getJitTimeLogFilename() { return original_ICorJitInfo->getJitTimeLogFilename(); } -/*********************************************************************************/ -// -// Diagnostic methods -// -/*********************************************************************************/ - -// this function is for debugging only. Returns method token. -// Returns mdMethodDefNil for dynamic methods. -mdMethodDef interceptor_ICJI::getMethodDefFromMethod(CORINFO_METHOD_HANDLE hMethod) +mdMethodDef interceptor_ICJI::getMethodDefFromMethod( + CORINFO_METHOD_HANDLE hMethod) { return original_ICorJitInfo->getMethodDefFromMethod(hMethod); } -// this function is for debugging only. It returns the method name -// and if 'moduleName' is non-null, it sets it to something that will -// says which method (a class name, or a module name) -const char* interceptor_ICJI::getMethodName(CORINFO_METHOD_HANDLE ftn, /* IN */ - const char** moduleName /* OUT */ - ) +const char* interceptor_ICJI::getMethodName( + CORINFO_METHOD_HANDLE ftn, + const char** moduleName) { return original_ICorJitInfo->getMethodName(ftn, moduleName); } -const char* interceptor_ICJI::getMethodNameFromMetadata(CORINFO_METHOD_HANDLE ftn, /* IN */ - const char** className, /* OUT */ - const char** namespaceName, /* OUT */ - const char** enclosingClassName /* OUT */ - ) +const char* interceptor_ICJI::getMethodNameFromMetadata( + CORINFO_METHOD_HANDLE ftn, + const char** className, + const char** namespaceName, + const char** enclosingClassName) { return original_ICorJitInfo->getMethodNameFromMetadata(ftn, className, namespaceName, enclosingClassName); } -// this function is for debugging only. It returns a value that -// is will always be the same for a given method. It is used -// to implement the 'jitRange' functionality -unsigned interceptor_ICJI::getMethodHash(CORINFO_METHOD_HANDLE ftn /* IN */ - ) +unsigned interceptor_ICJI::getMethodHash( + CORINFO_METHOD_HANDLE ftn) { return original_ICorJitInfo->getMethodHash(ftn); } -// this function is for debugging only. -size_t interceptor_ICJI::findNameOfToken(CORINFO_MODULE_HANDLE module, /* IN */ - mdToken metaTOK, /* IN */ - __out_ecount(FQNameCapacity) char* szFQName, /* OUT */ - size_t FQNameCapacity /* IN */ - ) +size_t interceptor_ICJI::findNameOfToken( + CORINFO_MODULE_HANDLE moduleHandle, + mdToken token, + char* szFQName, + size_t FQNameCapacity) { - return original_ICorJitInfo->findNameOfToken(module, metaTOK, szFQName, FQNameCapacity); + return original_ICorJitInfo->findNameOfToken(moduleHandle, token, szFQName, FQNameCapacity); } bool interceptor_ICJI::getSystemVAmd64PassStructInRegisterDescriptor( - /* IN */ CORINFO_CLASS_HANDLE structHnd, - /* OUT */ SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr) + CORINFO_CLASS_HANDLE structHnd, + SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr) { return original_ICorJitInfo->getSystemVAmd64PassStructInRegisterDescriptor(structHnd, structPassInRegDescPtr); } -// Stuff on ICorDynamicInfo -DWORD interceptor_ICJI::getThreadTLSIndex(void** ppIndirection) +DWORD interceptor_ICJI::getThreadTLSIndex( + void** ppIndirection) { return original_ICorJitInfo->getThreadTLSIndex(ppIndirection); } -const void* interceptor_ICJI::getInlinedCallFrameVptr(void** ppIndirection) +const void* interceptor_ICJI::getInlinedCallFrameVptr( + void** ppIndirection) { return original_ICorJitInfo->getInlinedCallFrameVptr(ppIndirection); } -LONG* interceptor_ICJI::getAddrOfCaptureThreadGlobal(void** ppIndirection) +LONG* interceptor_ICJI::getAddrOfCaptureThreadGlobal( + void** ppIndirection) { return original_ICorJitInfo->getAddrOfCaptureThreadGlobal(ppIndirection); } -// return the native entry point to an EE helper (see CorInfoHelpFunc) -void* interceptor_ICJI::getHelperFtn(CorInfoHelpFunc ftnNum, void** ppIndirection) +void* interceptor_ICJI::getHelperFtn( + CorInfoHelpFunc ftnNum, + void** ppIndirection) { return original_ICorJitInfo->getHelperFtn(ftnNum, ppIndirection); } -// return a callable address of the function (native code). This function -// may return a different value (depending on whether the method has -// been JITed or not. -void interceptor_ICJI::getFunctionEntryPoint(CORINFO_METHOD_HANDLE ftn, /* IN */ - CORINFO_CONST_LOOKUP* pResult, /* OUT */ - CORINFO_ACCESS_FLAGS accessFlags) +void interceptor_ICJI::getFunctionEntryPoint( + CORINFO_METHOD_HANDLE ftn, + CORINFO_CONST_LOOKUP* pResult, + CORINFO_ACCESS_FLAGS accessFlags) { original_ICorJitInfo->getFunctionEntryPoint(ftn, pResult, accessFlags); } -// return a directly callable address. This can be used similarly to the -// value returned by getFunctionEntryPoint() except that it is -// guaranteed to be multi callable entrypoint. -void interceptor_ICJI::getFunctionFixedEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_CONST_LOOKUP* pResult) +void interceptor_ICJI::getFunctionFixedEntryPoint( + CORINFO_METHOD_HANDLE ftn, + CORINFO_CONST_LOOKUP* pResult) { original_ICorJitInfo->getFunctionFixedEntryPoint(ftn, pResult); } -// get the synchronization handle that is passed to monXstatic function -void* interceptor_ICJI::getMethodSync(CORINFO_METHOD_HANDLE ftn, void** ppIndirection) +void* interceptor_ICJI::getMethodSync( + CORINFO_METHOD_HANDLE ftn, + void** ppIndirection) { return original_ICorJitInfo->getMethodSync(ftn, ppIndirection); } -// These entry points must be called if a handle is being embedded in -// the code to be passed to a JIT helper function. (as opposed to just -// being passed back into the ICorInfo interface.) - -// get slow lazy string literal helper to use (CORINFO_HELP_STRCNS*). -// Returns CORINFO_HELP_UNDEF if lazy string literal helper cannot be used. -CorInfoHelpFunc interceptor_ICJI::getLazyStringLiteralHelper(CORINFO_MODULE_HANDLE handle) +CorInfoHelpFunc interceptor_ICJI::getLazyStringLiteralHelper( + CORINFO_MODULE_HANDLE handle) { return original_ICorJitInfo->getLazyStringLiteralHelper(handle); } -CORINFO_MODULE_HANDLE interceptor_ICJI::embedModuleHandle(CORINFO_MODULE_HANDLE handle, void** ppIndirection) +CORINFO_MODULE_HANDLE interceptor_ICJI::embedModuleHandle( + CORINFO_MODULE_HANDLE handle, + void** ppIndirection) { return original_ICorJitInfo->embedModuleHandle(handle, ppIndirection); } -CORINFO_CLASS_HANDLE interceptor_ICJI::embedClassHandle(CORINFO_CLASS_HANDLE handle, void** ppIndirection) +CORINFO_CLASS_HANDLE interceptor_ICJI::embedClassHandle( + CORINFO_CLASS_HANDLE handle, + void** ppIndirection) { return original_ICorJitInfo->embedClassHandle(handle, ppIndirection); } -CORINFO_METHOD_HANDLE interceptor_ICJI::embedMethodHandle(CORINFO_METHOD_HANDLE handle, void** ppIndirection) +CORINFO_METHOD_HANDLE interceptor_ICJI::embedMethodHandle( + CORINFO_METHOD_HANDLE handle, + void** ppIndirection) { return original_ICorJitInfo->embedMethodHandle(handle, ppIndirection); } -CORINFO_FIELD_HANDLE interceptor_ICJI::embedFieldHandle(CORINFO_FIELD_HANDLE handle, void** ppIndirection) +CORINFO_FIELD_HANDLE interceptor_ICJI::embedFieldHandle( + CORINFO_FIELD_HANDLE handle, + void** ppIndirection) { return original_ICorJitInfo->embedFieldHandle(handle, ppIndirection); } -// Given a module scope (module), a method handle (context) and -// a metadata token (metaTOK), fetch the handle -// (type, field or method) 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 how the handle should be looked up at run-time. -// -void interceptor_ICJI::embedGenericHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken, - BOOL fEmbedParent, // TRUE - embeds parent type handle of the field/method - // handle - CORINFO_GENERICHANDLE_RESULT* pResult) +void interceptor_ICJI::embedGenericHandle( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + BOOL fEmbedParent, + CORINFO_GENERICHANDLE_RESULT* pResult) { original_ICorJitInfo->embedGenericHandle(pResolvedToken, fEmbedParent, pResult); } -// Return information used to locate the exact enclosing type of the current method. -// Used only to invoke .cctor method from code shared across generic instantiations -// !needsRuntimeLookup statically known (enclosing type of method itself) -// needsRuntimeLookup: -// 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 -void interceptor_ICJI::getLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND* pLookupKind) +void interceptor_ICJI::getLocationOfThisType( + CORINFO_METHOD_HANDLE context, + CORINFO_LOOKUP_KIND* pLookupKind) { original_ICorJitInfo->getLocationOfThisType(context, pLookupKind); } -// return address of fixup area for late-bound PInvoke calls. -void interceptor_ICJI::getAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP* pLookup) +void interceptor_ICJI::getAddressOfPInvokeTarget( + CORINFO_METHOD_HANDLE method, + CORINFO_CONST_LOOKUP* pLookup) { original_ICorJitInfo->getAddressOfPInvokeTarget(method, pLookup); } -// Generate a cookie based on the signature that would needs to be passed -// to CORINFO_HELP_PINVOKE_CALLI -LPVOID interceptor_ICJI::GetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, void** ppIndirection) +LPVOID interceptor_ICJI::GetCookieForPInvokeCalliSig( + CORINFO_SIG_INFO* szMetaSig, + void** ppIndirection) { return original_ICorJitInfo->GetCookieForPInvokeCalliSig(szMetaSig, ppIndirection); } -// returns true if a VM cookie can be generated for it (might be false due to cross-module -// inlining, in which case the inlining should be aborted) -bool interceptor_ICJI::canGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig) +bool interceptor_ICJI::canGetCookieForPInvokeCalliSig( + CORINFO_SIG_INFO* szMetaSig) { return original_ICorJitInfo->canGetCookieForPInvokeCalliSig(szMetaSig); } -// Gets a handle that is checked to see if the current method is -// included in "JustMyCode" -CORINFO_JUST_MY_CODE_HANDLE interceptor_ICJI::getJustMyCodeHandle(CORINFO_METHOD_HANDLE method, - CORINFO_JUST_MY_CODE_HANDLE** ppIndirection) +CORINFO_JUST_MY_CODE_HANDLE interceptor_ICJI::getJustMyCodeHandle( + CORINFO_METHOD_HANDLE method, + CORINFO_JUST_MY_CODE_HANDLE** ppIndirection) { return original_ICorJitInfo->getJustMyCodeHandle(method, ppIndirection); } -// Gets a method handle that can be used to correlate profiling data. -// This is the IP of a native method, or the address of the descriptor struct -// for IL. Always guaranteed to be unique per process, and not to move. */ -void interceptor_ICJI::GetProfilingHandle(BOOL* pbHookFunction, void** pProfilerHandle, BOOL* pbIndirectedHandles) +void interceptor_ICJI::GetProfilingHandle( + BOOL* pbHookFunction, + void** pProfilerHandle, + BOOL* pbIndirectedHandles) { original_ICorJitInfo->GetProfilingHandle(pbHookFunction, pProfilerHandle, pbIndirectedHandles); } -// Returns instructions on how to make the call. See code:CORINFO_CALL_INFO for possible return values. void interceptor_ICJI::getCallInfo( - // Token info - CORINFO_RESOLVED_TOKEN* pResolvedToken, - - // Generics info - CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken, - - // Security info - CORINFO_METHOD_HANDLE callerHandle, - - // Jit info - CORINFO_CALLINFO_FLAGS flags, - - // out params - CORINFO_CALL_INFO* pResult) + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken, + CORINFO_METHOD_HANDLE callerHandle, + CORINFO_CALLINFO_FLAGS flags, + CORINFO_CALL_INFO* pResult) { original_ICorJitInfo->getCallInfo(pResolvedToken, pConstrainedResolvedToken, callerHandle, flags, pResult); } -BOOL interceptor_ICJI::canAccessFamily(CORINFO_METHOD_HANDLE hCaller, CORINFO_CLASS_HANDLE hInstanceType) - +BOOL interceptor_ICJI::canAccessFamily( + CORINFO_METHOD_HANDLE hCaller, + CORINFO_CLASS_HANDLE hInstanceType) { return original_ICorJitInfo->canAccessFamily(hCaller, hInstanceType); } -// Returns TRUE if the Class Domain ID is the RID of the class (currently true for every class -// except reflection emitted classes and generics) -BOOL interceptor_ICJI::isRIDClassDomainID(CORINFO_CLASS_HANDLE cls) + +BOOL interceptor_ICJI::isRIDClassDomainID( + CORINFO_CLASS_HANDLE cls) { return original_ICorJitInfo->isRIDClassDomainID(cls); } -// returns the class's domain ID for accessing shared statics -unsigned interceptor_ICJI::getClassDomainID(CORINFO_CLASS_HANDLE cls, void** ppIndirection) +unsigned interceptor_ICJI::getClassDomainID( + CORINFO_CLASS_HANDLE cls, + void** ppIndirection) { return original_ICorJitInfo->getClassDomainID(cls, ppIndirection); } -// return the data's address (for static fields only) -void* interceptor_ICJI::getFieldAddress(CORINFO_FIELD_HANDLE field, void** ppIndirection) +void* interceptor_ICJI::getFieldAddress( + CORINFO_FIELD_HANDLE field, + void** ppIndirection) { return original_ICorJitInfo->getFieldAddress(field, ppIndirection); } -// return the class handle for the current value of a static field -CORINFO_CLASS_HANDLE interceptor_ICJI::getStaticFieldCurrentClass(CORINFO_FIELD_HANDLE field, bool* pIsSpeculative) +CORINFO_CLASS_HANDLE interceptor_ICJI::getStaticFieldCurrentClass( + CORINFO_FIELD_HANDLE field, + bool* pIsSpeculative) { return original_ICorJitInfo->getStaticFieldCurrentClass(field, pIsSpeculative); } -// registers a vararg sig & returns a VM cookie for it (which can contain other stuff) -CORINFO_VARARGS_HANDLE interceptor_ICJI::getVarArgsHandle(CORINFO_SIG_INFO* pSig, void** ppIndirection) +CORINFO_VARARGS_HANDLE interceptor_ICJI::getVarArgsHandle( + CORINFO_SIG_INFO* pSig, + void** ppIndirection) { return original_ICorJitInfo->getVarArgsHandle(pSig, ppIndirection); } -// returns true if a VM cookie can be generated for it (might be false due to cross-module -// inlining, in which case the inlining should be aborted) -bool interceptor_ICJI::canGetVarArgsHandle(CORINFO_SIG_INFO* pSig) +bool interceptor_ICJI::canGetVarArgsHandle( + CORINFO_SIG_INFO* pSig) { return original_ICorJitInfo->canGetVarArgsHandle(pSig); } -// Allocate a string literal on the heap and return a handle to it -InfoAccessType interceptor_ICJI::constructStringLiteral(CORINFO_MODULE_HANDLE module, mdToken metaTok, void** ppValue) +InfoAccessType interceptor_ICJI::constructStringLiteral( + CORINFO_MODULE_HANDLE module, + mdToken metaTok, + void** ppValue) { return original_ICorJitInfo->constructStringLiteral(module, metaTok, ppValue); } -bool interceptor_ICJI::convertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool fMustConvert) -{ - return original_ICorJitInfo->convertPInvokeCalliToCall(pResolvedToken, fMustConvert); -} - -InfoAccessType interceptor_ICJI::emptyStringLiteral(void** ppValue) +InfoAccessType interceptor_ICJI::emptyStringLiteral( + void** ppValue) { return original_ICorJitInfo->emptyStringLiteral(ppValue); } -// (static fields only) given that 'field' refers to thread local store, -// 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. -DWORD interceptor_ICJI::getFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, void** ppIndirection) +DWORD interceptor_ICJI::getFieldThreadLocalStoreID( + CORINFO_FIELD_HANDLE field, + void** ppIndirection) { return original_ICorJitInfo->getFieldThreadLocalStoreID(field, ppIndirection); } -// Sets another object to intercept calls to "self" and current method being compiled -void interceptor_ICJI::setOverride(ICorDynamicInfo* pOverride, CORINFO_METHOD_HANDLE currentMethod) +void interceptor_ICJI::setOverride( + ICorDynamicInfo* pOverride, + CORINFO_METHOD_HANDLE currentMethod) { original_ICorJitInfo->setOverride(pOverride, currentMethod); } -// Adds an active dependency from the context method's module to the given module -// This is internal callback for the EE. JIT should not call it directly. -void interceptor_ICJI::addActiveDependency(CORINFO_MODULE_HANDLE moduleFrom, CORINFO_MODULE_HANDLE moduleTo) +void interceptor_ICJI::addActiveDependency( + CORINFO_MODULE_HANDLE moduleFrom, + CORINFO_MODULE_HANDLE moduleTo) { original_ICorJitInfo->addActiveDependency(moduleFrom, moduleTo); } -CORINFO_METHOD_HANDLE interceptor_ICJI::GetDelegateCtor(CORINFO_METHOD_HANDLE methHnd, - CORINFO_CLASS_HANDLE clsHnd, - CORINFO_METHOD_HANDLE targetMethodHnd, - DelegateCtorArgs* pCtorData) +CORINFO_METHOD_HANDLE interceptor_ICJI::GetDelegateCtor( + CORINFO_METHOD_HANDLE methHnd, + CORINFO_CLASS_HANDLE clsHnd, + CORINFO_METHOD_HANDLE targetMethodHnd, + DelegateCtorArgs* pCtorData) { return original_ICorJitInfo->GetDelegateCtor(methHnd, clsHnd, targetMethodHnd, pCtorData); } -void interceptor_ICJI::MethodCompileComplete(CORINFO_METHOD_HANDLE methHnd) +void interceptor_ICJI::MethodCompileComplete( + CORINFO_METHOD_HANDLE methHnd) { original_ICorJitInfo->MethodCompileComplete(methHnd); } bool interceptor_ICJI::getTailCallHelpers( - CORINFO_RESOLVED_TOKEN* callToken, - CORINFO_SIG_INFO* sig, - CORINFO_GET_TAILCALL_HELPERS_FLAGS flags, - CORINFO_TAILCALL_HELPERS* pResult) + CORINFO_RESOLVED_TOKEN* callToken, + CORINFO_SIG_INFO* sig, + CORINFO_GET_TAILCALL_HELPERS_FLAGS flags, + CORINFO_TAILCALL_HELPERS* pResult) { return original_ICorJitInfo->getTailCallHelpers(callToken, sig, flags, pResult); } -// Stuff directly on ICorJitInfo - -// Returns extended flags for a particular compilation instance. -DWORD interceptor_ICJI::getJitFlags(CORJIT_FLAGS* jitFlags, DWORD sizeInBytes) +bool interceptor_ICJI::convertPInvokeCalliToCall( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + bool mustConvert) { - return original_ICorJitInfo->getJitFlags(jitFlags, sizeInBytes); + return original_ICorJitInfo->convertPInvokeCalliToCall(pResolvedToken, mustConvert); } -// Runs the given function with the given parameter under an error trap -// and returns true if the function completes successfully. -bool interceptor_ICJI::runWithErrorTrap(void (*function)(void*), void* param) +void interceptor_ICJI::notifyInstructionSetUsage( + CORINFO_InstructionSet instructionSet, + bool supportEnabled) { - return original_ICorJitInfo->runWithErrorTrap(function, param); + original_ICorJitInfo->notifyInstructionSetUsage(instructionSet, supportEnabled); } -// get a block of memory for the code, readonly data, and read-write data -void interceptor_ICJI::allocMem(ULONG hotCodeSize, /* IN */ - ULONG coldCodeSize, /* IN */ - ULONG roDataSize, /* IN */ - ULONG xcptnsCount, /* IN */ - CorJitAllocMemFlag flag, /* IN */ - void** hotCodeBlock, /* OUT */ - void** coldCodeBlock, /* OUT */ - void** roDataBlock /* OUT */ - ) +void interceptor_ICJI::allocMem( + ULONG hotCodeSize, + ULONG coldCodeSize, + ULONG roDataSize, + ULONG xcptnsCount, + CorJitAllocMemFlag flag, + void** hotCodeBlock, + void** coldCodeBlock, + void** roDataBlock) { - return original_ICorJitInfo->allocMem(hotCodeSize, coldCodeSize, roDataSize, xcptnsCount, flag, hotCodeBlock, - coldCodeBlock, roDataBlock); + original_ICorJitInfo->allocMem(hotCodeSize, coldCodeSize, roDataSize, xcptnsCount, flag, hotCodeBlock, coldCodeBlock, roDataBlock); } -// Reserve memory for the method/funclet's unwind information. -// Note that this must be called before allocMem. It should be -// called once for the main method, once for every funclet, and -// once for every block of cold code for which allocUnwindInfo -// will be called. -// -// This is necessary because jitted code must allocate all the -// memory needed for the unwindInfo at the allocMem call. -// For prejitted code we split up the unwinding information into -// separate sections .rdata and .pdata. -// -void interceptor_ICJI::reserveUnwindInfo(BOOL isFunclet, /* IN */ - BOOL isColdCode, /* IN */ - ULONG unwindSize /* IN */ - ) +void interceptor_ICJI::reserveUnwindInfo( + BOOL isFunclet, + BOOL isColdCode, + ULONG unwindSize) { original_ICorJitInfo->reserveUnwindInfo(isFunclet, isColdCode, unwindSize); } -// Allocate and initialize the .rdata and .pdata for this method or -// funclet, and get the block of memory needed for the machine-specific -// unwind information (the info for crawling the stack frame). -// Note that allocMem must be called first. -// -// Parameters: -// -// pHotCode main method code buffer, always filled in -// 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). -// endOffset end of code block, relative to appropriate code buffer -// unwindSize size of unwind info pointed to by pUnwindBlock -// pUnwindBlock pointer to unwind info -// funcKind type of funclet (main method code, handler, filter) -// -void interceptor_ICJI::allocUnwindInfo(BYTE* pHotCode, /* IN */ - BYTE* pColdCode, /* IN */ - ULONG startOffset, /* IN */ - ULONG endOffset, /* IN */ - ULONG unwindSize, /* IN */ - BYTE* pUnwindBlock, /* IN */ - CorJitFuncKind funcKind /* IN */ - ) -{ - original_ICorJitInfo->allocUnwindInfo(pHotCode, pColdCode, startOffset, endOffset, unwindSize, pUnwindBlock, - funcKind); -} - -// Get a block of memory needed for the code manager information, -// (the info for enumerating the GC pointers while crawling the -// stack frame). -// Note that allocMem must be called first -void* interceptor_ICJI::allocGCInfo(size_t size /* IN */ - ) +void interceptor_ICJI::allocUnwindInfo( + BYTE* pHotCode, + BYTE* pColdCode, + ULONG startOffset, + ULONG endOffset, + ULONG unwindSize, + BYTE* pUnwindBlock, + CorJitFuncKind funcKind) +{ + original_ICorJitInfo->allocUnwindInfo(pHotCode, pColdCode, startOffset, endOffset, unwindSize, pUnwindBlock, funcKind); +} + +void* interceptor_ICJI::allocGCInfo( + size_t size) { return original_ICorJitInfo->allocGCInfo(size); } -// 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. -void interceptor_ICJI::setEHcount(unsigned cEH /* IN */ - ) +void interceptor_ICJI::setEHcount( + unsigned cEH) { original_ICorJitInfo->setEHcount(cEH); } -// Set the values for one particular exception handler block. -// -// Handler regions should be lexically contiguous. -// This is because FinallyIsUnwinding() uses lexicality to -// determine if a "finally" clause is executing. -void interceptor_ICJI::setEHinfo(unsigned EHnumber, /* IN */ - const CORINFO_EH_CLAUSE* clause /* IN */ - ) +void interceptor_ICJI::setEHinfo( + unsigned EHnumber, + const CORINFO_EH_CLAUSE* clause) { original_ICorJitInfo->setEHinfo(EHnumber, clause); } -// Level 1 -> fatalError, Level 2 -> Error, Level 3 -> Warning -// Level 4 means happens 10 times in a run, level 5 means 100, level 6 means 1000 ... -// returns non-zero if the logging succeeded -BOOL interceptor_ICJI::logMsg(unsigned level, const char* fmt, va_list args) +BOOL interceptor_ICJI::logMsg( + unsigned level, + const char* fmt, + va_list args) { return original_ICorJitInfo->logMsg(level, fmt, args); } -// do an assert. will return true if the code should retry (DebugBreak) -// returns false, if the assert should be igored. -int interceptor_ICJI::doAssert(const char* szFile, int iLine, const char* szExpr) +int interceptor_ICJI::doAssert( + const char* szFile, + int iLine, + const char* szExpr) { return original_ICorJitInfo->doAssert(szFile, iLine, szExpr); } -void interceptor_ICJI::reportFatalError(CorJitResult result) +void interceptor_ICJI::reportFatalError( + CorJitResult result) { original_ICorJitInfo->reportFatalError(result); } -// allocate a basic block profile buffer where execution counts will be stored -// for jitted basic blocks. -HRESULT interceptor_ICJI::allocMethodBlockCounts(UINT32 count, // The number of basic blocks that we have - BlockCounts** pBlockCounts) +HRESULT interceptor_ICJI::allocMethodBlockCounts( + UINT32 count, + ICorJitInfo::BlockCounts** pBlockCounts) { return original_ICorJitInfo->allocMethodBlockCounts(count, pBlockCounts); } -// get profile information to be used for optimizing the current method. The format -// of the buffer is the same as the format the JIT passes to allocMethodBlockCounts. -HRESULT interceptor_ICJI::getMethodBlockCounts(CORINFO_METHOD_HANDLE ftnHnd, - UINT32 * pCount, // The number of basic blocks that we have - BlockCounts** pBlockCounts, - UINT32 * pNumRuns) +HRESULT interceptor_ICJI::getMethodBlockCounts( + CORINFO_METHOD_HANDLE ftnHnd, + UINT32* pCount, + ICorJitInfo::BlockCounts** pBlockCounts, + UINT32* pNumRuns) { return original_ICorJitInfo->getMethodBlockCounts(ftnHnd, pCount, pBlockCounts, pNumRuns); } -// Get the likely implementing class for a virtual call or interface call made by ftnHnd -// at the indicated IL offset. baseHnd is the interface class or base class for the method -// being called. -CORINFO_CLASS_HANDLE interceptor_ICJI::getLikelyClass(CORINFO_METHOD_HANDLE ftnHnd, - CORINFO_CLASS_HANDLE baseHnd, - UINT32 ilOffset, - UINT32* pLikelihood, - UINT32* pNumberOfClasses) +CORINFO_CLASS_HANDLE interceptor_ICJI::getLikelyClass( + CORINFO_METHOD_HANDLE ftnHnd, + CORINFO_CLASS_HANDLE baseHnd, + UINT32 ilOffset, + UINT32* pLikelihood, + UINT32* pNumberOfClasses) { return original_ICorJitInfo->getLikelyClass(ftnHnd, baseHnd, ilOffset, pLikelihood, pNumberOfClasses); } -// Associates a native call site, identified by its offset in the native code stream, with -// the signature information and method handle the JIT used to lay out the call site. If -// the call site has no signature information (e.g. a helper call) or has no method handle -// (e.g. a CALLI P/Invoke), then null should be passed instead. -void interceptor_ICJI::recordCallSite(ULONG instrOffset, /* IN */ - CORINFO_SIG_INFO* callSig, /* IN */ - CORINFO_METHOD_HANDLE methodHandle /* IN */ - ) +void interceptor_ICJI::recordCallSite( + ULONG instrOffset, + CORINFO_SIG_INFO* callSig, + CORINFO_METHOD_HANDLE methodHandle) { original_ICorJitInfo->recordCallSite(instrOffset, callSig, methodHandle); } -// A relocation is recorded if we are pre-jitting. -// A jump thunk may be inserted if we are jitting -void interceptor_ICJI::recordRelocation(void* location, /* IN */ - void* target, /* IN */ - WORD fRelocType, /* IN */ - WORD slotNum, /* IN */ - INT32 addlDelta /* IN */ - ) +void interceptor_ICJI::recordRelocation( + void* location, + void* target, + WORD fRelocType, + WORD slotNum, + INT32 addlDelta) { original_ICorJitInfo->recordRelocation(location, target, fRelocType, slotNum, addlDelta); } -WORD interceptor_ICJI::getRelocTypeHint(void* target) +WORD interceptor_ICJI::getRelocTypeHint( + void* target) { return original_ICorJitInfo->getRelocTypeHint(target); } -// 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. -// DWORD interceptor_ICJI::getExpectedTargetArchitecture() { return original_ICorJitInfo->getExpectedTargetArchitecture(); } -void interceptor_ICJI::notifyInstructionSetUsage(CORINFO_InstructionSet instructionSet, bool supported) +DWORD interceptor_ICJI::getJitFlags( + CORJIT_FLAGS* flags, + DWORD sizeInBytes) { - original_ICorJitInfo->notifyInstructionSetUsage(instructionSet, supported); + return original_ICorJitInfo->getJitFlags(flags, sizeInBytes); } + diff --git a/src/coreclr/src/inc/corinfo.h b/src/coreclr/src/inc/corinfo.h index fa9db2c..0cac53c 100644 --- a/src/coreclr/src/inc/corinfo.h +++ b/src/coreclr/src/inc/corinfo.h @@ -184,42 +184,9 @@ TODO: Talk about initializing strutures before use #ifndef _COR_INFO_H_ #define _COR_INFO_H_ -#include +#include "corhdr.h" #include - -////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE -// -// #JITEEVersionIdentifier -// -// This GUID represents the version of the JIT/EE interface. Any time the interface between the JIT and -// the EE changes (by adding or removing methods to any interface shared between them), this GUID should -// be changed. This is the identifier verified by ICorJitCompiler::getVersionIdentifier(). -// -// You can use "uuidgen.exe -s" to generate this value. -// -// **** NOTE TO INTEGRATORS: -// -// If there is a merge conflict here, because the version changed in two different places, you must -// create a **NEW** GUID, not simply choose one or the other! -// -// NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE -// -////////////////////////////////////////////////////////////////////////////////////////////////////////// - -constexpr GUID JITEEVersionIdentifier = { /* 0d235fe4-65a1-487a-8553-c845496da901 */ - 0x0d235fe4, - 0x65a1, - 0x487a, - {0x85, 0x53, 0xc8, 0x45, 0x49, 0x6d, 0xa9, 0x01} -}; - -////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// END JITEEVersionIdentifier -// -////////////////////////////////////////////////////////////////////////////////////////////////////////// +#include "jiteeversionguid.h" // 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. @@ -2758,8 +2725,9 @@ public: // to interface functions that may throw exceptions without needing to be aware of // the EH ABI, exception types, etc. Returns true if the given function completed // successfully and false otherwise. + typedef void (*errorTrapFunction)(void*); virtual bool runWithErrorTrap( - void (*function)(void*), // The function to run + errorTrapFunction function, // The function to run void* parameter // The context parameter that will be passed to the function and the handler ) = 0; diff --git a/src/coreclr/src/inc/corjit.h b/src/coreclr/src/inc/corjit.h index 13a9e33..f358f67 100644 --- a/src/coreclr/src/inc/corjit.h +++ b/src/coreclr/src/inc/corjit.h @@ -27,11 +27,11 @@ #ifndef _COR_JIT_H_ #define _COR_JIT_H_ -#include +#include "corinfo.h" #include -#include +#include "corjitflags.h" /*****************************************************************************/ // These are error codes returned by CompileMethod diff --git a/src/coreclr/src/inc/jiteeversionguid.h b/src/coreclr/src/inc/jiteeversionguid.h new file mode 100644 index 0000000..abc6044 --- /dev/null +++ b/src/coreclr/src/inc/jiteeversionguid.h @@ -0,0 +1,39 @@ + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE +// +// #JITEEVersionIdentifier +// +// This GUID represents the version of the JIT/EE interface. Any time the interface between the JIT and +// the EE changes (by adding or removing methods to any interface shared between them), this GUID should +// be changed. This is the identifier verified by ICorJitCompiler::getVersionIdentifier(). +// +// You can use "uuidgen.exe -s" to generate this value. +// +// See docs/project/updating-jitinterface.md for details +// +// **** NOTE TO INTEGRATORS: +// +// If there is a merge conflict here, because the version changed in two different places, you must +// create a **NEW** GUID, not simply choose one or the other! +// +// NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE +// +////////////////////////////////////////////////////////////////////////////////////////////////////////// + +constexpr GUID JITEEVersionIdentifier = { /* 0d235fe4-65a1-487a-8553-c845496da901 */ + 0x0d235fe4, + 0x65a1, + 0x487a, + {0x85, 0x53, 0xc8, 0x45, 0x49, 0x6d, 0xa9, 0x01} +}; + +////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// END JITEEVersionIdentifier +// +////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/coreclr/src/jit/ICorJitInfo_API_names.h b/src/coreclr/src/jit/ICorJitInfo_API_names.h index ff5cd92..d9a6719 100644 --- a/src/coreclr/src/jit/ICorJitInfo_API_names.h +++ b/src/coreclr/src/jit/ICorJitInfo_API_names.h @@ -1,6 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +// DO NOT EDIT THIS FILE! IT IS AUTOGENERATED +// To regenerate run the gen script in src/coreclr/src/tools/Common/JitInterface/ThunkGenerator +// and follow the instructions in docs/project/updating-jitinterface.md DEF_CLR_API(getMethodAttribs) DEF_CLR_API(setMethodAttribs) DEF_CLR_API(getMethodSig) @@ -26,6 +29,8 @@ DEF_CLR_API(isCompatibleDelegate) DEF_CLR_API(methodMustBeLoadedBeforeCodeIsRun) DEF_CLR_API(mapMethodDeclToMethodImpl) DEF_CLR_API(getGSCookie) +DEF_CLR_API(setPatchpointInfo) +DEF_CLR_API(getOSRInfo) DEF_CLR_API(resolveToken) DEF_CLR_API(tryResolveToken) DEF_CLR_API(findSig) @@ -153,12 +158,10 @@ DEF_CLR_API(MethodCompileComplete) DEF_CLR_API(getTailCallHelpers) DEF_CLR_API(convertPInvokeCalliToCall) DEF_CLR_API(notifyInstructionSetUsage) -DEF_CLR_API(getMemoryManager) DEF_CLR_API(allocMem) DEF_CLR_API(reserveUnwindInfo) DEF_CLR_API(allocUnwindInfo) DEF_CLR_API(allocGCInfo) -DEF_CLR_API(yieldExecution) DEF_CLR_API(setEHcount) DEF_CLR_API(setEHinfo) DEF_CLR_API(logMsg) @@ -166,6 +169,7 @@ DEF_CLR_API(doAssert) DEF_CLR_API(reportFatalError) DEF_CLR_API(allocMethodBlockCounts) DEF_CLR_API(getMethodBlockCounts) +DEF_CLR_API(getLikelyClass) DEF_CLR_API(recordCallSite) DEF_CLR_API(recordRelocation) DEF_CLR_API(getRelocTypeHint) diff --git a/src/coreclr/src/jit/ICorJitInfo_API_wrapper.hpp b/src/coreclr/src/jit/ICorJitInfo_API_wrapper.hpp index 9593be5..60010a2 100644 --- a/src/coreclr/src/jit/ICorJitInfo_API_wrapper.hpp +++ b/src/coreclr/src/jit/ICorJitInfo_API_wrapper.hpp @@ -1,35 +1,39 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +// DO NOT EDIT THIS FILE! IT IS AUTOGENERATED +// To regenerate run the gen script in src/coreclr/src/tools/Common/JitInterface/ThunkGenerator +// and follow the instructions in docs/project/updating-jitinterface.md + #define API_ENTER(name) wrapComp->CLR_API_Enter(API_##name); #define API_LEAVE(name) wrapComp->CLR_API_Leave(API_##name); /**********************************************************************************/ // clang-format off /**********************************************************************************/ -// -// ICorMethodInfo -// -DWORD WrapICorJitInfo::getMethodAttribs(CORINFO_METHOD_HANDLE ftn /* IN */) +DWORD WrapICorJitInfo::getMethodAttribs( + CORINFO_METHOD_HANDLE ftn) { - API_ENTER(getMethodAttribs) + API_ENTER(getMethodAttribs); DWORD temp = wrapHnd->getMethodAttribs(ftn); - API_LEAVE(getMethodAttribs) + API_LEAVE(getMethodAttribs); return temp; } -void WrapICorJitInfo::setMethodAttribs(CORINFO_METHOD_HANDLE ftn,/* IN */ - CorInfoMethodRuntimeFlags attribs/* IN */) +void WrapICorJitInfo::setMethodAttribs( + CORINFO_METHOD_HANDLE ftn, + CorInfoMethodRuntimeFlags attribs) { API_ENTER(setMethodAttribs); wrapHnd->setMethodAttribs(ftn, attribs); API_LEAVE(setMethodAttribs); } -void WrapICorJitInfo::getMethodSig(CORINFO_METHOD_HANDLE ftn, /* IN */ - CORINFO_SIG_INFO *sig, /* OUT */ - CORINFO_CLASS_HANDLE memberParent/* IN */) +void WrapICorJitInfo::getMethodSig( + CORINFO_METHOD_HANDLE ftn, + CORINFO_SIG_INFO* sig, + CORINFO_CLASS_HANDLE memberParent) { API_ENTER(getMethodSig); wrapHnd->getMethodSig(ftn, sig, memberParent); @@ -37,8 +41,8 @@ void WrapICorJitInfo::getMethodSig(CORINFO_METHOD_HANDLE ftn, /* IN } bool WrapICorJitInfo::getMethodInfo( - CORINFO_METHOD_HANDLE ftn, /* IN */ - CORINFO_METHOD_INFO* info /* OUT */) + CORINFO_METHOD_HANDLE ftn, + CORINFO_METHOD_INFO* info) { API_ENTER(getMethodInfo); bool temp = wrapHnd->getMethodInfo(ftn, info); @@ -47,9 +51,9 @@ bool WrapICorJitInfo::getMethodInfo( } CorInfoInline WrapICorJitInfo::canInline( - CORINFO_METHOD_HANDLE callerHnd, /* IN */ - CORINFO_METHOD_HANDLE calleeHnd, /* IN */ - DWORD* pRestrictions /* OUT */) + CORINFO_METHOD_HANDLE callerHnd, + CORINFO_METHOD_HANDLE calleeHnd, + DWORD* pRestrictions) { API_ENTER(canInline); CorInfoInline temp = wrapHnd->canInline(callerHnd, calleeHnd, pRestrictions); @@ -57,10 +61,11 @@ CorInfoInline WrapICorJitInfo::canInline( return temp; } -void WrapICorJitInfo::reportInliningDecision(CORINFO_METHOD_HANDLE inlinerHnd, - CORINFO_METHOD_HANDLE inlineeHnd, - CorInfoInline inlineResult, - const char * reason) +void WrapICorJitInfo::reportInliningDecision( + CORINFO_METHOD_HANDLE inlinerHnd, + CORINFO_METHOD_HANDLE inlineeHnd, + CorInfoInline inlineResult, + const char* reason) { API_ENTER(reportInliningDecision); wrapHnd->reportInliningDecision(inlinerHnd, inlineeHnd, inlineResult, reason); @@ -68,10 +73,10 @@ void WrapICorJitInfo::reportInliningDecision(CORINFO_METHOD_HANDLE inlinerHnd, } bool WrapICorJitInfo::canTailCall( - CORINFO_METHOD_HANDLE callerHnd, /* IN */ - CORINFO_METHOD_HANDLE declaredCalleeHnd, /* IN */ - CORINFO_METHOD_HANDLE exactCalleeHnd, /* IN */ - bool fIsTailPrefix /* IN */) + CORINFO_METHOD_HANDLE callerHnd, + CORINFO_METHOD_HANDLE declaredCalleeHnd, + CORINFO_METHOD_HANDLE exactCalleeHnd, + bool fIsTailPrefix) { API_ENTER(canTailCall); bool temp = wrapHnd->canTailCall(callerHnd, declaredCalleeHnd, exactCalleeHnd, fIsTailPrefix); @@ -79,11 +84,12 @@ bool WrapICorJitInfo::canTailCall( return temp; } -void WrapICorJitInfo::reportTailCallDecision(CORINFO_METHOD_HANDLE callerHnd, - CORINFO_METHOD_HANDLE calleeHnd, - bool fIsTailPrefix, - CorInfoTailCall tailCallResult, - const char * reason) +void WrapICorJitInfo::reportTailCallDecision( + CORINFO_METHOD_HANDLE callerHnd, + CORINFO_METHOD_HANDLE calleeHnd, + bool fIsTailPrefix, + CorInfoTailCall tailCallResult, + const char* reason) { API_ENTER(reportTailCallDecision); wrapHnd->reportTailCallDecision(callerHnd, calleeHnd, fIsTailPrefix, tailCallResult, reason); @@ -91,9 +97,9 @@ void WrapICorJitInfo::reportTailCallDecision(CORINFO_METHOD_HANDLE callerHnd, } void WrapICorJitInfo::getEHinfo( - CORINFO_METHOD_HANDLE ftn, /* IN */ - unsigned EHnumber, /* IN */ - CORINFO_EH_CLAUSE* clause /* OUT */) + CORINFO_METHOD_HANDLE ftn, + unsigned EHnumber, + CORINFO_EH_CLAUSE* clause) { API_ENTER(getEHinfo); wrapHnd->getEHinfo(ftn, EHnumber, clause); @@ -101,7 +107,7 @@ void WrapICorJitInfo::getEHinfo( } CORINFO_CLASS_HANDLE WrapICorJitInfo::getMethodClass( - CORINFO_METHOD_HANDLE method) + CORINFO_METHOD_HANDLE method) { API_ENTER(getMethodClass); CORINFO_CLASS_HANDLE temp = wrapHnd->getMethodClass(method); @@ -110,7 +116,7 @@ CORINFO_CLASS_HANDLE WrapICorJitInfo::getMethodClass( } CORINFO_MODULE_HANDLE WrapICorJitInfo::getMethodModule( - CORINFO_METHOD_HANDLE method) + CORINFO_METHOD_HANDLE method) { API_ENTER(getMethodModule); CORINFO_MODULE_HANDLE temp = wrapHnd->getMethodModule(method); @@ -119,10 +125,10 @@ CORINFO_MODULE_HANDLE WrapICorJitInfo::getMethodModule( } void WrapICorJitInfo::getMethodVTableOffset( - CORINFO_METHOD_HANDLE method, /* IN */ - unsigned* offsetOfIndirection, /* OUT */ - unsigned* offsetAfterIndirection, /* OUT */ - bool* isRelative /* OUT */) + CORINFO_METHOD_HANDLE method, + unsigned* offsetOfIndirection, + unsigned* offsetAfterIndirection, + bool* isRelative) { API_ENTER(getMethodVTableOffset); wrapHnd->getMethodVTableOffset(method, offsetOfIndirection, offsetAfterIndirection, isRelative); @@ -130,10 +136,9 @@ void WrapICorJitInfo::getMethodVTableOffset( } CORINFO_METHOD_HANDLE WrapICorJitInfo::resolveVirtualMethod( - CORINFO_METHOD_HANDLE virtualMethod, /* IN */ - CORINFO_CLASS_HANDLE implementingClass, /* IN */ - CORINFO_CONTEXT_HANDLE ownerType = NULL /* IN */ - ) + CORINFO_METHOD_HANDLE virtualMethod, + CORINFO_CLASS_HANDLE implementingClass, + CORINFO_CONTEXT_HANDLE ownerType) { API_ENTER(resolveVirtualMethod); CORINFO_METHOD_HANDLE temp = wrapHnd->resolveVirtualMethod(virtualMethod, implementingClass, ownerType); @@ -142,9 +147,8 @@ CORINFO_METHOD_HANDLE WrapICorJitInfo::resolveVirtualMethod( } CORINFO_METHOD_HANDLE WrapICorJitInfo::getUnboxedEntry( - CORINFO_METHOD_HANDLE ftn, - bool* requiresInstMethodTableArg = NULL /* OUT */ - ) + CORINFO_METHOD_HANDLE ftn, + bool* requiresInstMethodTableArg) { API_ENTER(getUnboxedEntry); CORINFO_METHOD_HANDLE temp = wrapHnd->getUnboxedEntry(ftn, requiresInstMethodTableArg); @@ -153,8 +157,7 @@ CORINFO_METHOD_HANDLE WrapICorJitInfo::getUnboxedEntry( } CORINFO_CLASS_HANDLE WrapICorJitInfo::getDefaultEqualityComparerClass( - CORINFO_CLASS_HANDLE elemType - ) + CORINFO_CLASS_HANDLE elemType) { API_ENTER(getDefaultEqualityComparerClass); CORINFO_CLASS_HANDLE temp = wrapHnd->getDefaultEqualityComparerClass(elemType); @@ -163,8 +166,8 @@ CORINFO_CLASS_HANDLE WrapICorJitInfo::getDefaultEqualityComparerClass( } void WrapICorJitInfo::expandRawHandleIntrinsic( - CORINFO_RESOLVED_TOKEN * pResolvedToken, - CORINFO_GENERICHANDLE_RESULT * pResult) + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_GENERICHANDLE_RESULT* pResult) { API_ENTER(expandRawHandleIntrinsic); wrapHnd->expandRawHandleIntrinsic(pResolvedToken, pResult); @@ -172,8 +175,8 @@ void WrapICorJitInfo::expandRawHandleIntrinsic( } CorInfoIntrinsics WrapICorJitInfo::getIntrinsicID( - CORINFO_METHOD_HANDLE method, - bool* pMustExpand /* OUT */) + CORINFO_METHOD_HANDLE method, + bool* pMustExpand) { API_ENTER(getIntrinsicID); CorInfoIntrinsics temp = wrapHnd->getIntrinsicID(method, pMustExpand); @@ -181,7 +184,8 @@ CorInfoIntrinsics WrapICorJitInfo::getIntrinsicID( return temp; } -bool WrapICorJitInfo::isIntrinsicType(CORINFO_CLASS_HANDLE classHnd) +bool WrapICorJitInfo::isIntrinsicType( + CORINFO_CLASS_HANDLE classHnd) { API_ENTER(isIntrinsicType); bool temp = wrapHnd->isIntrinsicType(classHnd); @@ -190,7 +194,7 @@ bool WrapICorJitInfo::isIntrinsicType(CORINFO_CLASS_HANDLE classHnd) } CorInfoUnmanagedCallConv WrapICorJitInfo::getUnmanagedCallConv( - CORINFO_METHOD_HANDLE method) + CORINFO_METHOD_HANDLE method) { API_ENTER(getUnmanagedCallConv); CorInfoUnmanagedCallConv temp = wrapHnd->getUnmanagedCallConv(method); @@ -199,8 +203,8 @@ CorInfoUnmanagedCallConv WrapICorJitInfo::getUnmanagedCallConv( } BOOL WrapICorJitInfo::pInvokeMarshalingRequired( - CORINFO_METHOD_HANDLE method, - CORINFO_SIG_INFO* callSiteSig) + CORINFO_METHOD_HANDLE method, + CORINFO_SIG_INFO* callSiteSig) { API_ENTER(pInvokeMarshalingRequired); BOOL temp = wrapHnd->pInvokeMarshalingRequired(method, callSiteSig); @@ -209,8 +213,8 @@ BOOL WrapICorJitInfo::pInvokeMarshalingRequired( } BOOL WrapICorJitInfo::satisfiesMethodConstraints( - CORINFO_CLASS_HANDLE parent, // the exact parent of the method - CORINFO_METHOD_HANDLE method) + CORINFO_CLASS_HANDLE parent, + CORINFO_METHOD_HANDLE method) { API_ENTER(satisfiesMethodConstraints); BOOL temp = wrapHnd->satisfiesMethodConstraints(parent, method); @@ -219,11 +223,11 @@ BOOL WrapICorJitInfo::satisfiesMethodConstraints( } BOOL WrapICorJitInfo::isCompatibleDelegate( - CORINFO_CLASS_HANDLE objCls, - CORINFO_CLASS_HANDLE methodParentCls, - CORINFO_METHOD_HANDLE method, - CORINFO_CLASS_HANDLE delegateCls, - BOOL *pfIsOpenDelegate) + CORINFO_CLASS_HANDLE objCls, + CORINFO_CLASS_HANDLE methodParentCls, + CORINFO_METHOD_HANDLE method, + CORINFO_CLASS_HANDLE delegateCls, + BOOL* pfIsOpenDelegate) { API_ENTER(isCompatibleDelegate); BOOL temp = wrapHnd->isCompatibleDelegate(objCls, methodParentCls, method, delegateCls, pfIsOpenDelegate); @@ -232,7 +236,7 @@ BOOL WrapICorJitInfo::isCompatibleDelegate( } void WrapICorJitInfo::methodMustBeLoadedBeforeCodeIsRun( - CORINFO_METHOD_HANDLE method) + CORINFO_METHOD_HANDLE method) { API_ENTER(methodMustBeLoadedBeforeCodeIsRun); wrapHnd->methodMustBeLoadedBeforeCodeIsRun(method); @@ -240,7 +244,7 @@ void WrapICorJitInfo::methodMustBeLoadedBeforeCodeIsRun( } CORINFO_METHOD_HANDLE WrapICorJitInfo::mapMethodDeclToMethodImpl( - CORINFO_METHOD_HANDLE method) + CORINFO_METHOD_HANDLE method) { API_ENTER(mapMethodDeclToMethodImpl); CORINFO_METHOD_HANDLE temp = wrapHnd->mapMethodDeclToMethodImpl(method); @@ -249,40 +253,53 @@ CORINFO_METHOD_HANDLE WrapICorJitInfo::mapMethodDeclToMethodImpl( } void WrapICorJitInfo::getGSCookie( - GSCookie * pCookieVal, - GSCookie ** ppCookieVal ) + GSCookie* pCookieVal, + GSCookie** ppCookieVal) { API_ENTER(getGSCookie); wrapHnd->getGSCookie(pCookieVal, ppCookieVal); API_LEAVE(getGSCookie); } -/**********************************************************************************/ -// -// ICorModuleInfo -// -/**********************************************************************************/ +void WrapICorJitInfo::setPatchpointInfo( + PatchpointInfo* patchpointInfo) +{ + API_ENTER(setPatchpointInfo); + wrapHnd->setPatchpointInfo(patchpointInfo); + API_LEAVE(setPatchpointInfo); +} + +PatchpointInfo* WrapICorJitInfo::getOSRInfo( + unsigned* ilOffset) +{ + API_ENTER(getOSRInfo); + PatchpointInfo* temp = wrapHnd->getOSRInfo(ilOffset); + API_LEAVE(getOSRInfo); + return temp; +} -void WrapICorJitInfo::resolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN * pResolvedToken) +void WrapICorJitInfo::resolveToken( + CORINFO_RESOLVED_TOKEN* pResolvedToken) { API_ENTER(resolveToken); wrapHnd->resolveToken(pResolvedToken); API_LEAVE(resolveToken); } -bool WrapICorJitInfo::tryResolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN * pResolvedToken) +bool WrapICorJitInfo::tryResolveToken( + CORINFO_RESOLVED_TOKEN* pResolvedToken) { API_ENTER(tryResolveToken); - bool success = wrapHnd->tryResolveToken(pResolvedToken); + bool temp = wrapHnd->tryResolveToken(pResolvedToken); API_LEAVE(tryResolveToken); - return success; + return temp; } void WrapICorJitInfo::findSig( - CORINFO_MODULE_HANDLE module, - unsigned sigTOK, - CORINFO_CONTEXT_HANDLE context, - CORINFO_SIG_INFO *sig ) + CORINFO_MODULE_HANDLE module, + unsigned sigTOK, + CORINFO_CONTEXT_HANDLE context, + CORINFO_SIG_INFO* sig) { API_ENTER(findSig); wrapHnd->findSig(module, sigTOK, context, sig); @@ -290,10 +307,10 @@ void WrapICorJitInfo::findSig( } void WrapICorJitInfo::findCallSiteSig( - CORINFO_MODULE_HANDLE module, /* IN */ - unsigned methTOK, /* IN */ - CORINFO_CONTEXT_HANDLE context, /* IN */ - CORINFO_SIG_INFO *sig /* OUT */) + CORINFO_MODULE_HANDLE module, + unsigned methTOK, + CORINFO_CONTEXT_HANDLE context, + CORINFO_SIG_INFO* sig) { API_ENTER(findCallSiteSig); wrapHnd->findCallSiteSig(module, methTOK, context, sig); @@ -301,7 +318,7 @@ void WrapICorJitInfo::findCallSiteSig( } CORINFO_CLASS_HANDLE WrapICorJitInfo::getTokenTypeAsHandle( - CORINFO_RESOLVED_TOKEN * pResolvedToken /* IN */) + CORINFO_RESOLVED_TOKEN* pResolvedToken) { API_ENTER(getTokenTypeAsHandle); CORINFO_CLASS_HANDLE temp = wrapHnd->getTokenTypeAsHandle(pResolvedToken); @@ -310,18 +327,18 @@ CORINFO_CLASS_HANDLE WrapICorJitInfo::getTokenTypeAsHandle( } BOOL WrapICorJitInfo::isValidToken( - CORINFO_MODULE_HANDLE module, /* IN */ - unsigned metaTOK /* IN */) + CORINFO_MODULE_HANDLE module, + unsigned metaTOK) { API_ENTER(isValidToken); - BOOL result = wrapHnd->isValidToken(module, metaTOK); + BOOL temp = wrapHnd->isValidToken(module, metaTOK); API_LEAVE(isValidToken); - return result; + return temp; } BOOL WrapICorJitInfo::isValidStringRef( - CORINFO_MODULE_HANDLE module, /* IN */ - unsigned metaTOK /* IN */) + CORINFO_MODULE_HANDLE module, + unsigned metaTOK) { API_ENTER(isValidStringRef); BOOL temp = wrapHnd->isValidStringRef(module, metaTOK); @@ -330,9 +347,9 @@ BOOL WrapICorJitInfo::isValidStringRef( } LPCWSTR WrapICorJitInfo::getStringLiteral( - CORINFO_MODULE_HANDLE module, /* IN */ - unsigned metaTOK, /* IN */ - int* length /* OUT */) + CORINFO_MODULE_HANDLE module, + unsigned metaTOK, + int* length) { API_ENTER(getStringLiteral); LPCWSTR temp = wrapHnd->getStringLiteral(module, metaTOK, length); @@ -340,13 +357,8 @@ LPCWSTR WrapICorJitInfo::getStringLiteral( return temp; } -/**********************************************************************************/ -// -// ICorClassInfo -// -/**********************************************************************************/ - -CorInfoType WrapICorJitInfo::asCorInfoType(CORINFO_CLASS_HANDLE cls) +CorInfoType WrapICorJitInfo::asCorInfoType( + CORINFO_CLASS_HANDLE cls) { API_ENTER(asCorInfoType); CorInfoType temp = wrapHnd->asCorInfoType(cls); @@ -354,46 +366,51 @@ CorInfoType WrapICorJitInfo::asCorInfoType(CORINFO_CLASS_HANDLE cls) return temp; } -const char* WrapICorJitInfo::getClassName(CORINFO_CLASS_HANDLE cls) +const char* WrapICorJitInfo::getClassName( + CORINFO_CLASS_HANDLE cls) { API_ENTER(getClassName); - const char* result = wrapHnd->getClassName(cls); + const char* temp = wrapHnd->getClassName(cls); API_LEAVE(getClassName); - return result; + return temp; } -const char* WrapICorJitInfo::getClassNameFromMetadata(CORINFO_CLASS_HANDLE cls, const char** namespaceName) +const char* WrapICorJitInfo::getClassNameFromMetadata( + CORINFO_CLASS_HANDLE cls, + const char** namespaceName) { API_ENTER(getClassNameFromMetadata); - const char* result = wrapHnd->getClassNameFromMetadata(cls, namespaceName); + const char* temp = wrapHnd->getClassNameFromMetadata(cls, namespaceName); API_LEAVE(getClassNameFromMetadata); - return result; + return temp; } -CORINFO_CLASS_HANDLE WrapICorJitInfo::getTypeInstantiationArgument(CORINFO_CLASS_HANDLE cls, unsigned index) +CORINFO_CLASS_HANDLE WrapICorJitInfo::getTypeInstantiationArgument( + CORINFO_CLASS_HANDLE cls, + unsigned index) { API_ENTER(getTypeInstantiationArgument); - CORINFO_CLASS_HANDLE result = wrapHnd->getTypeInstantiationArgument(cls, index); + CORINFO_CLASS_HANDLE temp = wrapHnd->getTypeInstantiationArgument(cls, index); API_LEAVE(getTypeInstantiationArgument); - return result; + return temp; } int WrapICorJitInfo::appendClassName( - __deref_inout_ecount(*pnBufLen) WCHAR** ppBuf, - int* pnBufLen, - CORINFO_CLASS_HANDLE cls, - BOOL fNamespace, - BOOL fFullInst, - BOOL fAssembly) + WCHAR** ppBuf, + int* pnBufLen, + CORINFO_CLASS_HANDLE cls, + BOOL fNamespace, + BOOL fFullInst, + BOOL fAssembly) { API_ENTER(appendClassName); - WCHAR* pBuf = *ppBuf; - int nLen = wrapHnd->appendClassName(ppBuf, pnBufLen, cls, fNamespace, fFullInst, fAssembly); + int temp = wrapHnd->appendClassName(ppBuf, pnBufLen, cls, fNamespace, fFullInst, fAssembly); API_LEAVE(appendClassName); - return nLen; + return temp; } -BOOL WrapICorJitInfo::isValueClass(CORINFO_CLASS_HANDLE cls) +BOOL WrapICorJitInfo::isValueClass( + CORINFO_CLASS_HANDLE cls) { API_ENTER(isValueClass); BOOL temp = wrapHnd->isValueClass(cls); @@ -401,7 +418,9 @@ BOOL WrapICorJitInfo::isValueClass(CORINFO_CLASS_HANDLE cls) return temp; } -CorInfoInlineTypeCheck WrapICorJitInfo::canInlineTypeCheck(CORINFO_CLASS_HANDLE cls, CorInfoInlineTypeCheckSource source) +CorInfoInlineTypeCheck WrapICorJitInfo::canInlineTypeCheck( + CORINFO_CLASS_HANDLE cls, + CorInfoInlineTypeCheckSource source) { API_ENTER(canInlineTypeCheck); CorInfoInlineTypeCheck temp = wrapHnd->canInlineTypeCheck(cls, source); @@ -410,7 +429,7 @@ CorInfoInlineTypeCheck WrapICorJitInfo::canInlineTypeCheck(CORINFO_CLASS_HANDLE } DWORD WrapICorJitInfo::getClassAttribs( - CORINFO_CLASS_HANDLE cls) + CORINFO_CLASS_HANDLE cls) { API_ENTER(getClassAttribs); DWORD temp = wrapHnd->getClassAttribs(cls); @@ -418,7 +437,8 @@ DWORD WrapICorJitInfo::getClassAttribs( return temp; } -BOOL WrapICorJitInfo::isStructRequiringStackAllocRetBuf(CORINFO_CLASS_HANDLE cls) +BOOL WrapICorJitInfo::isStructRequiringStackAllocRetBuf( + CORINFO_CLASS_HANDLE cls) { API_ENTER(isStructRequiringStackAllocRetBuf); BOOL temp = wrapHnd->isStructRequiringStackAllocRetBuf(cls); @@ -427,41 +447,43 @@ BOOL WrapICorJitInfo::isStructRequiringStackAllocRetBuf(CORINFO_CLASS_HANDLE cls } CORINFO_MODULE_HANDLE WrapICorJitInfo::getClassModule( - CORINFO_CLASS_HANDLE cls) + CORINFO_CLASS_HANDLE cls) { API_ENTER(getClassModule); - CORINFO_MODULE_HANDLE result = wrapHnd->getClassModule(cls); + CORINFO_MODULE_HANDLE temp = wrapHnd->getClassModule(cls); API_LEAVE(getClassModule); - return result; + return temp; } CORINFO_ASSEMBLY_HANDLE WrapICorJitInfo::getModuleAssembly( - CORINFO_MODULE_HANDLE mod) + CORINFO_MODULE_HANDLE mod) { API_ENTER(getModuleAssembly); - CORINFO_ASSEMBLY_HANDLE result = wrapHnd->getModuleAssembly(mod); + CORINFO_ASSEMBLY_HANDLE temp = wrapHnd->getModuleAssembly(mod); API_LEAVE(getModuleAssembly); - return result; + return temp; } const char* WrapICorJitInfo::getAssemblyName( - CORINFO_ASSEMBLY_HANDLE assem) + CORINFO_ASSEMBLY_HANDLE assem) { API_ENTER(getAssemblyName); - const char* result = wrapHnd->getAssemblyName(assem); + const char* temp = wrapHnd->getAssemblyName(assem); API_LEAVE(getAssemblyName); - return result; + return temp; } -void* WrapICorJitInfo::LongLifetimeMalloc(size_t sz) +void* WrapICorJitInfo::LongLifetimeMalloc( + size_t sz) { API_ENTER(LongLifetimeMalloc); - void* result = wrapHnd->LongLifetimeMalloc(sz); + void* temp = wrapHnd->LongLifetimeMalloc(sz); API_LEAVE(LongLifetimeMalloc); - return result; + return temp; } -void WrapICorJitInfo::LongLifetimeFree(void* obj) +void WrapICorJitInfo::LongLifetimeFree( + void* obj) { API_ENTER(LongLifetimeFree); wrapHnd->LongLifetimeFree(obj); @@ -469,9 +491,9 @@ void WrapICorJitInfo::LongLifetimeFree(void* obj) } size_t WrapICorJitInfo::getClassModuleIdForStatics( - CORINFO_CLASS_HANDLE cls, - CORINFO_MODULE_HANDLE *pModule, - void **ppIndirection) + CORINFO_CLASS_HANDLE cls, + CORINFO_MODULE_HANDLE* pModule, + void** ppIndirection) { API_ENTER(getClassModuleIdForStatics); size_t temp = wrapHnd->getClassModuleIdForStatics(cls, pModule, ppIndirection); @@ -479,7 +501,8 @@ size_t WrapICorJitInfo::getClassModuleIdForStatics( return temp; } -unsigned WrapICorJitInfo::getClassSize(CORINFO_CLASS_HANDLE cls) +unsigned WrapICorJitInfo::getClassSize( + CORINFO_CLASS_HANDLE cls) { API_ENTER(getClassSize); unsigned temp = wrapHnd->getClassSize(cls); @@ -487,7 +510,8 @@ unsigned WrapICorJitInfo::getClassSize(CORINFO_CLASS_HANDLE cls) return temp; } -unsigned WrapICorJitInfo::getHeapClassSize(CORINFO_CLASS_HANDLE cls) +unsigned WrapICorJitInfo::getHeapClassSize( + CORINFO_CLASS_HANDLE cls) { API_ENTER(getHeapClassSize); unsigned temp = wrapHnd->getHeapClassSize(cls); @@ -495,7 +519,8 @@ unsigned WrapICorJitInfo::getHeapClassSize(CORINFO_CLASS_HANDLE cls) return temp; } -BOOL WrapICorJitInfo::canAllocateOnStack(CORINFO_CLASS_HANDLE cls) +BOOL WrapICorJitInfo::canAllocateOnStack( + CORINFO_CLASS_HANDLE cls) { API_ENTER(canAllocateOnStack); BOOL temp = wrapHnd->canAllocateOnStack(cls); @@ -504,8 +529,8 @@ BOOL WrapICorJitInfo::canAllocateOnStack(CORINFO_CLASS_HANDLE cls) } unsigned WrapICorJitInfo::getClassAlignmentRequirement( - CORINFO_CLASS_HANDLE cls, - BOOL fDoubleAlignHint) + CORINFO_CLASS_HANDLE cls, + BOOL fDoubleAlignHint) { API_ENTER(getClassAlignmentRequirement); unsigned temp = wrapHnd->getClassAlignmentRequirement(cls, fDoubleAlignHint); @@ -514,8 +539,8 @@ unsigned WrapICorJitInfo::getClassAlignmentRequirement( } unsigned WrapICorJitInfo::getClassGClayout( - CORINFO_CLASS_HANDLE cls, /* IN */ - BYTE *gcPtrs /* OUT */) + CORINFO_CLASS_HANDLE cls, + BYTE* gcPtrs) { API_ENTER(getClassGClayout); unsigned temp = wrapHnd->getClassGClayout(cls, gcPtrs); @@ -524,7 +549,7 @@ unsigned WrapICorJitInfo::getClassGClayout( } unsigned WrapICorJitInfo::getClassNumInstanceFields( - CORINFO_CLASS_HANDLE cls /* IN */) + CORINFO_CLASS_HANDLE cls) { API_ENTER(getClassNumInstanceFields); unsigned temp = wrapHnd->getClassNumInstanceFields(cls); @@ -533,8 +558,8 @@ unsigned WrapICorJitInfo::getClassNumInstanceFields( } CORINFO_FIELD_HANDLE WrapICorJitInfo::getFieldInClass( - CORINFO_CLASS_HANDLE clsHnd, - INT num) + CORINFO_CLASS_HANDLE clsHnd, + INT num) { API_ENTER(getFieldInClass); CORINFO_FIELD_HANDLE temp = wrapHnd->getFieldInClass(clsHnd, num); @@ -543,20 +568,20 @@ CORINFO_FIELD_HANDLE WrapICorJitInfo::getFieldInClass( } BOOL WrapICorJitInfo::checkMethodModifier( - CORINFO_METHOD_HANDLE hMethod, - LPCSTR modifier, - BOOL fOptional) + CORINFO_METHOD_HANDLE hMethod, + LPCSTR modifier, + BOOL fOptional) { API_ENTER(checkMethodModifier); - BOOL result = wrapHnd->checkMethodModifier(hMethod, modifier, fOptional); + BOOL temp = wrapHnd->checkMethodModifier(hMethod, modifier, fOptional); API_LEAVE(checkMethodModifier); - return result; + return temp; } CorInfoHelpFunc WrapICorJitInfo::getNewHelper( - CORINFO_RESOLVED_TOKEN * pResolvedToken, - CORINFO_METHOD_HANDLE callerHandle, - bool * pHasSideEffects) + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_METHOD_HANDLE callerHandle, + bool* pHasSideEffects) { API_ENTER(getNewHelper); CorInfoHelpFunc temp = wrapHnd->getNewHelper(pResolvedToken, callerHandle, pHasSideEffects); @@ -565,7 +590,7 @@ CorInfoHelpFunc WrapICorJitInfo::getNewHelper( } CorInfoHelpFunc WrapICorJitInfo::getNewArrHelper( - CORINFO_CLASS_HANDLE arrayCls) + CORINFO_CLASS_HANDLE arrayCls) { API_ENTER(getNewArrHelper); CorInfoHelpFunc temp = wrapHnd->getNewArrHelper(arrayCls); @@ -574,8 +599,8 @@ CorInfoHelpFunc WrapICorJitInfo::getNewArrHelper( } CorInfoHelpFunc WrapICorJitInfo::getCastingHelper( - CORINFO_RESOLVED_TOKEN * pResolvedToken, - bool fThrowing) + CORINFO_RESOLVED_TOKEN* pResolvedToken, + bool fThrowing) { API_ENTER(getCastingHelper); CorInfoHelpFunc temp = wrapHnd->getCastingHelper(pResolvedToken, fThrowing); @@ -584,7 +609,7 @@ CorInfoHelpFunc WrapICorJitInfo::getCastingHelper( } CorInfoHelpFunc WrapICorJitInfo::getSharedCCtorHelper( - CORINFO_CLASS_HANDLE clsHnd) + CORINFO_CLASS_HANDLE clsHnd) { API_ENTER(getSharedCCtorHelper); CorInfoHelpFunc temp = wrapHnd->getSharedCCtorHelper(clsHnd); @@ -592,8 +617,8 @@ CorInfoHelpFunc WrapICorJitInfo::getSharedCCtorHelper( return temp; } -CORINFO_CLASS_HANDLE WrapICorJitInfo::getTypeForBox( - CORINFO_CLASS_HANDLE cls) +CORINFO_CLASS_HANDLE WrapICorJitInfo::getTypeForBox( + CORINFO_CLASS_HANDLE cls) { API_ENTER(getTypeForBox); CORINFO_CLASS_HANDLE temp = wrapHnd->getTypeForBox(cls); @@ -602,7 +627,7 @@ CORINFO_CLASS_HANDLE WrapICorJitInfo::getTypeForBox( } CorInfoHelpFunc WrapICorJitInfo::getBoxHelper( - CORINFO_CLASS_HANDLE cls) + CORINFO_CLASS_HANDLE cls) { API_ENTER(getBoxHelper); CorInfoHelpFunc temp = wrapHnd->getBoxHelper(cls); @@ -611,7 +636,7 @@ CorInfoHelpFunc WrapICorJitInfo::getBoxHelper( } CorInfoHelpFunc WrapICorJitInfo::getUnBoxHelper( - CORINFO_CLASS_HANDLE cls) + CORINFO_CLASS_HANDLE cls) { API_ENTER(getUnBoxHelper); CorInfoHelpFunc temp = wrapHnd->getUnBoxHelper(cls); @@ -620,21 +645,21 @@ CorInfoHelpFunc WrapICorJitInfo::getUnBoxHelper( } bool WrapICorJitInfo::getReadyToRunHelper( - CORINFO_RESOLVED_TOKEN * pResolvedToken, - CORINFO_LOOKUP_KIND * pGenericLookupKind, - CorInfoHelpFunc id, - CORINFO_CONST_LOOKUP * pLookup) + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_LOOKUP_KIND* pGenericLookupKind, + CorInfoHelpFunc id, + CORINFO_CONST_LOOKUP* pLookup) { API_ENTER(getReadyToRunHelper); - bool result = wrapHnd->getReadyToRunHelper(pResolvedToken, pGenericLookupKind, id, pLookup); + bool temp = wrapHnd->getReadyToRunHelper(pResolvedToken, pGenericLookupKind, id, pLookup); API_LEAVE(getReadyToRunHelper); - return result; + return temp; } void WrapICorJitInfo::getReadyToRunDelegateCtorHelper( - CORINFO_RESOLVED_TOKEN * pTargetMethod, - CORINFO_CLASS_HANDLE delegateType, - CORINFO_LOOKUP * pLookup) + CORINFO_RESOLVED_TOKEN* pTargetMethod, + CORINFO_CLASS_HANDLE delegateType, + CORINFO_LOOKUP* pLookup) { API_ENTER(getReadyToRunDelegateCtorHelper); wrapHnd->getReadyToRunDelegateCtorHelper(pTargetMethod, delegateType, pLookup); @@ -642,19 +667,18 @@ void WrapICorJitInfo::getReadyToRunDelegateCtorHelper( } const char* WrapICorJitInfo::getHelperName( - CorInfoHelpFunc funcNum) + CorInfoHelpFunc helpFunc) { API_ENTER(getHelperName); - const char* temp = wrapHnd->getHelperName(funcNum); + const char* temp = wrapHnd->getHelperName(helpFunc); API_LEAVE(getHelperName); return temp; } CorInfoInitClassResult WrapICorJitInfo::initClass( - CORINFO_FIELD_HANDLE field, - - CORINFO_METHOD_HANDLE method, - CORINFO_CONTEXT_HANDLE context) + CORINFO_FIELD_HANDLE field, + CORINFO_METHOD_HANDLE method, + CORINFO_CONTEXT_HANDLE context) { API_ENTER(initClass); CorInfoInitClassResult temp = wrapHnd->initClass(field, method, context); @@ -663,7 +687,7 @@ CorInfoInitClassResult WrapICorJitInfo::initClass( } void WrapICorJitInfo::classMustBeLoadedBeforeCodeIsRun( - CORINFO_CLASS_HANDLE cls) + CORINFO_CLASS_HANDLE cls) { API_ENTER(classMustBeLoadedBeforeCodeIsRun); wrapHnd->classMustBeLoadedBeforeCodeIsRun(cls); @@ -671,7 +695,7 @@ void WrapICorJitInfo::classMustBeLoadedBeforeCodeIsRun( } CORINFO_CLASS_HANDLE WrapICorJitInfo::getBuiltinClass( - CorInfoClassId classId) + CorInfoClassId classId) { API_ENTER(getBuiltinClass); CORINFO_CLASS_HANDLE temp = wrapHnd->getBuiltinClass(classId); @@ -680,7 +704,7 @@ CORINFO_CLASS_HANDLE WrapICorJitInfo::getBuiltinClass( } CorInfoType WrapICorJitInfo::getTypeForPrimitiveValueClass( - CORINFO_CLASS_HANDLE cls) + CORINFO_CLASS_HANDLE cls) { API_ENTER(getTypeForPrimitiveValueClass); CorInfoType temp = wrapHnd->getTypeForPrimitiveValueClass(cls); @@ -689,7 +713,7 @@ CorInfoType WrapICorJitInfo::getTypeForPrimitiveValueClass( } CorInfoType WrapICorJitInfo::getTypeForPrimitiveNumericClass( - CORINFO_CLASS_HANDLE cls) + CORINFO_CLASS_HANDLE cls) { API_ENTER(getTypeForPrimitiveNumericClass); CorInfoType temp = wrapHnd->getTypeForPrimitiveNumericClass(cls); @@ -698,8 +722,8 @@ CorInfoType WrapICorJitInfo::getTypeForPrimitiveNumericClass( } BOOL WrapICorJitInfo::canCast( - CORINFO_CLASS_HANDLE child, - CORINFO_CLASS_HANDLE parent ) + CORINFO_CLASS_HANDLE child, + CORINFO_CLASS_HANDLE parent) { API_ENTER(canCast); BOOL temp = wrapHnd->canCast(child, parent); @@ -708,8 +732,8 @@ BOOL WrapICorJitInfo::canCast( } BOOL WrapICorJitInfo::areTypesEquivalent( - CORINFO_CLASS_HANDLE cls1, - CORINFO_CLASS_HANDLE cls2) + CORINFO_CLASS_HANDLE cls1, + CORINFO_CLASS_HANDLE cls2) { API_ENTER(areTypesEquivalent); BOOL temp = wrapHnd->areTypesEquivalent(cls1, cls2); @@ -718,9 +742,8 @@ BOOL WrapICorJitInfo::areTypesEquivalent( } TypeCompareState WrapICorJitInfo::compareTypesForCast( - CORINFO_CLASS_HANDLE fromClass, - CORINFO_CLASS_HANDLE toClass - ) + CORINFO_CLASS_HANDLE fromClass, + CORINFO_CLASS_HANDLE toClass) { API_ENTER(compareTypesForCast); TypeCompareState temp = wrapHnd->compareTypesForCast(fromClass, toClass); @@ -729,9 +752,8 @@ TypeCompareState WrapICorJitInfo::compareTypesForCast( } TypeCompareState WrapICorJitInfo::compareTypesForEquality( - CORINFO_CLASS_HANDLE cls1, - CORINFO_CLASS_HANDLE cls2 - ) + CORINFO_CLASS_HANDLE cls1, + CORINFO_CLASS_HANDLE cls2) { API_ENTER(compareTypesForEquality); TypeCompareState temp = wrapHnd->compareTypesForEquality(cls1, cls2); @@ -740,8 +762,8 @@ TypeCompareState WrapICorJitInfo::compareTypesForEquality( } CORINFO_CLASS_HANDLE WrapICorJitInfo::mergeClasses( - CORINFO_CLASS_HANDLE cls1, - CORINFO_CLASS_HANDLE cls2) + CORINFO_CLASS_HANDLE cls1, + CORINFO_CLASS_HANDLE cls2) { API_ENTER(mergeClasses); CORINFO_CLASS_HANDLE temp = wrapHnd->mergeClasses(cls1, cls2); @@ -750,9 +772,8 @@ CORINFO_CLASS_HANDLE WrapICorJitInfo::mergeClasses( } BOOL WrapICorJitInfo::isMoreSpecificType( - CORINFO_CLASS_HANDLE cls1, - CORINFO_CLASS_HANDLE cls2 - ) + CORINFO_CLASS_HANDLE cls1, + CORINFO_CLASS_HANDLE cls2) { API_ENTER(isMoreSpecificType); BOOL temp = wrapHnd->isMoreSpecificType(cls1, cls2); @@ -761,7 +782,7 @@ BOOL WrapICorJitInfo::isMoreSpecificType( } CORINFO_CLASS_HANDLE WrapICorJitInfo::getParentType( - CORINFO_CLASS_HANDLE cls) + CORINFO_CLASS_HANDLE cls) { API_ENTER(getParentType); CORINFO_CLASS_HANDLE temp = wrapHnd->getParentType(cls); @@ -770,8 +791,8 @@ CORINFO_CLASS_HANDLE WrapICorJitInfo::getParentType( } CorInfoType WrapICorJitInfo::getChildType( - CORINFO_CLASS_HANDLE clsHnd, - CORINFO_CLASS_HANDLE *clsRet) + CORINFO_CLASS_HANDLE clsHnd, + CORINFO_CLASS_HANDLE* clsRet) { API_ENTER(getChildType); CorInfoType temp = wrapHnd->getChildType(clsHnd, clsRet); @@ -780,17 +801,16 @@ CorInfoType WrapICorJitInfo::getChildType( } BOOL WrapICorJitInfo::satisfiesClassConstraints( - CORINFO_CLASS_HANDLE cls) + CORINFO_CLASS_HANDLE cls) { API_ENTER(satisfiesClassConstraints); BOOL temp = wrapHnd->satisfiesClassConstraints(cls); API_LEAVE(satisfiesClassConstraints); return temp; - } BOOL WrapICorJitInfo::isSDArray( - CORINFO_CLASS_HANDLE cls) + CORINFO_CLASS_HANDLE cls) { API_ENTER(isSDArray); BOOL temp = wrapHnd->isSDArray(cls); @@ -799,28 +819,28 @@ BOOL WrapICorJitInfo::isSDArray( } unsigned WrapICorJitInfo::getArrayRank( - CORINFO_CLASS_HANDLE cls) + CORINFO_CLASS_HANDLE cls) { API_ENTER(getArrayRank); - unsigned result = wrapHnd->getArrayRank(cls); + unsigned temp = wrapHnd->getArrayRank(cls); API_LEAVE(getArrayRank); - return result; + return temp; } -void * WrapICorJitInfo::getArrayInitializationData( - CORINFO_FIELD_HANDLE field, - DWORD size) +void* WrapICorJitInfo::getArrayInitializationData( + CORINFO_FIELD_HANDLE field, + DWORD size) { API_ENTER(getArrayInitializationData); - void *temp = wrapHnd->getArrayInitializationData(field, size); + void* temp = wrapHnd->getArrayInitializationData(field, size); API_LEAVE(getArrayInitializationData); return temp; } CorInfoIsAccessAllowedResult WrapICorJitInfo::canAccessClass( - CORINFO_RESOLVED_TOKEN * pResolvedToken, - CORINFO_METHOD_HANDLE callerHandle, - CORINFO_HELPER_DESC *pAccessHelper) + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_METHOD_HANDLE callerHandle, + CORINFO_HELPER_DESC* pAccessHelper) { API_ENTER(canAccessClass); CorInfoIsAccessAllowedResult temp = wrapHnd->canAccessClass(pResolvedToken, callerHandle, pAccessHelper); @@ -828,15 +848,9 @@ CorInfoIsAccessAllowedResult WrapICorJitInfo::canAccessClass( return temp; } -/**********************************************************************************/ -// -// ICorFieldInfo -// -/**********************************************************************************/ - const char* WrapICorJitInfo::getFieldName( - CORINFO_FIELD_HANDLE ftn, /* IN */ - const char **moduleName /* OUT */) + CORINFO_FIELD_HANDLE ftn, + const char** moduleName) { API_ENTER(getFieldName); const char* temp = wrapHnd->getFieldName(ftn, moduleName); @@ -845,7 +859,7 @@ const char* WrapICorJitInfo::getFieldName( } CORINFO_CLASS_HANDLE WrapICorJitInfo::getFieldClass( - CORINFO_FIELD_HANDLE field) + CORINFO_FIELD_HANDLE field) { API_ENTER(getFieldClass); CORINFO_CLASS_HANDLE temp = wrapHnd->getFieldClass(field); @@ -854,9 +868,9 @@ CORINFO_CLASS_HANDLE WrapICorJitInfo::getFieldClass( } CorInfoType WrapICorJitInfo::getFieldType( - CORINFO_FIELD_HANDLE field, - CORINFO_CLASS_HANDLE *structType, - CORINFO_CLASS_HANDLE memberParent/* IN */) + CORINFO_FIELD_HANDLE field, + CORINFO_CLASS_HANDLE* structType, + CORINFO_CLASS_HANDLE memberParent) { API_ENTER(getFieldType); CorInfoType temp = wrapHnd->getFieldType(field, structType, memberParent); @@ -865,7 +879,7 @@ CorInfoType WrapICorJitInfo::getFieldType( } unsigned WrapICorJitInfo::getFieldOffset( - CORINFO_FIELD_HANDLE field) + CORINFO_FIELD_HANDLE field) { API_ENTER(getFieldOffset); unsigned temp = wrapHnd->getFieldOffset(field); @@ -873,36 +887,31 @@ unsigned WrapICorJitInfo::getFieldOffset( return temp; } -void WrapICorJitInfo::getFieldInfo(CORINFO_RESOLVED_TOKEN * pResolvedToken, - CORINFO_METHOD_HANDLE callerHandle, - CORINFO_ACCESS_FLAGS flags, - CORINFO_FIELD_INFO *pResult) +void WrapICorJitInfo::getFieldInfo( + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_METHOD_HANDLE callerHandle, + CORINFO_ACCESS_FLAGS flags, + CORINFO_FIELD_INFO* pResult) { API_ENTER(getFieldInfo); wrapHnd->getFieldInfo(pResolvedToken, callerHandle, flags, pResult); API_LEAVE(getFieldInfo); } -bool WrapICorJitInfo::isFieldStatic(CORINFO_FIELD_HANDLE fldHnd) +bool WrapICorJitInfo::isFieldStatic( + CORINFO_FIELD_HANDLE fldHnd) { API_ENTER(isFieldStatic); - bool result = wrapHnd->isFieldStatic(fldHnd); + bool temp = wrapHnd->isFieldStatic(fldHnd); API_LEAVE(isFieldStatic); - return result; + return temp; } -/*********************************************************************************/ -// -// ICorDebugInfo -// -/*********************************************************************************/ - void WrapICorJitInfo::getBoundaries( - CORINFO_METHOD_HANDLE ftn, - unsigned int *cILOffsets, - DWORD **pILOffsets, - - ICorDebugInfo::BoundaryTypes *implictBoundaries) + CORINFO_METHOD_HANDLE ftn, + unsigned int* cILOffsets, + DWORD** pILOffsets, + ICorDebugInfo::BoundaryTypes* implictBoundaries) { API_ENTER(getBoundaries); wrapHnd->getBoundaries(ftn, cILOffsets, pILOffsets, implictBoundaries); @@ -910,9 +919,9 @@ void WrapICorJitInfo::getBoundaries( } void WrapICorJitInfo::setBoundaries( - CORINFO_METHOD_HANDLE ftn, - ULONG32 cMap, - ICorDebugInfo::OffsetMapping *pMap) + CORINFO_METHOD_HANDLE ftn, + ULONG32 cMap, + ICorDebugInfo::OffsetMapping* pMap) { API_ENTER(setBoundaries); wrapHnd->setBoundaries(ftn, cMap, pMap); @@ -920,11 +929,10 @@ void WrapICorJitInfo::setBoundaries( } void WrapICorJitInfo::getVars( - CORINFO_METHOD_HANDLE ftn, - ULONG32 *cVars, - ICorDebugInfo::ILVarInfo **vars, - bool *extendOthers) - + CORINFO_METHOD_HANDLE ftn, + ULONG32* cVars, + ICorDebugInfo::ILVarInfo** vars, + bool* extendOthers) { API_ENTER(getVars); wrapHnd->getVars(ftn, cVars, vars, extendOthers); @@ -932,41 +940,34 @@ void WrapICorJitInfo::getVars( } void WrapICorJitInfo::setVars( - CORINFO_METHOD_HANDLE ftn, - ULONG32 cVars, - ICorDebugInfo::NativeVarInfo *vars) - + CORINFO_METHOD_HANDLE ftn, + ULONG32 cVars, + ICorDebugInfo::NativeVarInfo* vars) { API_ENTER(setVars); wrapHnd->setVars(ftn, cVars, vars); API_LEAVE(setVars); } -void * WrapICorJitInfo::allocateArray( - size_t cBytes) +void* WrapICorJitInfo::allocateArray( + size_t cBytes) { API_ENTER(allocateArray); - void *temp = wrapHnd->allocateArray(cBytes); + void* temp = wrapHnd->allocateArray(cBytes); API_LEAVE(allocateArray); return temp; } void WrapICorJitInfo::freeArray( - void *array) + void* array) { API_ENTER(freeArray); wrapHnd->freeArray(array); API_LEAVE(freeArray); } -/*********************************************************************************/ -// -// ICorArgInfo -// -/*********************************************************************************/ - CORINFO_ARG_LIST_HANDLE WrapICorJitInfo::getArgNext( - CORINFO_ARG_LIST_HANDLE args /* IN */) + CORINFO_ARG_LIST_HANDLE args) { API_ENTER(getArgNext); CORINFO_ARG_LIST_HANDLE temp = wrapHnd->getArgNext(args); @@ -975,9 +976,9 @@ CORINFO_ARG_LIST_HANDLE WrapICorJitInfo::getArgNext( } CorInfoTypeWithMod WrapICorJitInfo::getArgType( - CORINFO_SIG_INFO* sig, /* IN */ - CORINFO_ARG_LIST_HANDLE args, /* IN */ - CORINFO_CLASS_HANDLE *vcTypeRet /* OUT */) + CORINFO_SIG_INFO* sig, + CORINFO_ARG_LIST_HANDLE args, + CORINFO_CLASS_HANDLE* vcTypeRet) { API_ENTER(getArgType); CorInfoTypeWithMod temp = wrapHnd->getArgType(sig, args, vcTypeRet); @@ -986,8 +987,8 @@ CorInfoTypeWithMod WrapICorJitInfo::getArgType( } CORINFO_CLASS_HANDLE WrapICorJitInfo::getArgClass( - CORINFO_SIG_INFO* sig, /* IN */ - CORINFO_ARG_LIST_HANDLE args /* IN */) + CORINFO_SIG_INFO* sig, + CORINFO_ARG_LIST_HANDLE args) { API_ENTER(getArgClass); CORINFO_CLASS_HANDLE temp = wrapHnd->getArgClass(sig, args); @@ -995,17 +996,17 @@ CORINFO_CLASS_HANDLE WrapICorJitInfo::getArgClass( return temp; } -CorInfoType WrapICorJitInfo::getHFAType( - CORINFO_CLASS_HANDLE hClass) +CorInfoHFAElemType WrapICorJitInfo::getHFAType( + CORINFO_CLASS_HANDLE hClass) { API_ENTER(getHFAType); - CorInfoType temp = wrapHnd->getHFAType(hClass); + CorInfoHFAElemType temp = wrapHnd->getHFAType(hClass); API_LEAVE(getHFAType); return temp; } HRESULT WrapICorJitInfo::GetErrorHRESULT( - struct _EXCEPTION_POINTERS *pExceptionPointers) + struct _EXCEPTION_POINTERS* pExceptionPointers) { API_ENTER(GetErrorHRESULT); HRESULT temp = wrapHnd->GetErrorHRESULT(pExceptionPointers); @@ -1014,8 +1015,8 @@ HRESULT WrapICorJitInfo::GetErrorHRESULT( } ULONG WrapICorJitInfo::GetErrorMessage( - __inout_ecount(bufferLength) LPWSTR buffer, - ULONG bufferLength) + LPWSTR buffer, + ULONG bufferLength) { API_ENTER(GetErrorMessage); ULONG temp = wrapHnd->GetErrorMessage(buffer, bufferLength); @@ -1024,7 +1025,7 @@ ULONG WrapICorJitInfo::GetErrorMessage( } int WrapICorJitInfo::FilterException( - struct _EXCEPTION_POINTERS *pExceptionPointers) + struct _EXCEPTION_POINTERS* pExceptionPointers) { API_ENTER(FilterException); int temp = wrapHnd->FilterException(pExceptionPointers); @@ -1033,7 +1034,7 @@ int WrapICorJitInfo::FilterException( } void WrapICorJitInfo::HandleException( - struct _EXCEPTION_POINTERS *pExceptionPointers) + struct _EXCEPTION_POINTERS* pExceptionPointers) { API_ENTER(HandleException); wrapHnd->HandleException(pExceptionPointers); @@ -1041,7 +1042,7 @@ void WrapICorJitInfo::HandleException( } void WrapICorJitInfo::ThrowExceptionForJitResult( - HRESULT result) + HRESULT result) { API_ENTER(ThrowExceptionForJitResult); wrapHnd->ThrowExceptionForJitResult(result); @@ -1049,7 +1050,7 @@ void WrapICorJitInfo::ThrowExceptionForJitResult( } void WrapICorJitInfo::ThrowExceptionForHelper( - const CORINFO_HELPER_DESC * throwHelper) + const CORINFO_HELPER_DESC* throwHelper) { API_ENTER(ThrowExceptionForHelper); wrapHnd->ThrowExceptionForHelper(throwHelper); @@ -1057,9 +1058,8 @@ void WrapICorJitInfo::ThrowExceptionForHelper( } bool WrapICorJitInfo::runWithErrorTrap( - void (*function)(void*), // The function to run - void* parameter // The context parameter that will be passed to the function and the handler - ) + ICorJitInfo::errorTrapFunction function, + void* parameter) { API_ENTER(runWithErrorTrap); bool temp = wrapHnd->runWithErrorTrap(function, parameter); @@ -1068,7 +1068,7 @@ bool WrapICorJitInfo::runWithErrorTrap( } void WrapICorJitInfo::getEEInfo( - CORINFO_EE_INFO *pEEInfoOut) + CORINFO_EE_INFO* pEEInfoOut) { API_ENTER(getEEInfo); wrapHnd->getEEInfo(pEEInfoOut); @@ -1084,17 +1084,17 @@ LPCWSTR WrapICorJitInfo::getJitTimeLogFilename() } mdMethodDef WrapICorJitInfo::getMethodDefFromMethod( - CORINFO_METHOD_HANDLE hMethod) + CORINFO_METHOD_HANDLE hMethod) { API_ENTER(getMethodDefFromMethod); - mdMethodDef result = wrapHnd->getMethodDefFromMethod(hMethod); + mdMethodDef temp = wrapHnd->getMethodDefFromMethod(hMethod); API_LEAVE(getMethodDefFromMethod); - return result; + return temp; } const char* WrapICorJitInfo::getMethodName( - CORINFO_METHOD_HANDLE ftn, /* IN */ - const char **moduleName /* OUT */) + CORINFO_METHOD_HANDLE ftn, + const char** moduleName) { API_ENTER(getMethodName); const char* temp = wrapHnd->getMethodName(ftn, moduleName); @@ -1103,10 +1103,10 @@ const char* WrapICorJitInfo::getMethodName( } const char* WrapICorJitInfo::getMethodNameFromMetadata( - CORINFO_METHOD_HANDLE ftn, /* IN */ - const char **className, /* OUT */ - const char **namespaceName, /* OUT */ - const char **enclosingClassName /* OUT */) + CORINFO_METHOD_HANDLE ftn, + const char** className, + const char** namespaceName, + const char** enclosingClassName) { API_ENTER(getMethodNameFromMetadata); const char* temp = wrapHnd->getMethodNameFromMetadata(ftn, className, namespaceName, enclosingClassName); @@ -1115,7 +1115,7 @@ const char* WrapICorJitInfo::getMethodNameFromMetadata( } unsigned WrapICorJitInfo::getMethodHash( - CORINFO_METHOD_HANDLE ftn /* IN */) + CORINFO_METHOD_HANDLE ftn) { API_ENTER(getMethodHash); unsigned temp = wrapHnd->getMethodHash(ftn); @@ -1124,29 +1124,29 @@ unsigned WrapICorJitInfo::getMethodHash( } size_t WrapICorJitInfo::findNameOfToken( - CORINFO_MODULE_HANDLE module, /* IN */ - mdToken metaTOK, /* IN */ - __out_ecount(FQNameCapacity) char * szFQName, /* OUT */ - size_t FQNameCapacity /* IN */) + CORINFO_MODULE_HANDLE moduleHandle, + mdToken token, + char* szFQName, + size_t FQNameCapacity) { API_ENTER(findNameOfToken); - size_t result = wrapHnd->findNameOfToken(module, metaTOK, szFQName, FQNameCapacity); + size_t temp = wrapHnd->findNameOfToken(moduleHandle, token, szFQName, FQNameCapacity); API_LEAVE(findNameOfToken); - return result; + return temp; } bool WrapICorJitInfo::getSystemVAmd64PassStructInRegisterDescriptor( - /* IN */ CORINFO_CLASS_HANDLE structHnd, - /* OUT */ SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr) + CORINFO_CLASS_HANDLE structHnd, + SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr) { API_ENTER(getSystemVAmd64PassStructInRegisterDescriptor); - bool result = wrapHnd->getSystemVAmd64PassStructInRegisterDescriptor(structHnd, structPassInRegDescPtr); + bool temp = wrapHnd->getSystemVAmd64PassStructInRegisterDescriptor(structHnd, structPassInRegDescPtr); API_LEAVE(getSystemVAmd64PassStructInRegisterDescriptor); - return result; + return temp; } DWORD WrapICorJitInfo::getThreadTLSIndex( - void **ppIndirection) + void** ppIndirection) { API_ENTER(getThreadTLSIndex); DWORD temp = wrapHnd->getThreadTLSIndex(ppIndirection); @@ -1154,8 +1154,8 @@ DWORD WrapICorJitInfo::getThreadTLSIndex( return temp; } -const void * WrapICorJitInfo::getInlinedCallFrameVptr( - void **ppIndirection) +const void* WrapICorJitInfo::getInlinedCallFrameVptr( + void** ppIndirection) { API_ENTER(getInlinedCallFrameVptr); const void* temp = wrapHnd->getInlinedCallFrameVptr(ppIndirection); @@ -1163,29 +1163,29 @@ const void * WrapICorJitInfo::getInlinedCallFrameVptr( return temp; } -LONG * WrapICorJitInfo::getAddrOfCaptureThreadGlobal( - void **ppIndirection) +LONG* WrapICorJitInfo::getAddrOfCaptureThreadGlobal( + void** ppIndirection) { API_ENTER(getAddrOfCaptureThreadGlobal); - LONG * temp = wrapHnd->getAddrOfCaptureThreadGlobal(ppIndirection); + LONG* temp = wrapHnd->getAddrOfCaptureThreadGlobal(ppIndirection); API_LEAVE(getAddrOfCaptureThreadGlobal); return temp; } void* WrapICorJitInfo::getHelperFtn( - CorInfoHelpFunc ftnNum, - void **ppIndirection) + CorInfoHelpFunc ftnNum, + void** ppIndirection) { API_ENTER(getHelperFtn); - void *temp = wrapHnd->getHelperFtn(ftnNum, ppIndirection); + void* temp = wrapHnd->getHelperFtn(ftnNum, ppIndirection); API_LEAVE(getHelperFtn); return temp; } void WrapICorJitInfo::getFunctionEntryPoint( - CORINFO_METHOD_HANDLE ftn, /* IN */ - CORINFO_CONST_LOOKUP * pResult, /* OUT */ - CORINFO_ACCESS_FLAGS accessFlags) + CORINFO_METHOD_HANDLE ftn, + CORINFO_CONST_LOOKUP* pResult, + CORINFO_ACCESS_FLAGS accessFlags) { API_ENTER(getFunctionEntryPoint); wrapHnd->getFunctionEntryPoint(ftn, pResult, accessFlags); @@ -1193,8 +1193,8 @@ void WrapICorJitInfo::getFunctionEntryPoint( } void WrapICorJitInfo::getFunctionFixedEntryPoint( - CORINFO_METHOD_HANDLE ftn, - CORINFO_CONST_LOOKUP * pResult) + CORINFO_METHOD_HANDLE ftn, + CORINFO_CONST_LOOKUP* pResult) { API_ENTER(getFunctionFixedEntryPoint); wrapHnd->getFunctionFixedEntryPoint(ftn, pResult); @@ -1202,18 +1202,17 @@ void WrapICorJitInfo::getFunctionFixedEntryPoint( } void* WrapICorJitInfo::getMethodSync( - CORINFO_METHOD_HANDLE ftn, - void **ppIndirection) + CORINFO_METHOD_HANDLE ftn, + void** ppIndirection) { API_ENTER(getMethodSync); - void *temp = wrapHnd->getMethodSync(ftn, ppIndirection); + void* temp = wrapHnd->getMethodSync(ftn, ppIndirection); API_LEAVE(getMethodSync); return temp; } - CorInfoHelpFunc WrapICorJitInfo::getLazyStringLiteralHelper( - CORINFO_MODULE_HANDLE handle) + CORINFO_MODULE_HANDLE handle) { API_ENTER(getLazyStringLiteralHelper); CorInfoHelpFunc temp = wrapHnd->getLazyStringLiteralHelper(handle); @@ -1222,8 +1221,8 @@ CorInfoHelpFunc WrapICorJitInfo::getLazyStringLiteralHelper( } CORINFO_MODULE_HANDLE WrapICorJitInfo::embedModuleHandle( - CORINFO_MODULE_HANDLE handle, - void **ppIndirection) + CORINFO_MODULE_HANDLE handle, + void** ppIndirection) { API_ENTER(embedModuleHandle); CORINFO_MODULE_HANDLE temp = wrapHnd->embedModuleHandle(handle, ppIndirection); @@ -1232,8 +1231,8 @@ CORINFO_MODULE_HANDLE WrapICorJitInfo::embedModuleHandle( } CORINFO_CLASS_HANDLE WrapICorJitInfo::embedClassHandle( - CORINFO_CLASS_HANDLE handle, - void **ppIndirection) + CORINFO_CLASS_HANDLE handle, + void** ppIndirection) { API_ENTER(embedClassHandle); CORINFO_CLASS_HANDLE temp = wrapHnd->embedClassHandle(handle, ppIndirection); @@ -1242,8 +1241,8 @@ CORINFO_CLASS_HANDLE WrapICorJitInfo::embedClassHandle( } CORINFO_METHOD_HANDLE WrapICorJitInfo::embedMethodHandle( - CORINFO_METHOD_HANDLE handle, - void **ppIndirection) + CORINFO_METHOD_HANDLE handle, + void** ppIndirection) { API_ENTER(embedMethodHandle); CORINFO_METHOD_HANDLE temp = wrapHnd->embedMethodHandle(handle, ppIndirection); @@ -1252,8 +1251,8 @@ CORINFO_METHOD_HANDLE WrapICorJitInfo::embedMethodHandle( } CORINFO_FIELD_HANDLE WrapICorJitInfo::embedFieldHandle( - CORINFO_FIELD_HANDLE handle, - void **ppIndirection) + CORINFO_FIELD_HANDLE handle, + void** ppIndirection) { API_ENTER(embedFieldHandle); CORINFO_FIELD_HANDLE temp = wrapHnd->embedFieldHandle(handle, ppIndirection); @@ -1262,9 +1261,9 @@ CORINFO_FIELD_HANDLE WrapICorJitInfo::embedFieldHandle( } void WrapICorJitInfo::embedGenericHandle( - CORINFO_RESOLVED_TOKEN * pResolvedToken, - BOOL fEmbedParent, - CORINFO_GENERICHANDLE_RESULT * pResult) + CORINFO_RESOLVED_TOKEN* pResolvedToken, + BOOL fEmbedParent, + CORINFO_GENERICHANDLE_RESULT* pResult) { API_ENTER(embedGenericHandle); wrapHnd->embedGenericHandle(pResolvedToken, fEmbedParent, pResult); @@ -1272,8 +1271,8 @@ void WrapICorJitInfo::embedGenericHandle( } void WrapICorJitInfo::getLocationOfThisType( - CORINFO_METHOD_HANDLE context, - CORINFO_LOOKUP_KIND * pLookupKind) + CORINFO_METHOD_HANDLE context, + CORINFO_LOOKUP_KIND* pLookupKind) { API_ENTER(getLocationOfThisType); wrapHnd->getLocationOfThisType(context, pLookupKind); @@ -1281,8 +1280,8 @@ void WrapICorJitInfo::getLocationOfThisType( } void WrapICorJitInfo::getAddressOfPInvokeTarget( - CORINFO_METHOD_HANDLE method, - CORINFO_CONST_LOOKUP *pLookup) + CORINFO_METHOD_HANDLE method, + CORINFO_CONST_LOOKUP* pLookup) { API_ENTER(getAddressOfPInvokeTarget); wrapHnd->getAddressOfPInvokeTarget(method, pLookup); @@ -1290,8 +1289,8 @@ void WrapICorJitInfo::getAddressOfPInvokeTarget( } LPVOID WrapICorJitInfo::GetCookieForPInvokeCalliSig( - CORINFO_SIG_INFO* szMetaSig, - void ** ppIndirection) + CORINFO_SIG_INFO* szMetaSig, + void** ppIndirection) { API_ENTER(GetCookieForPInvokeCalliSig); LPVOID temp = wrapHnd->GetCookieForPInvokeCalliSig(szMetaSig, ppIndirection); @@ -1300,7 +1299,7 @@ LPVOID WrapICorJitInfo::GetCookieForPInvokeCalliSig( } bool WrapICorJitInfo::canGetCookieForPInvokeCalliSig( - CORINFO_SIG_INFO* szMetaSig) + CORINFO_SIG_INFO* szMetaSig) { API_ENTER(canGetCookieForPInvokeCalliSig); bool temp = wrapHnd->canGetCookieForPInvokeCalliSig(szMetaSig); @@ -1309,8 +1308,8 @@ bool WrapICorJitInfo::canGetCookieForPInvokeCalliSig( } CORINFO_JUST_MY_CODE_HANDLE WrapICorJitInfo::getJustMyCodeHandle( - CORINFO_METHOD_HANDLE method, - CORINFO_JUST_MY_CODE_HANDLE**ppIndirection) + CORINFO_METHOD_HANDLE method, + CORINFO_JUST_MY_CODE_HANDLE** ppIndirection) { API_ENTER(getJustMyCodeHandle); CORINFO_JUST_MY_CODE_HANDLE temp = wrapHnd->getJustMyCodeHandle(method, ppIndirection); @@ -1319,9 +1318,9 @@ CORINFO_JUST_MY_CODE_HANDLE WrapICorJitInfo::getJustMyCodeHandle( } void WrapICorJitInfo::GetProfilingHandle( - BOOL *pbHookFunction, - void **pProfilerHandle, - BOOL *pbIndirectedHandles) + BOOL* pbHookFunction, + void** pProfilerHandle, + BOOL* pbIndirectedHandles) { API_ENTER(GetProfilingHandle); wrapHnd->GetProfilingHandle(pbHookFunction, pProfilerHandle, pbIndirectedHandles); @@ -1329,19 +1328,20 @@ void WrapICorJitInfo::GetProfilingHandle( } void WrapICorJitInfo::getCallInfo( - CORINFO_RESOLVED_TOKEN * pResolvedToken, - CORINFO_RESOLVED_TOKEN * pConstrainedResolvedToken, - CORINFO_METHOD_HANDLE callerHandle, - CORINFO_CALLINFO_FLAGS flags, - CORINFO_CALL_INFO *pResult) + CORINFO_RESOLVED_TOKEN* pResolvedToken, + CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken, + CORINFO_METHOD_HANDLE callerHandle, + CORINFO_CALLINFO_FLAGS flags, + CORINFO_CALL_INFO* pResult) { API_ENTER(getCallInfo); wrapHnd->getCallInfo(pResolvedToken, pConstrainedResolvedToken, callerHandle, flags, pResult); API_LEAVE(getCallInfo); } -BOOL WrapICorJitInfo::canAccessFamily(CORINFO_METHOD_HANDLE hCaller, - CORINFO_CLASS_HANDLE hInstanceType) +BOOL WrapICorJitInfo::canAccessFamily( + CORINFO_METHOD_HANDLE hCaller, + CORINFO_CLASS_HANDLE hInstanceType) { API_ENTER(canAccessFamily); BOOL temp = wrapHnd->canAccessFamily(hCaller, hInstanceType); @@ -1349,17 +1349,18 @@ BOOL WrapICorJitInfo::canAccessFamily(CORINFO_METHOD_HANDLE hCaller, return temp; } -BOOL WrapICorJitInfo::isRIDClassDomainID(CORINFO_CLASS_HANDLE cls) +BOOL WrapICorJitInfo::isRIDClassDomainID( + CORINFO_CLASS_HANDLE cls) { API_ENTER(isRIDClassDomainID); - BOOL result = wrapHnd->isRIDClassDomainID(cls); + BOOL temp = wrapHnd->isRIDClassDomainID(cls); API_LEAVE(isRIDClassDomainID); - return result; + return temp; } unsigned WrapICorJitInfo::getClassDomainID( - CORINFO_CLASS_HANDLE cls, - void **ppIndirection) + CORINFO_CLASS_HANDLE cls, + void** ppIndirection) { API_ENTER(getClassDomainID); unsigned temp = wrapHnd->getClassDomainID(cls, ppIndirection); @@ -1368,19 +1369,18 @@ unsigned WrapICorJitInfo::getClassDomainID( } void* WrapICorJitInfo::getFieldAddress( - CORINFO_FIELD_HANDLE field, - void **ppIndirection) + CORINFO_FIELD_HANDLE field, + void** ppIndirection) { API_ENTER(getFieldAddress); - void *temp = wrapHnd->getFieldAddress(field, ppIndirection); + void* temp = wrapHnd->getFieldAddress(field, ppIndirection); API_LEAVE(getFieldAddress); return temp; } CORINFO_CLASS_HANDLE WrapICorJitInfo::getStaticFieldCurrentClass( - CORINFO_FIELD_HANDLE field, - bool *pIsSpeculative = NULL - ) + CORINFO_FIELD_HANDLE field, + bool* pIsSpeculative) { API_ENTER(getStaticFieldCurrentClass); CORINFO_CLASS_HANDLE temp = wrapHnd->getStaticFieldCurrentClass(field, pIsSpeculative); @@ -1389,8 +1389,8 @@ CORINFO_CLASS_HANDLE WrapICorJitInfo::getStaticFieldCurrentClass( } CORINFO_VARARGS_HANDLE WrapICorJitInfo::getVarArgsHandle( - CORINFO_SIG_INFO *pSig, - void **ppIndirection) + CORINFO_SIG_INFO* pSig, + void** ppIndirection) { API_ENTER(getVarArgsHandle); CORINFO_VARARGS_HANDLE temp = wrapHnd->getVarArgsHandle(pSig, ppIndirection); @@ -1399,7 +1399,7 @@ CORINFO_VARARGS_HANDLE WrapICorJitInfo::getVarArgsHandle( } bool WrapICorJitInfo::canGetVarArgsHandle( - CORINFO_SIG_INFO *pSig) + CORINFO_SIG_INFO* pSig) { API_ENTER(canGetVarArgsHandle); bool temp = wrapHnd->canGetVarArgsHandle(pSig); @@ -1408,9 +1408,9 @@ bool WrapICorJitInfo::canGetVarArgsHandle( } InfoAccessType WrapICorJitInfo::constructStringLiteral( - CORINFO_MODULE_HANDLE module, - mdToken metaTok, - void **ppValue) + CORINFO_MODULE_HANDLE module, + mdToken metaTok, + void** ppValue) { API_ENTER(constructStringLiteral); InfoAccessType temp = wrapHnd->constructStringLiteral(module, metaTok, ppValue); @@ -1418,7 +1418,8 @@ InfoAccessType WrapICorJitInfo::constructStringLiteral( return temp; } -InfoAccessType WrapICorJitInfo::emptyStringLiteral(void **ppValue) +InfoAccessType WrapICorJitInfo::emptyStringLiteral( + void** ppValue) { API_ENTER(emptyStringLiteral); InfoAccessType temp = wrapHnd->emptyStringLiteral(ppValue); @@ -1427,8 +1428,8 @@ InfoAccessType WrapICorJitInfo::emptyStringLiteral(void **ppValue) } DWORD WrapICorJitInfo::getFieldThreadLocalStoreID( - CORINFO_FIELD_HANDLE field, - void **ppIndirection) + CORINFO_FIELD_HANDLE field, + void** ppIndirection) { API_ENTER(getFieldThreadLocalStoreID); DWORD temp = wrapHnd->getFieldThreadLocalStoreID(field, ppIndirection); @@ -1437,8 +1438,8 @@ DWORD WrapICorJitInfo::getFieldThreadLocalStoreID( } void WrapICorJitInfo::setOverride( - ICorDynamicInfo *pOverride, - CORINFO_METHOD_HANDLE currentMethod) + ICorDynamicInfo* pOverride, + CORINFO_METHOD_HANDLE currentMethod) { API_ENTER(setOverride); wrapHnd->setOverride(pOverride, currentMethod); @@ -1446,8 +1447,8 @@ void WrapICorJitInfo::setOverride( } void WrapICorJitInfo::addActiveDependency( - CORINFO_MODULE_HANDLE moduleFrom, - CORINFO_MODULE_HANDLE moduleTo) + CORINFO_MODULE_HANDLE moduleFrom, + CORINFO_MODULE_HANDLE moduleTo) { API_ENTER(addActiveDependency); wrapHnd->addActiveDependency(moduleFrom, moduleTo); @@ -1455,10 +1456,10 @@ void WrapICorJitInfo::addActiveDependency( } CORINFO_METHOD_HANDLE WrapICorJitInfo::GetDelegateCtor( - CORINFO_METHOD_HANDLE methHnd, - CORINFO_CLASS_HANDLE clsHnd, - CORINFO_METHOD_HANDLE targetMethodHnd, - DelegateCtorArgs * pCtorData) + CORINFO_METHOD_HANDLE methHnd, + CORINFO_CLASS_HANDLE clsHnd, + CORINFO_METHOD_HANDLE targetMethodHnd, + DelegateCtorArgs* pCtorData) { API_ENTER(GetDelegateCtor); CORINFO_METHOD_HANDLE temp = wrapHnd->GetDelegateCtor(methHnd, clsHnd, targetMethodHnd, pCtorData); @@ -1467,61 +1468,53 @@ CORINFO_METHOD_HANDLE WrapICorJitInfo::GetDelegateCtor( } void WrapICorJitInfo::MethodCompileComplete( - CORINFO_METHOD_HANDLE methHnd) + CORINFO_METHOD_HANDLE methHnd) { API_ENTER(MethodCompileComplete); wrapHnd->MethodCompileComplete(methHnd); API_LEAVE(MethodCompileComplete); } -void* WrapICorJitInfo::getTailCallHelpers( - CORINFO_RESOLVED_TOKEN* callToken, - CORINFO_SIG_INFO* sig, - CORINFO_GET_TAILCALL_HELPERS_FLAGS flags, - CORINFO_TAILCALL_HELPERS* pResult) +bool WrapICorJitInfo::getTailCallHelpers( + CORINFO_RESOLVED_TOKEN* callToken, + CORINFO_SIG_INFO* sig, + CORINFO_GET_TAILCALL_HELPERS_FLAGS flags, + CORINFO_TAILCALL_HELPERS* pResult) { API_ENTER(getTailCallHelpers); - void *result = wrapHnd->getTailCallHelpers(callToken, sig, flags, pResult); + bool temp = wrapHnd->getTailCallHelpers(callToken, sig, flags, pResult); API_LEAVE(getTailCallHelpers); - return result; + return temp; } bool WrapICorJitInfo::convertPInvokeCalliToCall( - CORINFO_RESOLVED_TOKEN * pResolvedToken, - bool fMustConvert - ) + CORINFO_RESOLVED_TOKEN* pResolvedToken, + bool mustConvert) { API_ENTER(convertPInvokeCalliToCall); - bool temp = wrapHnd->convertPInvokeCalliToCall(pResolvedToken, fMustConvert); + bool temp = wrapHnd->convertPInvokeCalliToCall(pResolvedToken, mustConvert); API_LEAVE(convertPInvokeCalliToCall); return temp; } void WrapICorJitInfo::notifyInstructionSetUsage( - CORINFO_InstructionSet instructionSet, - bool supported - ) + CORINFO_InstructionSet instructionSet, + bool supportEnabled) { API_ENTER(notifyInstructionSetUsage); - wrapHnd->notifyInstructionSetUsage(instructionSetName, supported); + wrapHnd->notifyInstructionSetUsage(instructionSet, supportEnabled); API_LEAVE(notifyInstructionSetUsage); } -/*********************************************************************************/ -// -// ICorJitInfo -// -/*********************************************************************************/ - void WrapICorJitInfo::allocMem( - ULONG hotCodeSize, /* IN */ - ULONG coldCodeSize, /* IN */ - ULONG roDataSize, /* IN */ - ULONG xcptnsCount, /* IN */ - CorJitAllocMemFlag flag, /* IN */ - void ** hotCodeBlock, /* OUT */ - void ** coldCodeBlock, /* OUT */ - void ** roDataBlock /* OUT */) + ULONG hotCodeSize, + ULONG coldCodeSize, + ULONG roDataSize, + ULONG xcptnsCount, + CorJitAllocMemFlag flag, + void** hotCodeBlock, + void** coldCodeBlock, + void** roDataBlock) { API_ENTER(allocMem); wrapHnd->allocMem(hotCodeSize, coldCodeSize, roDataSize, xcptnsCount, flag, hotCodeBlock, coldCodeBlock, roDataBlock); @@ -1529,9 +1522,9 @@ void WrapICorJitInfo::allocMem( } void WrapICorJitInfo::reserveUnwindInfo( - BOOL isFunclet, /* IN */ - BOOL isColdCode, /* IN */ - ULONG unwindSize /* IN */) + BOOL isFunclet, + BOOL isColdCode, + ULONG unwindSize) { API_ENTER(reserveUnwindInfo); wrapHnd->reserveUnwindInfo(isFunclet, isColdCode, unwindSize); @@ -1539,28 +1532,30 @@ void WrapICorJitInfo::reserveUnwindInfo( } void WrapICorJitInfo::allocUnwindInfo( - BYTE * pHotCode, /* IN */ - BYTE * pColdCode, /* IN */ - ULONG startOffset, /* IN */ - ULONG endOffset, /* IN */ - ULONG unwindSize, /* IN */ - BYTE * pUnwindBlock, /* IN */ - CorJitFuncKind funcKind /* IN */) + BYTE* pHotCode, + BYTE* pColdCode, + ULONG startOffset, + ULONG endOffset, + ULONG unwindSize, + BYTE* pUnwindBlock, + CorJitFuncKind funcKind) { API_ENTER(allocUnwindInfo); wrapHnd->allocUnwindInfo(pHotCode, pColdCode, startOffset, endOffset, unwindSize, pUnwindBlock, funcKind); API_LEAVE(allocUnwindInfo); } -void *WrapICorJitInfo::allocGCInfo(size_t size /* IN */) +void* WrapICorJitInfo::allocGCInfo( + size_t size) { API_ENTER(allocGCInfo); - void *temp = wrapHnd->allocGCInfo(size); + void* temp = wrapHnd->allocGCInfo(size); API_LEAVE(allocGCInfo); return temp; } -void WrapICorJitInfo::setEHcount(unsigned cEH /* IN */) +void WrapICorJitInfo::setEHcount( + unsigned cEH) { API_ENTER(setEHcount); wrapHnd->setEHcount(cEH); @@ -1568,31 +1563,38 @@ void WrapICorJitInfo::setEHcount(unsigned cEH /* IN */) } void WrapICorJitInfo::setEHinfo( - unsigned EHnumber, /* IN */ - const CORINFO_EH_CLAUSE *clause /* IN */) + unsigned EHnumber, + const CORINFO_EH_CLAUSE* clause) { API_ENTER(setEHinfo); wrapHnd->setEHinfo(EHnumber, clause); API_LEAVE(setEHinfo); } -BOOL WrapICorJitInfo::logMsg(unsigned level, const char* fmt, va_list args) +BOOL WrapICorJitInfo::logMsg( + unsigned level, + const char* fmt, + va_list args) { API_ENTER(logMsg); - BOOL result = wrapHnd->logMsg(level, fmt, args); + BOOL temp = wrapHnd->logMsg(level, fmt, args); API_LEAVE(logMsg); - return result; + return temp; } -int WrapICorJitInfo::doAssert(const char* szFile, int iLine, const char* szExpr) +int WrapICorJitInfo::doAssert( + const char* szFile, + int iLine, + const char* szExpr) { API_ENTER(doAssert); - int result = wrapHnd->doAssert(szFile, iLine, szExpr); + int temp = wrapHnd->doAssert(szFile, iLine, szExpr); API_LEAVE(doAssert); - return result; + return temp; } -void WrapICorJitInfo::reportFatalError(CorJitResult result) +void WrapICorJitInfo::reportFatalError( + CorJitResult result) { API_ENTER(reportFatalError); wrapHnd->reportFatalError(result); @@ -1600,20 +1602,20 @@ void WrapICorJitInfo::reportFatalError(CorJitResult result) } HRESULT WrapICorJitInfo::allocMethodBlockCounts( - UINT32 count, - BlockCounts **pBlockCounts) + UINT32 count, + ICorJitInfo::BlockCounts** pBlockCounts) { API_ENTER(allocMethodBlockCounts); - HRESULT result = wrapHnd->allocMethodBlockCounts(count, pBlockCounts); + HRESULT temp = wrapHnd->allocMethodBlockCounts(count, pBlockCounts); API_LEAVE(allocMethodBlockCounts); - return result; + return temp; } HRESULT WrapICorJitInfo::getMethodBlockCounts( - CORINFO_METHOD_HANDLE ftnHnd, - UINT32 *pCount, - BlockCounts **pBlockCounts, - UINT32 *pNumRuns) + CORINFO_METHOD_HANDLE ftnHnd, + UINT32* pCount, + ICorJitInfo::BlockCounts** pBlockCounts, + UINT32* pNumRuns) { API_ENTER(getMethodBlockCounts); HRESULT temp = wrapHnd->getMethodBlockCounts(ftnHnd, pCount, pBlockCounts, pNumRuns); @@ -1621,10 +1623,23 @@ HRESULT WrapICorJitInfo::getMethodBlockCounts( return temp; } +CORINFO_CLASS_HANDLE WrapICorJitInfo::getLikelyClass( + CORINFO_METHOD_HANDLE ftnHnd, + CORINFO_CLASS_HANDLE baseHnd, + UINT32 ilOffset, + UINT32* pLikelihood, + UINT32* pNumberOfClasses) +{ + API_ENTER(getLikelyClass); + CORINFO_CLASS_HANDLE temp = wrapHnd->getLikelyClass(ftnHnd, baseHnd, ilOffset, pLikelihood, pNumberOfClasses); + API_LEAVE(getLikelyClass); + return temp; +} + void WrapICorJitInfo::recordCallSite( - ULONG instrOffset, /* IN */ - CORINFO_SIG_INFO * callSig, /* IN */ - CORINFO_METHOD_HANDLE methodHandle /* IN */) + ULONG instrOffset, + CORINFO_SIG_INFO* callSig, + CORINFO_METHOD_HANDLE methodHandle) { API_ENTER(recordCallSite); wrapHnd->recordCallSite(instrOffset, callSig, methodHandle); @@ -1632,39 +1647,42 @@ void WrapICorJitInfo::recordCallSite( } void WrapICorJitInfo::recordRelocation( - void *location, /* IN */ - void *target, /* IN */ - WORD fRelocType, /* IN */ - WORD slotNum, /* IN */ - INT32 addlDelta /* IN */) + void* location, + void* target, + WORD fRelocType, + WORD slotNum, + INT32 addlDelta) { API_ENTER(recordRelocation); wrapHnd->recordRelocation(location, target, fRelocType, slotNum, addlDelta); API_LEAVE(recordRelocation); } -WORD WrapICorJitInfo::getRelocTypeHint(void *target) +WORD WrapICorJitInfo::getRelocTypeHint( + void* target) { API_ENTER(getRelocTypeHint); - WORD result = wrapHnd->getRelocTypeHint(target); + WORD temp = wrapHnd->getRelocTypeHint(target); API_LEAVE(getRelocTypeHint); - return result; + return temp; } DWORD WrapICorJitInfo::getExpectedTargetArchitecture() { API_ENTER(getExpectedTargetArchitecture); - DWORD result = wrapHnd->getExpectedTargetArchitecture(); + DWORD temp = wrapHnd->getExpectedTargetArchitecture(); API_LEAVE(getExpectedTargetArchitecture); - return result; + return temp; } -DWORD WrapICorJitInfo::getJitFlags(CORJIT_FLAGS *jitFlags, DWORD sizeInBytes) +DWORD WrapICorJitInfo::getJitFlags( + CORJIT_FLAGS* flags, + DWORD sizeInBytes) { API_ENTER(getJitFlags); - DWORD result = wrapHnd->getJitFlags(jitFlags, sizeInBytes); + DWORD temp = wrapHnd->getJitFlags(flags, sizeInBytes); API_LEAVE(getJitFlags); - return result; + return temp; } /**********************************************************************************/ diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs index 511ea87..0aeb5ee 100644 --- a/src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs +++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs @@ -1,7 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// DO NOT EDIT THIS FILE! It IS AUTOGENERATED +// DO NOT EDIT THIS FILE! IT IS AUTOGENERATED +// To regenerate run the gen script in src/coreclr/src/tools/Common/JitInterface/ThunkGenerator +// and follow the instructions in docs/project/updating-jitinterface.md + using System; using System.Runtime.InteropServices; @@ -419,16 +422,17 @@ namespace Internal.JitInterface } [UnmanagedCallersOnly] - static void _tryResolveToken(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken) + static byte _tryResolveToken(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken) { var _this = GetThis(thisHandle); try { - _this.tryResolveToken(ref *pResolvedToken); + return _this.tryResolveToken(ref *pResolvedToken) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); + return default; } } @@ -2561,7 +2565,7 @@ namespace Internal.JitInterface callbacks[25] = (delegate* unmanaged)&_setPatchpointInfo; callbacks[26] = (delegate* unmanaged)&_getOSRInfo; callbacks[27] = (delegate* unmanaged)&_resolveToken; - callbacks[28] = (delegate* unmanaged)&_tryResolveToken; + callbacks[28] = (delegate* unmanaged)&_tryResolveToken; callbacks[29] = (delegate* unmanaged)&_findSig; callbacks[30] = (delegate* unmanaged)&_findCallSiteSig; callbacks[31] = (delegate* unmanaged)&_getTokenTypeAsHandle; diff --git a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/Program.cs b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/Program.cs index 8f27ec8..26614d5 100644 --- a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/Program.cs +++ b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/Program.cs @@ -39,7 +39,7 @@ namespace Thunkerator public TypeReplacement(string line) { string[] typenames = line.Split(','); - if ((typenames.Length < 1) || (typenames.Length > 3)) + if ((typenames.Length < 1) || (typenames.Length > 4)) { throw new Exception("Wrong number of type name entries"); } @@ -62,9 +62,19 @@ namespace Thunkerator { NativeTypeName = ThunkTypeName; } + + if (typenames.Length > 3) + { + NativeTypeName2 = typenames[3].Canonicalize(); + } + else + { + NativeTypeName2 = ThunkTypeName; + } } public readonly string ThunkTypeName; public readonly string NativeTypeName; + public readonly string NativeTypeName2; public readonly string ManagedTypeName; public bool IsByRef => ManagedTypeName.Contains("ref "); @@ -248,13 +258,22 @@ namespace Thunkerator return functions.AsReadOnly(); } - static void WriteManagedThunkInterface(TextWriter tr, IEnumerable functionData) + static void WriteAutogeneratedHeader(TextWriter tw) { // Write header - tr.Write(@"// Licensed to the .NET Foundation under one or more agreements. + tw.Write(@"// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// DO NOT EDIT THIS FILE! It IS AUTOGENERATED +// DO NOT EDIT THIS FILE! IT IS AUTOGENERATED +// To regenerate run the gen script in src/coreclr/src/tools/Common/JitInterface/ThunkGenerator +// and follow the instructions in docs/project/updating-jitinterface.md +"); + } + + static void WriteManagedThunkInterface(TextWriter tw, IEnumerable functionData) + { + WriteAutogeneratedHeader(tw); + tw.Write(@" using System; using System.Runtime.InteropServices; @@ -266,20 +285,20 @@ namespace Internal.JitInterface foreach (FunctionDecl decl in functionData) { - tr.WriteLine(" [UnmanagedCallersOnly]"); - tr.Write($" static {decl.ReturnType.UnmanagedTypeName} _{decl.FunctionName}(IntPtr thisHandle, IntPtr* ppException"); + tw.WriteLine(" [UnmanagedCallersOnly]"); + tw.Write($" static {decl.ReturnType.UnmanagedTypeName} _{decl.FunctionName}(IntPtr thisHandle, IntPtr* ppException"); foreach (Parameter param in decl.Parameters) { - tr.Write($", {param.Type.UnmanagedTypeName} {param.Name}"); + tw.Write($", {param.Type.UnmanagedTypeName} {param.Name}"); } - tr.Write(@") + tw.Write(@") { var _this = GetThis(thisHandle); try { "); bool isVoid = decl.ReturnType.ManagedTypeName == "void"; - tr.Write($" {(isVoid ? "" : "return ")}_this.{decl.FunctionName}("); + tw.Write($" {(isVoid ? "" : "return ")}_this.{decl.FunctionName}("); bool isFirst = true; foreach (Parameter param in decl.Parameters) { @@ -289,26 +308,26 @@ namespace Internal.JitInterface } else { - tr.Write(", "); + tw.Write(", "); } if (param.Type.IsByRef) { - tr.Write("ref *"); + tw.Write("ref *"); } - tr.Write(param.Name); + tw.Write(param.Name); if (param.Type.IsBoolean || param.Type.IsBOOL) { - tr.Write(" != 0"); + tw.Write(" != 0"); } } - tr.Write(")"); + tw.Write(")"); if (decl.ReturnType.IsBOOL || decl.ReturnType.IsBoolean) { - tr.Write(" ? 1 : 0"); + tw.Write(" ? 1 : 0"); } - tr.Write(";"); - tr.Write(@" + tw.Write(";"); + tw.Write(@" } catch (Exception ex) { @@ -316,15 +335,15 @@ namespace Internal.JitInterface "); if (!isVoid) { - tr.WriteLine(" return default;"); + tw.WriteLine(" return default;"); } - tr.WriteLine(@" }"); - tr.WriteLine(" }"); - tr.WriteLine(); + tw.WriteLine(@" }"); + tw.WriteLine(" }"); + tw.WriteLine(); } int total = functionData.Count(); - tr.WriteLine(@" + tw.WriteLine(@" static IntPtr GetUnmanagedCallbacks() { void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * " + total + @"); @@ -333,16 +352,16 @@ namespace Internal.JitInterface int index = 0; foreach (FunctionDecl decl in functionData) { - tr.Write($" callbacks[{index}] = (delegate* unmanaged)&_{decl.FunctionName};"); + tw.WriteLine($", {decl.ReturnType.UnmanagedTypeName}>)&_{decl.FunctionName};"); index++; } - tr.WriteLine(@" + tw.WriteLine(@" return (IntPtr)callbacks; } } @@ -352,10 +371,9 @@ namespace Internal.JitInterface static void WriteNativeWrapperInterface(TextWriter tw, IEnumerable functionData) { - tw.Write(@"// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. + WriteAutogeneratedHeader(tw); + tw.Write(@" -// DO NOT EDIT THIS FILE! It IS AUTOGENERATED #include ""corinfoexception.h"" struct JitInterfaceCallbacks @@ -364,7 +382,7 @@ struct JitInterfaceCallbacks foreach (FunctionDecl decl in functionData) { - tw.Write($" {decl.ReturnType.NativeTypeName} (* {decl.FunctionName})(void * thisHandle, CorInfoException** ppException"); + tw.Write($" {decl.ReturnType.NativeTypeName} (* {decl.FunctionName})(void * thisHandle, CorInfoExceptionClass** ppException"); foreach (Parameter param in decl.Parameters) { tw.Write($", {param.Type.NativeTypeName} {param.Name}"); @@ -388,9 +406,42 @@ public: "); + API_Wrapper_Generic_Core(tw, functionData, + funcNameFunc: (FunctionDecl decl)=>$"{decl.FunctionName }", + beforeCallFunc:(FunctionDecl)=>" CorInfoExceptionClass* pException = nullptr;", + afterCallFunc: (FunctionDecl decl) => " if (pException != nullptr) throw pException;", + wrappedObjectName: "_callbacks", + useNativeType2: false, + addVirtualPrefix: true, + skipManualWrapper: true); + + tw.WriteLine("};"); + } + + static void WriteAPI_Names(TextWriter tw, IEnumerable functionData) + { + WriteAutogeneratedHeader(tw); + foreach (FunctionDecl decl in functionData) { - tw.Write(" virtual " + decl.ReturnType.NativeTypeName + " " + decl.FunctionName + "("); + tw.WriteLine($"DEF_CLR_API({decl.FunctionName})"); + } + + tw.Write(@" +#undef DEF_CLR_API +"); + } + + static void API_Wrapper_Generic_Core(TextWriter tw, IEnumerable functionData, Func funcNameFunc, Func beforeCallFunc, Func afterCallFunc, string wrappedObjectName, bool useNativeType2, bool addVirtualPrefix, bool skipManualWrapper) + { + foreach (FunctionDecl decl in functionData) + { + tw.Write($"\n"); + if (addVirtualPrefix) + { + tw.Write(" virtual "); + } + tw.Write($"{GetNativeType(decl.ReturnType)} {funcNameFunc(decl)}("); bool isFirst = true; foreach (Parameter param in decl.Parameters) { @@ -400,49 +451,202 @@ public: } else { - tw.Write(", "); + tw.Write(","); } - tw.Write(param.Type.NativeTypeName + " " + param.Name); + tw.Write("\n " + GetNativeType(param.Type) + " " + param.Name); } tw.Write(')'); - - if (decl.ManualNativeWrapper) + if (skipManualWrapper && decl.ManualNativeWrapper) { - tw.WriteLine(';'); + tw.WriteLine(";"); continue; } - tw.Write(@" - { - CorInfoException* pException = nullptr; - "); - if (decl.ReturnType.NativeTypeName != "void") + tw.Write('\n'); + tw.WriteLine("{"); + string beforeCall = beforeCallFunc(decl) ?? null; + string afterCall = afterCallFunc(decl) ?? null; + if (beforeCall != null) + tw.WriteLine(beforeCall); + + tw.Write(" "); + if (GetNativeType(decl.ReturnType) != "void") { - tw.Write($"{decl.ReturnType.NativeTypeName} _ret = "); + if (afterCall != null) + tw.Write($"{GetNativeType(decl.ReturnType)} temp = "); + else + tw.Write("return "); } - tw.Write($"_callbacks->{decl.FunctionName}(_thisHandle, &pException"); + tw.Write($"{wrappedObjectName}->{decl.FunctionName}("); + isFirst = true; + + if (skipManualWrapper) + { + tw.Write("_thisHandle, &pException"); + isFirst = false; + } + foreach (Parameter param in decl.Parameters) { - tw.Write($", {param.Name}"); + if (isFirst) + { + isFirst = false; + } + else + { + tw.Write(", "); + } + tw.Write(param.Name); + } + tw.WriteLine(");"); + if (afterCall != null) + tw.WriteLine(afterCall); + if ((GetNativeType(decl.ReturnType) != "void") && (afterCall != null)) + { + tw.WriteLine(" return temp;"); } - tw.Write(@"); - if (pException != nullptr) - throw pException; + tw.WriteLine("}"); + } + + string GetNativeType(TypeReplacement typeReplacement) + { + if (useNativeType2) + return typeReplacement.NativeTypeName2; + else + return typeReplacement.NativeTypeName; + } + } + + static void API_Wrapper_Generic(TextWriter tw, IEnumerable functionData, string header, string footer, string cppType, Func beforeCallFunc, Func afterCallFunc, string wrappedObjectName) + { + WriteAutogeneratedHeader(tw); + tw.Write(header); + + API_Wrapper_Generic_Core(tw, functionData, funcNameFunc: (FunctionDecl decl)=>$"{cppType}::{ decl.FunctionName }", beforeCallFunc:beforeCallFunc, afterCallFunc: afterCallFunc, wrappedObjectName: wrappedObjectName, useNativeType2: true, addVirtualPrefix: false, skipManualWrapper: false); + + tw.Write(footer); + } + + static void API_Wrapper(TextWriter tw, IEnumerable functionData) + { + API_Wrapper_Generic(tw, functionData, + header:@" +#define API_ENTER(name) wrapComp->CLR_API_Enter(API_##name); +#define API_LEAVE(name) wrapComp->CLR_API_Leave(API_##name); + +/**********************************************************************************/ +// clang-format off +/**********************************************************************************/ +", + footer: @" +/**********************************************************************************/ +// clang-format on +/**********************************************************************************/ +", + cppType: "WrapICorJitInfo", + beforeCallFunc: (FunctionDecl decl)=> $" API_ENTER({decl.FunctionName});", + afterCallFunc: (FunctionDecl decl)=> $" API_LEAVE({decl.FunctionName});", + wrappedObjectName: "wrapHnd"); + } + + static void SPMI_ICorJitInfoImpl(TextWriter tw, IEnumerable functionData) + { + WriteAutogeneratedHeader(tw); + tw.Write(@" +#ifndef _ICorJitInfoImpl +#define _ICorJitInfoImpl + +// ICorJitInfoImpl: declare for implementation all the members of the ICorJitInfo interface (which are +// specified as pure virtual methods). This is done once, here, and all implementations share it, +// to avoid duplicated declarations. This file is #include'd within all the ICorJitInfo implementation +// classes. +// +// NOTE: this file is in exactly the same order, with exactly the same whitespace, as the ICorJitInfo +// interface declaration (with the ""virtual"" and ""= 0"" syntax removed). This is to make it easy to compare +// against the interface declaration. + +/**********************************************************************************/ +// clang-format off +/**********************************************************************************/ + +public: "); - if (decl.ReturnType.NativeTypeName != "void") + + foreach (FunctionDecl decl in functionData) + { + tw.Write($"\n{decl.ReturnType.NativeTypeName2} { decl.FunctionName}("); + bool isFirst = true; + foreach (Parameter param in decl.Parameters) { - tw.WriteLine(" return _ret;"); + if (isFirst) + { + isFirst = false; + } + else + { + tw.Write(","); + } + tw.Write("\n " + param.Type.NativeTypeName2 + " " + param.Name); } - tw.WriteLine(" }"); - tw.WriteLine(); + tw.WriteLine(");"); } - tw.WriteLine("};"); + tw.Write(@" +#endif // _ICorJitInfoImpl +/**********************************************************************************/ +// clang-format on +/**********************************************************************************/ +"); + } + + static void SPMI_ShimCounter_ICorJitInfo(TextWriter tw, IEnumerable functionData) + { + API_Wrapper_Generic(tw, functionData, + header:@" +#include ""standardpch.h"" +#include ""icorjitinfo.h"" +#include ""superpmi-shim-counter.h"" +#include ""icorjitcompiler.h"" +#include ""spmiutil.h"" + +", + footer: "\n", + cppType: "interceptor_ICJI", + beforeCallFunc: (FunctionDecl decl)=> $" mcs->AddCall(\"{decl.FunctionName}\");", + afterCallFunc: (FunctionDecl decl)=> null, + wrappedObjectName: "original_ICorJitInfo"); + } + + static void SPMI_ShimSimple_ICorJitInfo(TextWriter tw, IEnumerable functionData) + { + API_Wrapper_Generic(tw, functionData, + header:@" +#include ""standardpch.h"" +#include ""icorjitinfo.h"" +#include ""superpmi-shim-simple.h"" +#include ""icorjitcompiler.h"" +#include ""spmiutil.h"" + +", + footer: "\n", + cppType: "interceptor_ICJI", + beforeCallFunc: (FunctionDecl decl)=> null, + afterCallFunc: (FunctionDecl decl)=> null, + wrappedObjectName: "original_ICorJitInfo"); } static void Main(string[] args) { + if (args.Length == 0) + { + Console.WriteLine("ThunkGenerator - Generate thunks for the jit interface and for defining the set of instruction sets supported by the runtime, JIT, and crossgen2. Call by using the gen scripts which are aware of the right set of files generated and command line args."); + return; + } if (args[0] == "InstructionSetGenerator") { + if (args.Length != 7) + { + Console.WriteLine("Incorrect number of files specified for generation"); + } InstructionSetGenerator generator = new InstructionSetGenerator(); if (!generator.ParseInput(new StreamReader(args[1]))) return; @@ -479,16 +683,28 @@ public: } else { - IEnumerable functions = ParseInput(new StreamReader(args[0])); - using (TextWriter tw = new StreamWriter(args[1])) + if (args.Length != 8) { - Console.WriteLine("Generating {0}", args[1]); - WriteManagedThunkInterface(tw, functions); + Console.WriteLine("Incorrect number of files specified for generation"); } - using (TextWriter tw = new StreamWriter(args[2])) + + IEnumerable functions = ParseInput(new StreamReader(args[0])); + + EmitStuff(1, WriteManagedThunkInterface); + EmitStuff(2, WriteNativeWrapperInterface); + EmitStuff(3, WriteAPI_Names); + EmitStuff(4, API_Wrapper); + EmitStuff(5, SPMI_ICorJitInfoImpl); + EmitStuff(6, SPMI_ShimCounter_ICorJitInfo); + EmitStuff(7, SPMI_ShimSimple_ICorJitInfo); + + void EmitStuff(int index, Action> printer) { - Console.WriteLine("Generating {0}", args[2]); - WriteNativeWrapperInterface(tw, functions); + using (TextWriter tw = new StreamWriter(args[index])) + { + Console.WriteLine("Generating {0}", args[index]); + printer(tw, functions); + } } } } diff --git a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt index 7576357..73c2a88 100644 --- a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt +++ b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt @@ -11,8 +11,10 @@ ; then the NORMALTYPES description can be used for a return value. ; ; TYPES have three fields -; ThunkDescriptionType,ManagedType,NativeType -; If either ManagedType or NativeType are missing, then that form is replaced with ThunkDescriptionType. +; ThunkDescriptionType,ManagedType,NativeType,NativeType2 +; If either ManagedType, NativeType, or NativeType2 are missing, then that form is replaced with ThunkDescriptionType. +; NativeType is used for representing the type in headers which do not include the PAL and corinfo.h +; NativeType2 is used for representing the type in headers that are fully integrated with the PAL ; This feature allows reduction in type for enums and other types where the same type can be used in managed an native ; ; Specification of a custom native type is done to allow multiple translations of the same native type to managed. @@ -29,7 +31,7 @@ ; ; If the boilerplate around the individual functions needs adjustment, edit the thunk generator source code, and ; rebuild with rebuildthunkgen.cmd in the the ThunkGenerator subdir, then rebuildthunks.cmd -; If this file is editted, rebuild with rebuildthunks.cmd -- DO NOT RUN from within a razzle window. +; If this file is editted, rebuild with gen.cmd -- DO NOT RUN from within a razzle window. ; NORMALTYPES void @@ -60,12 +62,12 @@ GSCookie*,IntPtr*,void* GSCookie**,IntPtr**,void** BOOL*,BOOL*,int* -bool*,ref bool,bool* -BoolStar,byte*,bool* +bool*,ref bool +BoolStar,byte*,bool*,bool* UINT32*,ref uint,unsigned int* ULONG*,ref uint,unsigned long* void **,ref void* -VOIDSTARSTAR,void **,void ** +VOIDSTARSTAR,void **,void **,void ** ULONG32*,ref uint,unsigned int* LONG*,int*,long* char*,byte* @@ -88,7 +90,7 @@ CORINFO_EH_CLAUSE*,ref CORINFO_EH_CLAUSE,void* const CORINFO_EH_CLAUSE*,ref CORINFO_EH_CLAUSE,void* CORINFO_SIG_INFO*,,void* CORINFO_RESOLVED_TOKEN*,ref CORINFO_RESOLVED_TOKEN,void* -CORINFO_RESOLVED_TOKEN_PTR,CORINFO_RESOLVED_TOKEN*,void* +CORINFO_RESOLVED_TOKEN_PTR,CORINFO_RESOLVED_TOKEN*,void*,CORINFO_RESOLVED_TOKEN* CORINFO_EE_INFO*,ref CORINFO_EE_INFO,void* CORINFO_TAILCALL_HELPERS*,ref CORINFO_TAILCALL_HELPERS,void* CORINFO_GENERICHANDLE_RESULT*,ref CORINFO_GENERICHANDLE_RESULT,void* @@ -154,6 +156,7 @@ ICorDebugInfo::NativeVarInfo*,NativeVarInfo*,void* ICorDebugInfo::BoundaryTypes*,BoundaryTypes*,void* struct _EXCEPTION_POINTERS*,_EXCEPTION_POINTERS*,void* +ICorJitInfo::errorTrapFunction,void*,void* FUNCTIONS DWORD getMethodAttribs( CORINFO_METHOD_HANDLE ftn ); @@ -184,7 +187,7 @@ FUNCTIONS void setPatchpointInfo(PatchpointInfo* patchpointInfo); PatchpointInfo* getOSRInfo(unsigned * ilOffset); void resolveToken(CORINFO_RESOLVED_TOKEN * pResolvedToken); - void tryResolveToken(CORINFO_RESOLVED_TOKEN * pResolvedToken); + bool tryResolveToken(CORINFO_RESOLVED_TOKEN * pResolvedToken); void findSig( CORINFO_MODULE_HANDLE module, unsigned sigTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO *sig ); void findCallSiteSig( CORINFO_MODULE_HANDLE module,unsigned methTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO *sig) CORINFO_CLASS_HANDLE getTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken) @@ -264,7 +267,7 @@ FUNCTIONS [ManualNativeWrapper] void HandleException(struct _EXCEPTION_POINTERS* pExceptionPointers); void ThrowExceptionForJitResult(HRESULT result); void ThrowExceptionForHelper(const CORINFO_HELPER_DESC* throwHelper); - [ManualNativeWrapper] bool runWithErrorTrap(void* function, void* parameter); + [ManualNativeWrapper] bool runWithErrorTrap(ICorJitInfo::errorTrapFunction function, void* parameter); void getEEInfo(CORINFO_EE_INFO* pEEInfoOut); LPCWSTR getJitTimeLogFilename(); mdMethodDef getMethodDefFromMethod(CORINFO_METHOD_HANDLE hMethod); diff --git a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.bat b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.bat index fcf12d5..658335d 100644 --- a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.bat +++ b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.bat @@ -1,4 +1,4 @@ pushd %~dp0 -call ..\..\..\..\..\..\..\dotnet.cmd run -- ThunkInput.txt ..\CorInfoBase.cs ..\..\..\aot\jitinterface\jitinterface.h +call ..\..\..\..\..\..\..\dotnet.cmd run -- ThunkInput.txt ..\CorInfoBase.cs ..\..\..\aot\jitinterface\jitinterface.h ..\..\..\..\jit\ICorJitInfo_API_names.h ..\..\..\..\jit\ICorJitInfo_API_wrapper.hpp ..\..\..\..\ToolBox\superpmi\superpmi-shared\icorjitinfoimpl.h ..\..\..\..\ToolBox\superpmi\superpmi-shim-counter\icorjitinfo.cpp ..\..\..\..\ToolBox\superpmi\superpmi-shim-simple\icorjitinfo.cpp call ..\..\..\..\..\..\..\dotnet.cmd run -- InstructionSetGenerator InstructionSetDesc.txt ..\..\Internal\Runtime\ReadyToRunInstructionSet.cs ..\..\Internal\Runtime\ReadyToRunInstructionSetHelper.cs ..\CorInfoInstructionSet.cs ..\..\..\..\inc\corinfoinstructionset.h ..\..\..\..\inc\readytoruninstructionset.h popd diff --git a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.sh b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.sh index 5572be7..9701090 100755 --- a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.sh +++ b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash cd "$(dirname ${BASH_SOURCE[0]})" -../../../../../../../dotnet.sh run -- ThunkInput.txt ../CorInfoBase.cs ../../../crossgen2/jitinterface/jitinterface.h -../../../../../../../dotnet.sh run -- InstructionSetGenerator InstructionSetDesc.txt ../../Internal/Runtime/ReadyToRunInstructionSet.cs ../../Internal/Runtime/ReadyToRunInstructionSetHelper.cs ../CorInfoInstructionSet.cs ../../../../inc/corinfoinstructionset.h ../../../../inc/readytoruninstructionset.h \ No newline at end of file +../../../../../../../dotnet.sh run -- ThunkInput.txt ../CorInfoBase.cs ../../../aot/jitinterface/jitinterface.h ../../../../jit/ICorJitInfo_API_names.h ../../../../jit/ICorJitInfo_API_wrapper.hpp ../../../../ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h ../../../../ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp ../../../../ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp +../../../../../../../dotnet.sh run -- InstructionSetGenerator InstructionSetDesc.txt ../../Internal/Runtime/ReadyToRunInstructionSet.cs ../../Internal/Runtime/ReadyToRunInstructionSetHelper.cs ../CorInfoInstructionSet.cs ../../../../inc/corinfoinstructionset.h ../../../../inc/readytoruninstructionset.h diff --git a/src/coreclr/src/tools/aot/jitinterface/corinfoexception.cpp b/src/coreclr/src/tools/aot/jitinterface/corinfoexception.cpp index 1487f5a..e5ca0b4 100644 --- a/src/coreclr/src/tools/aot/jitinterface/corinfoexception.cpp +++ b/src/coreclr/src/tools/aot/jitinterface/corinfoexception.cpp @@ -4,17 +4,17 @@ #include "corinfoexception.h" #include "dllexport.h" -DLL_EXPORT CorInfoException* AllocException(const WCHAR* message, int messageLength) +DLL_EXPORT CorInfoExceptionClass* AllocException(const WCHAR* message, int messageLength) { - return new CorInfoException(message, messageLength); + return new CorInfoExceptionClass(message, messageLength); } -DLL_EXPORT void FreeException(CorInfoException* pException) +DLL_EXPORT void FreeException(CorInfoExceptionClass* pException) { delete pException; } -DLL_EXPORT const WCHAR* GetExceptionMessage(const CorInfoException* pException) +DLL_EXPORT const WCHAR* GetExceptionMessage(const CorInfoExceptionClass* pException) { return pException->GetMessage(); } diff --git a/src/coreclr/src/tools/aot/jitinterface/corinfoexception.h b/src/coreclr/src/tools/aot/jitinterface/corinfoexception.h index f16813b..12704d6 100644 --- a/src/coreclr/src/tools/aot/jitinterface/corinfoexception.h +++ b/src/coreclr/src/tools/aot/jitinterface/corinfoexception.h @@ -9,17 +9,17 @@ typedef char16_t WCHAR; typedef wchar_t WCHAR; #endif -class CorInfoException +class CorInfoExceptionClass { public: - CorInfoException(const WCHAR* message, int messageLength) + CorInfoExceptionClass(const WCHAR* message, int messageLength) { this->message = new WCHAR[messageLength + 1]; memcpy(this->message, message, messageLength * sizeof(WCHAR)); this->message[messageLength] = L'\0'; } - ~CorInfoException() + ~CorInfoExceptionClass() { if (message != nullptr) { diff --git a/src/coreclr/src/tools/aot/jitinterface/jitinterface.cpp b/src/coreclr/src/tools/aot/jitinterface/jitinterface.cpp index 74b5a9c..d3cf1bd 100644 --- a/src/coreclr/src/tools/aot/jitinterface/jitinterface.cpp +++ b/src/coreclr/src/tools/aot/jitinterface/jitinterface.cpp @@ -31,7 +31,7 @@ bool JitInterfaceWrapper::runWithErrorTrap(void* function, void* parameter) { (*(pfn)function)(parameter); } - catch (CorInfoException *) + catch (CorInfoExceptionClass *) { return false; } diff --git a/src/coreclr/src/tools/aot/jitinterface/jitinterface.h b/src/coreclr/src/tools/aot/jitinterface/jitinterface.h index 3782856..a1660c1 100644 --- a/src/coreclr/src/tools/aot/jitinterface/jitinterface.h +++ b/src/coreclr/src/tools/aot/jitinterface/jitinterface.h @@ -1,182 +1,186 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// DO NOT EDIT THIS FILE! It IS AUTOGENERATED +// DO NOT EDIT THIS FILE! IT IS AUTOGENERATED +// To regenerate run the gen script in src/coreclr/src/tools/Common/JitInterface/ThunkGenerator +// and follow the instructions in docs/project/updating-jitinterface.md + + #include "corinfoexception.h" struct JitInterfaceCallbacks { - unsigned int (* getMethodAttribs)(void * thisHandle, CorInfoException** ppException, void* ftn); - void (* setMethodAttribs)(void * thisHandle, CorInfoException** ppException, void* ftn, int attribs); - void (* getMethodSig)(void * thisHandle, CorInfoException** ppException, void* ftn, void* sig, void* memberParent); - bool (* getMethodInfo)(void * thisHandle, CorInfoException** ppException, void* ftn, void* info); - int (* canInline)(void * thisHandle, CorInfoException** ppException, void* callerHnd, void* calleeHnd, unsigned int* pRestrictions); - void (* reportInliningDecision)(void * thisHandle, CorInfoException** ppException, void* inlinerHnd, void* inlineeHnd, int inlineResult, const char* reason); - bool (* canTailCall)(void * thisHandle, CorInfoException** ppException, void* callerHnd, void* declaredCalleeHnd, void* exactCalleeHnd, bool fIsTailPrefix); - void (* reportTailCallDecision)(void * thisHandle, CorInfoException** ppException, void* callerHnd, void* calleeHnd, bool fIsTailPrefix, int tailCallResult, const char* reason); - void (* getEHinfo)(void * thisHandle, CorInfoException** ppException, void* ftn, unsigned EHnumber, void* clause); - void* (* getMethodClass)(void * thisHandle, CorInfoException** ppException, void* method); - void* (* getMethodModule)(void * thisHandle, CorInfoException** ppException, void* method); - void (* getMethodVTableOffset)(void * thisHandle, CorInfoException** ppException, void* method, unsigned* offsetOfIndirection, unsigned* offsetAfterIndirection, bool* isRelative); - void* (* resolveVirtualMethod)(void * thisHandle, CorInfoException** ppException, void* virtualMethod, void* implementingClass, void* ownerType); - void* (* getUnboxedEntry)(void * thisHandle, CorInfoException** ppException, void* ftn, bool* requiresInstMethodTableArg); - void* (* getDefaultEqualityComparerClass)(void * thisHandle, CorInfoException** ppException, void* elemType); - void (* expandRawHandleIntrinsic)(void * thisHandle, CorInfoException** ppException, void* pResolvedToken, void* pResult); - int (* getIntrinsicID)(void * thisHandle, CorInfoException** ppException, void* method, bool* pMustExpand); - bool (* isIntrinsicType)(void * thisHandle, CorInfoException** ppException, void* classHnd); - int (* getUnmanagedCallConv)(void * thisHandle, CorInfoException** ppException, void* method); - int (* pInvokeMarshalingRequired)(void * thisHandle, CorInfoException** ppException, void* method, void* callSiteSig); - int (* satisfiesMethodConstraints)(void * thisHandle, CorInfoException** ppException, void* parent, void* method); - int (* isCompatibleDelegate)(void * thisHandle, CorInfoException** ppException, void* objCls, void* methodParentCls, void* method, void* delegateCls, int* pfIsOpenDelegate); - void (* methodMustBeLoadedBeforeCodeIsRun)(void * thisHandle, CorInfoException** ppException, void* method); - void* (* mapMethodDeclToMethodImpl)(void * thisHandle, CorInfoException** ppException, void* method); - void (* getGSCookie)(void * thisHandle, CorInfoException** ppException, void* pCookieVal, void** ppCookieVal); - void (* setPatchpointInfo)(void * thisHandle, CorInfoException** ppException, void* patchpointInfo); - void* (* getOSRInfo)(void * thisHandle, CorInfoException** ppException, unsigned* ilOffset); - void (* resolveToken)(void * thisHandle, CorInfoException** ppException, void* pResolvedToken); - void (* tryResolveToken)(void * thisHandle, CorInfoException** ppException, void* pResolvedToken); - void (* findSig)(void * thisHandle, CorInfoException** ppException, void* module, unsigned sigTOK, void* context, void* sig); - void (* findCallSiteSig)(void * thisHandle, CorInfoException** ppException, void* module, unsigned methTOK, void* context, void* sig); - void* (* getTokenTypeAsHandle)(void * thisHandle, CorInfoException** ppException, void* pResolvedToken); - int (* isValidToken)(void * thisHandle, CorInfoException** ppException, void* module, unsigned metaTOK); - int (* isValidStringRef)(void * thisHandle, CorInfoException** ppException, void* module, unsigned metaTOK); - const wchar_t* (* getStringLiteral)(void * thisHandle, CorInfoException** ppException, void* module, unsigned metaTOK, int* length); - int (* asCorInfoType)(void * thisHandle, CorInfoException** ppException, void* cls); - const char* (* getClassName)(void * thisHandle, CorInfoException** ppException, void* cls); - const char* (* getClassNameFromMetadata)(void * thisHandle, CorInfoException** ppException, void* cls, const char** namespaceName); - void* (* getTypeInstantiationArgument)(void * thisHandle, CorInfoException** ppException, void* cls, unsigned index); - int (* appendClassName)(void * thisHandle, CorInfoException** ppException, wchar_t** ppBuf, int* pnBufLen, void* cls, int fNamespace, int fFullInst, int fAssembly); - int (* isValueClass)(void * thisHandle, CorInfoException** ppException, void* cls); - int (* canInlineTypeCheck)(void * thisHandle, CorInfoException** ppException, void* cls, int source); - unsigned int (* getClassAttribs)(void * thisHandle, CorInfoException** ppException, void* cls); - int (* isStructRequiringStackAllocRetBuf)(void * thisHandle, CorInfoException** ppException, void* cls); - void* (* getClassModule)(void * thisHandle, CorInfoException** ppException, void* cls); - void* (* getModuleAssembly)(void * thisHandle, CorInfoException** ppException, void* mod); - const char* (* getAssemblyName)(void * thisHandle, CorInfoException** ppException, void* assem); - void* (* LongLifetimeMalloc)(void * thisHandle, CorInfoException** ppException, size_t sz); - void (* LongLifetimeFree)(void * thisHandle, CorInfoException** ppException, void* obj); - size_t (* getClassModuleIdForStatics)(void * thisHandle, CorInfoException** ppException, void* cls, void* pModule, void** ppIndirection); - unsigned (* getClassSize)(void * thisHandle, CorInfoException** ppException, void* cls); - unsigned (* getHeapClassSize)(void * thisHandle, CorInfoException** ppException, void* cls); - int (* canAllocateOnStack)(void * thisHandle, CorInfoException** ppException, void* cls); - unsigned (* getClassAlignmentRequirement)(void * thisHandle, CorInfoException** ppException, void* cls, int fDoubleAlignHint); - unsigned (* getClassGClayout)(void * thisHandle, CorInfoException** ppException, void* cls, unsigned char* gcPtrs); - unsigned (* getClassNumInstanceFields)(void * thisHandle, CorInfoException** ppException, void* cls); - void* (* getFieldInClass)(void * thisHandle, CorInfoException** ppException, void* clsHnd, int num); - int (* checkMethodModifier)(void * thisHandle, CorInfoException** ppException, void* hMethod, const char* modifier, int fOptional); - int (* getNewHelper)(void * thisHandle, CorInfoException** ppException, void* pResolvedToken, void* callerHandle, bool* pHasSideEffects); - int (* getNewArrHelper)(void * thisHandle, CorInfoException** ppException, void* arrayCls); - int (* getCastingHelper)(void * thisHandle, CorInfoException** ppException, void* pResolvedToken, bool fThrowing); - int (* getSharedCCtorHelper)(void * thisHandle, CorInfoException** ppException, void* clsHnd); - void* (* getTypeForBox)(void * thisHandle, CorInfoException** ppException, void* cls); - int (* getBoxHelper)(void * thisHandle, CorInfoException** ppException, void* cls); - int (* getUnBoxHelper)(void * thisHandle, CorInfoException** ppException, void* cls); - bool (* getReadyToRunHelper)(void * thisHandle, CorInfoException** ppException, void* pResolvedToken, void* pGenericLookupKind, int id, void* pLookup); - void (* getReadyToRunDelegateCtorHelper)(void * thisHandle, CorInfoException** ppException, void* pTargetMethod, void* delegateType, void* pLookup); - const char* (* getHelperName)(void * thisHandle, CorInfoException** ppException, int helpFunc); - int (* initClass)(void * thisHandle, CorInfoException** ppException, void* field, void* method, void* context); - void (* classMustBeLoadedBeforeCodeIsRun)(void * thisHandle, CorInfoException** ppException, void* cls); - void* (* getBuiltinClass)(void * thisHandle, CorInfoException** ppException, int classId); - int (* getTypeForPrimitiveValueClass)(void * thisHandle, CorInfoException** ppException, void* cls); - int (* getTypeForPrimitiveNumericClass)(void * thisHandle, CorInfoException** ppException, void* cls); - int (* canCast)(void * thisHandle, CorInfoException** ppException, void* child, void* parent); - int (* areTypesEquivalent)(void * thisHandle, CorInfoException** ppException, void* cls1, void* cls2); - int (* compareTypesForCast)(void * thisHandle, CorInfoException** ppException, void* fromClass, void* toClass); - int (* compareTypesForEquality)(void * thisHandle, CorInfoException** ppException, void* cls1, void* cls2); - void* (* mergeClasses)(void * thisHandle, CorInfoException** ppException, void* cls1, void* cls2); - int (* isMoreSpecificType)(void * thisHandle, CorInfoException** ppException, void* cls1, void* cls2); - void* (* getParentType)(void * thisHandle, CorInfoException** ppException, void* cls); - int (* getChildType)(void * thisHandle, CorInfoException** ppException, void* clsHnd, void* clsRet); - int (* satisfiesClassConstraints)(void * thisHandle, CorInfoException** ppException, void* cls); - int (* isSDArray)(void * thisHandle, CorInfoException** ppException, void* cls); - unsigned (* getArrayRank)(void * thisHandle, CorInfoException** ppException, void* cls); - void* (* getArrayInitializationData)(void * thisHandle, CorInfoException** ppException, void* field, unsigned int size); - int (* canAccessClass)(void * thisHandle, CorInfoException** ppException, void* pResolvedToken, void* callerHandle, void* pAccessHelper); - const char* (* getFieldName)(void * thisHandle, CorInfoException** ppException, void* ftn, const char** moduleName); - void* (* getFieldClass)(void * thisHandle, CorInfoException** ppException, void* field); - int (* getFieldType)(void * thisHandle, CorInfoException** ppException, void* field, void* structType, void* memberParent); - unsigned (* getFieldOffset)(void * thisHandle, CorInfoException** ppException, void* field); - void (* getFieldInfo)(void * thisHandle, CorInfoException** ppException, void* pResolvedToken, void* callerHandle, int flags, void* pResult); - bool (* isFieldStatic)(void * thisHandle, CorInfoException** ppException, void* fldHnd); - void (* getBoundaries)(void * thisHandle, CorInfoException** ppException, void* ftn, unsigned int* cILOffsets, unsigned int** pILOffsets, void* implictBoundaries); - void (* setBoundaries)(void * thisHandle, CorInfoException** ppException, void* ftn, unsigned int cMap, void* pMap); - void (* getVars)(void * thisHandle, CorInfoException** ppException, void* ftn, unsigned int* cVars, void* vars, bool* extendOthers); - void (* setVars)(void * thisHandle, CorInfoException** ppException, void* ftn, unsigned int cVars, void* vars); - void* (* allocateArray)(void * thisHandle, CorInfoException** ppException, size_t cBytes); - void (* freeArray)(void * thisHandle, CorInfoException** ppException, void* array); - void* (* getArgNext)(void * thisHandle, CorInfoException** ppException, void* args); - int (* getArgType)(void * thisHandle, CorInfoException** ppException, void* sig, void* args, void* vcTypeRet); - void* (* getArgClass)(void * thisHandle, CorInfoException** ppException, void* sig, void* args); - int (* getHFAType)(void * thisHandle, CorInfoException** ppException, void* hClass); - int (* GetErrorHRESULT)(void * thisHandle, CorInfoException** ppException, void* pExceptionPointers); - unsigned int (* GetErrorMessage)(void * thisHandle, CorInfoException** ppException, wchar_t* buffer, unsigned int bufferLength); - int (* FilterException)(void * thisHandle, CorInfoException** ppException, void* pExceptionPointers); - void (* HandleException)(void * thisHandle, CorInfoException** ppException, void* pExceptionPointers); - void (* ThrowExceptionForJitResult)(void * thisHandle, CorInfoException** ppException, int result); - void (* ThrowExceptionForHelper)(void * thisHandle, CorInfoException** ppException, const void* throwHelper); - bool (* runWithErrorTrap)(void * thisHandle, CorInfoException** ppException, void* function, void* parameter); - void (* getEEInfo)(void * thisHandle, CorInfoException** ppException, void* pEEInfoOut); - const wchar_t* (* getJitTimeLogFilename)(void * thisHandle, CorInfoException** ppException); - unsigned int (* getMethodDefFromMethod)(void * thisHandle, CorInfoException** ppException, void* hMethod); - const char* (* getMethodName)(void * thisHandle, CorInfoException** ppException, void* ftn, const char** moduleName); - const char* (* getMethodNameFromMetadata)(void * thisHandle, CorInfoException** ppException, void* ftn, const char** className, const char** namespaceName, const char** enclosingClassName); - unsigned (* getMethodHash)(void * thisHandle, CorInfoException** ppException, void* ftn); - size_t (* findNameOfToken)(void * thisHandle, CorInfoException** ppException, void* moduleHandle, unsigned int token, char* szFQName, size_t FQNameCapacity); - bool (* getSystemVAmd64PassStructInRegisterDescriptor)(void * thisHandle, CorInfoException** ppException, void* structHnd, void* structPassInRegDescPtr); - unsigned int (* getThreadTLSIndex)(void * thisHandle, CorInfoException** ppException, void** ppIndirection); - const void* (* getInlinedCallFrameVptr)(void * thisHandle, CorInfoException** ppException, void** ppIndirection); - long* (* getAddrOfCaptureThreadGlobal)(void * thisHandle, CorInfoException** ppException, void** ppIndirection); - void* (* getHelperFtn)(void * thisHandle, CorInfoException** ppException, int ftnNum, void** ppIndirection); - void (* getFunctionEntryPoint)(void * thisHandle, CorInfoException** ppException, void* ftn, void* pResult, int accessFlags); - void (* getFunctionFixedEntryPoint)(void * thisHandle, CorInfoException** ppException, void* ftn, void* pResult); - void* (* getMethodSync)(void * thisHandle, CorInfoException** ppException, void* ftn, void** ppIndirection); - int (* getLazyStringLiteralHelper)(void * thisHandle, CorInfoException** ppException, void* handle); - void* (* embedModuleHandle)(void * thisHandle, CorInfoException** ppException, void* handle, void** ppIndirection); - void* (* embedClassHandle)(void * thisHandle, CorInfoException** ppException, void* handle, void** ppIndirection); - void* (* embedMethodHandle)(void * thisHandle, CorInfoException** ppException, void* handle, void** ppIndirection); - void* (* embedFieldHandle)(void * thisHandle, CorInfoException** ppException, void* handle, void** ppIndirection); - void (* embedGenericHandle)(void * thisHandle, CorInfoException** ppException, void* pResolvedToken, int fEmbedParent, void* pResult); - void (* getLocationOfThisType)(void * thisHandle, CorInfoException** ppException, void* context, void* pLookupKind); - void (* getAddressOfPInvokeTarget)(void * thisHandle, CorInfoException** ppException, void* method, void* pLookup); - void* (* GetCookieForPInvokeCalliSig)(void * thisHandle, CorInfoException** ppException, void* szMetaSig, void** ppIndirection); - bool (* canGetCookieForPInvokeCalliSig)(void * thisHandle, CorInfoException** ppException, void* szMetaSig); - void* (* getJustMyCodeHandle)(void * thisHandle, CorInfoException** ppException, void* method, void** ppIndirection); - void (* GetProfilingHandle)(void * thisHandle, CorInfoException** ppException, int* pbHookFunction, void** pProfilerHandle, int* pbIndirectedHandles); - void (* getCallInfo)(void * thisHandle, CorInfoException** ppException, void* pResolvedToken, void* pConstrainedResolvedToken, void* callerHandle, int flags, void* pResult); - int (* canAccessFamily)(void * thisHandle, CorInfoException** ppException, void* hCaller, void* hInstanceType); - int (* isRIDClassDomainID)(void * thisHandle, CorInfoException** ppException, void* cls); - unsigned (* getClassDomainID)(void * thisHandle, CorInfoException** ppException, void* cls, void** ppIndirection); - void* (* getFieldAddress)(void * thisHandle, CorInfoException** ppException, void* field, void** ppIndirection); - void* (* getStaticFieldCurrentClass)(void * thisHandle, CorInfoException** ppException, void* field, bool* pIsSpeculative); - void* (* getVarArgsHandle)(void * thisHandle, CorInfoException** ppException, void* pSig, void** ppIndirection); - bool (* canGetVarArgsHandle)(void * thisHandle, CorInfoException** ppException, void* pSig); - int (* constructStringLiteral)(void * thisHandle, CorInfoException** ppException, void* module, unsigned int metaTok, void** ppValue); - int (* emptyStringLiteral)(void * thisHandle, CorInfoException** ppException, void** ppValue); - unsigned int (* getFieldThreadLocalStoreID)(void * thisHandle, CorInfoException** ppException, void* field, void** ppIndirection); - void (* setOverride)(void * thisHandle, CorInfoException** ppException, void* pOverride, void* currentMethod); - void (* addActiveDependency)(void * thisHandle, CorInfoException** ppException, void* moduleFrom, void* moduleTo); - void* (* GetDelegateCtor)(void * thisHandle, CorInfoException** ppException, void* methHnd, void* clsHnd, void* targetMethodHnd, void* pCtorData); - void (* MethodCompileComplete)(void * thisHandle, CorInfoException** ppException, void* methHnd); - bool (* getTailCallHelpers)(void * thisHandle, CorInfoException** ppException, void* callToken, void* sig, int flags, void* pResult); - bool (* convertPInvokeCalliToCall)(void * thisHandle, CorInfoException** ppException, void* pResolvedToken, bool mustConvert); - void (* notifyInstructionSetUsage)(void * thisHandle, CorInfoException** ppException, int instructionSet, bool supportEnabled); - void (* allocMem)(void * thisHandle, CorInfoException** ppException, unsigned int hotCodeSize, unsigned int coldCodeSize, unsigned int roDataSize, unsigned int xcptnsCount, int flag, void** hotCodeBlock, void** coldCodeBlock, void** roDataBlock); - void (* reserveUnwindInfo)(void * thisHandle, CorInfoException** ppException, int isFunclet, int isColdCode, unsigned int unwindSize); - void (* allocUnwindInfo)(void * thisHandle, CorInfoException** ppException, unsigned char* pHotCode, unsigned char* pColdCode, unsigned int startOffset, unsigned int endOffset, unsigned int unwindSize, unsigned char* pUnwindBlock, int funcKind); - void* (* allocGCInfo)(void * thisHandle, CorInfoException** ppException, size_t size); - void (* setEHcount)(void * thisHandle, CorInfoException** ppException, unsigned cEH); - void (* setEHinfo)(void * thisHandle, CorInfoException** ppException, unsigned EHnumber, void* clause); - int (* logMsg)(void * thisHandle, CorInfoException** ppException, unsigned level, const char* fmt, va_list args); - int (* doAssert)(void * thisHandle, CorInfoException** ppException, const char* szFile, int iLine, const char* szExpr); - void (* reportFatalError)(void * thisHandle, CorInfoException** ppException, int result); - int (* allocMethodBlockCounts)(void * thisHandle, CorInfoException** ppException, unsigned int count, void** pBlockCounts); - int (* getMethodBlockCounts)(void * thisHandle, CorInfoException** ppException, void* ftnHnd, unsigned int* pCount, void** pBlockCounts, unsigned int* pNumRuns); - void* (* getLikelyClass)(void * thisHandle, CorInfoException** ppException, void* ftnHnd, void* baseHnd, unsigned int ilOffset, unsigned int* pLikelihood, unsigned int* pNumberOfClasses); - void (* recordCallSite)(void * thisHandle, CorInfoException** ppException, unsigned int instrOffset, void* callSig, void* methodHandle); - void (* recordRelocation)(void * thisHandle, CorInfoException** ppException, void* location, void* target, unsigned short fRelocType, unsigned short slotNum, int addlDelta); - unsigned short (* getRelocTypeHint)(void * thisHandle, CorInfoException** ppException, void* target); - unsigned int (* getExpectedTargetArchitecture)(void * thisHandle, CorInfoException** ppException); - unsigned int (* getJitFlags)(void * thisHandle, CorInfoException** ppException, void* flags, unsigned int sizeInBytes); + unsigned int (* getMethodAttribs)(void * thisHandle, CorInfoExceptionClass** ppException, void* ftn); + void (* setMethodAttribs)(void * thisHandle, CorInfoExceptionClass** ppException, void* ftn, int attribs); + void (* getMethodSig)(void * thisHandle, CorInfoExceptionClass** ppException, void* ftn, void* sig, void* memberParent); + bool (* getMethodInfo)(void * thisHandle, CorInfoExceptionClass** ppException, void* ftn, void* info); + int (* canInline)(void * thisHandle, CorInfoExceptionClass** ppException, void* callerHnd, void* calleeHnd, unsigned int* pRestrictions); + void (* reportInliningDecision)(void * thisHandle, CorInfoExceptionClass** ppException, void* inlinerHnd, void* inlineeHnd, int inlineResult, const char* reason); + bool (* canTailCall)(void * thisHandle, CorInfoExceptionClass** ppException, void* callerHnd, void* declaredCalleeHnd, void* exactCalleeHnd, bool fIsTailPrefix); + void (* reportTailCallDecision)(void * thisHandle, CorInfoExceptionClass** ppException, void* callerHnd, void* calleeHnd, bool fIsTailPrefix, int tailCallResult, const char* reason); + void (* getEHinfo)(void * thisHandle, CorInfoExceptionClass** ppException, void* ftn, unsigned EHnumber, void* clause); + void* (* getMethodClass)(void * thisHandle, CorInfoExceptionClass** ppException, void* method); + void* (* getMethodModule)(void * thisHandle, CorInfoExceptionClass** ppException, void* method); + void (* getMethodVTableOffset)(void * thisHandle, CorInfoExceptionClass** ppException, void* method, unsigned* offsetOfIndirection, unsigned* offsetAfterIndirection, bool* isRelative); + void* (* resolveVirtualMethod)(void * thisHandle, CorInfoExceptionClass** ppException, void* virtualMethod, void* implementingClass, void* ownerType); + void* (* getUnboxedEntry)(void * thisHandle, CorInfoExceptionClass** ppException, void* ftn, bool* requiresInstMethodTableArg); + void* (* getDefaultEqualityComparerClass)(void * thisHandle, CorInfoExceptionClass** ppException, void* elemType); + void (* expandRawHandleIntrinsic)(void * thisHandle, CorInfoExceptionClass** ppException, void* pResolvedToken, void* pResult); + int (* getIntrinsicID)(void * thisHandle, CorInfoExceptionClass** ppException, void* method, bool* pMustExpand); + bool (* isIntrinsicType)(void * thisHandle, CorInfoExceptionClass** ppException, void* classHnd); + int (* getUnmanagedCallConv)(void * thisHandle, CorInfoExceptionClass** ppException, void* method); + int (* pInvokeMarshalingRequired)(void * thisHandle, CorInfoExceptionClass** ppException, void* method, void* callSiteSig); + int (* satisfiesMethodConstraints)(void * thisHandle, CorInfoExceptionClass** ppException, void* parent, void* method); + int (* isCompatibleDelegate)(void * thisHandle, CorInfoExceptionClass** ppException, void* objCls, void* methodParentCls, void* method, void* delegateCls, int* pfIsOpenDelegate); + void (* methodMustBeLoadedBeforeCodeIsRun)(void * thisHandle, CorInfoExceptionClass** ppException, void* method); + void* (* mapMethodDeclToMethodImpl)(void * thisHandle, CorInfoExceptionClass** ppException, void* method); + void (* getGSCookie)(void * thisHandle, CorInfoExceptionClass** ppException, void* pCookieVal, void** ppCookieVal); + void (* setPatchpointInfo)(void * thisHandle, CorInfoExceptionClass** ppException, void* patchpointInfo); + void* (* getOSRInfo)(void * thisHandle, CorInfoExceptionClass** ppException, unsigned* ilOffset); + void (* resolveToken)(void * thisHandle, CorInfoExceptionClass** ppException, void* pResolvedToken); + bool (* tryResolveToken)(void * thisHandle, CorInfoExceptionClass** ppException, void* pResolvedToken); + void (* findSig)(void * thisHandle, CorInfoExceptionClass** ppException, void* module, unsigned sigTOK, void* context, void* sig); + void (* findCallSiteSig)(void * thisHandle, CorInfoExceptionClass** ppException, void* module, unsigned methTOK, void* context, void* sig); + void* (* getTokenTypeAsHandle)(void * thisHandle, CorInfoExceptionClass** ppException, void* pResolvedToken); + int (* isValidToken)(void * thisHandle, CorInfoExceptionClass** ppException, void* module, unsigned metaTOK); + int (* isValidStringRef)(void * thisHandle, CorInfoExceptionClass** ppException, void* module, unsigned metaTOK); + const wchar_t* (* getStringLiteral)(void * thisHandle, CorInfoExceptionClass** ppException, void* module, unsigned metaTOK, int* length); + int (* asCorInfoType)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + const char* (* getClassName)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + const char* (* getClassNameFromMetadata)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls, const char** namespaceName); + void* (* getTypeInstantiationArgument)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls, unsigned index); + int (* appendClassName)(void * thisHandle, CorInfoExceptionClass** ppException, wchar_t** ppBuf, int* pnBufLen, void* cls, int fNamespace, int fFullInst, int fAssembly); + int (* isValueClass)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + int (* canInlineTypeCheck)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls, int source); + unsigned int (* getClassAttribs)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + int (* isStructRequiringStackAllocRetBuf)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + void* (* getClassModule)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + void* (* getModuleAssembly)(void * thisHandle, CorInfoExceptionClass** ppException, void* mod); + const char* (* getAssemblyName)(void * thisHandle, CorInfoExceptionClass** ppException, void* assem); + void* (* LongLifetimeMalloc)(void * thisHandle, CorInfoExceptionClass** ppException, size_t sz); + void (* LongLifetimeFree)(void * thisHandle, CorInfoExceptionClass** ppException, void* obj); + size_t (* getClassModuleIdForStatics)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls, void* pModule, void** ppIndirection); + unsigned (* getClassSize)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + unsigned (* getHeapClassSize)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + int (* canAllocateOnStack)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + unsigned (* getClassAlignmentRequirement)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls, int fDoubleAlignHint); + unsigned (* getClassGClayout)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls, unsigned char* gcPtrs); + unsigned (* getClassNumInstanceFields)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + void* (* getFieldInClass)(void * thisHandle, CorInfoExceptionClass** ppException, void* clsHnd, int num); + int (* checkMethodModifier)(void * thisHandle, CorInfoExceptionClass** ppException, void* hMethod, const char* modifier, int fOptional); + int (* getNewHelper)(void * thisHandle, CorInfoExceptionClass** ppException, void* pResolvedToken, void* callerHandle, bool* pHasSideEffects); + int (* getNewArrHelper)(void * thisHandle, CorInfoExceptionClass** ppException, void* arrayCls); + int (* getCastingHelper)(void * thisHandle, CorInfoExceptionClass** ppException, void* pResolvedToken, bool fThrowing); + int (* getSharedCCtorHelper)(void * thisHandle, CorInfoExceptionClass** ppException, void* clsHnd); + void* (* getTypeForBox)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + int (* getBoxHelper)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + int (* getUnBoxHelper)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + bool (* getReadyToRunHelper)(void * thisHandle, CorInfoExceptionClass** ppException, void* pResolvedToken, void* pGenericLookupKind, int id, void* pLookup); + void (* getReadyToRunDelegateCtorHelper)(void * thisHandle, CorInfoExceptionClass** ppException, void* pTargetMethod, void* delegateType, void* pLookup); + const char* (* getHelperName)(void * thisHandle, CorInfoExceptionClass** ppException, int helpFunc); + int (* initClass)(void * thisHandle, CorInfoExceptionClass** ppException, void* field, void* method, void* context); + void (* classMustBeLoadedBeforeCodeIsRun)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + void* (* getBuiltinClass)(void * thisHandle, CorInfoExceptionClass** ppException, int classId); + int (* getTypeForPrimitiveValueClass)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + int (* getTypeForPrimitiveNumericClass)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + int (* canCast)(void * thisHandle, CorInfoExceptionClass** ppException, void* child, void* parent); + int (* areTypesEquivalent)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls1, void* cls2); + int (* compareTypesForCast)(void * thisHandle, CorInfoExceptionClass** ppException, void* fromClass, void* toClass); + int (* compareTypesForEquality)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls1, void* cls2); + void* (* mergeClasses)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls1, void* cls2); + int (* isMoreSpecificType)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls1, void* cls2); + void* (* getParentType)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + int (* getChildType)(void * thisHandle, CorInfoExceptionClass** ppException, void* clsHnd, void* clsRet); + int (* satisfiesClassConstraints)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + int (* isSDArray)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + unsigned (* getArrayRank)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + void* (* getArrayInitializationData)(void * thisHandle, CorInfoExceptionClass** ppException, void* field, unsigned int size); + int (* canAccessClass)(void * thisHandle, CorInfoExceptionClass** ppException, void* pResolvedToken, void* callerHandle, void* pAccessHelper); + const char* (* getFieldName)(void * thisHandle, CorInfoExceptionClass** ppException, void* ftn, const char** moduleName); + void* (* getFieldClass)(void * thisHandle, CorInfoExceptionClass** ppException, void* field); + int (* getFieldType)(void * thisHandle, CorInfoExceptionClass** ppException, void* field, void* structType, void* memberParent); + unsigned (* getFieldOffset)(void * thisHandle, CorInfoExceptionClass** ppException, void* field); + void (* getFieldInfo)(void * thisHandle, CorInfoExceptionClass** ppException, void* pResolvedToken, void* callerHandle, int flags, void* pResult); + bool (* isFieldStatic)(void * thisHandle, CorInfoExceptionClass** ppException, void* fldHnd); + void (* getBoundaries)(void * thisHandle, CorInfoExceptionClass** ppException, void* ftn, unsigned int* cILOffsets, unsigned int** pILOffsets, void* implictBoundaries); + void (* setBoundaries)(void * thisHandle, CorInfoExceptionClass** ppException, void* ftn, unsigned int cMap, void* pMap); + void (* getVars)(void * thisHandle, CorInfoExceptionClass** ppException, void* ftn, unsigned int* cVars, void* vars, bool* extendOthers); + void (* setVars)(void * thisHandle, CorInfoExceptionClass** ppException, void* ftn, unsigned int cVars, void* vars); + void* (* allocateArray)(void * thisHandle, CorInfoExceptionClass** ppException, size_t cBytes); + void (* freeArray)(void * thisHandle, CorInfoExceptionClass** ppException, void* array); + void* (* getArgNext)(void * thisHandle, CorInfoExceptionClass** ppException, void* args); + int (* getArgType)(void * thisHandle, CorInfoExceptionClass** ppException, void* sig, void* args, void* vcTypeRet); + void* (* getArgClass)(void * thisHandle, CorInfoExceptionClass** ppException, void* sig, void* args); + int (* getHFAType)(void * thisHandle, CorInfoExceptionClass** ppException, void* hClass); + int (* GetErrorHRESULT)(void * thisHandle, CorInfoExceptionClass** ppException, void* pExceptionPointers); + unsigned int (* GetErrorMessage)(void * thisHandle, CorInfoExceptionClass** ppException, wchar_t* buffer, unsigned int bufferLength); + int (* FilterException)(void * thisHandle, CorInfoExceptionClass** ppException, void* pExceptionPointers); + void (* HandleException)(void * thisHandle, CorInfoExceptionClass** ppException, void* pExceptionPointers); + void (* ThrowExceptionForJitResult)(void * thisHandle, CorInfoExceptionClass** ppException, int result); + void (* ThrowExceptionForHelper)(void * thisHandle, CorInfoExceptionClass** ppException, const void* throwHelper); + bool (* runWithErrorTrap)(void * thisHandle, CorInfoExceptionClass** ppException, void* function, void* parameter); + void (* getEEInfo)(void * thisHandle, CorInfoExceptionClass** ppException, void* pEEInfoOut); + const wchar_t* (* getJitTimeLogFilename)(void * thisHandle, CorInfoExceptionClass** ppException); + unsigned int (* getMethodDefFromMethod)(void * thisHandle, CorInfoExceptionClass** ppException, void* hMethod); + const char* (* getMethodName)(void * thisHandle, CorInfoExceptionClass** ppException, void* ftn, const char** moduleName); + const char* (* getMethodNameFromMetadata)(void * thisHandle, CorInfoExceptionClass** ppException, void* ftn, const char** className, const char** namespaceName, const char** enclosingClassName); + unsigned (* getMethodHash)(void * thisHandle, CorInfoExceptionClass** ppException, void* ftn); + size_t (* findNameOfToken)(void * thisHandle, CorInfoExceptionClass** ppException, void* moduleHandle, unsigned int token, char* szFQName, size_t FQNameCapacity); + bool (* getSystemVAmd64PassStructInRegisterDescriptor)(void * thisHandle, CorInfoExceptionClass** ppException, void* structHnd, void* structPassInRegDescPtr); + unsigned int (* getThreadTLSIndex)(void * thisHandle, CorInfoExceptionClass** ppException, void** ppIndirection); + const void* (* getInlinedCallFrameVptr)(void * thisHandle, CorInfoExceptionClass** ppException, void** ppIndirection); + long* (* getAddrOfCaptureThreadGlobal)(void * thisHandle, CorInfoExceptionClass** ppException, void** ppIndirection); + void* (* getHelperFtn)(void * thisHandle, CorInfoExceptionClass** ppException, int ftnNum, void** ppIndirection); + void (* getFunctionEntryPoint)(void * thisHandle, CorInfoExceptionClass** ppException, void* ftn, void* pResult, int accessFlags); + void (* getFunctionFixedEntryPoint)(void * thisHandle, CorInfoExceptionClass** ppException, void* ftn, void* pResult); + void* (* getMethodSync)(void * thisHandle, CorInfoExceptionClass** ppException, void* ftn, void** ppIndirection); + int (* getLazyStringLiteralHelper)(void * thisHandle, CorInfoExceptionClass** ppException, void* handle); + void* (* embedModuleHandle)(void * thisHandle, CorInfoExceptionClass** ppException, void* handle, void** ppIndirection); + void* (* embedClassHandle)(void * thisHandle, CorInfoExceptionClass** ppException, void* handle, void** ppIndirection); + void* (* embedMethodHandle)(void * thisHandle, CorInfoExceptionClass** ppException, void* handle, void** ppIndirection); + void* (* embedFieldHandle)(void * thisHandle, CorInfoExceptionClass** ppException, void* handle, void** ppIndirection); + void (* embedGenericHandle)(void * thisHandle, CorInfoExceptionClass** ppException, void* pResolvedToken, int fEmbedParent, void* pResult); + void (* getLocationOfThisType)(void * thisHandle, CorInfoExceptionClass** ppException, void* context, void* pLookupKind); + void (* getAddressOfPInvokeTarget)(void * thisHandle, CorInfoExceptionClass** ppException, void* method, void* pLookup); + void* (* GetCookieForPInvokeCalliSig)(void * thisHandle, CorInfoExceptionClass** ppException, void* szMetaSig, void** ppIndirection); + bool (* canGetCookieForPInvokeCalliSig)(void * thisHandle, CorInfoExceptionClass** ppException, void* szMetaSig); + void* (* getJustMyCodeHandle)(void * thisHandle, CorInfoExceptionClass** ppException, void* method, void** ppIndirection); + void (* GetProfilingHandle)(void * thisHandle, CorInfoExceptionClass** ppException, int* pbHookFunction, void** pProfilerHandle, int* pbIndirectedHandles); + void (* getCallInfo)(void * thisHandle, CorInfoExceptionClass** ppException, void* pResolvedToken, void* pConstrainedResolvedToken, void* callerHandle, int flags, void* pResult); + int (* canAccessFamily)(void * thisHandle, CorInfoExceptionClass** ppException, void* hCaller, void* hInstanceType); + int (* isRIDClassDomainID)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls); + unsigned (* getClassDomainID)(void * thisHandle, CorInfoExceptionClass** ppException, void* cls, void** ppIndirection); + void* (* getFieldAddress)(void * thisHandle, CorInfoExceptionClass** ppException, void* field, void** ppIndirection); + void* (* getStaticFieldCurrentClass)(void * thisHandle, CorInfoExceptionClass** ppException, void* field, bool* pIsSpeculative); + void* (* getVarArgsHandle)(void * thisHandle, CorInfoExceptionClass** ppException, void* pSig, void** ppIndirection); + bool (* canGetVarArgsHandle)(void * thisHandle, CorInfoExceptionClass** ppException, void* pSig); + int (* constructStringLiteral)(void * thisHandle, CorInfoExceptionClass** ppException, void* module, unsigned int metaTok, void** ppValue); + int (* emptyStringLiteral)(void * thisHandle, CorInfoExceptionClass** ppException, void** ppValue); + unsigned int (* getFieldThreadLocalStoreID)(void * thisHandle, CorInfoExceptionClass** ppException, void* field, void** ppIndirection); + void (* setOverride)(void * thisHandle, CorInfoExceptionClass** ppException, void* pOverride, void* currentMethod); + void (* addActiveDependency)(void * thisHandle, CorInfoExceptionClass** ppException, void* moduleFrom, void* moduleTo); + void* (* GetDelegateCtor)(void * thisHandle, CorInfoExceptionClass** ppException, void* methHnd, void* clsHnd, void* targetMethodHnd, void* pCtorData); + void (* MethodCompileComplete)(void * thisHandle, CorInfoExceptionClass** ppException, void* methHnd); + bool (* getTailCallHelpers)(void * thisHandle, CorInfoExceptionClass** ppException, void* callToken, void* sig, int flags, void* pResult); + bool (* convertPInvokeCalliToCall)(void * thisHandle, CorInfoExceptionClass** ppException, void* pResolvedToken, bool mustConvert); + void (* notifyInstructionSetUsage)(void * thisHandle, CorInfoExceptionClass** ppException, int instructionSet, bool supportEnabled); + void (* allocMem)(void * thisHandle, CorInfoExceptionClass** ppException, unsigned int hotCodeSize, unsigned int coldCodeSize, unsigned int roDataSize, unsigned int xcptnsCount, int flag, void** hotCodeBlock, void** coldCodeBlock, void** roDataBlock); + void (* reserveUnwindInfo)(void * thisHandle, CorInfoExceptionClass** ppException, int isFunclet, int isColdCode, unsigned int unwindSize); + void (* allocUnwindInfo)(void * thisHandle, CorInfoExceptionClass** ppException, unsigned char* pHotCode, unsigned char* pColdCode, unsigned int startOffset, unsigned int endOffset, unsigned int unwindSize, unsigned char* pUnwindBlock, int funcKind); + void* (* allocGCInfo)(void * thisHandle, CorInfoExceptionClass** ppException, size_t size); + void (* setEHcount)(void * thisHandle, CorInfoExceptionClass** ppException, unsigned cEH); + void (* setEHinfo)(void * thisHandle, CorInfoExceptionClass** ppException, unsigned EHnumber, void* clause); + int (* logMsg)(void * thisHandle, CorInfoExceptionClass** ppException, unsigned level, const char* fmt, va_list args); + int (* doAssert)(void * thisHandle, CorInfoExceptionClass** ppException, const char* szFile, int iLine, const char* szExpr); + void (* reportFatalError)(void * thisHandle, CorInfoExceptionClass** ppException, int result); + int (* allocMethodBlockCounts)(void * thisHandle, CorInfoExceptionClass** ppException, unsigned int count, void** pBlockCounts); + int (* getMethodBlockCounts)(void * thisHandle, CorInfoExceptionClass** ppException, void* ftnHnd, unsigned int* pCount, void** pBlockCounts, unsigned int* pNumRuns); + void* (* getLikelyClass)(void * thisHandle, CorInfoExceptionClass** ppException, void* ftnHnd, void* baseHnd, unsigned int ilOffset, unsigned int* pLikelihood, unsigned int* pNumberOfClasses); + void (* recordCallSite)(void * thisHandle, CorInfoExceptionClass** ppException, unsigned int instrOffset, void* callSig, void* methodHandle); + void (* recordRelocation)(void * thisHandle, CorInfoExceptionClass** ppException, void* location, void* target, unsigned short fRelocType, unsigned short slotNum, int addlDelta); + unsigned short (* getRelocTypeHint)(void * thisHandle, CorInfoExceptionClass** ppException, void* target); + unsigned int (* getExpectedTargetArchitecture)(void * thisHandle, CorInfoExceptionClass** ppException); + unsigned int (* getJitFlags)(void * thisHandle, CorInfoExceptionClass** ppException, void* flags, unsigned int sizeInBytes); }; @@ -191,1474 +195,1660 @@ public: { } - virtual unsigned int getMethodAttribs(void* ftn) - { - CorInfoException* pException = nullptr; - unsigned int _ret = _callbacks->getMethodAttribs(_thisHandle, &pException, ftn); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void setMethodAttribs(void* ftn, int attribs) - { - CorInfoException* pException = nullptr; - _callbacks->setMethodAttribs(_thisHandle, &pException, ftn, attribs); - if (pException != nullptr) - throw pException; - } - - virtual void getMethodSig(void* ftn, void* sig, void* memberParent) - { - CorInfoException* pException = nullptr; - _callbacks->getMethodSig(_thisHandle, &pException, ftn, sig, memberParent); - if (pException != nullptr) - throw pException; - } - - virtual bool getMethodInfo(void* ftn, void* info) - { - CorInfoException* pException = nullptr; - bool _ret = _callbacks->getMethodInfo(_thisHandle, &pException, ftn, info); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int canInline(void* callerHnd, void* calleeHnd, unsigned int* pRestrictions) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->canInline(_thisHandle, &pException, callerHnd, calleeHnd, pRestrictions); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void reportInliningDecision(void* inlinerHnd, void* inlineeHnd, int inlineResult, const char* reason) - { - CorInfoException* pException = nullptr; - _callbacks->reportInliningDecision(_thisHandle, &pException, inlinerHnd, inlineeHnd, inlineResult, reason); - if (pException != nullptr) - throw pException; - } - - virtual bool canTailCall(void* callerHnd, void* declaredCalleeHnd, void* exactCalleeHnd, bool fIsTailPrefix) - { - CorInfoException* pException = nullptr; - bool _ret = _callbacks->canTailCall(_thisHandle, &pException, callerHnd, declaredCalleeHnd, exactCalleeHnd, fIsTailPrefix); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void reportTailCallDecision(void* callerHnd, void* calleeHnd, bool fIsTailPrefix, int tailCallResult, const char* reason) - { - CorInfoException* pException = nullptr; - _callbacks->reportTailCallDecision(_thisHandle, &pException, callerHnd, calleeHnd, fIsTailPrefix, tailCallResult, reason); - if (pException != nullptr) - throw pException; - } - - virtual void getEHinfo(void* ftn, unsigned EHnumber, void* clause) - { - CorInfoException* pException = nullptr; - _callbacks->getEHinfo(_thisHandle, &pException, ftn, EHnumber, clause); - if (pException != nullptr) - throw pException; - } - - virtual void* getMethodClass(void* method) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getMethodClass(_thisHandle, &pException, method); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* getMethodModule(void* method) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getMethodModule(_thisHandle, &pException, method); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void getMethodVTableOffset(void* method, unsigned* offsetOfIndirection, unsigned* offsetAfterIndirection, bool* isRelative) - { - CorInfoException* pException = nullptr; - _callbacks->getMethodVTableOffset(_thisHandle, &pException, method, offsetOfIndirection, offsetAfterIndirection, isRelative); - if (pException != nullptr) - throw pException; - } - - virtual void* resolveVirtualMethod(void* virtualMethod, void* implementingClass, void* ownerType) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->resolveVirtualMethod(_thisHandle, &pException, virtualMethod, implementingClass, ownerType); - if (pException != nullptr) - throw pException; - return _ret; - } - virtual void* getUnboxedEntry(void* ftn, bool* requiresInstMethodTableArg) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getUnboxedEntry(_thisHandle, &pException, ftn, requiresInstMethodTableArg); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* getDefaultEqualityComparerClass(void* elemType) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getDefaultEqualityComparerClass(_thisHandle, &pException, elemType); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void expandRawHandleIntrinsic(void* pResolvedToken, void* pResult) - { - CorInfoException* pException = nullptr; - _callbacks->expandRawHandleIntrinsic(_thisHandle, &pException, pResolvedToken, pResult); - if (pException != nullptr) - throw pException; - } + virtual unsigned int getMethodAttribs( + void* ftn) +{ + CorInfoExceptionClass* pException = nullptr; + unsigned int temp = _callbacks->getMethodAttribs(_thisHandle, &pException, ftn); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void setMethodAttribs( + void* ftn, + int attribs) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->setMethodAttribs(_thisHandle, &pException, ftn, attribs); + if (pException != nullptr) throw pException; +} + + virtual void getMethodSig( + void* ftn, + void* sig, + void* memberParent) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->getMethodSig(_thisHandle, &pException, ftn, sig, memberParent); + if (pException != nullptr) throw pException; +} + + virtual bool getMethodInfo( + void* ftn, + void* info) +{ + CorInfoExceptionClass* pException = nullptr; + bool temp = _callbacks->getMethodInfo(_thisHandle, &pException, ftn, info); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int canInline( + void* callerHnd, + void* calleeHnd, + unsigned int* pRestrictions) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->canInline(_thisHandle, &pException, callerHnd, calleeHnd, pRestrictions); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void reportInliningDecision( + void* inlinerHnd, + void* inlineeHnd, + int inlineResult, + const char* reason) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->reportInliningDecision(_thisHandle, &pException, inlinerHnd, inlineeHnd, inlineResult, reason); + if (pException != nullptr) throw pException; +} + + virtual bool canTailCall( + void* callerHnd, + void* declaredCalleeHnd, + void* exactCalleeHnd, + bool fIsTailPrefix) +{ + CorInfoExceptionClass* pException = nullptr; + bool temp = _callbacks->canTailCall(_thisHandle, &pException, callerHnd, declaredCalleeHnd, exactCalleeHnd, fIsTailPrefix); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void reportTailCallDecision( + void* callerHnd, + void* calleeHnd, + bool fIsTailPrefix, + int tailCallResult, + const char* reason) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->reportTailCallDecision(_thisHandle, &pException, callerHnd, calleeHnd, fIsTailPrefix, tailCallResult, reason); + if (pException != nullptr) throw pException; +} + + virtual void getEHinfo( + void* ftn, + unsigned EHnumber, + void* clause) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->getEHinfo(_thisHandle, &pException, ftn, EHnumber, clause); + if (pException != nullptr) throw pException; +} - virtual int getIntrinsicID(void* method, bool* pMustExpand) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->getIntrinsicID(_thisHandle, &pException, method, pMustExpand); - if (pException != nullptr) - throw pException; - return _ret; - } + virtual void* getMethodClass( + void* method) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getMethodClass(_thisHandle, &pException, method); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* getMethodModule( + void* method) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getMethodModule(_thisHandle, &pException, method); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void getMethodVTableOffset( + void* method, + unsigned* offsetOfIndirection, + unsigned* offsetAfterIndirection, + bool* isRelative) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->getMethodVTableOffset(_thisHandle, &pException, method, offsetOfIndirection, offsetAfterIndirection, isRelative); + if (pException != nullptr) throw pException; +} + + virtual void* resolveVirtualMethod( + void* virtualMethod, + void* implementingClass, + void* ownerType) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->resolveVirtualMethod(_thisHandle, &pException, virtualMethod, implementingClass, ownerType); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* getUnboxedEntry( + void* ftn, + bool* requiresInstMethodTableArg) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getUnboxedEntry(_thisHandle, &pException, ftn, requiresInstMethodTableArg); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* getDefaultEqualityComparerClass( + void* elemType) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getDefaultEqualityComparerClass(_thisHandle, &pException, elemType); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void expandRawHandleIntrinsic( + void* pResolvedToken, + void* pResult) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->expandRawHandleIntrinsic(_thisHandle, &pException, pResolvedToken, pResult); + if (pException != nullptr) throw pException; +} + + virtual int getIntrinsicID( + void* method, + bool* pMustExpand) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->getIntrinsicID(_thisHandle, &pException, method, pMustExpand); + if (pException != nullptr) throw pException; + return temp; +} + + virtual bool isIntrinsicType( + void* classHnd) +{ + CorInfoExceptionClass* pException = nullptr; + bool temp = _callbacks->isIntrinsicType(_thisHandle, &pException, classHnd); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int getUnmanagedCallConv( + void* method) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->getUnmanagedCallConv(_thisHandle, &pException, method); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int pInvokeMarshalingRequired( + void* method, + void* callSiteSig) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->pInvokeMarshalingRequired(_thisHandle, &pException, method, callSiteSig); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int satisfiesMethodConstraints( + void* parent, + void* method) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->satisfiesMethodConstraints(_thisHandle, &pException, parent, method); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int isCompatibleDelegate( + void* objCls, + void* methodParentCls, + void* method, + void* delegateCls, + int* pfIsOpenDelegate) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->isCompatibleDelegate(_thisHandle, &pException, objCls, methodParentCls, method, delegateCls, pfIsOpenDelegate); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void methodMustBeLoadedBeforeCodeIsRun( + void* method) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->methodMustBeLoadedBeforeCodeIsRun(_thisHandle, &pException, method); + if (pException != nullptr) throw pException; +} - virtual bool isIntrinsicType(void* classHnd) - { - CorInfoException* pException = nullptr; - bool _ret = _callbacks->isIntrinsicType(_thisHandle, &pException, classHnd); - if (pException != nullptr) - throw pException; - return _ret; - } + virtual void* mapMethodDeclToMethodImpl( + void* method) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->mapMethodDeclToMethodImpl(_thisHandle, &pException, method); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void getGSCookie( + void* pCookieVal, + void** ppCookieVal) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->getGSCookie(_thisHandle, &pException, pCookieVal, ppCookieVal); + if (pException != nullptr) throw pException; +} - virtual int getUnmanagedCallConv(void* method) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->getUnmanagedCallConv(_thisHandle, &pException, method); - if (pException != nullptr) - throw pException; - return _ret; - } + virtual void setPatchpointInfo( + void* patchpointInfo) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->setPatchpointInfo(_thisHandle, &pException, patchpointInfo); + if (pException != nullptr) throw pException; +} - virtual int pInvokeMarshalingRequired(void* method, void* callSiteSig) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->pInvokeMarshalingRequired(_thisHandle, &pException, method, callSiteSig); - if (pException != nullptr) - throw pException; - return _ret; - } + virtual void* getOSRInfo( + unsigned* ilOffset) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getOSRInfo(_thisHandle, &pException, ilOffset); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void resolveToken( + void* pResolvedToken) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->resolveToken(_thisHandle, &pException, pResolvedToken); + if (pException != nullptr) throw pException; +} - virtual int satisfiesMethodConstraints(void* parent, void* method) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->satisfiesMethodConstraints(_thisHandle, &pException, parent, method); - if (pException != nullptr) - throw pException; - return _ret; - } + virtual bool tryResolveToken( + void* pResolvedToken) +{ + CorInfoExceptionClass* pException = nullptr; + bool temp = _callbacks->tryResolveToken(_thisHandle, &pException, pResolvedToken); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void findSig( + void* module, + unsigned sigTOK, + void* context, + void* sig) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->findSig(_thisHandle, &pException, module, sigTOK, context, sig); + if (pException != nullptr) throw pException; +} + + virtual void findCallSiteSig( + void* module, + unsigned methTOK, + void* context, + void* sig) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->findCallSiteSig(_thisHandle, &pException, module, methTOK, context, sig); + if (pException != nullptr) throw pException; +} - virtual int isCompatibleDelegate(void* objCls, void* methodParentCls, void* method, void* delegateCls, int* pfIsOpenDelegate) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->isCompatibleDelegate(_thisHandle, &pException, objCls, methodParentCls, method, delegateCls, pfIsOpenDelegate); - if (pException != nullptr) - throw pException; - return _ret; - } + virtual void* getTokenTypeAsHandle( + void* pResolvedToken) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getTokenTypeAsHandle(_thisHandle, &pException, pResolvedToken); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int isValidToken( + void* module, + unsigned metaTOK) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->isValidToken(_thisHandle, &pException, module, metaTOK); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int isValidStringRef( + void* module, + unsigned metaTOK) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->isValidStringRef(_thisHandle, &pException, module, metaTOK); + if (pException != nullptr) throw pException; + return temp; +} + + virtual const wchar_t* getStringLiteral( + void* module, + unsigned metaTOK, + int* length) +{ + CorInfoExceptionClass* pException = nullptr; + const wchar_t* temp = _callbacks->getStringLiteral(_thisHandle, &pException, module, metaTOK, length); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int asCorInfoType( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->asCorInfoType(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual const char* getClassName( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + const char* temp = _callbacks->getClassName(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual const char* getClassNameFromMetadata( + void* cls, + const char** namespaceName) +{ + CorInfoExceptionClass* pException = nullptr; + const char* temp = _callbacks->getClassNameFromMetadata(_thisHandle, &pException, cls, namespaceName); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* getTypeInstantiationArgument( + void* cls, + unsigned index) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getTypeInstantiationArgument(_thisHandle, &pException, cls, index); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int appendClassName( + wchar_t** ppBuf, + int* pnBufLen, + void* cls, + int fNamespace, + int fFullInst, + int fAssembly) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->appendClassName(_thisHandle, &pException, ppBuf, pnBufLen, cls, fNamespace, fFullInst, fAssembly); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int isValueClass( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->isValueClass(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int canInlineTypeCheck( + void* cls, + int source) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->canInlineTypeCheck(_thisHandle, &pException, cls, source); + if (pException != nullptr) throw pException; + return temp; +} + + virtual unsigned int getClassAttribs( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + unsigned int temp = _callbacks->getClassAttribs(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int isStructRequiringStackAllocRetBuf( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->isStructRequiringStackAllocRetBuf(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* getClassModule( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getClassModule(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* getModuleAssembly( + void* mod) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getModuleAssembly(_thisHandle, &pException, mod); + if (pException != nullptr) throw pException; + return temp; +} + + virtual const char* getAssemblyName( + void* assem) +{ + CorInfoExceptionClass* pException = nullptr; + const char* temp = _callbacks->getAssemblyName(_thisHandle, &pException, assem); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* LongLifetimeMalloc( + size_t sz) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->LongLifetimeMalloc(_thisHandle, &pException, sz); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void LongLifetimeFree( + void* obj) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->LongLifetimeFree(_thisHandle, &pException, obj); + if (pException != nullptr) throw pException; +} + + virtual size_t getClassModuleIdForStatics( + void* cls, + void* pModule, + void** ppIndirection) +{ + CorInfoExceptionClass* pException = nullptr; + size_t temp = _callbacks->getClassModuleIdForStatics(_thisHandle, &pException, cls, pModule, ppIndirection); + if (pException != nullptr) throw pException; + return temp; +} + + virtual unsigned getClassSize( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + unsigned temp = _callbacks->getClassSize(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual unsigned getHeapClassSize( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + unsigned temp = _callbacks->getHeapClassSize(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int canAllocateOnStack( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->canAllocateOnStack(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual unsigned getClassAlignmentRequirement( + void* cls, + int fDoubleAlignHint) +{ + CorInfoExceptionClass* pException = nullptr; + unsigned temp = _callbacks->getClassAlignmentRequirement(_thisHandle, &pException, cls, fDoubleAlignHint); + if (pException != nullptr) throw pException; + return temp; +} + + virtual unsigned getClassGClayout( + void* cls, + unsigned char* gcPtrs) +{ + CorInfoExceptionClass* pException = nullptr; + unsigned temp = _callbacks->getClassGClayout(_thisHandle, &pException, cls, gcPtrs); + if (pException != nullptr) throw pException; + return temp; +} + + virtual unsigned getClassNumInstanceFields( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + unsigned temp = _callbacks->getClassNumInstanceFields(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* getFieldInClass( + void* clsHnd, + int num) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getFieldInClass(_thisHandle, &pException, clsHnd, num); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int checkMethodModifier( + void* hMethod, + const char* modifier, + int fOptional) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->checkMethodModifier(_thisHandle, &pException, hMethod, modifier, fOptional); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int getNewHelper( + void* pResolvedToken, + void* callerHandle, + bool* pHasSideEffects) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->getNewHelper(_thisHandle, &pException, pResolvedToken, callerHandle, pHasSideEffects); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int getNewArrHelper( + void* arrayCls) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->getNewArrHelper(_thisHandle, &pException, arrayCls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int getCastingHelper( + void* pResolvedToken, + bool fThrowing) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->getCastingHelper(_thisHandle, &pException, pResolvedToken, fThrowing); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int getSharedCCtorHelper( + void* clsHnd) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->getSharedCCtorHelper(_thisHandle, &pException, clsHnd); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* getTypeForBox( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getTypeForBox(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int getBoxHelper( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->getBoxHelper(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int getUnBoxHelper( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->getUnBoxHelper(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual bool getReadyToRunHelper( + void* pResolvedToken, + void* pGenericLookupKind, + int id, + void* pLookup) +{ + CorInfoExceptionClass* pException = nullptr; + bool temp = _callbacks->getReadyToRunHelper(_thisHandle, &pException, pResolvedToken, pGenericLookupKind, id, pLookup); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void getReadyToRunDelegateCtorHelper( + void* pTargetMethod, + void* delegateType, + void* pLookup) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->getReadyToRunDelegateCtorHelper(_thisHandle, &pException, pTargetMethod, delegateType, pLookup); + if (pException != nullptr) throw pException; +} - virtual void methodMustBeLoadedBeforeCodeIsRun(void* method) - { - CorInfoException* pException = nullptr; - _callbacks->methodMustBeLoadedBeforeCodeIsRun(_thisHandle, &pException, method); - if (pException != nullptr) - throw pException; - } + virtual const char* getHelperName( + int helpFunc) +{ + CorInfoExceptionClass* pException = nullptr; + const char* temp = _callbacks->getHelperName(_thisHandle, &pException, helpFunc); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int initClass( + void* field, + void* method, + void* context) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->initClass(_thisHandle, &pException, field, method, context); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void classMustBeLoadedBeforeCodeIsRun( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->classMustBeLoadedBeforeCodeIsRun(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; +} - virtual void* mapMethodDeclToMethodImpl(void* method) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->mapMethodDeclToMethodImpl(_thisHandle, &pException, method); - if (pException != nullptr) - throw pException; - return _ret; - } + virtual void* getBuiltinClass( + int classId) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getBuiltinClass(_thisHandle, &pException, classId); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int getTypeForPrimitiveValueClass( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->getTypeForPrimitiveValueClass(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int getTypeForPrimitiveNumericClass( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->getTypeForPrimitiveNumericClass(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int canCast( + void* child, + void* parent) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->canCast(_thisHandle, &pException, child, parent); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int areTypesEquivalent( + void* cls1, + void* cls2) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->areTypesEquivalent(_thisHandle, &pException, cls1, cls2); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int compareTypesForCast( + void* fromClass, + void* toClass) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->compareTypesForCast(_thisHandle, &pException, fromClass, toClass); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int compareTypesForEquality( + void* cls1, + void* cls2) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->compareTypesForEquality(_thisHandle, &pException, cls1, cls2); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* mergeClasses( + void* cls1, + void* cls2) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->mergeClasses(_thisHandle, &pException, cls1, cls2); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int isMoreSpecificType( + void* cls1, + void* cls2) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->isMoreSpecificType(_thisHandle, &pException, cls1, cls2); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* getParentType( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getParentType(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int getChildType( + void* clsHnd, + void* clsRet) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->getChildType(_thisHandle, &pException, clsHnd, clsRet); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int satisfiesClassConstraints( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->satisfiesClassConstraints(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int isSDArray( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->isSDArray(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual unsigned getArrayRank( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + unsigned temp = _callbacks->getArrayRank(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* getArrayInitializationData( + void* field, + unsigned int size) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getArrayInitializationData(_thisHandle, &pException, field, size); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int canAccessClass( + void* pResolvedToken, + void* callerHandle, + void* pAccessHelper) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->canAccessClass(_thisHandle, &pException, pResolvedToken, callerHandle, pAccessHelper); + if (pException != nullptr) throw pException; + return temp; +} + + virtual const char* getFieldName( + void* ftn, + const char** moduleName) +{ + CorInfoExceptionClass* pException = nullptr; + const char* temp = _callbacks->getFieldName(_thisHandle, &pException, ftn, moduleName); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* getFieldClass( + void* field) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getFieldClass(_thisHandle, &pException, field); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int getFieldType( + void* field, + void* structType, + void* memberParent) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->getFieldType(_thisHandle, &pException, field, structType, memberParent); + if (pException != nullptr) throw pException; + return temp; +} + + virtual unsigned getFieldOffset( + void* field) +{ + CorInfoExceptionClass* pException = nullptr; + unsigned temp = _callbacks->getFieldOffset(_thisHandle, &pException, field); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void getFieldInfo( + void* pResolvedToken, + void* callerHandle, + int flags, + void* pResult) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->getFieldInfo(_thisHandle, &pException, pResolvedToken, callerHandle, flags, pResult); + if (pException != nullptr) throw pException; +} - virtual void getGSCookie(void* pCookieVal, void** ppCookieVal) - { - CorInfoException* pException = nullptr; - _callbacks->getGSCookie(_thisHandle, &pException, pCookieVal, ppCookieVal); - if (pException != nullptr) - throw pException; - } + virtual bool isFieldStatic( + void* fldHnd) +{ + CorInfoExceptionClass* pException = nullptr; + bool temp = _callbacks->isFieldStatic(_thisHandle, &pException, fldHnd); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void getBoundaries( + void* ftn, + unsigned int* cILOffsets, + unsigned int** pILOffsets, + void* implictBoundaries) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->getBoundaries(_thisHandle, &pException, ftn, cILOffsets, pILOffsets, implictBoundaries); + if (pException != nullptr) throw pException; +} + + virtual void setBoundaries( + void* ftn, + unsigned int cMap, + void* pMap) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->setBoundaries(_thisHandle, &pException, ftn, cMap, pMap); + if (pException != nullptr) throw pException; +} + + virtual void getVars( + void* ftn, + unsigned int* cVars, + void* vars, + bool* extendOthers) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->getVars(_thisHandle, &pException, ftn, cVars, vars, extendOthers); + if (pException != nullptr) throw pException; +} + + virtual void setVars( + void* ftn, + unsigned int cVars, + void* vars) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->setVars(_thisHandle, &pException, ftn, cVars, vars); + if (pException != nullptr) throw pException; +} - virtual void setPatchpointInfo(void* patchpointInfo) - { - CorInfoException* pException = nullptr; - _callbacks->setPatchpointInfo(_thisHandle, &pException, patchpointInfo); - if (pException != nullptr) - throw pException; - } + virtual void* allocateArray( + size_t cBytes) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->allocateArray(_thisHandle, &pException, cBytes); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void freeArray( + void* array) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->freeArray(_thisHandle, &pException, array); + if (pException != nullptr) throw pException; +} - virtual void* getOSRInfo(unsigned* ilOffset) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getOSRInfo(_thisHandle, &pException, ilOffset); - if (pException != nullptr) - throw pException; - return _ret; - } + virtual void* getArgNext( + void* args) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getArgNext(_thisHandle, &pException, args); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int getArgType( + void* sig, + void* args, + void* vcTypeRet) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->getArgType(_thisHandle, &pException, sig, args, vcTypeRet); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* getArgClass( + void* sig, + void* args) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getArgClass(_thisHandle, &pException, sig, args); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int getHFAType( + void* hClass) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->getHFAType(_thisHandle, &pException, hClass); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int GetErrorHRESULT( + void* pExceptionPointers) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->GetErrorHRESULT(_thisHandle, &pException, pExceptionPointers); + if (pException != nullptr) throw pException; + return temp; +} + + virtual unsigned int GetErrorMessage( + wchar_t* buffer, + unsigned int bufferLength) +{ + CorInfoExceptionClass* pException = nullptr; + unsigned int temp = _callbacks->GetErrorMessage(_thisHandle, &pException, buffer, bufferLength); + if (pException != nullptr) throw pException; + return temp; +} - virtual void resolveToken(void* pResolvedToken) - { - CorInfoException* pException = nullptr; - _callbacks->resolveToken(_thisHandle, &pException, pResolvedToken); - if (pException != nullptr) - throw pException; - } + virtual int FilterException( + void* pExceptionPointers); - virtual void tryResolveToken(void* pResolvedToken) - { - CorInfoException* pException = nullptr; - _callbacks->tryResolveToken(_thisHandle, &pException, pResolvedToken); - if (pException != nullptr) - throw pException; - } + virtual void HandleException( + void* pExceptionPointers); - virtual void findSig(void* module, unsigned sigTOK, void* context, void* sig) - { - CorInfoException* pException = nullptr; - _callbacks->findSig(_thisHandle, &pException, module, sigTOK, context, sig); - if (pException != nullptr) - throw pException; - } + virtual void ThrowExceptionForJitResult( + int result) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->ThrowExceptionForJitResult(_thisHandle, &pException, result); + if (pException != nullptr) throw pException; +} - virtual void findCallSiteSig(void* module, unsigned methTOK, void* context, void* sig) - { - CorInfoException* pException = nullptr; - _callbacks->findCallSiteSig(_thisHandle, &pException, module, methTOK, context, sig); - if (pException != nullptr) - throw pException; - } + virtual void ThrowExceptionForHelper( + const void* throwHelper) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->ThrowExceptionForHelper(_thisHandle, &pException, throwHelper); + if (pException != nullptr) throw pException; +} - virtual void* getTokenTypeAsHandle(void* pResolvedToken) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getTokenTypeAsHandle(_thisHandle, &pException, pResolvedToken); - if (pException != nullptr) - throw pException; - return _ret; - } + virtual bool runWithErrorTrap( + void* function, + void* parameter); - virtual int isValidToken(void* module, unsigned metaTOK) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->isValidToken(_thisHandle, &pException, module, metaTOK); - if (pException != nullptr) - throw pException; - return _ret; - } + virtual void getEEInfo( + void* pEEInfoOut) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->getEEInfo(_thisHandle, &pException, pEEInfoOut); + if (pException != nullptr) throw pException; +} - virtual int isValidStringRef(void* module, unsigned metaTOK) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->isValidStringRef(_thisHandle, &pException, module, metaTOK); - if (pException != nullptr) - throw pException; - return _ret; - } + virtual const wchar_t* getJitTimeLogFilename() +{ + CorInfoExceptionClass* pException = nullptr; + const wchar_t* temp = _callbacks->getJitTimeLogFilename(_thisHandle, &pException); + if (pException != nullptr) throw pException; + return temp; +} + + virtual unsigned int getMethodDefFromMethod( + void* hMethod) +{ + CorInfoExceptionClass* pException = nullptr; + unsigned int temp = _callbacks->getMethodDefFromMethod(_thisHandle, &pException, hMethod); + if (pException != nullptr) throw pException; + return temp; +} + + virtual const char* getMethodName( + void* ftn, + const char** moduleName) +{ + CorInfoExceptionClass* pException = nullptr; + const char* temp = _callbacks->getMethodName(_thisHandle, &pException, ftn, moduleName); + if (pException != nullptr) throw pException; + return temp; +} + + virtual const char* getMethodNameFromMetadata( + void* ftn, + const char** className, + const char** namespaceName, + const char** enclosingClassName) +{ + CorInfoExceptionClass* pException = nullptr; + const char* temp = _callbacks->getMethodNameFromMetadata(_thisHandle, &pException, ftn, className, namespaceName, enclosingClassName); + if (pException != nullptr) throw pException; + return temp; +} + + virtual unsigned getMethodHash( + void* ftn) +{ + CorInfoExceptionClass* pException = nullptr; + unsigned temp = _callbacks->getMethodHash(_thisHandle, &pException, ftn); + if (pException != nullptr) throw pException; + return temp; +} + + virtual size_t findNameOfToken( + void* moduleHandle, + unsigned int token, + char* szFQName, + size_t FQNameCapacity) +{ + CorInfoExceptionClass* pException = nullptr; + size_t temp = _callbacks->findNameOfToken(_thisHandle, &pException, moduleHandle, token, szFQName, FQNameCapacity); + if (pException != nullptr) throw pException; + return temp; +} + + virtual bool getSystemVAmd64PassStructInRegisterDescriptor( + void* structHnd, + void* structPassInRegDescPtr) +{ + CorInfoExceptionClass* pException = nullptr; + bool temp = _callbacks->getSystemVAmd64PassStructInRegisterDescriptor(_thisHandle, &pException, structHnd, structPassInRegDescPtr); + if (pException != nullptr) throw pException; + return temp; +} + + virtual unsigned int getThreadTLSIndex( + void** ppIndirection) +{ + CorInfoExceptionClass* pException = nullptr; + unsigned int temp = _callbacks->getThreadTLSIndex(_thisHandle, &pException, ppIndirection); + if (pException != nullptr) throw pException; + return temp; +} + + virtual const void* getInlinedCallFrameVptr( + void** ppIndirection) +{ + CorInfoExceptionClass* pException = nullptr; + const void* temp = _callbacks->getInlinedCallFrameVptr(_thisHandle, &pException, ppIndirection); + if (pException != nullptr) throw pException; + return temp; +} + + virtual long* getAddrOfCaptureThreadGlobal( + void** ppIndirection) +{ + CorInfoExceptionClass* pException = nullptr; + long* temp = _callbacks->getAddrOfCaptureThreadGlobal(_thisHandle, &pException, ppIndirection); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* getHelperFtn( + int ftnNum, + void** ppIndirection) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getHelperFtn(_thisHandle, &pException, ftnNum, ppIndirection); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void getFunctionEntryPoint( + void* ftn, + void* pResult, + int accessFlags) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->getFunctionEntryPoint(_thisHandle, &pException, ftn, pResult, accessFlags); + if (pException != nullptr) throw pException; +} + + virtual void getFunctionFixedEntryPoint( + void* ftn, + void* pResult) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->getFunctionFixedEntryPoint(_thisHandle, &pException, ftn, pResult); + if (pException != nullptr) throw pException; +} + + virtual void* getMethodSync( + void* ftn, + void** ppIndirection) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getMethodSync(_thisHandle, &pException, ftn, ppIndirection); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int getLazyStringLiteralHelper( + void* handle) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->getLazyStringLiteralHelper(_thisHandle, &pException, handle); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* embedModuleHandle( + void* handle, + void** ppIndirection) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->embedModuleHandle(_thisHandle, &pException, handle, ppIndirection); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* embedClassHandle( + void* handle, + void** ppIndirection) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->embedClassHandle(_thisHandle, &pException, handle, ppIndirection); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* embedMethodHandle( + void* handle, + void** ppIndirection) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->embedMethodHandle(_thisHandle, &pException, handle, ppIndirection); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* embedFieldHandle( + void* handle, + void** ppIndirection) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->embedFieldHandle(_thisHandle, &pException, handle, ppIndirection); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void embedGenericHandle( + void* pResolvedToken, + int fEmbedParent, + void* pResult) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->embedGenericHandle(_thisHandle, &pException, pResolvedToken, fEmbedParent, pResult); + if (pException != nullptr) throw pException; +} + + virtual void getLocationOfThisType( + void* context, + void* pLookupKind) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->getLocationOfThisType(_thisHandle, &pException, context, pLookupKind); + if (pException != nullptr) throw pException; +} + + virtual void getAddressOfPInvokeTarget( + void* method, + void* pLookup) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->getAddressOfPInvokeTarget(_thisHandle, &pException, method, pLookup); + if (pException != nullptr) throw pException; +} + + virtual void* GetCookieForPInvokeCalliSig( + void* szMetaSig, + void** ppIndirection) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->GetCookieForPInvokeCalliSig(_thisHandle, &pException, szMetaSig, ppIndirection); + if (pException != nullptr) throw pException; + return temp; +} + + virtual bool canGetCookieForPInvokeCalliSig( + void* szMetaSig) +{ + CorInfoExceptionClass* pException = nullptr; + bool temp = _callbacks->canGetCookieForPInvokeCalliSig(_thisHandle, &pException, szMetaSig); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* getJustMyCodeHandle( + void* method, + void** ppIndirection) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getJustMyCodeHandle(_thisHandle, &pException, method, ppIndirection); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void GetProfilingHandle( + int* pbHookFunction, + void** pProfilerHandle, + int* pbIndirectedHandles) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->GetProfilingHandle(_thisHandle, &pException, pbHookFunction, pProfilerHandle, pbIndirectedHandles); + if (pException != nullptr) throw pException; +} + + virtual void getCallInfo( + void* pResolvedToken, + void* pConstrainedResolvedToken, + void* callerHandle, + int flags, + void* pResult) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->getCallInfo(_thisHandle, &pException, pResolvedToken, pConstrainedResolvedToken, callerHandle, flags, pResult); + if (pException != nullptr) throw pException; +} + + virtual int canAccessFamily( + void* hCaller, + void* hInstanceType) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->canAccessFamily(_thisHandle, &pException, hCaller, hInstanceType); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int isRIDClassDomainID( + void* cls) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->isRIDClassDomainID(_thisHandle, &pException, cls); + if (pException != nullptr) throw pException; + return temp; +} + + virtual unsigned getClassDomainID( + void* cls, + void** ppIndirection) +{ + CorInfoExceptionClass* pException = nullptr; + unsigned temp = _callbacks->getClassDomainID(_thisHandle, &pException, cls, ppIndirection); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* getFieldAddress( + void* field, + void** ppIndirection) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getFieldAddress(_thisHandle, &pException, field, ppIndirection); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* getStaticFieldCurrentClass( + void* field, + bool* pIsSpeculative) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getStaticFieldCurrentClass(_thisHandle, &pException, field, pIsSpeculative); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* getVarArgsHandle( + void* pSig, + void** ppIndirection) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getVarArgsHandle(_thisHandle, &pException, pSig, ppIndirection); + if (pException != nullptr) throw pException; + return temp; +} + + virtual bool canGetVarArgsHandle( + void* pSig) +{ + CorInfoExceptionClass* pException = nullptr; + bool temp = _callbacks->canGetVarArgsHandle(_thisHandle, &pException, pSig); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int constructStringLiteral( + void* module, + unsigned int metaTok, + void** ppValue) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->constructStringLiteral(_thisHandle, &pException, module, metaTok, ppValue); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int emptyStringLiteral( + void** ppValue) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->emptyStringLiteral(_thisHandle, &pException, ppValue); + if (pException != nullptr) throw pException; + return temp; +} + + virtual unsigned int getFieldThreadLocalStoreID( + void* field, + void** ppIndirection) +{ + CorInfoExceptionClass* pException = nullptr; + unsigned int temp = _callbacks->getFieldThreadLocalStoreID(_thisHandle, &pException, field, ppIndirection); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void setOverride( + void* pOverride, + void* currentMethod) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->setOverride(_thisHandle, &pException, pOverride, currentMethod); + if (pException != nullptr) throw pException; +} + + virtual void addActiveDependency( + void* moduleFrom, + void* moduleTo) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->addActiveDependency(_thisHandle, &pException, moduleFrom, moduleTo); + if (pException != nullptr) throw pException; +} + + virtual void* GetDelegateCtor( + void* methHnd, + void* clsHnd, + void* targetMethodHnd, + void* pCtorData) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->GetDelegateCtor(_thisHandle, &pException, methHnd, clsHnd, targetMethodHnd, pCtorData); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void MethodCompileComplete( + void* methHnd) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->MethodCompileComplete(_thisHandle, &pException, methHnd); + if (pException != nullptr) throw pException; +} + + virtual bool getTailCallHelpers( + void* callToken, + void* sig, + int flags, + void* pResult) +{ + CorInfoExceptionClass* pException = nullptr; + bool temp = _callbacks->getTailCallHelpers(_thisHandle, &pException, callToken, sig, flags, pResult); + if (pException != nullptr) throw pException; + return temp; +} + + virtual bool convertPInvokeCalliToCall( + void* pResolvedToken, + bool mustConvert) +{ + CorInfoExceptionClass* pException = nullptr; + bool temp = _callbacks->convertPInvokeCalliToCall(_thisHandle, &pException, pResolvedToken, mustConvert); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void notifyInstructionSetUsage( + int instructionSet, + bool supportEnabled) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->notifyInstructionSetUsage(_thisHandle, &pException, instructionSet, supportEnabled); + if (pException != nullptr) throw pException; +} + + virtual void allocMem( + unsigned int hotCodeSize, + unsigned int coldCodeSize, + unsigned int roDataSize, + unsigned int xcptnsCount, + int flag, + void** hotCodeBlock, + void** coldCodeBlock, + void** roDataBlock) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->allocMem(_thisHandle, &pException, hotCodeSize, coldCodeSize, roDataSize, xcptnsCount, flag, hotCodeBlock, coldCodeBlock, roDataBlock); + if (pException != nullptr) throw pException; +} + + virtual void reserveUnwindInfo( + int isFunclet, + int isColdCode, + unsigned int unwindSize) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->reserveUnwindInfo(_thisHandle, &pException, isFunclet, isColdCode, unwindSize); + if (pException != nullptr) throw pException; +} + + virtual void allocUnwindInfo( + unsigned char* pHotCode, + unsigned char* pColdCode, + unsigned int startOffset, + unsigned int endOffset, + unsigned int unwindSize, + unsigned char* pUnwindBlock, + int funcKind) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->allocUnwindInfo(_thisHandle, &pException, pHotCode, pColdCode, startOffset, endOffset, unwindSize, pUnwindBlock, funcKind); + if (pException != nullptr) throw pException; +} - virtual const wchar_t* getStringLiteral(void* module, unsigned metaTOK, int* length) - { - CorInfoException* pException = nullptr; - const wchar_t* _ret = _callbacks->getStringLiteral(_thisHandle, &pException, module, metaTOK, length); - if (pException != nullptr) - throw pException; - return _ret; - } + virtual void* allocGCInfo( + size_t size) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->allocGCInfo(_thisHandle, &pException, size); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void setEHcount( + unsigned cEH) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->setEHcount(_thisHandle, &pException, cEH); + if (pException != nullptr) throw pException; +} + + virtual void setEHinfo( + unsigned EHnumber, + void* clause) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->setEHinfo(_thisHandle, &pException, EHnumber, clause); + if (pException != nullptr) throw pException; +} + + virtual int logMsg( + unsigned level, + const char* fmt, + va_list args) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->logMsg(_thisHandle, &pException, level, fmt, args); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int doAssert( + const char* szFile, + int iLine, + const char* szExpr) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->doAssert(_thisHandle, &pException, szFile, iLine, szExpr); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void reportFatalError( + int result) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->reportFatalError(_thisHandle, &pException, result); + if (pException != nullptr) throw pException; +} + + virtual int allocMethodBlockCounts( + unsigned int count, + void** pBlockCounts) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->allocMethodBlockCounts(_thisHandle, &pException, count, pBlockCounts); + if (pException != nullptr) throw pException; + return temp; +} + + virtual int getMethodBlockCounts( + void* ftnHnd, + unsigned int* pCount, + void** pBlockCounts, + unsigned int* pNumRuns) +{ + CorInfoExceptionClass* pException = nullptr; + int temp = _callbacks->getMethodBlockCounts(_thisHandle, &pException, ftnHnd, pCount, pBlockCounts, pNumRuns); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void* getLikelyClass( + void* ftnHnd, + void* baseHnd, + unsigned int ilOffset, + unsigned int* pLikelihood, + unsigned int* pNumberOfClasses) +{ + CorInfoExceptionClass* pException = nullptr; + void* temp = _callbacks->getLikelyClass(_thisHandle, &pException, ftnHnd, baseHnd, ilOffset, pLikelihood, pNumberOfClasses); + if (pException != nullptr) throw pException; + return temp; +} + + virtual void recordCallSite( + unsigned int instrOffset, + void* callSig, + void* methodHandle) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->recordCallSite(_thisHandle, &pException, instrOffset, callSig, methodHandle); + if (pException != nullptr) throw pException; +} + + virtual void recordRelocation( + void* location, + void* target, + unsigned short fRelocType, + unsigned short slotNum, + int addlDelta) +{ + CorInfoExceptionClass* pException = nullptr; + _callbacks->recordRelocation(_thisHandle, &pException, location, target, fRelocType, slotNum, addlDelta); + if (pException != nullptr) throw pException; +} - virtual int asCorInfoType(void* cls) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->asCorInfoType(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual const char* getClassName(void* cls) - { - CorInfoException* pException = nullptr; - const char* _ret = _callbacks->getClassName(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual const char* getClassNameFromMetadata(void* cls, const char** namespaceName) - { - CorInfoException* pException = nullptr; - const char* _ret = _callbacks->getClassNameFromMetadata(_thisHandle, &pException, cls, namespaceName); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* getTypeInstantiationArgument(void* cls, unsigned index) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getTypeInstantiationArgument(_thisHandle, &pException, cls, index); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int appendClassName(wchar_t** ppBuf, int* pnBufLen, void* cls, int fNamespace, int fFullInst, int fAssembly) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->appendClassName(_thisHandle, &pException, ppBuf, pnBufLen, cls, fNamespace, fFullInst, fAssembly); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int isValueClass(void* cls) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->isValueClass(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int canInlineTypeCheck(void* cls, int source) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->canInlineTypeCheck(_thisHandle, &pException, cls, source); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual unsigned int getClassAttribs(void* cls) - { - CorInfoException* pException = nullptr; - unsigned int _ret = _callbacks->getClassAttribs(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int isStructRequiringStackAllocRetBuf(void* cls) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->isStructRequiringStackAllocRetBuf(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* getClassModule(void* cls) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getClassModule(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* getModuleAssembly(void* mod) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getModuleAssembly(_thisHandle, &pException, mod); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual const char* getAssemblyName(void* assem) - { - CorInfoException* pException = nullptr; - const char* _ret = _callbacks->getAssemblyName(_thisHandle, &pException, assem); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* LongLifetimeMalloc(size_t sz) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->LongLifetimeMalloc(_thisHandle, &pException, sz); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void LongLifetimeFree(void* obj) - { - CorInfoException* pException = nullptr; - _callbacks->LongLifetimeFree(_thisHandle, &pException, obj); - if (pException != nullptr) - throw pException; - } - - virtual size_t getClassModuleIdForStatics(void* cls, void* pModule, void** ppIndirection) - { - CorInfoException* pException = nullptr; - size_t _ret = _callbacks->getClassModuleIdForStatics(_thisHandle, &pException, cls, pModule, ppIndirection); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual unsigned getClassSize(void* cls) - { - CorInfoException* pException = nullptr; - unsigned _ret = _callbacks->getClassSize(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual unsigned getHeapClassSize(void* cls) - { - CorInfoException* pException = nullptr; - unsigned _ret = _callbacks->getHeapClassSize(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int canAllocateOnStack(void* cls) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->canAllocateOnStack(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual unsigned getClassAlignmentRequirement(void* cls, int fDoubleAlignHint) - { - CorInfoException* pException = nullptr; - unsigned _ret = _callbacks->getClassAlignmentRequirement(_thisHandle, &pException, cls, fDoubleAlignHint); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual unsigned getClassGClayout(void* cls, unsigned char* gcPtrs) - { - CorInfoException* pException = nullptr; - unsigned _ret = _callbacks->getClassGClayout(_thisHandle, &pException, cls, gcPtrs); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual unsigned getClassNumInstanceFields(void* cls) - { - CorInfoException* pException = nullptr; - unsigned _ret = _callbacks->getClassNumInstanceFields(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* getFieldInClass(void* clsHnd, int num) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getFieldInClass(_thisHandle, &pException, clsHnd, num); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int checkMethodModifier(void* hMethod, const char* modifier, int fOptional) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->checkMethodModifier(_thisHandle, &pException, hMethod, modifier, fOptional); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int getNewHelper(void* pResolvedToken, void* callerHandle, bool* pHasSideEffects) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->getNewHelper(_thisHandle, &pException, pResolvedToken, callerHandle, pHasSideEffects); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int getNewArrHelper(void* arrayCls) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->getNewArrHelper(_thisHandle, &pException, arrayCls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int getCastingHelper(void* pResolvedToken, bool fThrowing) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->getCastingHelper(_thisHandle, &pException, pResolvedToken, fThrowing); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int getSharedCCtorHelper(void* clsHnd) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->getSharedCCtorHelper(_thisHandle, &pException, clsHnd); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* getTypeForBox(void* cls) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getTypeForBox(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int getBoxHelper(void* cls) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->getBoxHelper(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int getUnBoxHelper(void* cls) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->getUnBoxHelper(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual bool getReadyToRunHelper(void* pResolvedToken, void* pGenericLookupKind, int id, void* pLookup) - { - CorInfoException* pException = nullptr; - bool _ret = _callbacks->getReadyToRunHelper(_thisHandle, &pException, pResolvedToken, pGenericLookupKind, id, pLookup); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void getReadyToRunDelegateCtorHelper(void* pTargetMethod, void* delegateType, void* pLookup) - { - CorInfoException* pException = nullptr; - _callbacks->getReadyToRunDelegateCtorHelper(_thisHandle, &pException, pTargetMethod, delegateType, pLookup); - if (pException != nullptr) - throw pException; - } - - virtual const char* getHelperName(int helpFunc) - { - CorInfoException* pException = nullptr; - const char* _ret = _callbacks->getHelperName(_thisHandle, &pException, helpFunc); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int initClass(void* field, void* method, void* context) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->initClass(_thisHandle, &pException, field, method, context); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void classMustBeLoadedBeforeCodeIsRun(void* cls) - { - CorInfoException* pException = nullptr; - _callbacks->classMustBeLoadedBeforeCodeIsRun(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - } - - virtual void* getBuiltinClass(int classId) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getBuiltinClass(_thisHandle, &pException, classId); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int getTypeForPrimitiveValueClass(void* cls) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->getTypeForPrimitiveValueClass(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int getTypeForPrimitiveNumericClass(void* cls) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->getTypeForPrimitiveNumericClass(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int canCast(void* child, void* parent) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->canCast(_thisHandle, &pException, child, parent); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int areTypesEquivalent(void* cls1, void* cls2) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->areTypesEquivalent(_thisHandle, &pException, cls1, cls2); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int compareTypesForCast(void* fromClass, void* toClass) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->compareTypesForCast(_thisHandle, &pException, fromClass, toClass); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int compareTypesForEquality(void* cls1, void* cls2) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->compareTypesForEquality(_thisHandle, &pException, cls1, cls2); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* mergeClasses(void* cls1, void* cls2) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->mergeClasses(_thisHandle, &pException, cls1, cls2); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int isMoreSpecificType(void* cls1, void* cls2) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->isMoreSpecificType(_thisHandle, &pException, cls1, cls2); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* getParentType(void* cls) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getParentType(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int getChildType(void* clsHnd, void* clsRet) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->getChildType(_thisHandle, &pException, clsHnd, clsRet); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int satisfiesClassConstraints(void* cls) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->satisfiesClassConstraints(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int isSDArray(void* cls) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->isSDArray(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual unsigned getArrayRank(void* cls) - { - CorInfoException* pException = nullptr; - unsigned _ret = _callbacks->getArrayRank(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* getArrayInitializationData(void* field, unsigned int size) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getArrayInitializationData(_thisHandle, &pException, field, size); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int canAccessClass(void* pResolvedToken, void* callerHandle, void* pAccessHelper) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->canAccessClass(_thisHandle, &pException, pResolvedToken, callerHandle, pAccessHelper); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual const char* getFieldName(void* ftn, const char** moduleName) - { - CorInfoException* pException = nullptr; - const char* _ret = _callbacks->getFieldName(_thisHandle, &pException, ftn, moduleName); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* getFieldClass(void* field) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getFieldClass(_thisHandle, &pException, field); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int getFieldType(void* field, void* structType, void* memberParent) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->getFieldType(_thisHandle, &pException, field, structType, memberParent); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual unsigned getFieldOffset(void* field) - { - CorInfoException* pException = nullptr; - unsigned _ret = _callbacks->getFieldOffset(_thisHandle, &pException, field); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void getFieldInfo(void* pResolvedToken, void* callerHandle, int flags, void* pResult) - { - CorInfoException* pException = nullptr; - _callbacks->getFieldInfo(_thisHandle, &pException, pResolvedToken, callerHandle, flags, pResult); - if (pException != nullptr) - throw pException; - } - - virtual bool isFieldStatic(void* fldHnd) - { - CorInfoException* pException = nullptr; - bool _ret = _callbacks->isFieldStatic(_thisHandle, &pException, fldHnd); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void getBoundaries(void* ftn, unsigned int* cILOffsets, unsigned int** pILOffsets, void* implictBoundaries) - { - CorInfoException* pException = nullptr; - _callbacks->getBoundaries(_thisHandle, &pException, ftn, cILOffsets, pILOffsets, implictBoundaries); - if (pException != nullptr) - throw pException; - } - - virtual void setBoundaries(void* ftn, unsigned int cMap, void* pMap) - { - CorInfoException* pException = nullptr; - _callbacks->setBoundaries(_thisHandle, &pException, ftn, cMap, pMap); - if (pException != nullptr) - throw pException; - } - - virtual void getVars(void* ftn, unsigned int* cVars, void* vars, bool* extendOthers) - { - CorInfoException* pException = nullptr; - _callbacks->getVars(_thisHandle, &pException, ftn, cVars, vars, extendOthers); - if (pException != nullptr) - throw pException; - } - - virtual void setVars(void* ftn, unsigned int cVars, void* vars) - { - CorInfoException* pException = nullptr; - _callbacks->setVars(_thisHandle, &pException, ftn, cVars, vars); - if (pException != nullptr) - throw pException; - } - - virtual void* allocateArray(size_t cBytes) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->allocateArray(_thisHandle, &pException, cBytes); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void freeArray(void* array) - { - CorInfoException* pException = nullptr; - _callbacks->freeArray(_thisHandle, &pException, array); - if (pException != nullptr) - throw pException; - } - - virtual void* getArgNext(void* args) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getArgNext(_thisHandle, &pException, args); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int getArgType(void* sig, void* args, void* vcTypeRet) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->getArgType(_thisHandle, &pException, sig, args, vcTypeRet); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* getArgClass(void* sig, void* args) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getArgClass(_thisHandle, &pException, sig, args); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int getHFAType(void* hClass) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->getHFAType(_thisHandle, &pException, hClass); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int GetErrorHRESULT(void* pExceptionPointers) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->GetErrorHRESULT(_thisHandle, &pException, pExceptionPointers); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual unsigned int GetErrorMessage(wchar_t* buffer, unsigned int bufferLength) - { - CorInfoException* pException = nullptr; - unsigned int _ret = _callbacks->GetErrorMessage(_thisHandle, &pException, buffer, bufferLength); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int FilterException(void* pExceptionPointers); - virtual void HandleException(void* pExceptionPointers); - virtual void ThrowExceptionForJitResult(int result) - { - CorInfoException* pException = nullptr; - _callbacks->ThrowExceptionForJitResult(_thisHandle, &pException, result); - if (pException != nullptr) - throw pException; - } - - virtual void ThrowExceptionForHelper(const void* throwHelper) - { - CorInfoException* pException = nullptr; - _callbacks->ThrowExceptionForHelper(_thisHandle, &pException, throwHelper); - if (pException != nullptr) - throw pException; - } - - virtual bool runWithErrorTrap(void* function, void* parameter); - virtual void getEEInfo(void* pEEInfoOut) - { - CorInfoException* pException = nullptr; - _callbacks->getEEInfo(_thisHandle, &pException, pEEInfoOut); - if (pException != nullptr) - throw pException; - } - - virtual const wchar_t* getJitTimeLogFilename() - { - CorInfoException* pException = nullptr; - const wchar_t* _ret = _callbacks->getJitTimeLogFilename(_thisHandle, &pException); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual unsigned int getMethodDefFromMethod(void* hMethod) - { - CorInfoException* pException = nullptr; - unsigned int _ret = _callbacks->getMethodDefFromMethod(_thisHandle, &pException, hMethod); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual const char* getMethodName(void* ftn, const char** moduleName) - { - CorInfoException* pException = nullptr; - const char* _ret = _callbacks->getMethodName(_thisHandle, &pException, ftn, moduleName); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual const char* getMethodNameFromMetadata(void* ftn, const char** className, const char** namespaceName, const char** enclosingClassName) - { - CorInfoException* pException = nullptr; - const char* _ret = _callbacks->getMethodNameFromMetadata(_thisHandle, &pException, ftn, className, namespaceName, enclosingClassName); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual unsigned getMethodHash(void* ftn) - { - CorInfoException* pException = nullptr; - unsigned _ret = _callbacks->getMethodHash(_thisHandle, &pException, ftn); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual size_t findNameOfToken(void* moduleHandle, unsigned int token, char* szFQName, size_t FQNameCapacity) - { - CorInfoException* pException = nullptr; - size_t _ret = _callbacks->findNameOfToken(_thisHandle, &pException, moduleHandle, token, szFQName, FQNameCapacity); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual bool getSystemVAmd64PassStructInRegisterDescriptor(void* structHnd, void* structPassInRegDescPtr) - { - CorInfoException* pException = nullptr; - bool _ret = _callbacks->getSystemVAmd64PassStructInRegisterDescriptor(_thisHandle, &pException, structHnd, structPassInRegDescPtr); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual unsigned int getThreadTLSIndex(void** ppIndirection) - { - CorInfoException* pException = nullptr; - unsigned int _ret = _callbacks->getThreadTLSIndex(_thisHandle, &pException, ppIndirection); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual const void* getInlinedCallFrameVptr(void** ppIndirection) - { - CorInfoException* pException = nullptr; - const void* _ret = _callbacks->getInlinedCallFrameVptr(_thisHandle, &pException, ppIndirection); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual long* getAddrOfCaptureThreadGlobal(void** ppIndirection) - { - CorInfoException* pException = nullptr; - long* _ret = _callbacks->getAddrOfCaptureThreadGlobal(_thisHandle, &pException, ppIndirection); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* getHelperFtn(int ftnNum, void** ppIndirection) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getHelperFtn(_thisHandle, &pException, ftnNum, ppIndirection); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void getFunctionEntryPoint(void* ftn, void* pResult, int accessFlags) - { - CorInfoException* pException = nullptr; - _callbacks->getFunctionEntryPoint(_thisHandle, &pException, ftn, pResult, accessFlags); - if (pException != nullptr) - throw pException; - } - - virtual void getFunctionFixedEntryPoint(void* ftn, void* pResult) - { - CorInfoException* pException = nullptr; - _callbacks->getFunctionFixedEntryPoint(_thisHandle, &pException, ftn, pResult); - if (pException != nullptr) - throw pException; - } - - virtual void* getMethodSync(void* ftn, void** ppIndirection) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getMethodSync(_thisHandle, &pException, ftn, ppIndirection); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int getLazyStringLiteralHelper(void* handle) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->getLazyStringLiteralHelper(_thisHandle, &pException, handle); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* embedModuleHandle(void* handle, void** ppIndirection) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->embedModuleHandle(_thisHandle, &pException, handle, ppIndirection); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* embedClassHandle(void* handle, void** ppIndirection) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->embedClassHandle(_thisHandle, &pException, handle, ppIndirection); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* embedMethodHandle(void* handle, void** ppIndirection) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->embedMethodHandle(_thisHandle, &pException, handle, ppIndirection); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* embedFieldHandle(void* handle, void** ppIndirection) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->embedFieldHandle(_thisHandle, &pException, handle, ppIndirection); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void embedGenericHandle(void* pResolvedToken, int fEmbedParent, void* pResult) - { - CorInfoException* pException = nullptr; - _callbacks->embedGenericHandle(_thisHandle, &pException, pResolvedToken, fEmbedParent, pResult); - if (pException != nullptr) - throw pException; - } - - virtual void getLocationOfThisType(void* context, void* pLookupKind) - { - CorInfoException* pException = nullptr; - _callbacks->getLocationOfThisType(_thisHandle, &pException, context, pLookupKind); - if (pException != nullptr) - throw pException; - } - - virtual void getAddressOfPInvokeTarget(void* method, void* pLookup) - { - CorInfoException* pException = nullptr; - _callbacks->getAddressOfPInvokeTarget(_thisHandle, &pException, method, pLookup); - if (pException != nullptr) - throw pException; - } - - virtual void* GetCookieForPInvokeCalliSig(void* szMetaSig, void** ppIndirection) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->GetCookieForPInvokeCalliSig(_thisHandle, &pException, szMetaSig, ppIndirection); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual bool canGetCookieForPInvokeCalliSig(void* szMetaSig) - { - CorInfoException* pException = nullptr; - bool _ret = _callbacks->canGetCookieForPInvokeCalliSig(_thisHandle, &pException, szMetaSig); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* getJustMyCodeHandle(void* method, void** ppIndirection) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getJustMyCodeHandle(_thisHandle, &pException, method, ppIndirection); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void GetProfilingHandle(int* pbHookFunction, void** pProfilerHandle, int* pbIndirectedHandles) - { - CorInfoException* pException = nullptr; - _callbacks->GetProfilingHandle(_thisHandle, &pException, pbHookFunction, pProfilerHandle, pbIndirectedHandles); - if (pException != nullptr) - throw pException; - } - - virtual void getCallInfo(void* pResolvedToken, void* pConstrainedResolvedToken, void* callerHandle, int flags, void* pResult) - { - CorInfoException* pException = nullptr; - _callbacks->getCallInfo(_thisHandle, &pException, pResolvedToken, pConstrainedResolvedToken, callerHandle, flags, pResult); - if (pException != nullptr) - throw pException; - } - - virtual int canAccessFamily(void* hCaller, void* hInstanceType) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->canAccessFamily(_thisHandle, &pException, hCaller, hInstanceType); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int isRIDClassDomainID(void* cls) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->isRIDClassDomainID(_thisHandle, &pException, cls); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual unsigned getClassDomainID(void* cls, void** ppIndirection) - { - CorInfoException* pException = nullptr; - unsigned _ret = _callbacks->getClassDomainID(_thisHandle, &pException, cls, ppIndirection); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* getFieldAddress(void* field, void** ppIndirection) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getFieldAddress(_thisHandle, &pException, field, ppIndirection); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* getStaticFieldCurrentClass(void* field, bool* pIsSpeculative) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getStaticFieldCurrentClass(_thisHandle, &pException, field, pIsSpeculative); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* getVarArgsHandle(void* pSig, void** ppIndirection) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getVarArgsHandle(_thisHandle, &pException, pSig, ppIndirection); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual bool canGetVarArgsHandle(void* pSig) - { - CorInfoException* pException = nullptr; - bool _ret = _callbacks->canGetVarArgsHandle(_thisHandle, &pException, pSig); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int constructStringLiteral(void* module, unsigned int metaTok, void** ppValue) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->constructStringLiteral(_thisHandle, &pException, module, metaTok, ppValue); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int emptyStringLiteral(void** ppValue) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->emptyStringLiteral(_thisHandle, &pException, ppValue); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual unsigned int getFieldThreadLocalStoreID(void* field, void** ppIndirection) - { - CorInfoException* pException = nullptr; - unsigned int _ret = _callbacks->getFieldThreadLocalStoreID(_thisHandle, &pException, field, ppIndirection); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void setOverride(void* pOverride, void* currentMethod) - { - CorInfoException* pException = nullptr; - _callbacks->setOverride(_thisHandle, &pException, pOverride, currentMethod); - if (pException != nullptr) - throw pException; - } - - virtual void addActiveDependency(void* moduleFrom, void* moduleTo) - { - CorInfoException* pException = nullptr; - _callbacks->addActiveDependency(_thisHandle, &pException, moduleFrom, moduleTo); - if (pException != nullptr) - throw pException; - } - - virtual void* GetDelegateCtor(void* methHnd, void* clsHnd, void* targetMethodHnd, void* pCtorData) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->GetDelegateCtor(_thisHandle, &pException, methHnd, clsHnd, targetMethodHnd, pCtorData); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void MethodCompileComplete(void* methHnd) - { - CorInfoException* pException = nullptr; - _callbacks->MethodCompileComplete(_thisHandle, &pException, methHnd); - if (pException != nullptr) - throw pException; - } - - virtual bool getTailCallHelpers(void* callToken, void* sig, int flags, void* pResult) - { - CorInfoException* pException = nullptr; - bool _ret = _callbacks->getTailCallHelpers(_thisHandle, &pException, callToken, sig, flags, pResult); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual bool convertPInvokeCalliToCall(void* pResolvedToken, bool mustConvert) - { - CorInfoException* pException = nullptr; - bool _ret = _callbacks->convertPInvokeCalliToCall(_thisHandle, &pException, pResolvedToken, mustConvert); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void notifyInstructionSetUsage(int instructionSet, bool supportEnabled) - { - CorInfoException* pException = nullptr; - _callbacks->notifyInstructionSetUsage(_thisHandle, &pException, instructionSet, supportEnabled); - if (pException != nullptr) - throw pException; - } - - virtual void allocMem(unsigned int hotCodeSize, unsigned int coldCodeSize, unsigned int roDataSize, unsigned int xcptnsCount, int flag, void** hotCodeBlock, void** coldCodeBlock, void** roDataBlock) - { - CorInfoException* pException = nullptr; - _callbacks->allocMem(_thisHandle, &pException, hotCodeSize, coldCodeSize, roDataSize, xcptnsCount, flag, hotCodeBlock, coldCodeBlock, roDataBlock); - if (pException != nullptr) - throw pException; - } - - virtual void reserveUnwindInfo(int isFunclet, int isColdCode, unsigned int unwindSize) - { - CorInfoException* pException = nullptr; - _callbacks->reserveUnwindInfo(_thisHandle, &pException, isFunclet, isColdCode, unwindSize); - if (pException != nullptr) - throw pException; - } - - virtual void allocUnwindInfo(unsigned char* pHotCode, unsigned char* pColdCode, unsigned int startOffset, unsigned int endOffset, unsigned int unwindSize, unsigned char* pUnwindBlock, int funcKind) - { - CorInfoException* pException = nullptr; - _callbacks->allocUnwindInfo(_thisHandle, &pException, pHotCode, pColdCode, startOffset, endOffset, unwindSize, pUnwindBlock, funcKind); - if (pException != nullptr) - throw pException; - } - - virtual void* allocGCInfo(size_t size) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->allocGCInfo(_thisHandle, &pException, size); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void setEHcount(unsigned cEH) - { - CorInfoException* pException = nullptr; - _callbacks->setEHcount(_thisHandle, &pException, cEH); - if (pException != nullptr) - throw pException; - } - - virtual void setEHinfo(unsigned EHnumber, void* clause) - { - CorInfoException* pException = nullptr; - _callbacks->setEHinfo(_thisHandle, &pException, EHnumber, clause); - if (pException != nullptr) - throw pException; - } - - virtual int logMsg(unsigned level, const char* fmt, va_list args) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->logMsg(_thisHandle, &pException, level, fmt, args); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int doAssert(const char* szFile, int iLine, const char* szExpr) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->doAssert(_thisHandle, &pException, szFile, iLine, szExpr); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void reportFatalError(int result) - { - CorInfoException* pException = nullptr; - _callbacks->reportFatalError(_thisHandle, &pException, result); - if (pException != nullptr) - throw pException; - } - - virtual int allocMethodBlockCounts(unsigned int count, void** pBlockCounts) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->allocMethodBlockCounts(_thisHandle, &pException, count, pBlockCounts); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual int getMethodBlockCounts(void* ftnHnd, unsigned int* pCount, void** pBlockCounts, unsigned int* pNumRuns) - { - CorInfoException* pException = nullptr; - int _ret = _callbacks->getMethodBlockCounts(_thisHandle, &pException, ftnHnd, pCount, pBlockCounts, pNumRuns); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void* getLikelyClass(void* ftnHnd, void* baseHnd, unsigned int ilOffset, unsigned int* pLikelihood, unsigned int* pNumberOfClasses) - { - CorInfoException* pException = nullptr; - void* _ret = _callbacks->getLikelyClass(_thisHandle, &pException, ftnHnd, baseHnd, ilOffset, pLikelihood, pNumberOfClasses); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual void recordCallSite(unsigned int instrOffset, void* callSig, void* methodHandle) - { - CorInfoException* pException = nullptr; - _callbacks->recordCallSite(_thisHandle, &pException, instrOffset, callSig, methodHandle); - if (pException != nullptr) - throw pException; - } - - virtual void recordRelocation(void* location, void* target, unsigned short fRelocType, unsigned short slotNum, int addlDelta) - { - CorInfoException* pException = nullptr; - _callbacks->recordRelocation(_thisHandle, &pException, location, target, fRelocType, slotNum, addlDelta); - if (pException != nullptr) - throw pException; - } - - virtual unsigned short getRelocTypeHint(void* target) - { - CorInfoException* pException = nullptr; - unsigned short _ret = _callbacks->getRelocTypeHint(_thisHandle, &pException, target); - if (pException != nullptr) - throw pException; - return _ret; - } + virtual unsigned short getRelocTypeHint( + void* target) +{ + CorInfoExceptionClass* pException = nullptr; + unsigned short temp = _callbacks->getRelocTypeHint(_thisHandle, &pException, target); + if (pException != nullptr) throw pException; + return temp; +} virtual unsigned int getExpectedTargetArchitecture() - { - CorInfoException* pException = nullptr; - unsigned int _ret = _callbacks->getExpectedTargetArchitecture(_thisHandle, &pException); - if (pException != nullptr) - throw pException; - return _ret; - } - - virtual unsigned int getJitFlags(void* flags, unsigned int sizeInBytes) - { - CorInfoException* pException = nullptr; - unsigned int _ret = _callbacks->getJitFlags(_thisHandle, &pException, flags, sizeInBytes); - if (pException != nullptr) - throw pException; - return _ret; - } - +{ + CorInfoExceptionClass* pException = nullptr; + unsigned int temp = _callbacks->getExpectedTargetArchitecture(_thisHandle, &pException); + if (pException != nullptr) throw pException; + return temp; +} + + virtual unsigned int getJitFlags( + void* flags, + unsigned int sizeInBytes) +{ + CorInfoExceptionClass* pException = nullptr; + unsigned int temp = _callbacks->getJitFlags(_thisHandle, &pException, flags, sizeInBytes); + if (pException != nullptr) throw pException; + return temp; +} }; diff --git a/src/coreclr/src/tools/aot/jitinterface/jitwrapper.cpp b/src/coreclr/src/tools/aot/jitinterface/jitwrapper.cpp index f922a50..b1b78ef 100644 --- a/src/coreclr/src/tools/aot/jitinterface/jitwrapper.cpp +++ b/src/coreclr/src/tools/aot/jitinterface/jitwrapper.cpp @@ -26,12 +26,7 @@ private: uint64_t corJitFlags; }; -static const GUID JITEEVersionIdentifier = { /* 0d235fe4-65a1-487a-8553-c845496da901 */ - 0x0d235fe4, - 0x65a1, - 0x487a, - {0x85, 0x53, 0xc8, 0x45, 0x49, 0x6d, 0xa9, 0x01} -}; +#include "../../../inc/jiteeversionguid.h" class Jit { @@ -58,7 +53,7 @@ public: }; DLL_EXPORT int JitCompileMethod( - CorInfoException **ppException, + CorInfoExceptionClass **ppException, Jit * pJit, void * thisHandle, void ** callbacks, @@ -84,7 +79,7 @@ DLL_EXPORT int JitCompileMethod( JitInterfaceWrapper jitInterfaceWrapper(thisHandle, callbacks); return pJit->compileMethod(&jitInterfaceWrapper, methodInfo, flags, entryAddress, nativeSizeOfCode); } - catch (CorInfoException *pException) + catch (CorInfoExceptionClass *pException) { *ppException = pException; } -- 2.7.4