-
Notifications
You must be signed in to change notification settings - Fork 401
/
Copy pathCompilationTypes.hpp
226 lines (179 loc) · 6.24 KB
/
CompilationTypes.hpp
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
/*******************************************************************************
* Copyright (c) 2000, 2022 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
* distribution and is available at http://eclipse.org/legal/epl-2.0
* or the Apache License, Version 2.0 which accompanies this distribution
* and is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License, v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception [1] and GNU General Public
* License, version 2 with the OpenJDK Assembly Exception [2].
*
* [1] https://www.gnu.org/software/classpath/license.html
* [2] http://openjdk.java.net/legal/assembly-exception.html
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
*******************************************************************************/
#ifndef COMPILATION_DATATYPES_INCL
#define COMPILATION_DATATYPES_INCL
#include <stdint.h>
#include "infra/Link.hpp"
#include "infra/List.hpp"
#include "infra/Stack.hpp"
#include "optimizer/Optimizations.hpp"
class TR_BitVector;
class TR_OpaqueClassBlock;
class TR_ResolvedMethod;
namespace TR { class Compilation; }
namespace TR { class Node; }
namespace TR { class TreeTop; }
enum TR_Hotness
#if !defined(LINUXPPC) || defined(__LITTLE_ENDIAN__)
: int8_t // use only 8 bits to save space; The ifdef is needed because xlC BE compiler does not accept the syntax
#endif
{
noOpt,
deadCold = noOpt,
cold,
warm,
hot,
lastOMRStrategy = hot, // currently used to test available omr optimizations
veryHot,
scorching,
minHotness = noOpt,
maxHotness = scorching,
reducedWarm, ///< (Possibly temporary) OBSOLETE. It's way down here
///< so that count/bcount strings are not effected.
unknownHotness,
numHotnessLevels
}; // NOTE: if adding new hotnessLevels, corresponding names must be added to *pHotnessNames[numHotnessLevels] table in OMRCompilation.cpp
// If adding new entries in TR_CallingContext, also add corresponding names in callingContextNames[] in J9Compilation.cpp
enum TR_CallingContext {
NO_CONTEXT=0,
FBVA_INITIALIZE_CONTEXT=OMR::numOpts,
FBVA_ANALYZE_CONTEXT,
BBVA_INITIALIZE_CONTEXT,
BBVA_ANALYZE_CONTEXT,
GRA_ASSIGN_CONTEXT,
PRE_ANALYZE_CONTEXT,
AFTER_INSTRUCTION_SELECTION_CONTEXT,
AFTER_REGISTER_ASSIGNMENT_CONTEXT,
AFTER_POST_RA_SCHEDULING_CONTEXT,
REAL_TIME_ADDITIONAL_CONTEXTS=AFTER_POST_RA_SCHEDULING_CONTEXT,
BEFORE_PROCESS_STRUCTURE_CONTEXT,
GRA_FIND_LOOPS_AND_CORRESPONDING_AUTOS_BLOCK_CONTEXT,
GRA_AFTER_FIND_LOOP_AUTO_CONTEXT,
ESC_CHECK_DEFSUSES_CONTEXT,
LAST_CONTEXT
};
// function return type flags for word preceding the entry point in any
// linkage that needs to be callable from interpreted. Also used in pic
// for use when dispatching methods that are interpreted in megamorphic send
// case
enum TR_ReturnInfo
{
TR_VoidReturn = 0,
TR_IntReturn = 1,
TR_LongReturn = 2,
TR_FloatReturn = 3,
TR_DoubleReturn = 4,
TR_ObjectReturn = 5, // Currently 64-bit platforms only
TR_FloatXMMReturn = 6, // IA32 and AMD64 only
TR_DoubleXMMReturn = 7, // IA32 and AMD64 only
TR_ConstructorReturn = 8 // Return from constructor
};
typedef CS2::PhaseTimingSummary<TR::Allocator> PhaseTimingSummary;
typedef CS2::LexicalBlockTimer<TR::Allocator> LexicalTimer;
// for TR_Debug usage
typedef CS2::HashTable<void*, intptr_t, TR::Allocator> ToNumberMap;
typedef CS2::HashTable<void*, char*, TR::Allocator> ToStringMap;
typedef CS2::HashTable<void*, List<char>*, TR::Allocator> ToCommentMap;
typedef struct TR_HWPInstructionInfo
{
enum type
{
callInstructions = 0,
indirectCallInstructions,
returnInstructions,
valueProfileInstructions,
};
void *_instruction;
void *_data;
type _type;
} TR_HWPInstructionInfo;
typedef struct TR_HWPBytecodePCToIAMap
{
void *_bytecodePC;
void *_instructionAddr;
} TR_HWPBytecodePCToIAMap;
class TR_DevirtualizedCallInfo
{
public:
TR_DevirtualizedCallInfo(TR::Node *callNode, TR_OpaqueClassBlock *thisType) : _callNode(callNode), _thisType(thisType) {}
TR::Node * _callNode;
TR_OpaqueClassBlock * _thisType;
};
struct TR_PeekingArgInfo
{
TR_ResolvedMethod *_method;
const char **_args;
int32_t *_lengths;
};
class TR_PrefetchInfo
{
public:
TR_ALLOC(TR_Memory::IsolatedStoreElimination)
TR_PrefetchInfo(TR::TreeTop *defTree, TR::TreeTop *useTree,
TR::Node *addrNode, TR::Node *useNode,
int32_t offset, bool increasing) :
_defTree(defTree),
_useTree(useTree),
_addrNode(addrNode),
_useNode(useNode),
_offset(offset),
_increasing(increasing)
{
}
TR::TreeTop *_defTree;
TR::TreeTop *_useTree;
TR::Node *_addrNode;
TR::Node *_useNode;
int32_t _offset;
bool _increasing;
};
class TR_ClassExtendCheck : public TR_Link<TR_ClassExtendCheck>
{
public:
TR_ClassExtendCheck(TR_OpaqueClassBlock *c) : _clazz(c) { }
TR_OpaqueClassBlock *_clazz;
};
class TR_ClassLoadCheck : public TR_Link<TR_ClassLoadCheck>
{
public:
TR_ClassLoadCheck(char * n, int32_t l) : _name(n), _length(l) { }
char * _name;
int32_t _length;
struct Method : TR_Link<Method>
{
Method(char * name, int32_t nameLen, char * sig, int32_t sigLen)
: _name(name), _sig(sig), _nameLen(nameLen), _sigLen(sigLen)
{ }
char * _name, * _sig;
int32_t _nameLen, _sigLen;
};
TR_LinkHead<Method> _methods;
};
class BitVectorPool
{
TR_Stack<TR_BitVector*> _pool;
TR::Compilation* _comp;
public:
BitVectorPool(TR::Compilation* c);
TR_BitVector* get();
void release (TR_BitVector* v);
};
#endif