author | iveresov |
Thu, 22 Jan 2015 11:25:23 -0800 | |
changeset 28723 | 0a36120cb225 |
parent 28648 | 102bdbb42723 |
child 34194 | 213af0859e7e |
permissions | -rw-r--r-- |
1 | 1 |
/* |
25637
369f62cdfaba
8036588: VerifyFieldClosure fails instanceKlass:3133
drchase
parents:
24923
diff
changeset
|
2 |
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4751
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4751
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4751
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#ifndef SHARE_VM_OPTO_MACHNODE_HPP |
26 |
#define SHARE_VM_OPTO_MACHNODE_HPP |
|
27 |
||
28 |
#include "opto/callnode.hpp" |
|
29 |
#include "opto/matcher.hpp" |
|
30 |
#include "opto/multnode.hpp" |
|
31 |
#include "opto/node.hpp" |
|
32 |
#include "opto/regmask.hpp" |
|
33 |
||
22853
308672304981
8028767: PPC64: (part 121): smaller shared changes needed to build C2
goetz
parents:
22850
diff
changeset
|
34 |
class BiasedLockingCounters; |
1 | 35 |
class BufferBlob; |
36 |
class CodeBuffer; |
|
37 |
class JVMState; |
|
38 |
class MachCallDynamicJavaNode; |
|
39 |
class MachCallJavaNode; |
|
40 |
class MachCallLeafNode; |
|
41 |
class MachCallNode; |
|
42 |
class MachCallRuntimeNode; |
|
43 |
class MachCallStaticJavaNode; |
|
44 |
class MachEpilogNode; |
|
45 |
class MachIfNode; |
|
46 |
class MachNullCheckNode; |
|
47 |
class MachOper; |
|
48 |
class MachProjNode; |
|
49 |
class MachPrologNode; |
|
50 |
class MachReturnNode; |
|
51 |
class MachSafePointNode; |
|
52 |
class MachSpillCopyNode; |
|
53 |
class Matcher; |
|
54 |
class PhaseRegAlloc; |
|
55 |
class RegMask; |
|
23491 | 56 |
class RTMLockingCounters; |
1 | 57 |
class State; |
58 |
||
59 |
//---------------------------MachOper------------------------------------------ |
|
60 |
class MachOper : public ResourceObj { |
|
61 |
public: |
|
62 |
// Allocate right next to the MachNodes in the same arena |
|
24923
9631f7d691dc
8034812: remove IDX_INIT macro hack in Node class
thartmann
parents:
24008
diff
changeset
|
63 |
void *operator new(size_t x) throw() { |
9631f7d691dc
8034812: remove IDX_INIT macro hack in Node class
thartmann
parents:
24008
diff
changeset
|
64 |
Compile* C = Compile::current(); |
9631f7d691dc
8034812: remove IDX_INIT macro hack in Node class
thartmann
parents:
24008
diff
changeset
|
65 |
return C->node_arena()->Amalloc_D(x); |
9631f7d691dc
8034812: remove IDX_INIT macro hack in Node class
thartmann
parents:
24008
diff
changeset
|
66 |
} |
1 | 67 |
|
68 |
// Opcode |
|
69 |
virtual uint opcode() const = 0; |
|
70 |
||
71 |
// Number of input edges. |
|
72 |
// Generally at least 1 |
|
73 |
virtual uint num_edges() const { return 1; } |
|
74 |
// Array of Register masks |
|
75 |
virtual const RegMask *in_RegMask(int index) const; |
|
76 |
||
77 |
// Methods to output the encoding of the operand |
|
78 |
||
79 |
// Negate conditional branches. Error for non-branch Nodes |
|
80 |
virtual void negate(); |
|
81 |
||
82 |
// Return the value requested |
|
83 |
// result register lookup, corresponding to int_format |
|
84 |
virtual int reg(PhaseRegAlloc *ra_, const Node *node) const; |
|
85 |
// input register lookup, corresponding to ext_format |
|
86 |
virtual int reg(PhaseRegAlloc *ra_, const Node *node, int idx) const; |
|
87 |
||
88 |
// helpers for MacroAssembler generation from ADLC |
|
89 |
Register as_Register(PhaseRegAlloc *ra_, const Node *node) const { |
|
90 |
return ::as_Register(reg(ra_, node)); |
|
91 |
} |
|
92 |
Register as_Register(PhaseRegAlloc *ra_, const Node *node, int idx) const { |
|
93 |
return ::as_Register(reg(ra_, node, idx)); |
|
94 |
} |
|
95 |
FloatRegister as_FloatRegister(PhaseRegAlloc *ra_, const Node *node) const { |
|
96 |
return ::as_FloatRegister(reg(ra_, node)); |
|
97 |
} |
|
98 |
FloatRegister as_FloatRegister(PhaseRegAlloc *ra_, const Node *node, int idx) const { |
|
99 |
return ::as_FloatRegister(reg(ra_, node, idx)); |
|
100 |
} |
|
101 |
||
102 |
#if defined(IA32) || defined(AMD64) |
|
103 |
XMMRegister as_XMMRegister(PhaseRegAlloc *ra_, const Node *node) const { |
|
104 |
return ::as_XMMRegister(reg(ra_, node)); |
|
105 |
} |
|
106 |
XMMRegister as_XMMRegister(PhaseRegAlloc *ra_, const Node *node, int idx) const { |
|
107 |
return ::as_XMMRegister(reg(ra_, node, idx)); |
|
108 |
} |
|
109 |
#endif |
|
22860
80a845ab5e4a
8029888: PPC64: (part 219): adl replacement variable CondRegister
goetz
parents:
22856
diff
changeset
|
110 |
// CondRegister reg converter |
80a845ab5e4a
8029888: PPC64: (part 219): adl replacement variable CondRegister
goetz
parents:
22856
diff
changeset
|
111 |
#if defined(PPC64) |
80a845ab5e4a
8029888: PPC64: (part 219): adl replacement variable CondRegister
goetz
parents:
22856
diff
changeset
|
112 |
ConditionRegister as_ConditionRegister(PhaseRegAlloc *ra_, const Node *node) const { |
80a845ab5e4a
8029888: PPC64: (part 219): adl replacement variable CondRegister
goetz
parents:
22856
diff
changeset
|
113 |
return ::as_ConditionRegister(reg(ra_, node)); |
80a845ab5e4a
8029888: PPC64: (part 219): adl replacement variable CondRegister
goetz
parents:
22856
diff
changeset
|
114 |
} |
80a845ab5e4a
8029888: PPC64: (part 219): adl replacement variable CondRegister
goetz
parents:
22856
diff
changeset
|
115 |
ConditionRegister as_ConditionRegister(PhaseRegAlloc *ra_, const Node *node, int idx) const { |
80a845ab5e4a
8029888: PPC64: (part 219): adl replacement variable CondRegister
goetz
parents:
22856
diff
changeset
|
116 |
return ::as_ConditionRegister(reg(ra_, node, idx)); |
80a845ab5e4a
8029888: PPC64: (part 219): adl replacement variable CondRegister
goetz
parents:
22856
diff
changeset
|
117 |
} |
80a845ab5e4a
8029888: PPC64: (part 219): adl replacement variable CondRegister
goetz
parents:
22856
diff
changeset
|
118 |
#endif |
1 | 119 |
|
120 |
virtual intptr_t constant() const; |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13104
diff
changeset
|
121 |
virtual relocInfo::relocType constant_reloc() const; |
1 | 122 |
virtual jdouble constantD() const; |
123 |
virtual jfloat constantF() const; |
|
124 |
virtual jlong constantL() const; |
|
125 |
virtual TypeOopPtr *oop() const; |
|
126 |
virtual int ccode() const; |
|
127 |
// A zero, default, indicates this value is not needed. |
|
128 |
// May need to lookup the base register, as done in int_ and ext_format |
|
129 |
virtual int base (PhaseRegAlloc *ra_, const Node *node, int idx) const; |
|
130 |
virtual int index(PhaseRegAlloc *ra_, const Node *node, int idx) const; |
|
131 |
virtual int scale() const; |
|
132 |
// Parameters needed to support MEMORY_INTERFACE access to stackSlot |
|
133 |
virtual int disp (PhaseRegAlloc *ra_, const Node *node, int idx) const; |
|
134 |
// Check for PC-Relative displacement |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13104
diff
changeset
|
135 |
virtual relocInfo::relocType disp_reloc() const; |
1 | 136 |
virtual int constant_disp() const; // usu. 0, may return Type::OffsetBot |
137 |
virtual int base_position() const; // base edge position, or -1 |
|
138 |
virtual int index_position() const; // index edge position, or -1 |
|
139 |
||
140 |
// Access the TypeKlassPtr of operands with a base==RegI and disp==RegP |
|
141 |
// Only returns non-null value for i486.ad's indOffset32X |
|
142 |
virtual const TypePtr *disp_as_type() const { return NULL; } |
|
143 |
||
144 |
// Return the label |
|
145 |
virtual Label *label() const; |
|
146 |
||
147 |
// Return the method's address |
|
148 |
virtual intptr_t method() const; |
|
149 |
||
150 |
// Hash and compare over operands are currently identical |
|
151 |
virtual uint hash() const; |
|
152 |
virtual uint cmp( const MachOper &oper ) const; |
|
153 |
||
154 |
// Virtual clone, since I do not know how big the MachOper is. |
|
25930 | 155 |
virtual MachOper *clone() const = 0; |
1 | 156 |
|
157 |
// Return ideal Type from simple operands. Fail for complex operands. |
|
158 |
virtual const Type *type() const; |
|
159 |
||
160 |
// Set an integer offset if we have one, or error otherwise |
|
161 |
virtual void set_con( jint c0 ) { ShouldNotReachHere(); } |
|
162 |
||
163 |
#ifndef PRODUCT |
|
164 |
// Return name of operand |
|
165 |
virtual const char *Name() const { return "???";} |
|
166 |
||
167 |
// Methods to output the text version of the operand |
|
168 |
virtual void int_format(PhaseRegAlloc *,const MachNode *node, outputStream *st) const = 0; |
|
169 |
virtual void ext_format(PhaseRegAlloc *,const MachNode *node,int idx, outputStream *st) const=0; |
|
170 |
||
171 |
virtual void dump_spec(outputStream *st) const; // Print per-operand info |
|
22844
90f76a40ed8a
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
19696
diff
changeset
|
172 |
|
90f76a40ed8a
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
19696
diff
changeset
|
173 |
// Check whether o is a valid oper. |
90f76a40ed8a
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
19696
diff
changeset
|
174 |
static bool notAnOper(const MachOper *o) { |
90f76a40ed8a
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
19696
diff
changeset
|
175 |
if (o == NULL) return true; |
90f76a40ed8a
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
19696
diff
changeset
|
176 |
if (((intptr_t)o & 1) != 0) return true; |
90f76a40ed8a
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
19696
diff
changeset
|
177 |
if (*(address*)o == badAddress) return true; // kill by Node::destruct |
90f76a40ed8a
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
19696
diff
changeset
|
178 |
return false; |
90f76a40ed8a
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
19696
diff
changeset
|
179 |
} |
90f76a40ed8a
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
19696
diff
changeset
|
180 |
#endif // !PRODUCT |
1 | 181 |
}; |
182 |
||
183 |
//------------------------------MachNode--------------------------------------- |
|
184 |
// Base type for all machine specific nodes. All node classes generated by the |
|
185 |
// ADLC inherit from this class. |
|
186 |
class MachNode : public Node { |
|
187 |
public: |
|
188 |
MachNode() : Node((uint)0), _num_opnds(0), _opnds(NULL) { |
|
189 |
init_class_id(Class_Mach); |
|
190 |
} |
|
191 |
// Required boilerplate |
|
192 |
virtual uint size_of() const { return sizeof(MachNode); } |
|
193 |
virtual int Opcode() const; // Always equal to MachNode |
|
194 |
virtual uint rule() const = 0; // Machine-specific opcode |
|
195 |
// Number of inputs which come before the first operand. |
|
196 |
// Generally at least 1, to skip the Control input |
|
197 |
virtual uint oper_input_base() const { return 1; } |
|
22850
4e69ce7e1101
8028580: PPC64 (part 114/120): Support for Call nodes with constants.
goetz
parents:
22847
diff
changeset
|
198 |
// Position of constant base node in node's inputs. -1 if |
4e69ce7e1101
8028580: PPC64 (part 114/120): Support for Call nodes with constants.
goetz
parents:
22847
diff
changeset
|
199 |
// no constant base node input. |
4e69ce7e1101
8028580: PPC64 (part 114/120): Support for Call nodes with constants.
goetz
parents:
22847
diff
changeset
|
200 |
virtual uint mach_constant_base_node_input() const { return (uint)-1; } |
1 | 201 |
|
202 |
// Copy inputs and operands to new node of instruction. |
|
203 |
// Called from cisc_version() and short_branch_version(). |
|
204 |
// !!!! The method's body is defined in ad_<arch>.cpp file. |
|
25930 | 205 |
void fill_new_machnode(MachNode *n) const; |
1 | 206 |
|
207 |
// Return an equivalent instruction using memory for cisc_operand position |
|
25930 | 208 |
virtual MachNode *cisc_version(int offset); |
1 | 209 |
// Modify this instruction's register mask to use stack version for cisc_operand |
210 |
virtual void use_cisc_RegMask(); |
|
211 |
||
212 |
// Support for short branches |
|
213 |
bool may_be_short_branch() const { return (flags() & Flag_may_be_short_branch) != 0; } |
|
214 |
||
10264 | 215 |
// Avoid back to back some instructions on some CPUs. |
24008
da7059252295
8038297: Avoid placing CTI immediately following cbcond instruction on T4
iveresov
parents:
23491
diff
changeset
|
216 |
enum AvoidBackToBackFlag { AVOID_NONE = 0, |
da7059252295
8038297: Avoid placing CTI immediately following cbcond instruction on T4
iveresov
parents:
23491
diff
changeset
|
217 |
AVOID_BEFORE = Flag_avoid_back_to_back_before, |
da7059252295
8038297: Avoid placing CTI immediately following cbcond instruction on T4
iveresov
parents:
23491
diff
changeset
|
218 |
AVOID_AFTER = Flag_avoid_back_to_back_after, |
da7059252295
8038297: Avoid placing CTI immediately following cbcond instruction on T4
iveresov
parents:
23491
diff
changeset
|
219 |
AVOID_BEFORE_AND_AFTER = AVOID_BEFORE | AVOID_AFTER }; |
da7059252295
8038297: Avoid placing CTI immediately following cbcond instruction on T4
iveresov
parents:
23491
diff
changeset
|
220 |
|
da7059252295
8038297: Avoid placing CTI immediately following cbcond instruction on T4
iveresov
parents:
23491
diff
changeset
|
221 |
bool avoid_back_to_back(AvoidBackToBackFlag flag_value) const { |
da7059252295
8038297: Avoid placing CTI immediately following cbcond instruction on T4
iveresov
parents:
23491
diff
changeset
|
222 |
return (flags() & flag_value) == flag_value; |
da7059252295
8038297: Avoid placing CTI immediately following cbcond instruction on T4
iveresov
parents:
23491
diff
changeset
|
223 |
} |
10264 | 224 |
|
11196
a310a659c580
7077312: Provide a CALL effect for instruct declaration in the ad file
roland
parents:
10266
diff
changeset
|
225 |
// instruction implemented with a call |
a310a659c580
7077312: Provide a CALL effect for instruct declaration in the ad file
roland
parents:
10266
diff
changeset
|
226 |
bool has_call() const { return (flags() & Flag_has_call) != 0; } |
a310a659c580
7077312: Provide a CALL effect for instruct declaration in the ad file
roland
parents:
10266
diff
changeset
|
227 |
|
1 | 228 |
// First index in _in[] corresponding to operand, or -1 if there is none |
229 |
int operand_index(uint operand) const; |
|
22853
308672304981
8028767: PPC64: (part 121): smaller shared changes needed to build C2
goetz
parents:
22850
diff
changeset
|
230 |
int operand_index(const MachOper *oper) const; |
1 | 231 |
|
232 |
// Register class input is expected in |
|
233 |
virtual const RegMask &in_RegMask(uint) const; |
|
234 |
||
235 |
// cisc-spillable instructions redefine for use by in_RegMask |
|
236 |
virtual const RegMask *cisc_RegMask() const { return NULL; } |
|
237 |
||
238 |
// If this instruction is a 2-address instruction, then return the |
|
239 |
// index of the input which must match the output. Not nessecary |
|
240 |
// for instructions which bind the input and output register to the |
|
241 |
// same singleton regiser (e.g., Intel IDIV which binds AX to be |
|
242 |
// both an input and an output). It is nessecary when the input and |
|
243 |
// output have choices - but they must use the same choice. |
|
244 |
virtual uint two_adr( ) const { return 0; } |
|
245 |
||
246 |
// Array of complex operand pointers. Each corresponds to zero or |
|
247 |
// more leafs. Must be set by MachNode constructor to point to an |
|
248 |
// internal array of MachOpers. The MachOper array is sized by |
|
249 |
// specific MachNodes described in the ADL. |
|
250 |
uint _num_opnds; |
|
251 |
MachOper **_opnds; |
|
252 |
uint num_opnds() const { return _num_opnds; } |
|
253 |
||
254 |
// Emit bytes into cbuf |
|
255 |
virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const; |
|
22844
90f76a40ed8a
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
19696
diff
changeset
|
256 |
// Expand node after register allocation. |
90f76a40ed8a
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
19696
diff
changeset
|
257 |
// Node is replaced by several nodes in the postalloc expand phase. |
90f76a40ed8a
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
19696
diff
changeset
|
258 |
// Corresponding methods are generated for nodes if they specify |
90f76a40ed8a
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
19696
diff
changeset
|
259 |
// postalloc_expand. See block.cpp for more documentation. |
90f76a40ed8a
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
19696
diff
changeset
|
260 |
virtual bool requires_postalloc_expand() const { return false; } |
90f76a40ed8a
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
19696
diff
changeset
|
261 |
virtual void postalloc_expand(GrowableArray <Node *> *nodes, PhaseRegAlloc *ra_); |
1 | 262 |
// Size of instruction in bytes |
263 |
virtual uint size(PhaseRegAlloc *ra_) const; |
|
264 |
// Helper function that computes size by emitting code |
|
265 |
virtual uint emit_size(PhaseRegAlloc *ra_) const; |
|
266 |
||
267 |
// Return the alignment required (in units of relocInfo::addr_unit()) |
|
268 |
// for this instruction (must be a power of 2) |
|
269 |
virtual int alignment_required() const { return 1; } |
|
270 |
||
271 |
// Return the padding (in bytes) to be emitted before this |
|
272 |
// instruction to properly align it. |
|
273 |
virtual int compute_padding(int current_offset) const { return 0; } |
|
274 |
||
275 |
// Return number of relocatable values contained in this instruction |
|
276 |
virtual int reloc() const { return 0; } |
|
277 |
||
22850
4e69ce7e1101
8028580: PPC64 (part 114/120): Support for Call nodes with constants.
goetz
parents:
22847
diff
changeset
|
278 |
// Return number of words used for double constants in this instruction |
4e69ce7e1101
8028580: PPC64 (part 114/120): Support for Call nodes with constants.
goetz
parents:
22847
diff
changeset
|
279 |
virtual int ins_num_consts() const { return 0; } |
4e69ce7e1101
8028580: PPC64 (part 114/120): Support for Call nodes with constants.
goetz
parents:
22847
diff
changeset
|
280 |
|
1 | 281 |
// Hash and compare over operands. Used to do GVN on machine Nodes. |
282 |
virtual uint hash() const; |
|
283 |
virtual uint cmp( const Node &n ) const; |
|
284 |
||
285 |
// Expand method for MachNode, replaces nodes representing pseudo |
|
286 |
// instructions with a set of nodes which represent real machine |
|
287 |
// instructions and compute the same value. |
|
4751 | 288 |
virtual MachNode *Expand( State *, Node_List &proj_list, Node* mem ) { return this; } |
1 | 289 |
|
290 |
// Bottom_type call; value comes from operand0 |
|
291 |
virtual const class Type *bottom_type() const { return _opnds[0]->type(); } |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13104
diff
changeset
|
292 |
virtual uint ideal_reg() const { const Type *t = _opnds[0]->type(); return t == TypeInt::CC ? Op_RegFlags : t->ideal_reg(); } |
1 | 293 |
|
294 |
// If this is a memory op, return the base pointer and fixed offset. |
|
295 |
// If there are no such, return NULL. If there are multiple addresses |
|
296 |
// or the address is indeterminate (rare cases) then return (Node*)-1, |
|
297 |
// which serves as node bottom. |
|
298 |
// If the offset is not statically determined, set it to Type::OffsetBot. |
|
299 |
// This method is free to ignore stack slots if that helps. |
|
300 |
#define TYPE_PTR_SENTINAL ((const TypePtr*)-1) |
|
301 |
// Passing TYPE_PTR_SENTINAL as adr_type asks for computation of the adr_type if possible |
|
302 |
const Node* get_base_and_disp(intptr_t &offset, const TypePtr* &adr_type) const; |
|
303 |
||
304 |
// Helper for get_base_and_disp: find the base and index input nodes. |
|
305 |
// Returns the MachOper as determined by memory_operand(), for use, if |
|
306 |
// needed by the caller. If (MachOper *)-1 is returned, base and index |
|
307 |
// are set to NodeSentinel. If (MachOper *) NULL is returned, base and |
|
308 |
// index are set to NULL. |
|
309 |
const MachOper* memory_inputs(Node* &base, Node* &index) const; |
|
310 |
||
311 |
// Helper for memory_inputs: Which operand carries the necessary info? |
|
312 |
// By default, returns NULL, which means there is no such operand. |
|
313 |
// If it returns (MachOper*)-1, this means there are multiple memories. |
|
314 |
virtual const MachOper* memory_operand() const { return NULL; } |
|
315 |
||
316 |
// Call "get_base_and_disp" to decide which category of memory is used here. |
|
317 |
virtual const class TypePtr *adr_type() const; |
|
318 |
||
319 |
// Apply peephole rule(s) to this instruction |
|
25930 | 320 |
virtual MachNode *peephole(Block *block, int block_index, PhaseRegAlloc *ra_, int &deleted); |
1 | 321 |
|
322 |
// Top-level ideal Opcode matched |
|
323 |
virtual int ideal_Opcode() const { return Op_Node; } |
|
324 |
||
325 |
// Adds the label for the case |
|
326 |
virtual void add_case_label( int switch_val, Label* blockLabel); |
|
327 |
||
328 |
// Set the absolute address for methods |
|
329 |
virtual void method_set( intptr_t addr ); |
|
330 |
||
331 |
// Should we clone rather than spill this instruction? |
|
332 |
bool rematerialize() const; |
|
333 |
||
334 |
// Get the pipeline info |
|
335 |
static const Pipeline *pipeline_class(); |
|
336 |
virtual const Pipeline *pipeline() const; |
|
337 |
||
22856
03ad2cf18166
8029015: PPC64 (part 216): opto: trap based null and range checks
goetz
parents:
22853
diff
changeset
|
338 |
// Returns true if this node is a check that can be implemented with a trap. |
03ad2cf18166
8029015: PPC64 (part 216): opto: trap based null and range checks
goetz
parents:
22853
diff
changeset
|
339 |
virtual bool is_TrapBasedCheckNode() const { return false; } |
03ad2cf18166
8029015: PPC64 (part 216): opto: trap based null and range checks
goetz
parents:
22853
diff
changeset
|
340 |
|
1 | 341 |
#ifndef PRODUCT |
342 |
virtual const char *Name() const = 0; // Machine-specific name |
|
343 |
virtual void dump_spec(outputStream *st) const; // Print per-node info |
|
344 |
void dump_format(PhaseRegAlloc *ra, outputStream *st) const; // access to virtual |
|
345 |
#endif |
|
346 |
}; |
|
347 |
||
348 |
//------------------------------MachIdealNode---------------------------- |
|
349 |
// Machine specific versions of nodes that must be defined by user. |
|
350 |
// These are not converted by matcher from ideal nodes to machine nodes |
|
351 |
// but are inserted into the code by the compiler. |
|
352 |
class MachIdealNode : public MachNode { |
|
353 |
public: |
|
354 |
MachIdealNode( ) {} |
|
355 |
||
356 |
// Define the following defaults for non-matched machine nodes |
|
357 |
virtual uint oper_input_base() const { return 0; } |
|
358 |
virtual uint rule() const { return 9999999; } |
|
359 |
virtual const class Type *bottom_type() const { return _opnds == NULL ? Type::CONTROL : MachNode::bottom_type(); } |
|
360 |
}; |
|
361 |
||
362 |
//------------------------------MachTypeNode---------------------------- |
|
363 |
// Machine Nodes that need to retain a known Type. |
|
364 |
class MachTypeNode : public MachNode { |
|
365 |
virtual uint size_of() const { return sizeof(*this); } // Size is bigger |
|
366 |
public: |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11196
diff
changeset
|
367 |
MachTypeNode( ) {} |
1 | 368 |
const Type *_bottom_type; |
369 |
||
370 |
virtual const class Type *bottom_type() const { return _bottom_type; } |
|
371 |
#ifndef PRODUCT |
|
372 |
virtual void dump_spec(outputStream *st) const; |
|
373 |
#endif |
|
374 |
}; |
|
375 |
||
376 |
//------------------------------MachBreakpointNode---------------------------- |
|
377 |
// Machine breakpoint or interrupt Node |
|
378 |
class MachBreakpointNode : public MachIdealNode { |
|
379 |
public: |
|
380 |
MachBreakpointNode( ) {} |
|
381 |
virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const; |
|
382 |
virtual uint size(PhaseRegAlloc *ra_) const; |
|
383 |
||
384 |
#ifndef PRODUCT |
|
385 |
virtual const char *Name() const { return "Breakpoint"; } |
|
386 |
virtual void format( PhaseRegAlloc *, outputStream *st ) const; |
|
387 |
#endif |
|
388 |
}; |
|
389 |
||
7433 | 390 |
//------------------------------MachConstantBaseNode-------------------------- |
391 |
// Machine node that represents the base address of the constant table. |
|
392 |
class MachConstantBaseNode : public MachIdealNode { |
|
393 |
public: |
|
394 |
static const RegMask& _out_RegMask; // We need the out_RegMask statically in MachConstantNode::in_RegMask(). |
|
395 |
||
396 |
public: |
|
397 |
MachConstantBaseNode() : MachIdealNode() { |
|
398 |
init_class_id(Class_MachConstantBase); |
|
399 |
} |
|
400 |
virtual const class Type* bottom_type() const { return TypeRawPtr::NOTNULL; } |
|
401 |
virtual uint ideal_reg() const { return Op_RegP; } |
|
402 |
virtual uint oper_input_base() const { return 1; } |
|
403 |
||
22844
90f76a40ed8a
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
19696
diff
changeset
|
404 |
virtual bool requires_postalloc_expand() const; |
90f76a40ed8a
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
19696
diff
changeset
|
405 |
virtual void postalloc_expand(GrowableArray <Node *> *nodes, PhaseRegAlloc *ra_); |
90f76a40ed8a
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
19696
diff
changeset
|
406 |
|
7433 | 407 |
virtual void emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const; |
408 |
virtual uint size(PhaseRegAlloc* ra_) const; |
|
409 |
virtual bool pinned() const { return UseRDPCForConstantTableBase; } |
|
410 |
||
411 |
static const RegMask& static_out_RegMask() { return _out_RegMask; } |
|
412 |
virtual const RegMask& out_RegMask() const { return static_out_RegMask(); } |
|
413 |
||
414 |
#ifndef PRODUCT |
|
415 |
virtual const char* Name() const { return "MachConstantBaseNode"; } |
|
416 |
virtual void format(PhaseRegAlloc*, outputStream* st) const; |
|
417 |
#endif |
|
418 |
}; |
|
419 |
||
420 |
//------------------------------MachConstantNode------------------------------- |
|
421 |
// Machine node that holds a constant which is stored in the constant table. |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11196
diff
changeset
|
422 |
class MachConstantNode : public MachTypeNode { |
7433 | 423 |
protected: |
424 |
Compile::Constant _constant; // This node's constant. |
|
425 |
||
426 |
public: |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11196
diff
changeset
|
427 |
MachConstantNode() : MachTypeNode() { |
7433 | 428 |
init_class_id(Class_MachConstant); |
429 |
} |
|
430 |
||
431 |
virtual void eval_constant(Compile* C) { |
|
432 |
#ifdef ASSERT |
|
433 |
tty->print("missing MachConstantNode eval_constant function: "); |
|
434 |
dump(); |
|
435 |
#endif |
|
436 |
ShouldNotCallThis(); |
|
437 |
} |
|
438 |
||
439 |
virtual const RegMask &in_RegMask(uint idx) const { |
|
440 |
if (idx == mach_constant_base_node_input()) |
|
441 |
return MachConstantBaseNode::static_out_RegMask(); |
|
442 |
return MachNode::in_RegMask(idx); |
|
443 |
} |
|
444 |
||
445 |
// Input edge of MachConstantBaseNode. |
|
22850
4e69ce7e1101
8028580: PPC64 (part 114/120): Support for Call nodes with constants.
goetz
parents:
22847
diff
changeset
|
446 |
virtual uint mach_constant_base_node_input() const { return req() - 1; } |
7433 | 447 |
|
448 |
int constant_offset(); |
|
449 |
int constant_offset() const { return ((MachConstantNode*) this)->constant_offset(); } |
|
22847
603ad1f10e16
8028401: PPC (part 117): Improve usability of adlc and format() functionality.
goetz
parents:
22844
diff
changeset
|
450 |
// Unchecked version to avoid assertions in debug output. |
603ad1f10e16
8028401: PPC (part 117): Improve usability of adlc and format() functionality.
goetz
parents:
22844
diff
changeset
|
451 |
int constant_offset_unchecked() const; |
7433 | 452 |
}; |
453 |
||
1 | 454 |
//------------------------------MachUEPNode----------------------------------- |
455 |
// Machine Unvalidated Entry Point Node |
|
456 |
class MachUEPNode : public MachIdealNode { |
|
457 |
public: |
|
458 |
MachUEPNode( ) {} |
|
459 |
virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const; |
|
460 |
virtual uint size(PhaseRegAlloc *ra_) const; |
|
461 |
||
462 |
#ifndef PRODUCT |
|
463 |
virtual const char *Name() const { return "Unvalidated-Entry-Point"; } |
|
464 |
virtual void format( PhaseRegAlloc *, outputStream *st ) const; |
|
465 |
#endif |
|
466 |
}; |
|
467 |
||
468 |
//------------------------------MachPrologNode-------------------------------- |
|
469 |
// Machine function Prolog Node |
|
470 |
class MachPrologNode : public MachIdealNode { |
|
471 |
public: |
|
472 |
MachPrologNode( ) {} |
|
473 |
virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const; |
|
474 |
virtual uint size(PhaseRegAlloc *ra_) const; |
|
475 |
virtual int reloc() const; |
|
476 |
||
477 |
#ifndef PRODUCT |
|
478 |
virtual const char *Name() const { return "Prolog"; } |
|
479 |
virtual void format( PhaseRegAlloc *, outputStream *st ) const; |
|
480 |
#endif |
|
481 |
}; |
|
482 |
||
483 |
//------------------------------MachEpilogNode-------------------------------- |
|
484 |
// Machine function Epilog Node |
|
485 |
class MachEpilogNode : public MachIdealNode { |
|
486 |
public: |
|
487 |
MachEpilogNode(bool do_poll = false) : _do_polling(do_poll) {} |
|
488 |
virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const; |
|
489 |
virtual uint size(PhaseRegAlloc *ra_) const; |
|
490 |
virtual int reloc() const; |
|
491 |
virtual const Pipeline *pipeline() const; |
|
492 |
||
493 |
private: |
|
494 |
bool _do_polling; |
|
495 |
||
496 |
public: |
|
497 |
bool do_polling() const { return _do_polling; } |
|
498 |
||
499 |
// Offset of safepoint from the beginning of the node |
|
500 |
int safepoint_offset() const; |
|
501 |
||
502 |
#ifndef PRODUCT |
|
503 |
virtual const char *Name() const { return "Epilog"; } |
|
504 |
virtual void format( PhaseRegAlloc *, outputStream *st ) const; |
|
505 |
#endif |
|
506 |
}; |
|
507 |
||
508 |
//------------------------------MachNopNode----------------------------------- |
|
509 |
// Machine function Nop Node |
|
510 |
class MachNopNode : public MachIdealNode { |
|
511 |
private: |
|
512 |
int _count; |
|
513 |
public: |
|
514 |
MachNopNode( ) : _count(1) {} |
|
515 |
MachNopNode( int count ) : _count(count) {} |
|
516 |
virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const; |
|
517 |
virtual uint size(PhaseRegAlloc *ra_) const; |
|
518 |
||
519 |
virtual const class Type *bottom_type() const { return Type::CONTROL; } |
|
520 |
||
521 |
virtual int ideal_Opcode() const { return Op_Con; } // bogus; see output.cpp |
|
522 |
virtual const Pipeline *pipeline() const; |
|
523 |
#ifndef PRODUCT |
|
524 |
virtual const char *Name() const { return "Nop"; } |
|
525 |
virtual void format( PhaseRegAlloc *, outputStream *st ) const; |
|
526 |
virtual void dump_spec(outputStream *st) const { } // No per-operand info |
|
527 |
#endif |
|
528 |
}; |
|
529 |
||
530 |
//------------------------------MachSpillCopyNode------------------------------ |
|
531 |
// Machine SpillCopy Node. Copies 1 or 2 words from any location to any |
|
532 |
// location (stack or register). |
|
533 |
class MachSpillCopyNode : public MachIdealNode { |
|
22914
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
534 |
public: |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
535 |
enum SpillType { |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
536 |
TwoAddress, // Inserted when coalescing of a two-address-instruction node and its input fails |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
537 |
PhiInput, // Inserted when coalescing of a phi node and its input fails |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
538 |
DebugUse, // Inserted as debug info spills to safepoints in non-frequent blocks |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
539 |
LoopPhiInput, // Pre-split compares of loop-phis |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
540 |
Definition, // An lrg marked as spilled will be spilled to memory right after its definition, |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
541 |
// if in high pressure region or the lrg is bound |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
542 |
RegToReg, // A register to register move |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
543 |
RegToMem, // A register to memory move |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
544 |
MemToReg, // A memory to register move |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
545 |
PhiLocationDifferToInputLocation, // When coalescing phi nodes in PhaseChaitin::Split(), a move spill is inserted if |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
546 |
// the phi and its input resides at different locations (i.e. reg or mem) |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
547 |
BasePointerToMem, // Spill base pointer to memory at safepoint |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
548 |
InputToRematerialization, // When rematerializing a node we stretch the inputs live ranges, and they might be |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
549 |
// stretched beyond a new definition point, therefore we split out new copies instead |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
550 |
CallUse, // Spill use at a call |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
551 |
Bound // An lrg marked as spill that is bound and needs to be spilled at a use |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
552 |
}; |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
553 |
private: |
1 | 554 |
const RegMask *_in; // RegMask for input |
555 |
const RegMask *_out; // RegMask for output |
|
556 |
const Type *_type; |
|
22914
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
557 |
const SpillType _spill_type; |
1 | 558 |
public: |
22914
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
559 |
MachSpillCopyNode(SpillType spill_type, Node *n, const RegMask &in, const RegMask &out ) : |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
560 |
MachIdealNode(), _spill_type(spill_type), _in(&in), _out(&out), _type(n->bottom_type()) { |
1 | 561 |
init_class_id(Class_MachSpillCopy); |
562 |
init_flags(Flag_is_Copy); |
|
563 |
add_req(NULL); |
|
564 |
add_req(n); |
|
565 |
} |
|
566 |
virtual uint size_of() const { return sizeof(*this); } |
|
567 |
void set_out_RegMask(const RegMask &out) { _out = &out; } |
|
568 |
void set_in_RegMask(const RegMask &in) { _in = ∈ } |
|
569 |
virtual const RegMask &out_RegMask() const { return *_out; } |
|
570 |
virtual const RegMask &in_RegMask(uint) const { return *_in; } |
|
571 |
virtual const class Type *bottom_type() const { return _type; } |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13104
diff
changeset
|
572 |
virtual uint ideal_reg() const { return _type->ideal_reg(); } |
1 | 573 |
virtual uint oper_input_base() const { return 1; } |
574 |
uint implementation( CodeBuffer *cbuf, PhaseRegAlloc *ra_, bool do_size, outputStream* st ) const; |
|
575 |
||
576 |
virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const; |
|
577 |
virtual uint size(PhaseRegAlloc *ra_) const; |
|
578 |
||
22914
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
579 |
|
1 | 580 |
#ifndef PRODUCT |
22914
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
581 |
virtual const char *Name() const { |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
582 |
switch (_spill_type) { |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
583 |
case TwoAddress: |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
584 |
return "TwoAddressSpillCopy"; |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
585 |
case PhiInput: |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
586 |
return "PhiInputSpillCopy"; |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
587 |
case DebugUse: |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
588 |
return "DebugUseSpillCopy"; |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
589 |
case LoopPhiInput: |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
590 |
return "LoopPhiInputSpillCopy"; |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
591 |
case Definition: |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
592 |
return "DefinitionSpillCopy"; |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
593 |
case RegToReg: |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
594 |
return "RegToRegSpillCopy"; |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
595 |
case RegToMem: |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
596 |
return "RegToMemSpillCopy"; |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
597 |
case MemToReg: |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
598 |
return "MemToRegSpillCopy"; |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
599 |
case PhiLocationDifferToInputLocation: |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
600 |
return "PhiLocationDifferToInputLocationSpillCopy"; |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
601 |
case BasePointerToMem: |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
602 |
return "BasePointerToMemSpillCopy"; |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
603 |
case InputToRematerialization: |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
604 |
return "InputToRematerializationSpillCopy"; |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
605 |
case CallUse: |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
606 |
return "CallUseSpillCopy"; |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
607 |
case Bound: |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
608 |
return "BoundSpillCopy"; |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
609 |
default: |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
610 |
assert(false, "Must have valid spill type"); |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
611 |
return "MachSpillCopy"; |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
612 |
} |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
613 |
} |
0712db174bbb
8032656: Tag the MachSpillCopies with purpose information
adlertz
parents:
22860
diff
changeset
|
614 |
|
1 | 615 |
virtual void format( PhaseRegAlloc *, outputStream *st ) const; |
616 |
#endif |
|
617 |
}; |
|
618 |
||
28648
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
619 |
// MachMergeNode is similar to a PhiNode in a sense it merges multiple values, |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
620 |
// however it doesn't have a control input and is more like a MergeMem. |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
621 |
// It is inserted after the register allocation is done to ensure that nodes use single |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
622 |
// definition of a multidef lrg in a block. |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
623 |
class MachMergeNode : public MachIdealNode { |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
624 |
public: |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
625 |
MachMergeNode(Node *n1) { |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
626 |
init_class_id(Class_MachMerge); |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
627 |
add_req(NULL); |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
628 |
add_req(n1); |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
629 |
} |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
630 |
virtual const RegMask &out_RegMask() const { return in(1)->out_RegMask(); } |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
631 |
virtual const RegMask &in_RegMask(uint idx) const { return in(1)->in_RegMask(idx); } |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
632 |
virtual const class Type *bottom_type() const { return in(1)->bottom_type(); } |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
633 |
virtual uint ideal_reg() const { return bottom_type()->ideal_reg(); } |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
634 |
virtual uint oper_input_base() const { return 1; } |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
635 |
virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { } |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
636 |
virtual uint size(PhaseRegAlloc *ra_) const { return 0; } |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
637 |
#ifndef PRODUCT |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
638 |
virtual const char *Name() const { return "MachMerge"; } |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
639 |
#endif |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
640 |
}; |
102bdbb42723
8068881: SIGBUS in C2 compiled method weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory$SimulatedWsdlDefinitions.<init>
iveresov
parents:
25930
diff
changeset
|
641 |
|
10266
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
642 |
//------------------------------MachBranchNode-------------------------------- |
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
643 |
// Abstract machine branch Node |
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
644 |
class MachBranchNode : public MachIdealNode { |
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
645 |
public: |
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
646 |
MachBranchNode() : MachIdealNode() { |
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
647 |
init_class_id(Class_MachBranch); |
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
648 |
} |
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
649 |
virtual void label_set(Label* label, uint block_num) = 0; |
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
650 |
virtual void save_label(Label** label, uint* block_num) = 0; |
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
651 |
|
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
652 |
// Support for short branches |
25930 | 653 |
virtual MachNode *short_branch_version() { return NULL; } |
10266
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
654 |
|
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
655 |
virtual bool pinned() const { return true; }; |
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
656 |
}; |
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
657 |
|
1 | 658 |
//------------------------------MachNullChkNode-------------------------------- |
659 |
// Machine-dependent null-pointer-check Node. Points a real MachNode that is |
|
660 |
// also some kind of memory op. Turns the indicated MachNode into a |
|
661 |
// conditional branch with good latency on the ptr-not-null path and awful |
|
662 |
// latency on the pointer-is-null path. |
|
663 |
||
10266
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
664 |
class MachNullCheckNode : public MachBranchNode { |
1 | 665 |
public: |
666 |
const uint _vidx; // Index of memop being tested |
|
10266
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
667 |
MachNullCheckNode( Node *ctrl, Node *memop, uint vidx ) : MachBranchNode(), _vidx(vidx) { |
1 | 668 |
init_class_id(Class_MachNullCheck); |
669 |
add_req(ctrl); |
|
670 |
add_req(memop); |
|
671 |
} |
|
10266
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
672 |
virtual uint size_of() const { return sizeof(*this); } |
1 | 673 |
|
674 |
virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const; |
|
10252 | 675 |
virtual void label_set(Label* label, uint block_num); |
10266
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
676 |
virtual void save_label(Label** label, uint* block_num); |
1 | 677 |
virtual void negate() { } |
678 |
virtual const class Type *bottom_type() const { return TypeTuple::IFBOTH; } |
|
679 |
virtual uint ideal_reg() const { return NotAMachineReg; } |
|
680 |
virtual const RegMask &in_RegMask(uint) const; |
|
681 |
virtual const RegMask &out_RegMask() const { return RegMask::Empty; } |
|
682 |
#ifndef PRODUCT |
|
683 |
virtual const char *Name() const { return "NullCheck"; } |
|
684 |
virtual void format( PhaseRegAlloc *, outputStream *st ) const; |
|
685 |
#endif |
|
686 |
}; |
|
687 |
||
688 |
//------------------------------MachProjNode---------------------------------- |
|
689 |
// Machine-dependent Ideal projections (how is that for an oxymoron). Really |
|
690 |
// just MachNodes made by the Ideal world that replicate simple projections |
|
691 |
// but with machine-dependent input & output register masks. Generally |
|
692 |
// produced as part of calling conventions. Normally I make MachNodes as part |
|
693 |
// of the Matcher process, but the Matcher is ill suited to issues involving |
|
694 |
// frame handling, so frame handling is all done in the Ideal world with |
|
695 |
// occasional callbacks to the machine model for important info. |
|
696 |
class MachProjNode : public ProjNode { |
|
697 |
public: |
|
10255 | 698 |
MachProjNode( Node *multi, uint con, const RegMask &out, uint ideal_reg ) : ProjNode(multi,con), _rout(out), _ideal_reg(ideal_reg) { |
699 |
init_class_id(Class_MachProj); |
|
700 |
} |
|
1 | 701 |
RegMask _rout; |
702 |
const uint _ideal_reg; |
|
703 |
enum projType { |
|
704 |
unmatched_proj = 0, // Projs for Control, I/O, memory not matched |
|
705 |
fat_proj = 999 // Projs killing many regs, defined by _rout |
|
706 |
}; |
|
707 |
virtual int Opcode() const; |
|
708 |
virtual const Type *bottom_type() const; |
|
709 |
virtual const TypePtr *adr_type() const; |
|
710 |
virtual const RegMask &in_RegMask(uint) const { return RegMask::Empty; } |
|
711 |
virtual const RegMask &out_RegMask() const { return _rout; } |
|
712 |
virtual uint ideal_reg() const { return _ideal_reg; } |
|
713 |
// Need size_of() for virtual ProjNode::clone() |
|
714 |
virtual uint size_of() const { return sizeof(MachProjNode); } |
|
715 |
#ifndef PRODUCT |
|
716 |
virtual void dump_spec(outputStream *st) const; |
|
717 |
#endif |
|
718 |
}; |
|
719 |
||
720 |
//------------------------------MachIfNode------------------------------------- |
|
721 |
// Machine-specific versions of IfNodes |
|
10266
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
722 |
class MachIfNode : public MachBranchNode { |
1 | 723 |
virtual uint size_of() const { return sizeof(*this); } // Size is bigger |
724 |
public: |
|
725 |
float _prob; // Probability branch goes either way |
|
726 |
float _fcnt; // Frequency counter |
|
10266
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
727 |
MachIfNode() : MachBranchNode() { |
1 | 728 |
init_class_id(Class_MachIf); |
729 |
} |
|
10266
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
730 |
// Negate conditional branches. |
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
731 |
virtual void negate() = 0; |
1 | 732 |
#ifndef PRODUCT |
733 |
virtual void dump_spec(outputStream *st) const; |
|
734 |
#endif |
|
735 |
}; |
|
736 |
||
10255 | 737 |
//------------------------------MachGotoNode----------------------------------- |
738 |
// Machine-specific versions of GotoNodes |
|
10266
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
739 |
class MachGotoNode : public MachBranchNode { |
10255 | 740 |
public: |
10266
2ea344c79e33
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
10264
diff
changeset
|
741 |
MachGotoNode() : MachBranchNode() { |
10255 | 742 |
init_class_id(Class_MachGoto); |
743 |
} |
|
744 |
}; |
|
745 |
||
1 | 746 |
//------------------------------MachFastLockNode------------------------------------- |
747 |
// Machine-specific versions of FastLockNodes |
|
748 |
class MachFastLockNode : public MachNode { |
|
749 |
virtual uint size_of() const { return sizeof(*this); } // Size is bigger |
|
750 |
public: |
|
23491 | 751 |
BiasedLockingCounters* _counters; |
752 |
RTMLockingCounters* _rtm_counters; // RTM lock counters for inflated locks |
|
753 |
RTMLockingCounters* _stack_rtm_counters; // RTM lock counters for stack locks |
|
1 | 754 |
MachFastLockNode() : MachNode() {} |
755 |
}; |
|
756 |
||
757 |
//------------------------------MachReturnNode-------------------------------- |
|
758 |
// Machine-specific versions of subroutine returns |
|
759 |
class MachReturnNode : public MachNode { |
|
760 |
virtual uint size_of() const; // Size is bigger |
|
761 |
public: |
|
762 |
RegMask *_in_rms; // Input register masks, set during allocation |
|
763 |
ReallocMark _nesting; // assertion check for reallocations |
|
764 |
const TypePtr* _adr_type; // memory effects of call or return |
|
765 |
MachReturnNode() : MachNode() { |
|
766 |
init_class_id(Class_MachReturn); |
|
767 |
_adr_type = TypePtr::BOTTOM; // the default: all of memory |
|
768 |
} |
|
769 |
||
770 |
void set_adr_type(const TypePtr* atp) { _adr_type = atp; } |
|
771 |
||
772 |
virtual const RegMask &in_RegMask(uint) const; |
|
773 |
virtual bool pinned() const { return true; }; |
|
774 |
virtual const TypePtr *adr_type() const; |
|
775 |
}; |
|
776 |
||
777 |
//------------------------------MachSafePointNode----------------------------- |
|
778 |
// Machine-specific versions of safepoints |
|
779 |
class MachSafePointNode : public MachReturnNode { |
|
780 |
public: |
|
781 |
OopMap* _oop_map; // Array of OopMap info (8-bit char) for GC |
|
782 |
JVMState* _jvms; // Pointer to list of JVM State Objects |
|
783 |
uint _jvmadj; // Extra delta to jvms indexes (mach. args) |
|
784 |
OopMap* oop_map() const { return _oop_map; } |
|
785 |
void set_oop_map(OopMap* om) { _oop_map = om; } |
|
786 |
||
787 |
MachSafePointNode() : MachReturnNode(), _oop_map(NULL), _jvms(NULL), _jvmadj(0) { |
|
788 |
init_class_id(Class_MachSafePoint); |
|
789 |
} |
|
790 |
||
791 |
virtual JVMState* jvms() const { return _jvms; } |
|
792 |
void set_jvms(JVMState* s) { |
|
793 |
_jvms = s; |
|
794 |
} |
|
795 |
virtual const Type *bottom_type() const; |
|
796 |
||
797 |
virtual const RegMask &in_RegMask(uint) const; |
|
798 |
||
799 |
// Functionality from old debug nodes |
|
800 |
Node *returnadr() const { return in(TypeFunc::ReturnAdr); } |
|
801 |
Node *frameptr () const { return in(TypeFunc::FramePtr); } |
|
802 |
||
803 |
Node *local(const JVMState* jvms, uint idx) const { |
|
804 |
assert(verify_jvms(jvms), "jvms must match"); |
|
805 |
return in(_jvmadj + jvms->locoff() + idx); |
|
806 |
} |
|
807 |
Node *stack(const JVMState* jvms, uint idx) const { |
|
808 |
assert(verify_jvms(jvms), "jvms must match"); |
|
809 |
return in(_jvmadj + jvms->stkoff() + idx); |
|
810 |
} |
|
811 |
Node *monitor_obj(const JVMState* jvms, uint idx) const { |
|
812 |
assert(verify_jvms(jvms), "jvms must match"); |
|
813 |
return in(_jvmadj + jvms->monitor_obj_offset(idx)); |
|
814 |
} |
|
815 |
Node *monitor_box(const JVMState* jvms, uint idx) const { |
|
816 |
assert(verify_jvms(jvms), "jvms must match"); |
|
817 |
return in(_jvmadj + jvms->monitor_box_offset(idx)); |
|
818 |
} |
|
819 |
void set_local(const JVMState* jvms, uint idx, Node *c) { |
|
820 |
assert(verify_jvms(jvms), "jvms must match"); |
|
821 |
set_req(_jvmadj + jvms->locoff() + idx, c); |
|
822 |
} |
|
823 |
void set_stack(const JVMState* jvms, uint idx, Node *c) { |
|
824 |
assert(verify_jvms(jvms), "jvms must match"); |
|
825 |
set_req(_jvmadj + jvms->stkoff() + idx, c); |
|
826 |
} |
|
827 |
void set_monitor(const JVMState* jvms, uint idx, Node *c) { |
|
828 |
assert(verify_jvms(jvms), "jvms must match"); |
|
829 |
set_req(_jvmadj + jvms->monoff() + idx, c); |
|
830 |
} |
|
831 |
}; |
|
832 |
||
833 |
//------------------------------MachCallNode---------------------------------- |
|
834 |
// Machine-specific versions of subroutine calls |
|
835 |
class MachCallNode : public MachSafePointNode { |
|
836 |
protected: |
|
837 |
virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash |
|
838 |
virtual uint cmp( const Node &n ) const; |
|
839 |
virtual uint size_of() const = 0; // Size is bigger |
|
840 |
public: |
|
841 |
const TypeFunc *_tf; // Function type |
|
842 |
address _entry_point; // Address of the method being called |
|
843 |
float _cnt; // Estimate of number of times called |
|
844 |
uint _argsize; // Size of argument block on stack |
|
845 |
||
846 |
const TypeFunc* tf() const { return _tf; } |
|
847 |
const address entry_point() const { return _entry_point; } |
|
848 |
const float cnt() const { return _cnt; } |
|
849 |
uint argsize() const { return _argsize; } |
|
850 |
||
851 |
void set_tf(const TypeFunc* tf) { _tf = tf; } |
|
852 |
void set_entry_point(address p) { _entry_point = p; } |
|
853 |
void set_cnt(float c) { _cnt = c; } |
|
854 |
void set_argsize(int s) { _argsize = s; } |
|
855 |
||
856 |
MachCallNode() : MachSafePointNode() { |
|
857 |
init_class_id(Class_MachCall); |
|
858 |
} |
|
859 |
||
860 |
virtual const Type *bottom_type() const; |
|
861 |
virtual bool pinned() const { return false; } |
|
862 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
863 |
virtual const RegMask &in_RegMask(uint) const; |
|
864 |
virtual int ret_addr_offset() { return 0; } |
|
865 |
||
866 |
bool returns_long() const { return tf()->return_type() == T_LONG; } |
|
867 |
bool return_value_is_used() const; |
|
25637
369f62cdfaba
8036588: VerifyFieldClosure fails instanceKlass:3133
drchase
parents:
24923
diff
changeset
|
868 |
|
369f62cdfaba
8036588: VerifyFieldClosure fails instanceKlass:3133
drchase
parents:
24923
diff
changeset
|
869 |
// Similar to cousin class CallNode::returns_pointer |
369f62cdfaba
8036588: VerifyFieldClosure fails instanceKlass:3133
drchase
parents:
24923
diff
changeset
|
870 |
bool returns_pointer() const; |
369f62cdfaba
8036588: VerifyFieldClosure fails instanceKlass:3133
drchase
parents:
24923
diff
changeset
|
871 |
|
1 | 872 |
#ifndef PRODUCT |
873 |
virtual void dump_spec(outputStream *st) const; |
|
874 |
#endif |
|
875 |
}; |
|
876 |
||
877 |
//------------------------------MachCallJavaNode------------------------------ |
|
878 |
// "Base" class for machine-specific versions of subroutine calls |
|
879 |
class MachCallJavaNode : public MachCallNode { |
|
880 |
protected: |
|
881 |
virtual uint cmp( const Node &n ) const; |
|
882 |
virtual uint size_of() const; // Size is bigger |
|
883 |
public: |
|
884 |
ciMethod* _method; // Method being direct called |
|
885 |
int _bci; // Byte Code index of call byte code |
|
886 |
bool _optimized_virtual; // Tells if node is a static call or an optimized virtual |
|
4566 | 887 |
bool _method_handle_invoke; // Tells if the call has to preserve SP |
1 | 888 |
MachCallJavaNode() : MachCallNode() { |
889 |
init_class_id(Class_MachCallJava); |
|
890 |
} |
|
4566 | 891 |
|
892 |
virtual const RegMask &in_RegMask(uint) const; |
|
893 |
||
1 | 894 |
#ifndef PRODUCT |
895 |
virtual void dump_spec(outputStream *st) const; |
|
896 |
#endif |
|
897 |
}; |
|
898 |
||
899 |
//------------------------------MachCallStaticJavaNode------------------------ |
|
900 |
// Machine-specific versions of monomorphic subroutine calls |
|
901 |
class MachCallStaticJavaNode : public MachCallJavaNode { |
|
902 |
virtual uint cmp( const Node &n ) const; |
|
903 |
virtual uint size_of() const; // Size is bigger |
|
904 |
public: |
|
905 |
const char *_name; // Runtime wrapper name |
|
906 |
MachCallStaticJavaNode() : MachCallJavaNode() { |
|
907 |
init_class_id(Class_MachCallStaticJava); |
|
908 |
} |
|
909 |
||
910 |
// If this is an uncommon trap, return the request code, else zero. |
|
911 |
int uncommon_trap_request() const; |
|
912 |
||
913 |
virtual int ret_addr_offset(); |
|
914 |
#ifndef PRODUCT |
|
915 |
virtual void dump_spec(outputStream *st) const; |
|
916 |
void dump_trap_args(outputStream *st) const; |
|
917 |
#endif |
|
918 |
}; |
|
919 |
||
920 |
//------------------------------MachCallDynamicJavaNode------------------------ |
|
921 |
// Machine-specific versions of possibly megamorphic subroutine calls |
|
922 |
class MachCallDynamicJavaNode : public MachCallJavaNode { |
|
923 |
public: |
|
924 |
int _vtable_index; |
|
925 |
MachCallDynamicJavaNode() : MachCallJavaNode() { |
|
926 |
init_class_id(Class_MachCallDynamicJava); |
|
927 |
DEBUG_ONLY(_vtable_index = -99); // throw an assert if uninitialized |
|
928 |
} |
|
929 |
virtual int ret_addr_offset(); |
|
930 |
#ifndef PRODUCT |
|
931 |
virtual void dump_spec(outputStream *st) const; |
|
932 |
#endif |
|
933 |
}; |
|
934 |
||
935 |
//------------------------------MachCallRuntimeNode---------------------------- |
|
936 |
// Machine-specific versions of subroutine calls |
|
937 |
class MachCallRuntimeNode : public MachCallNode { |
|
938 |
virtual uint cmp( const Node &n ) const; |
|
939 |
virtual uint size_of() const; // Size is bigger |
|
940 |
public: |
|
941 |
const char *_name; // Printable name, if _method is NULL |
|
942 |
MachCallRuntimeNode() : MachCallNode() { |
|
943 |
init_class_id(Class_MachCallRuntime); |
|
944 |
} |
|
945 |
virtual int ret_addr_offset(); |
|
946 |
#ifndef PRODUCT |
|
947 |
virtual void dump_spec(outputStream *st) const; |
|
948 |
#endif |
|
949 |
}; |
|
950 |
||
951 |
class MachCallLeafNode: public MachCallRuntimeNode { |
|
952 |
public: |
|
953 |
MachCallLeafNode() : MachCallRuntimeNode() { |
|
954 |
init_class_id(Class_MachCallLeaf); |
|
955 |
} |
|
956 |
}; |
|
957 |
||
958 |
//------------------------------MachHaltNode----------------------------------- |
|
959 |
// Machine-specific versions of halt nodes |
|
960 |
class MachHaltNode : public MachReturnNode { |
|
961 |
public: |
|
962 |
virtual JVMState* jvms() const; |
|
963 |
}; |
|
964 |
||
965 |
||
966 |
//------------------------------MachTempNode----------------------------------- |
|
967 |
// Node used by the adlc to construct inputs to represent temporary registers |
|
968 |
class MachTempNode : public MachNode { |
|
969 |
private: |
|
970 |
MachOper *_opnd_array[1]; |
|
971 |
||
972 |
public: |
|
973 |
virtual const RegMask &out_RegMask() const { return *_opnds[0]->in_RegMask(0); } |
|
974 |
virtual uint rule() const { return 9999999; } |
|
975 |
virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {} |
|
976 |
||
977 |
MachTempNode(MachOper* oper) { |
|
978 |
init_class_id(Class_MachTemp); |
|
979 |
_num_opnds = 1; |
|
980 |
_opnds = _opnd_array; |
|
981 |
add_req(NULL); |
|
982 |
_opnds[0] = oper; |
|
983 |
} |
|
984 |
virtual uint size_of() const { return sizeof(MachTempNode); } |
|
985 |
||
986 |
#ifndef PRODUCT |
|
987 |
virtual void format(PhaseRegAlloc *, outputStream *st ) const {} |
|
988 |
virtual const char *Name() const { return "MachTemp";} |
|
989 |
#endif |
|
990 |
}; |
|
991 |
||
992 |
||
993 |
||
994 |
//------------------------------labelOper-------------------------------------- |
|
995 |
// Machine-independent version of label operand |
|
996 |
class labelOper : public MachOper { |
|
997 |
private: |
|
998 |
virtual uint num_edges() const { return 0; } |
|
999 |
public: |
|
1000 |
// Supported for fixed size branches |
|
1001 |
Label* _label; // Label for branch(es) |
|
1002 |
||
1003 |
uint _block_num; |
|
1004 |
||
1005 |
labelOper() : _block_num(0), _label(0) {} |
|
1006 |
||
1007 |
labelOper(Label* label, uint block_num) : _label(label), _block_num(block_num) {} |
|
1008 |
||
1009 |
labelOper(labelOper* l) : _label(l->_label) , _block_num(l->_block_num) {} |
|
1010 |
||
25930 | 1011 |
virtual MachOper *clone() const; |
1 | 1012 |
|
10252 | 1013 |
virtual Label *label() const { assert(_label != NULL, "need Label"); return _label; } |
1 | 1014 |
|
1015 |
virtual uint opcode() const; |
|
1016 |
||
1017 |
virtual uint hash() const; |
|
1018 |
virtual uint cmp( const MachOper &oper ) const; |
|
1019 |
#ifndef PRODUCT |
|
1020 |
virtual const char *Name() const { return "Label";} |
|
1021 |
||
1022 |
virtual void int_format(PhaseRegAlloc *ra, const MachNode *node, outputStream *st) const; |
|
1023 |
virtual void ext_format(PhaseRegAlloc *ra, const MachNode *node, int idx, outputStream *st) const { int_format( ra, node, st ); } |
|
1024 |
#endif |
|
1025 |
}; |
|
1026 |
||
1027 |
||
1028 |
//------------------------------methodOper-------------------------------------- |
|
1029 |
// Machine-independent version of method operand |
|
1030 |
class methodOper : public MachOper { |
|
1031 |
private: |
|
1032 |
virtual uint num_edges() const { return 0; } |
|
1033 |
public: |
|
1034 |
intptr_t _method; // Address of method |
|
1035 |
methodOper() : _method(0) {} |
|
1036 |
methodOper(intptr_t method) : _method(method) {} |
|
1037 |
||
25930 | 1038 |
virtual MachOper *clone() const; |
1 | 1039 |
|
1040 |
virtual intptr_t method() const { return _method; } |
|
1041 |
||
1042 |
virtual uint opcode() const; |
|
1043 |
||
1044 |
virtual uint hash() const; |
|
1045 |
virtual uint cmp( const MachOper &oper ) const; |
|
1046 |
#ifndef PRODUCT |
|
1047 |
virtual const char *Name() const { return "Method";} |
|
1048 |
||
1049 |
virtual void int_format(PhaseRegAlloc *ra, const MachNode *node, outputStream *st) const; |
|
1050 |
virtual void ext_format(PhaseRegAlloc *ra, const MachNode *node, int idx, outputStream *st) const { int_format( ra, node, st ); } |
|
1051 |
#endif |
|
1052 |
}; |
|
7397 | 1053 |
|
1054 |
#endif // SHARE_VM_OPTO_MACHNODE_HPP |