1//
2// Copyright (c) Microsoft. All rights reserved.
3// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4//
5//----------------------------------------------------------
6// CallUtils.h - Utility code for analyzing and working with managed calls
7//----------------------------------------------------------
8#ifndef _CallUtils
9#define _CallUtils
10
11#include "methodcontext.h"
12
13enum CallType
14{
15 CallType_UserFunction = 0,
16 CallType_Helper,
17 CallType_Unknown = -1
18};
19
20class CallUtils
21{
22public:
23 static CallType GetRecordedCallSiteInfo(MethodContext* mc,
24 CompileResult* cr,
25 unsigned int callInstrOffset,
26 /*out*/ CORINFO_SIG_INFO* outSigInfo,
27 /*out*/ char** outCallTargetSymbol);
28 static CallType GetDirectCallSiteInfo(MethodContext* mc,
29 void* callTarget,
30 /*out*/ CORINFO_SIG_INFO* outSigInfo,
31 /*out*/ char** outCallTargetSymbol);
32 static bool HasRetBuffArg(MethodContext* mc, CORINFO_SIG_INFO args);
33 static CorInfoHelpFunc GetHelperNum(CORINFO_METHOD_HANDLE method);
34 static bool IsNativeMethod(CORINFO_METHOD_HANDLE method);
35 static CORINFO_METHOD_HANDLE GetMethodHandleForNative(CORINFO_METHOD_HANDLE method);
36 static const char* GetMethodName(MethodContext* mc, CORINFO_METHOD_HANDLE method, const char** classNamePtr);
37 static const char* GetMethodFullName(MethodContext* mc, CORINFO_METHOD_HANDLE hnd, CORINFO_SIG_INFO sig);
38};
39
40#endif