forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjitconfig.h
102 lines (84 loc) · 3.54 KB
/
jitconfig.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#ifndef _JITCONFIG_H_
#define _JITCONFIG_H_
#include "switches.h"
struct CORINFO_SIG_INFO;
typedef struct CORINFO_CLASS_STRUCT_* CORINFO_CLASS_HANDLE;
typedef struct CORINFO_METHOD_STRUCT_* CORINFO_METHOD_HANDLE;
class ICorJitHost;
class JitConfigValues
{
public:
class MethodSet
{
private:
struct MethodName
{
MethodName* m_next;
const char* m_patternStart;
const char* m_patternEnd;
bool m_containsClassName;
bool m_classNameContainsInstantiation;
bool m_methodNameContainsInstantiation;
bool m_containsSignature;
};
char* m_list;
MethodName* m_names;
MethodSet(const MethodSet& other) = delete;
MethodSet& operator=(const MethodSet& other) = delete;
public:
MethodSet()
{
}
inline const char* list() const
{
return const_cast<const char*>(m_list);
}
void initialize(const WCHAR* list, ICorJitHost* host);
void destroy(ICorJitHost* host);
inline bool isEmpty() const
{
return m_names == nullptr;
}
bool contains(CORINFO_METHOD_HANDLE methodHnd, CORINFO_CLASS_HANDLE classHnd, CORINFO_SIG_INFO* sigInfo) const;
};
private:
#define CONFIG_INTEGER(name, key, defaultValue) int m_##name;
#define CONFIG_STRING(name, key) const WCHAR* m_##name;
#define CONFIG_METHODSET(name, key) MethodSet m_##name;
#include "jitconfigvalues.h"
public:
#define CONFIG_INTEGER(name, key, defaultValue) \
inline int name() const \
{ \
return m_##name; \
}
#define CONFIG_STRING(name, key) \
inline const WCHAR* name() const \
{ \
return m_##name; \
}
#define CONFIG_METHODSET(name, key) \
inline const MethodSet& name() const \
{ \
return m_##name; \
}
#include "jitconfigvalues.h"
private:
bool m_isInitialized;
JitConfigValues(const JitConfigValues& other) = delete;
JitConfigValues& operator=(const JitConfigValues& other) = delete;
public:
JitConfigValues()
{
}
inline bool isInitialized() const
{
return m_isInitialized != 0;
}
void initialize(ICorJitHost* host);
void destroy(ICorJitHost* host);
};
extern JitConfigValues JitConfig;
#endif