Mercurial > hg > graal-jvmci-8
annotate src/share/vm/opto/machnode.hpp @ 14437:15120a36272d
8028767: PPC64: (part 121): smaller shared changes needed to build C2
Summary: smaller shared changes required to build the C2 compiler on PPC64.
Reviewed-by: kvn
author | goetz |
---|---|
date | Thu, 21 Nov 2013 19:00:57 -0800 |
parents | 318d0622a6d7 |
children | 41b780b43b74 |
rev | line source |
---|---|
0 | 1 /* |
12146
9758d9f36299
8021954: VM SIGSEGV during classloading on MacOS; hs_err_pid file produced
coleenp
parents:
6725
diff
changeset
|
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1203
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1203
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1203
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 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 | |
14437
15120a36272d
8028767: PPC64: (part 121): smaller shared changes needed to build C2
goetz
parents:
14434
diff
changeset
|
34 class BiasedLockingCounters; |
0 | 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; | |
56 class State; | |
57 | |
58 //---------------------------MachOper------------------------------------------ | |
59 class MachOper : public ResourceObj { | |
60 public: | |
61 // Allocate right next to the MachNodes in the same arena | |
12146
9758d9f36299
8021954: VM SIGSEGV during classloading on MacOS; hs_err_pid file produced
coleenp
parents:
6725
diff
changeset
|
62 void *operator new( size_t x, Compile* C ) throw() { return C->node_arena()->Amalloc_D(x); } |
0 | 63 |
64 // Opcode | |
65 virtual uint opcode() const = 0; | |
66 | |
67 // Number of input edges. | |
68 // Generally at least 1 | |
69 virtual uint num_edges() const { return 1; } | |
70 // Array of Register masks | |
71 virtual const RegMask *in_RegMask(int index) const; | |
72 | |
73 // Methods to output the encoding of the operand | |
74 | |
75 // Negate conditional branches. Error for non-branch Nodes | |
76 virtual void negate(); | |
77 | |
78 // Return the value requested | |
79 // result register lookup, corresponding to int_format | |
80 virtual int reg(PhaseRegAlloc *ra_, const Node *node) const; | |
81 // input register lookup, corresponding to ext_format | |
82 virtual int reg(PhaseRegAlloc *ra_, const Node *node, int idx) const; | |
83 | |
84 // helpers for MacroAssembler generation from ADLC | |
85 Register as_Register(PhaseRegAlloc *ra_, const Node *node) const { | |
86 return ::as_Register(reg(ra_, node)); | |
87 } | |
88 Register as_Register(PhaseRegAlloc *ra_, const Node *node, int idx) const { | |
89 return ::as_Register(reg(ra_, node, idx)); | |
90 } | |
91 FloatRegister as_FloatRegister(PhaseRegAlloc *ra_, const Node *node) const { | |
92 return ::as_FloatRegister(reg(ra_, node)); | |
93 } | |
94 FloatRegister as_FloatRegister(PhaseRegAlloc *ra_, const Node *node, int idx) const { | |
95 return ::as_FloatRegister(reg(ra_, node, idx)); | |
96 } | |
97 | |
98 #if defined(IA32) || defined(AMD64) | |
99 XMMRegister as_XMMRegister(PhaseRegAlloc *ra_, const Node *node) const { | |
100 return ::as_XMMRegister(reg(ra_, node)); | |
101 } | |
102 XMMRegister as_XMMRegister(PhaseRegAlloc *ra_, const Node *node, int idx) const { | |
103 return ::as_XMMRegister(reg(ra_, node, idx)); | |
104 } | |
105 #endif | |
106 | |
107 virtual intptr_t constant() const; | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
108 virtual relocInfo::relocType constant_reloc() const; |
0 | 109 virtual jdouble constantD() const; |
110 virtual jfloat constantF() const; | |
111 virtual jlong constantL() const; | |
112 virtual TypeOopPtr *oop() const; | |
113 virtual int ccode() const; | |
114 // A zero, default, indicates this value is not needed. | |
115 // May need to lookup the base register, as done in int_ and ext_format | |
116 virtual int base (PhaseRegAlloc *ra_, const Node *node, int idx) const; | |
117 virtual int index(PhaseRegAlloc *ra_, const Node *node, int idx) const; | |
118 virtual int scale() const; | |
119 // Parameters needed to support MEMORY_INTERFACE access to stackSlot | |
120 virtual int disp (PhaseRegAlloc *ra_, const Node *node, int idx) const; | |
121 // Check for PC-Relative displacement | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
122 virtual relocInfo::relocType disp_reloc() const; |
0 | 123 virtual int constant_disp() const; // usu. 0, may return Type::OffsetBot |
124 virtual int base_position() const; // base edge position, or -1 | |
125 virtual int index_position() const; // index edge position, or -1 | |
126 | |
127 // Access the TypeKlassPtr of operands with a base==RegI and disp==RegP | |
128 // Only returns non-null value for i486.ad's indOffset32X | |
129 virtual const TypePtr *disp_as_type() const { return NULL; } | |
130 | |
131 // Return the label | |
132 virtual Label *label() const; | |
133 | |
134 // Return the method's address | |
135 virtual intptr_t method() const; | |
136 | |
137 // Hash and compare over operands are currently identical | |
138 virtual uint hash() const; | |
139 virtual uint cmp( const MachOper &oper ) const; | |
140 | |
141 // Virtual clone, since I do not know how big the MachOper is. | |
142 virtual MachOper *clone(Compile* C) const = 0; | |
143 | |
144 // Return ideal Type from simple operands. Fail for complex operands. | |
145 virtual const Type *type() const; | |
146 | |
147 // Set an integer offset if we have one, or error otherwise | |
148 virtual void set_con( jint c0 ) { ShouldNotReachHere(); } | |
149 | |
150 #ifndef PRODUCT | |
151 // Return name of operand | |
152 virtual const char *Name() const { return "???";} | |
153 | |
154 // Methods to output the text version of the operand | |
155 virtual void int_format(PhaseRegAlloc *,const MachNode *node, outputStream *st) const = 0; | |
156 virtual void ext_format(PhaseRegAlloc *,const MachNode *node,int idx, outputStream *st) const=0; | |
157 | |
158 virtual void dump_spec(outputStream *st) const; // Print per-operand info | |
14428
044b28168e20
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
12146
diff
changeset
|
159 |
044b28168e20
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
12146
diff
changeset
|
160 // Check whether o is a valid oper. |
044b28168e20
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
12146
diff
changeset
|
161 static bool notAnOper(const MachOper *o) { |
044b28168e20
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
12146
diff
changeset
|
162 if (o == NULL) return true; |
044b28168e20
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
12146
diff
changeset
|
163 if (((intptr_t)o & 1) != 0) return true; |
044b28168e20
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
12146
diff
changeset
|
164 if (*(address*)o == badAddress) return true; // kill by Node::destruct |
044b28168e20
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
12146
diff
changeset
|
165 return false; |
044b28168e20
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
12146
diff
changeset
|
166 } |
044b28168e20
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
12146
diff
changeset
|
167 #endif // !PRODUCT |
0 | 168 }; |
169 | |
170 //------------------------------MachNode--------------------------------------- | |
171 // Base type for all machine specific nodes. All node classes generated by the | |
172 // ADLC inherit from this class. | |
173 class MachNode : public Node { | |
174 public: | |
175 MachNode() : Node((uint)0), _num_opnds(0), _opnds(NULL) { | |
176 init_class_id(Class_Mach); | |
177 } | |
178 // Required boilerplate | |
179 virtual uint size_of() const { return sizeof(MachNode); } | |
180 virtual int Opcode() const; // Always equal to MachNode | |
181 virtual uint rule() const = 0; // Machine-specific opcode | |
182 // Number of inputs which come before the first operand. | |
183 // Generally at least 1, to skip the Control input | |
184 virtual uint oper_input_base() const { return 1; } | |
14434
318d0622a6d7
8028580: PPC64 (part 114/120): Support for Call nodes with constants.
goetz
parents:
14431
diff
changeset
|
185 // Position of constant base node in node's inputs. -1 if |
318d0622a6d7
8028580: PPC64 (part 114/120): Support for Call nodes with constants.
goetz
parents:
14431
diff
changeset
|
186 // no constant base node input. |
318d0622a6d7
8028580: PPC64 (part 114/120): Support for Call nodes with constants.
goetz
parents:
14431
diff
changeset
|
187 virtual uint mach_constant_base_node_input() const { return (uint)-1; } |
0 | 188 |
189 // Copy inputs and operands to new node of instruction. | |
190 // Called from cisc_version() and short_branch_version(). | |
191 // !!!! The method's body is defined in ad_<arch>.cpp file. | |
192 void fill_new_machnode(MachNode *n, Compile* C) const; | |
193 | |
194 // Return an equivalent instruction using memory for cisc_operand position | |
195 virtual MachNode *cisc_version(int offset, Compile* C); | |
196 // Modify this instruction's register mask to use stack version for cisc_operand | |
197 virtual void use_cisc_RegMask(); | |
198 | |
199 // Support for short branches | |
200 bool may_be_short_branch() const { return (flags() & Flag_may_be_short_branch) != 0; } | |
201 | |
3851 | 202 // Avoid back to back some instructions on some CPUs. |
203 bool avoid_back_to_back() const { return (flags() & Flag_avoid_back_to_back) != 0; } | |
204 | |
4120
f03a3c8bd5e5
7077312: Provide a CALL effect for instruct declaration in the ad file
roland
parents:
3853
diff
changeset
|
205 // instruction implemented with a call |
f03a3c8bd5e5
7077312: Provide a CALL effect for instruct declaration in the ad file
roland
parents:
3853
diff
changeset
|
206 bool has_call() const { return (flags() & Flag_has_call) != 0; } |
f03a3c8bd5e5
7077312: Provide a CALL effect for instruct declaration in the ad file
roland
parents:
3853
diff
changeset
|
207 |
0 | 208 // First index in _in[] corresponding to operand, or -1 if there is none |
209 int operand_index(uint operand) const; | |
14437
15120a36272d
8028767: PPC64: (part 121): smaller shared changes needed to build C2
goetz
parents:
14434
diff
changeset
|
210 int operand_index(const MachOper *oper) const; |
0 | 211 |
212 // Register class input is expected in | |
213 virtual const RegMask &in_RegMask(uint) const; | |
214 | |
215 // cisc-spillable instructions redefine for use by in_RegMask | |
216 virtual const RegMask *cisc_RegMask() const { return NULL; } | |
217 | |
218 // If this instruction is a 2-address instruction, then return the | |
219 // index of the input which must match the output. Not nessecary | |
220 // for instructions which bind the input and output register to the | |
221 // same singleton regiser (e.g., Intel IDIV which binds AX to be | |
222 // both an input and an output). It is nessecary when the input and | |
223 // output have choices - but they must use the same choice. | |
224 virtual uint two_adr( ) const { return 0; } | |
225 | |
226 // Array of complex operand pointers. Each corresponds to zero or | |
227 // more leafs. Must be set by MachNode constructor to point to an | |
228 // internal array of MachOpers. The MachOper array is sized by | |
229 // specific MachNodes described in the ADL. | |
230 uint _num_opnds; | |
231 MachOper **_opnds; | |
232 uint num_opnds() const { return _num_opnds; } | |
233 | |
234 // Emit bytes into cbuf | |
235 virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const; | |
14428
044b28168e20
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
12146
diff
changeset
|
236 // Expand node after register allocation. |
044b28168e20
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
12146
diff
changeset
|
237 // Node is replaced by several nodes in the postalloc expand phase. |
044b28168e20
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
12146
diff
changeset
|
238 // Corresponding methods are generated for nodes if they specify |
044b28168e20
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
12146
diff
changeset
|
239 // postalloc_expand. See block.cpp for more documentation. |
044b28168e20
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
12146
diff
changeset
|
240 virtual bool requires_postalloc_expand() const { return false; } |
044b28168e20
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
12146
diff
changeset
|
241 virtual void postalloc_expand(GrowableArray <Node *> *nodes, PhaseRegAlloc *ra_); |
0 | 242 // Size of instruction in bytes |
243 virtual uint size(PhaseRegAlloc *ra_) const; | |
244 // Helper function that computes size by emitting code | |
245 virtual uint emit_size(PhaseRegAlloc *ra_) const; | |
246 | |
247 // Return the alignment required (in units of relocInfo::addr_unit()) | |
248 // for this instruction (must be a power of 2) | |
249 virtual int alignment_required() const { return 1; } | |
250 | |
251 // Return the padding (in bytes) to be emitted before this | |
252 // instruction to properly align it. | |
253 virtual int compute_padding(int current_offset) const { return 0; } | |
254 | |
255 // Return number of relocatable values contained in this instruction | |
256 virtual int reloc() const { return 0; } | |
257 | |
14434
318d0622a6d7
8028580: PPC64 (part 114/120): Support for Call nodes with constants.
goetz
parents:
14431
diff
changeset
|
258 // Return number of words used for double constants in this instruction |
318d0622a6d7
8028580: PPC64 (part 114/120): Support for Call nodes with constants.
goetz
parents:
14431
diff
changeset
|
259 virtual int ins_num_consts() const { return 0; } |
318d0622a6d7
8028580: PPC64 (part 114/120): Support for Call nodes with constants.
goetz
parents:
14431
diff
changeset
|
260 |
0 | 261 // Hash and compare over operands. Used to do GVN on machine Nodes. |
262 virtual uint hash() const; | |
263 virtual uint cmp( const Node &n ) const; | |
264 | |
265 // Expand method for MachNode, replaces nodes representing pseudo | |
266 // instructions with a set of nodes which represent real machine | |
267 // instructions and compute the same value. | |
1203 | 268 virtual MachNode *Expand( State *, Node_List &proj_list, Node* mem ) { return this; } |
0 | 269 |
270 // Bottom_type call; value comes from operand0 | |
271 virtual const class Type *bottom_type() const { return _opnds[0]->type(); } | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
272 virtual uint ideal_reg() const { const Type *t = _opnds[0]->type(); return t == TypeInt::CC ? Op_RegFlags : t->ideal_reg(); } |
0 | 273 |
274 // If this is a memory op, return the base pointer and fixed offset. | |
275 // If there are no such, return NULL. If there are multiple addresses | |
276 // or the address is indeterminate (rare cases) then return (Node*)-1, | |
277 // which serves as node bottom. | |
278 // If the offset is not statically determined, set it to Type::OffsetBot. | |
279 // This method is free to ignore stack slots if that helps. | |
280 #define TYPE_PTR_SENTINAL ((const TypePtr*)-1) | |
281 // Passing TYPE_PTR_SENTINAL as adr_type asks for computation of the adr_type if possible | |
282 const Node* get_base_and_disp(intptr_t &offset, const TypePtr* &adr_type) const; | |
283 | |
284 // Helper for get_base_and_disp: find the base and index input nodes. | |
285 // Returns the MachOper as determined by memory_operand(), for use, if | |
286 // needed by the caller. If (MachOper *)-1 is returned, base and index | |
287 // are set to NodeSentinel. If (MachOper *) NULL is returned, base and | |
288 // index are set to NULL. | |
289 const MachOper* memory_inputs(Node* &base, Node* &index) const; | |
290 | |
291 // Helper for memory_inputs: Which operand carries the necessary info? | |
292 // By default, returns NULL, which means there is no such operand. | |
293 // If it returns (MachOper*)-1, this means there are multiple memories. | |
294 virtual const MachOper* memory_operand() const { return NULL; } | |
295 | |
296 // Call "get_base_and_disp" to decide which category of memory is used here. | |
297 virtual const class TypePtr *adr_type() const; | |
298 | |
299 // Apply peephole rule(s) to this instruction | |
300 virtual MachNode *peephole( Block *block, int block_index, PhaseRegAlloc *ra_, int &deleted, Compile* C ); | |
301 | |
302 // Top-level ideal Opcode matched | |
303 virtual int ideal_Opcode() const { return Op_Node; } | |
304 | |
305 // Adds the label for the case | |
306 virtual void add_case_label( int switch_val, Label* blockLabel); | |
307 | |
308 // Set the absolute address for methods | |
309 virtual void method_set( intptr_t addr ); | |
310 | |
311 // Should we clone rather than spill this instruction? | |
312 bool rematerialize() const; | |
313 | |
314 // Get the pipeline info | |
315 static const Pipeline *pipeline_class(); | |
316 virtual const Pipeline *pipeline() const; | |
317 | |
318 #ifndef PRODUCT | |
319 virtual const char *Name() const = 0; // Machine-specific name | |
320 virtual void dump_spec(outputStream *st) const; // Print per-node info | |
321 void dump_format(PhaseRegAlloc *ra, outputStream *st) const; // access to virtual | |
322 #endif | |
323 }; | |
324 | |
325 //------------------------------MachIdealNode---------------------------- | |
326 // Machine specific versions of nodes that must be defined by user. | |
327 // These are not converted by matcher from ideal nodes to machine nodes | |
328 // but are inserted into the code by the compiler. | |
329 class MachIdealNode : public MachNode { | |
330 public: | |
331 MachIdealNode( ) {} | |
332 | |
333 // Define the following defaults for non-matched machine nodes | |
334 virtual uint oper_input_base() const { return 0; } | |
335 virtual uint rule() const { return 9999999; } | |
336 virtual const class Type *bottom_type() const { return _opnds == NULL ? Type::CONTROL : MachNode::bottom_type(); } | |
337 }; | |
338 | |
339 //------------------------------MachTypeNode---------------------------- | |
340 // Machine Nodes that need to retain a known Type. | |
341 class MachTypeNode : public MachNode { | |
342 virtual uint size_of() const { return sizeof(*this); } // Size is bigger | |
343 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4120
diff
changeset
|
344 MachTypeNode( ) {} |
0 | 345 const Type *_bottom_type; |
346 | |
347 virtual const class Type *bottom_type() const { return _bottom_type; } | |
348 #ifndef PRODUCT | |
349 virtual void dump_spec(outputStream *st) const; | |
350 #endif | |
351 }; | |
352 | |
353 //------------------------------MachBreakpointNode---------------------------- | |
354 // Machine breakpoint or interrupt Node | |
355 class MachBreakpointNode : public MachIdealNode { | |
356 public: | |
357 MachBreakpointNode( ) {} | |
358 virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const; | |
359 virtual uint size(PhaseRegAlloc *ra_) const; | |
360 | |
361 #ifndef PRODUCT | |
362 virtual const char *Name() const { return "Breakpoint"; } | |
363 virtual void format( PhaseRegAlloc *, outputStream *st ) const; | |
364 #endif | |
365 }; | |
366 | |
2008 | 367 //------------------------------MachConstantBaseNode-------------------------- |
368 // Machine node that represents the base address of the constant table. | |
369 class MachConstantBaseNode : public MachIdealNode { | |
370 public: | |
371 static const RegMask& _out_RegMask; // We need the out_RegMask statically in MachConstantNode::in_RegMask(). | |
372 | |
373 public: | |
374 MachConstantBaseNode() : MachIdealNode() { | |
375 init_class_id(Class_MachConstantBase); | |
376 } | |
377 virtual const class Type* bottom_type() const { return TypeRawPtr::NOTNULL; } | |
378 virtual uint ideal_reg() const { return Op_RegP; } | |
379 virtual uint oper_input_base() const { return 1; } | |
380 | |
14428
044b28168e20
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
12146
diff
changeset
|
381 virtual bool requires_postalloc_expand() const; |
044b28168e20
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
12146
diff
changeset
|
382 virtual void postalloc_expand(GrowableArray <Node *> *nodes, PhaseRegAlloc *ra_); |
044b28168e20
8003854: PPC64 (part 115): Introduce PostallocExpand that expands nodes after register allocation
goetz
parents:
12146
diff
changeset
|
383 |
2008 | 384 virtual void emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const; |
385 virtual uint size(PhaseRegAlloc* ra_) const; | |
386 virtual bool pinned() const { return UseRDPCForConstantTableBase; } | |
387 | |
388 static const RegMask& static_out_RegMask() { return _out_RegMask; } | |
389 virtual const RegMask& out_RegMask() const { return static_out_RegMask(); } | |
390 | |
391 #ifndef PRODUCT | |
392 virtual const char* Name() const { return "MachConstantBaseNode"; } | |
393 virtual void format(PhaseRegAlloc*, outputStream* st) const; | |
394 #endif | |
395 }; | |
396 | |
397 //------------------------------MachConstantNode------------------------------- | |
398 // Machine node that holds a constant which is stored in the constant table. | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4120
diff
changeset
|
399 class MachConstantNode : public MachTypeNode { |
2008 | 400 protected: |
401 Compile::Constant _constant; // This node's constant. | |
402 | |
403 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4120
diff
changeset
|
404 MachConstantNode() : MachTypeNode() { |
2008 | 405 init_class_id(Class_MachConstant); |
406 } | |
407 | |
408 virtual void eval_constant(Compile* C) { | |
409 #ifdef ASSERT | |
410 tty->print("missing MachConstantNode eval_constant function: "); | |
411 dump(); | |
412 #endif | |
413 ShouldNotCallThis(); | |
414 } | |
415 | |
416 virtual const RegMask &in_RegMask(uint idx) const { | |
417 if (idx == mach_constant_base_node_input()) | |
418 return MachConstantBaseNode::static_out_RegMask(); | |
419 return MachNode::in_RegMask(idx); | |
420 } | |
421 | |
422 // Input edge of MachConstantBaseNode. | |
14434
318d0622a6d7
8028580: PPC64 (part 114/120): Support for Call nodes with constants.
goetz
parents:
14431
diff
changeset
|
423 virtual uint mach_constant_base_node_input() const { return req() - 1; } |
2008 | 424 |
425 int constant_offset(); | |
426 int constant_offset() const { return ((MachConstantNode*) this)->constant_offset(); } | |
14431
1410ad6b05f1
8028401: PPC (part 117): Improve usability of adlc and format() functionality.
goetz
parents:
14428
diff
changeset
|
427 // Unchecked version to avoid assertions in debug output. |
1410ad6b05f1
8028401: PPC (part 117): Improve usability of adlc and format() functionality.
goetz
parents:
14428
diff
changeset
|
428 int constant_offset_unchecked() const; |
2008 | 429 }; |
430 | |
0 | 431 //------------------------------MachUEPNode----------------------------------- |
432 // Machine Unvalidated Entry Point Node | |
433 class MachUEPNode : public MachIdealNode { | |
434 public: | |
435 MachUEPNode( ) {} | |
436 virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const; | |
437 virtual uint size(PhaseRegAlloc *ra_) const; | |
438 | |
439 #ifndef PRODUCT | |
440 virtual const char *Name() const { return "Unvalidated-Entry-Point"; } | |
441 virtual void format( PhaseRegAlloc *, outputStream *st ) const; | |
442 #endif | |
443 }; | |
444 | |
445 //------------------------------MachPrologNode-------------------------------- | |
446 // Machine function Prolog Node | |
447 class MachPrologNode : public MachIdealNode { | |
448 public: | |
449 MachPrologNode( ) {} | |
450 virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const; | |
451 virtual uint size(PhaseRegAlloc *ra_) const; | |
452 virtual int reloc() const; | |
453 | |
454 #ifndef PRODUCT | |
455 virtual const char *Name() const { return "Prolog"; } | |
456 virtual void format( PhaseRegAlloc *, outputStream *st ) const; | |
457 #endif | |
458 }; | |
459 | |
460 //------------------------------MachEpilogNode-------------------------------- | |
461 // Machine function Epilog Node | |
462 class MachEpilogNode : public MachIdealNode { | |
463 public: | |
464 MachEpilogNode(bool do_poll = false) : _do_polling(do_poll) {} | |
465 virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const; | |
466 virtual uint size(PhaseRegAlloc *ra_) const; | |
467 virtual int reloc() const; | |
468 virtual const Pipeline *pipeline() const; | |
469 | |
470 private: | |
471 bool _do_polling; | |
472 | |
473 public: | |
474 bool do_polling() const { return _do_polling; } | |
475 | |
476 // Offset of safepoint from the beginning of the node | |
477 int safepoint_offset() const; | |
478 | |
479 #ifndef PRODUCT | |
480 virtual const char *Name() const { return "Epilog"; } | |
481 virtual void format( PhaseRegAlloc *, outputStream *st ) const; | |
482 #endif | |
483 }; | |
484 | |
485 //------------------------------MachNopNode----------------------------------- | |
486 // Machine function Nop Node | |
487 class MachNopNode : public MachIdealNode { | |
488 private: | |
489 int _count; | |
490 public: | |
491 MachNopNode( ) : _count(1) {} | |
492 MachNopNode( int count ) : _count(count) {} | |
493 virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const; | |
494 virtual uint size(PhaseRegAlloc *ra_) const; | |
495 | |
496 virtual const class Type *bottom_type() const { return Type::CONTROL; } | |
497 | |
498 virtual int ideal_Opcode() const { return Op_Con; } // bogus; see output.cpp | |
499 virtual const Pipeline *pipeline() const; | |
500 #ifndef PRODUCT | |
501 virtual const char *Name() const { return "Nop"; } | |
502 virtual void format( PhaseRegAlloc *, outputStream *st ) const; | |
503 virtual void dump_spec(outputStream *st) const { } // No per-operand info | |
504 #endif | |
505 }; | |
506 | |
507 //------------------------------MachSpillCopyNode------------------------------ | |
508 // Machine SpillCopy Node. Copies 1 or 2 words from any location to any | |
509 // location (stack or register). | |
510 class MachSpillCopyNode : public MachIdealNode { | |
511 const RegMask *_in; // RegMask for input | |
512 const RegMask *_out; // RegMask for output | |
513 const Type *_type; | |
514 public: | |
515 MachSpillCopyNode( Node *n, const RegMask &in, const RegMask &out ) : | |
516 MachIdealNode(), _in(&in), _out(&out), _type(n->bottom_type()) { | |
517 init_class_id(Class_MachSpillCopy); | |
518 init_flags(Flag_is_Copy); | |
519 add_req(NULL); | |
520 add_req(n); | |
521 } | |
522 virtual uint size_of() const { return sizeof(*this); } | |
523 void set_out_RegMask(const RegMask &out) { _out = &out; } | |
524 void set_in_RegMask(const RegMask &in) { _in = ∈ } | |
525 virtual const RegMask &out_RegMask() const { return *_out; } | |
526 virtual const RegMask &in_RegMask(uint) const { return *_in; } | |
527 virtual const class Type *bottom_type() const { return _type; } | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
528 virtual uint ideal_reg() const { return _type->ideal_reg(); } |
0 | 529 virtual uint oper_input_base() const { return 1; } |
530 uint implementation( CodeBuffer *cbuf, PhaseRegAlloc *ra_, bool do_size, outputStream* st ) const; | |
531 | |
532 virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const; | |
533 virtual uint size(PhaseRegAlloc *ra_) const; | |
534 | |
535 #ifndef PRODUCT | |
536 virtual const char *Name() const { return "MachSpillCopy"; } | |
537 virtual void format( PhaseRegAlloc *, outputStream *st ) const; | |
538 #endif | |
539 }; | |
540 | |
3853
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
541 //------------------------------MachBranchNode-------------------------------- |
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
542 // Abstract machine branch Node |
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
543 class MachBranchNode : public MachIdealNode { |
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
544 public: |
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
545 MachBranchNode() : MachIdealNode() { |
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
546 init_class_id(Class_MachBranch); |
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
547 } |
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
548 virtual void label_set(Label* label, uint block_num) = 0; |
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
549 virtual void save_label(Label** label, uint* block_num) = 0; |
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
550 |
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
551 // Support for short branches |
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
552 virtual MachNode *short_branch_version(Compile* C) { return NULL; } |
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
553 |
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
554 virtual bool pinned() const { return true; }; |
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
555 }; |
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
556 |
0 | 557 //------------------------------MachNullChkNode-------------------------------- |
558 // Machine-dependent null-pointer-check Node. Points a real MachNode that is | |
559 // also some kind of memory op. Turns the indicated MachNode into a | |
560 // conditional branch with good latency on the ptr-not-null path and awful | |
561 // latency on the pointer-is-null path. | |
562 | |
3853
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
563 class MachNullCheckNode : public MachBranchNode { |
0 | 564 public: |
565 const uint _vidx; // Index of memop being tested | |
3853
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
566 MachNullCheckNode( Node *ctrl, Node *memop, uint vidx ) : MachBranchNode(), _vidx(vidx) { |
0 | 567 init_class_id(Class_MachNullCheck); |
568 add_req(ctrl); | |
569 add_req(memop); | |
570 } | |
3853
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
571 virtual uint size_of() const { return sizeof(*this); } |
0 | 572 |
573 virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const; | |
3839 | 574 virtual void label_set(Label* label, uint block_num); |
3853
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
575 virtual void save_label(Label** label, uint* block_num); |
0 | 576 virtual void negate() { } |
577 virtual const class Type *bottom_type() const { return TypeTuple::IFBOTH; } | |
578 virtual uint ideal_reg() const { return NotAMachineReg; } | |
579 virtual const RegMask &in_RegMask(uint) const; | |
580 virtual const RegMask &out_RegMask() const { return RegMask::Empty; } | |
581 #ifndef PRODUCT | |
582 virtual const char *Name() const { return "NullCheck"; } | |
583 virtual void format( PhaseRegAlloc *, outputStream *st ) const; | |
584 #endif | |
585 }; | |
586 | |
587 //------------------------------MachProjNode---------------------------------- | |
588 // Machine-dependent Ideal projections (how is that for an oxymoron). Really | |
589 // just MachNodes made by the Ideal world that replicate simple projections | |
590 // but with machine-dependent input & output register masks. Generally | |
591 // produced as part of calling conventions. Normally I make MachNodes as part | |
592 // of the Matcher process, but the Matcher is ill suited to issues involving | |
593 // frame handling, so frame handling is all done in the Ideal world with | |
594 // occasional callbacks to the machine model for important info. | |
595 class MachProjNode : public ProjNode { | |
596 public: | |
3842 | 597 MachProjNode( Node *multi, uint con, const RegMask &out, uint ideal_reg ) : ProjNode(multi,con), _rout(out), _ideal_reg(ideal_reg) { |
598 init_class_id(Class_MachProj); | |
599 } | |
0 | 600 RegMask _rout; |
601 const uint _ideal_reg; | |
602 enum projType { | |
603 unmatched_proj = 0, // Projs for Control, I/O, memory not matched | |
604 fat_proj = 999 // Projs killing many regs, defined by _rout | |
605 }; | |
606 virtual int Opcode() const; | |
607 virtual const Type *bottom_type() const; | |
608 virtual const TypePtr *adr_type() const; | |
609 virtual const RegMask &in_RegMask(uint) const { return RegMask::Empty; } | |
610 virtual const RegMask &out_RegMask() const { return _rout; } | |
611 virtual uint ideal_reg() const { return _ideal_reg; } | |
612 // Need size_of() for virtual ProjNode::clone() | |
613 virtual uint size_of() const { return sizeof(MachProjNode); } | |
614 #ifndef PRODUCT | |
615 virtual void dump_spec(outputStream *st) const; | |
616 #endif | |
617 }; | |
618 | |
619 //------------------------------MachIfNode------------------------------------- | |
620 // Machine-specific versions of IfNodes | |
3853
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
621 class MachIfNode : public MachBranchNode { |
0 | 622 virtual uint size_of() const { return sizeof(*this); } // Size is bigger |
623 public: | |
624 float _prob; // Probability branch goes either way | |
625 float _fcnt; // Frequency counter | |
3853
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
626 MachIfNode() : MachBranchNode() { |
0 | 627 init_class_id(Class_MachIf); |
628 } | |
3853
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
629 // Negate conditional branches. |
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
630 virtual void negate() = 0; |
0 | 631 #ifndef PRODUCT |
632 virtual void dump_spec(outputStream *st) const; | |
633 #endif | |
634 }; | |
635 | |
3842 | 636 //------------------------------MachGotoNode----------------------------------- |
637 // Machine-specific versions of GotoNodes | |
3853
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
638 class MachGotoNode : public MachBranchNode { |
3842 | 639 public: |
3853
11211f7cb5a0
7079317: Incorrect branch's destination block in PrintoOptoAssembly output
kvn
parents:
3851
diff
changeset
|
640 MachGotoNode() : MachBranchNode() { |
3842 | 641 init_class_id(Class_MachGoto); |
642 } | |
643 }; | |
644 | |
0 | 645 //------------------------------MachFastLockNode------------------------------------- |
646 // Machine-specific versions of FastLockNodes | |
647 class MachFastLockNode : public MachNode { | |
648 virtual uint size_of() const { return sizeof(*this); } // Size is bigger | |
649 public: | |
650 BiasedLockingCounters* _counters; | |
651 | |
652 MachFastLockNode() : MachNode() {} | |
653 }; | |
654 | |
655 //------------------------------MachReturnNode-------------------------------- | |
656 // Machine-specific versions of subroutine returns | |
657 class MachReturnNode : public MachNode { | |
658 virtual uint size_of() const; // Size is bigger | |
659 public: | |
660 RegMask *_in_rms; // Input register masks, set during allocation | |
661 ReallocMark _nesting; // assertion check for reallocations | |
662 const TypePtr* _adr_type; // memory effects of call or return | |
663 MachReturnNode() : MachNode() { | |
664 init_class_id(Class_MachReturn); | |
665 _adr_type = TypePtr::BOTTOM; // the default: all of memory | |
666 } | |
667 | |
668 void set_adr_type(const TypePtr* atp) { _adr_type = atp; } | |
669 | |
670 virtual const RegMask &in_RegMask(uint) const; | |
671 virtual bool pinned() const { return true; }; | |
672 virtual const TypePtr *adr_type() const; | |
673 }; | |
674 | |
675 //------------------------------MachSafePointNode----------------------------- | |
676 // Machine-specific versions of safepoints | |
677 class MachSafePointNode : public MachReturnNode { | |
678 public: | |
679 OopMap* _oop_map; // Array of OopMap info (8-bit char) for GC | |
680 JVMState* _jvms; // Pointer to list of JVM State Objects | |
681 uint _jvmadj; // Extra delta to jvms indexes (mach. args) | |
682 OopMap* oop_map() const { return _oop_map; } | |
683 void set_oop_map(OopMap* om) { _oop_map = om; } | |
684 | |
685 MachSafePointNode() : MachReturnNode(), _oop_map(NULL), _jvms(NULL), _jvmadj(0) { | |
686 init_class_id(Class_MachSafePoint); | |
687 } | |
688 | |
689 virtual JVMState* jvms() const { return _jvms; } | |
690 void set_jvms(JVMState* s) { | |
691 _jvms = s; | |
692 } | |
693 virtual const Type *bottom_type() const; | |
694 | |
695 virtual const RegMask &in_RegMask(uint) const; | |
696 | |
697 // Functionality from old debug nodes | |
698 Node *returnadr() const { return in(TypeFunc::ReturnAdr); } | |
699 Node *frameptr () const { return in(TypeFunc::FramePtr); } | |
700 | |
701 Node *local(const JVMState* jvms, uint idx) const { | |
702 assert(verify_jvms(jvms), "jvms must match"); | |
703 return in(_jvmadj + jvms->locoff() + idx); | |
704 } | |
705 Node *stack(const JVMState* jvms, uint idx) const { | |
706 assert(verify_jvms(jvms), "jvms must match"); | |
707 return in(_jvmadj + jvms->stkoff() + idx); | |
708 } | |
709 Node *monitor_obj(const JVMState* jvms, uint idx) const { | |
710 assert(verify_jvms(jvms), "jvms must match"); | |
711 return in(_jvmadj + jvms->monitor_obj_offset(idx)); | |
712 } | |
713 Node *monitor_box(const JVMState* jvms, uint idx) const { | |
714 assert(verify_jvms(jvms), "jvms must match"); | |
715 return in(_jvmadj + jvms->monitor_box_offset(idx)); | |
716 } | |
717 void set_local(const JVMState* jvms, uint idx, Node *c) { | |
718 assert(verify_jvms(jvms), "jvms must match"); | |
719 set_req(_jvmadj + jvms->locoff() + idx, c); | |
720 } | |
721 void set_stack(const JVMState* jvms, uint idx, Node *c) { | |
722 assert(verify_jvms(jvms), "jvms must match"); | |
723 set_req(_jvmadj + jvms->stkoff() + idx, c); | |
724 } | |
725 void set_monitor(const JVMState* jvms, uint idx, Node *c) { | |
726 assert(verify_jvms(jvms), "jvms must match"); | |
727 set_req(_jvmadj + jvms->monoff() + idx, c); | |
728 } | |
729 }; | |
730 | |
731 //------------------------------MachCallNode---------------------------------- | |
732 // Machine-specific versions of subroutine calls | |
733 class MachCallNode : public MachSafePointNode { | |
734 protected: | |
735 virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash | |
736 virtual uint cmp( const Node &n ) const; | |
737 virtual uint size_of() const = 0; // Size is bigger | |
738 public: | |
739 const TypeFunc *_tf; // Function type | |
740 address _entry_point; // Address of the method being called | |
741 float _cnt; // Estimate of number of times called | |
742 uint _argsize; // Size of argument block on stack | |
743 | |
744 const TypeFunc* tf() const { return _tf; } | |
745 const address entry_point() const { return _entry_point; } | |
746 const float cnt() const { return _cnt; } | |
747 uint argsize() const { return _argsize; } | |
748 | |
749 void set_tf(const TypeFunc* tf) { _tf = tf; } | |
750 void set_entry_point(address p) { _entry_point = p; } | |
751 void set_cnt(float c) { _cnt = c; } | |
752 void set_argsize(int s) { _argsize = s; } | |
753 | |
754 MachCallNode() : MachSafePointNode() { | |
755 init_class_id(Class_MachCall); | |
756 } | |
757 | |
758 virtual const Type *bottom_type() const; | |
759 virtual bool pinned() const { return false; } | |
760 virtual const Type *Value( PhaseTransform *phase ) const; | |
761 virtual const RegMask &in_RegMask(uint) const; | |
762 virtual int ret_addr_offset() { return 0; } | |
763 | |
764 bool returns_long() const { return tf()->return_type() == T_LONG; } | |
765 bool return_value_is_used() const; | |
766 #ifndef PRODUCT | |
767 virtual void dump_spec(outputStream *st) const; | |
768 #endif | |
769 }; | |
770 | |
771 //------------------------------MachCallJavaNode------------------------------ | |
772 // "Base" class for machine-specific versions of subroutine calls | |
773 class MachCallJavaNode : public MachCallNode { | |
774 protected: | |
775 virtual uint cmp( const Node &n ) const; | |
776 virtual uint size_of() const; // Size is bigger | |
777 public: | |
778 ciMethod* _method; // Method being direct called | |
779 int _bci; // Byte Code index of call byte code | |
780 bool _optimized_virtual; // Tells if node is a static call or an optimized virtual | |
1137 | 781 bool _method_handle_invoke; // Tells if the call has to preserve SP |
0 | 782 MachCallJavaNode() : MachCallNode() { |
783 init_class_id(Class_MachCallJava); | |
784 } | |
1137 | 785 |
786 virtual const RegMask &in_RegMask(uint) const; | |
787 | |
0 | 788 #ifndef PRODUCT |
789 virtual void dump_spec(outputStream *st) const; | |
790 #endif | |
791 }; | |
792 | |
793 //------------------------------MachCallStaticJavaNode------------------------ | |
794 // Machine-specific versions of monomorphic subroutine calls | |
795 class MachCallStaticJavaNode : public MachCallJavaNode { | |
796 virtual uint cmp( const Node &n ) const; | |
797 virtual uint size_of() const; // Size is bigger | |
798 public: | |
799 const char *_name; // Runtime wrapper name | |
800 MachCallStaticJavaNode() : MachCallJavaNode() { | |
801 init_class_id(Class_MachCallStaticJava); | |
802 } | |
803 | |
804 // If this is an uncommon trap, return the request code, else zero. | |
805 int uncommon_trap_request() const; | |
806 | |
807 virtual int ret_addr_offset(); | |
808 #ifndef PRODUCT | |
809 virtual void dump_spec(outputStream *st) const; | |
810 void dump_trap_args(outputStream *st) const; | |
811 #endif | |
812 }; | |
813 | |
814 //------------------------------MachCallDynamicJavaNode------------------------ | |
815 // Machine-specific versions of possibly megamorphic subroutine calls | |
816 class MachCallDynamicJavaNode : public MachCallJavaNode { | |
817 public: | |
818 int _vtable_index; | |
819 MachCallDynamicJavaNode() : MachCallJavaNode() { | |
820 init_class_id(Class_MachCallDynamicJava); | |
821 DEBUG_ONLY(_vtable_index = -99); // throw an assert if uninitialized | |
822 } | |
823 virtual int ret_addr_offset(); | |
824 #ifndef PRODUCT | |
825 virtual void dump_spec(outputStream *st) const; | |
826 #endif | |
827 }; | |
828 | |
829 //------------------------------MachCallRuntimeNode---------------------------- | |
830 // Machine-specific versions of subroutine calls | |
831 class MachCallRuntimeNode : public MachCallNode { | |
832 virtual uint cmp( const Node &n ) const; | |
833 virtual uint size_of() const; // Size is bigger | |
834 public: | |
835 const char *_name; // Printable name, if _method is NULL | |
836 MachCallRuntimeNode() : MachCallNode() { | |
837 init_class_id(Class_MachCallRuntime); | |
838 } | |
839 virtual int ret_addr_offset(); | |
840 #ifndef PRODUCT | |
841 virtual void dump_spec(outputStream *st) const; | |
842 #endif | |
843 }; | |
844 | |
845 class MachCallLeafNode: public MachCallRuntimeNode { | |
846 public: | |
847 MachCallLeafNode() : MachCallRuntimeNode() { | |
848 init_class_id(Class_MachCallLeaf); | |
849 } | |
850 }; | |
851 | |
852 //------------------------------MachHaltNode----------------------------------- | |
853 // Machine-specific versions of halt nodes | |
854 class MachHaltNode : public MachReturnNode { | |
855 public: | |
856 virtual JVMState* jvms() const; | |
857 }; | |
858 | |
859 | |
860 //------------------------------MachTempNode----------------------------------- | |
861 // Node used by the adlc to construct inputs to represent temporary registers | |
862 class MachTempNode : public MachNode { | |
863 private: | |
864 MachOper *_opnd_array[1]; | |
865 | |
866 public: | |
867 virtual const RegMask &out_RegMask() const { return *_opnds[0]->in_RegMask(0); } | |
868 virtual uint rule() const { return 9999999; } | |
869 virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {} | |
870 | |
871 MachTempNode(MachOper* oper) { | |
872 init_class_id(Class_MachTemp); | |
873 _num_opnds = 1; | |
874 _opnds = _opnd_array; | |
875 add_req(NULL); | |
876 _opnds[0] = oper; | |
877 } | |
878 virtual uint size_of() const { return sizeof(MachTempNode); } | |
879 | |
880 #ifndef PRODUCT | |
881 virtual void format(PhaseRegAlloc *, outputStream *st ) const {} | |
882 virtual const char *Name() const { return "MachTemp";} | |
883 #endif | |
884 }; | |
885 | |
886 | |
887 | |
888 //------------------------------labelOper-------------------------------------- | |
889 // Machine-independent version of label operand | |
890 class labelOper : public MachOper { | |
891 private: | |
892 virtual uint num_edges() const { return 0; } | |
893 public: | |
894 // Supported for fixed size branches | |
895 Label* _label; // Label for branch(es) | |
896 | |
897 uint _block_num; | |
898 | |
899 labelOper() : _block_num(0), _label(0) {} | |
900 | |
901 labelOper(Label* label, uint block_num) : _label(label), _block_num(block_num) {} | |
902 | |
903 labelOper(labelOper* l) : _label(l->_label) , _block_num(l->_block_num) {} | |
904 | |
905 virtual MachOper *clone(Compile* C) const; | |
906 | |
3839 | 907 virtual Label *label() const { assert(_label != NULL, "need Label"); return _label; } |
0 | 908 |
909 virtual uint opcode() const; | |
910 | |
911 virtual uint hash() const; | |
912 virtual uint cmp( const MachOper &oper ) const; | |
913 #ifndef PRODUCT | |
914 virtual const char *Name() const { return "Label";} | |
915 | |
916 virtual void int_format(PhaseRegAlloc *ra, const MachNode *node, outputStream *st) const; | |
917 virtual void ext_format(PhaseRegAlloc *ra, const MachNode *node, int idx, outputStream *st) const { int_format( ra, node, st ); } | |
918 #endif | |
919 }; | |
920 | |
921 | |
922 //------------------------------methodOper-------------------------------------- | |
923 // Machine-independent version of method operand | |
924 class methodOper : public MachOper { | |
925 private: | |
926 virtual uint num_edges() const { return 0; } | |
927 public: | |
928 intptr_t _method; // Address of method | |
929 methodOper() : _method(0) {} | |
930 methodOper(intptr_t method) : _method(method) {} | |
931 | |
932 virtual MachOper *clone(Compile* C) const; | |
933 | |
934 virtual intptr_t method() const { return _method; } | |
935 | |
936 virtual uint opcode() const; | |
937 | |
938 virtual uint hash() const; | |
939 virtual uint cmp( const MachOper &oper ) const; | |
940 #ifndef PRODUCT | |
941 virtual const char *Name() const { return "Method";} | |
942 | |
943 virtual void int_format(PhaseRegAlloc *ra, const MachNode *node, outputStream *st) const; | |
944 virtual void ext_format(PhaseRegAlloc *ra, const MachNode *node, int idx, outputStream *st) const { int_format( ra, node, st ); } | |
945 #endif | |
946 }; | |
1972 | 947 |
948 #endif // SHARE_VM_OPTO_MACHNODE_HPP |