annotate src/share/vm/opto/machnode.hpp @ 14498:04e7587c97dc

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