annotate src/share/vm/opto/connode.hpp @ 216:8d191a7697e2

6715633: when matching a memory node the adr_type should not change Summary: verify the adr_type of a mach node was not changed Reviewed-by: rasbold, never
author kvn
date Fri, 20 Jun 2008 11:10:05 -0700
parents 7793bd37a336
children 1e026f8da827
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
2 * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
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 *
a61af66fc99e Initial load
duke
parents:
diff changeset
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
20 * CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
21 * have any questions.
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 class PhaseTransform;
a61af66fc99e Initial load
duke
parents:
diff changeset
26 class MachNode;
a61af66fc99e Initial load
duke
parents:
diff changeset
27
a61af66fc99e Initial load
duke
parents:
diff changeset
28 //------------------------------ConNode----------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
29 // Simple constants
a61af66fc99e Initial load
duke
parents:
diff changeset
30 class ConNode : public TypeNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
31 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
32 ConNode( const Type *t ) : TypeNode(t,1) {
a61af66fc99e Initial load
duke
parents:
diff changeset
33 init_req(0, (Node*)Compile::current()->root());
a61af66fc99e Initial load
duke
parents:
diff changeset
34 init_flags(Flag_is_Con);
a61af66fc99e Initial load
duke
parents:
diff changeset
35 }
a61af66fc99e Initial load
duke
parents:
diff changeset
36 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
37 virtual uint hash() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
38 virtual const RegMask &out_RegMask() const { return RegMask::Empty; }
a61af66fc99e Initial load
duke
parents:
diff changeset
39 virtual const RegMask &in_RegMask(uint) const { return RegMask::Empty; }
a61af66fc99e Initial load
duke
parents:
diff changeset
40
a61af66fc99e Initial load
duke
parents:
diff changeset
41 // Polymorphic factory method:
a61af66fc99e Initial load
duke
parents:
diff changeset
42 static ConNode* make( Compile* C, const Type *t );
a61af66fc99e Initial load
duke
parents:
diff changeset
43 };
a61af66fc99e Initial load
duke
parents:
diff changeset
44
a61af66fc99e Initial load
duke
parents:
diff changeset
45 //------------------------------ConINode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
46 // Simple integer constants
a61af66fc99e Initial load
duke
parents:
diff changeset
47 class ConINode : public ConNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
48 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
49 ConINode( const TypeInt *t ) : ConNode(t) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
50 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
51
a61af66fc99e Initial load
duke
parents:
diff changeset
52 // Factory method:
a61af66fc99e Initial load
duke
parents:
diff changeset
53 static ConINode* make( Compile* C, int con ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
54 return new (C, 1) ConINode( TypeInt::make(con) );
a61af66fc99e Initial load
duke
parents:
diff changeset
55 }
a61af66fc99e Initial load
duke
parents:
diff changeset
56
a61af66fc99e Initial load
duke
parents:
diff changeset
57 };
a61af66fc99e Initial load
duke
parents:
diff changeset
58
a61af66fc99e Initial load
duke
parents:
diff changeset
59 //------------------------------ConPNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
60 // Simple pointer constants
a61af66fc99e Initial load
duke
parents:
diff changeset
61 class ConPNode : public ConNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
62 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
63 ConPNode( const TypePtr *t ) : ConNode(t) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
64 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
65
a61af66fc99e Initial load
duke
parents:
diff changeset
66 // Factory methods:
a61af66fc99e Initial load
duke
parents:
diff changeset
67 static ConPNode* make( Compile *C ,address con ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
68 if (con == NULL)
a61af66fc99e Initial load
duke
parents:
diff changeset
69 return new (C, 1) ConPNode( TypePtr::NULL_PTR ) ;
a61af66fc99e Initial load
duke
parents:
diff changeset
70 else
a61af66fc99e Initial load
duke
parents:
diff changeset
71 return new (C, 1) ConPNode( TypeRawPtr::make(con) );
a61af66fc99e Initial load
duke
parents:
diff changeset
72 }
a61af66fc99e Initial load
duke
parents:
diff changeset
73 };
a61af66fc99e Initial load
duke
parents:
diff changeset
74
a61af66fc99e Initial load
duke
parents:
diff changeset
75
113
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
76 //------------------------------ConNNode--------------------------------------
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
77 // Simple narrow oop constants
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
78 class ConNNode : public ConNode {
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
79 public:
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
80 ConNNode( const TypeNarrowOop *t ) : ConNode(t) {}
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
81 virtual int Opcode() const;
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
82 };
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
83
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
84
0
a61af66fc99e Initial load
duke
parents:
diff changeset
85 //------------------------------ConLNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
86 // Simple long constants
a61af66fc99e Initial load
duke
parents:
diff changeset
87 class ConLNode : public ConNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
88 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
89 ConLNode( const TypeLong *t ) : ConNode(t) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
90 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
91
a61af66fc99e Initial load
duke
parents:
diff changeset
92 // Factory method:
a61af66fc99e Initial load
duke
parents:
diff changeset
93 static ConLNode* make( Compile *C ,jlong con ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
94 return new (C, 1) ConLNode( TypeLong::make(con) );
a61af66fc99e Initial load
duke
parents:
diff changeset
95 }
a61af66fc99e Initial load
duke
parents:
diff changeset
96
a61af66fc99e Initial load
duke
parents:
diff changeset
97 };
a61af66fc99e Initial load
duke
parents:
diff changeset
98
a61af66fc99e Initial load
duke
parents:
diff changeset
99 //------------------------------ConFNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
100 // Simple float constants
a61af66fc99e Initial load
duke
parents:
diff changeset
101 class ConFNode : public ConNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
102 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
103 ConFNode( const TypeF *t ) : ConNode(t) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
104 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
105
a61af66fc99e Initial load
duke
parents:
diff changeset
106 // Factory method:
a61af66fc99e Initial load
duke
parents:
diff changeset
107 static ConFNode* make( Compile *C, float con ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
108 return new (C, 1) ConFNode( TypeF::make(con) );
a61af66fc99e Initial load
duke
parents:
diff changeset
109 }
a61af66fc99e Initial load
duke
parents:
diff changeset
110
a61af66fc99e Initial load
duke
parents:
diff changeset
111 };
a61af66fc99e Initial load
duke
parents:
diff changeset
112
a61af66fc99e Initial load
duke
parents:
diff changeset
113 //------------------------------ConDNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
114 // Simple double constants
a61af66fc99e Initial load
duke
parents:
diff changeset
115 class ConDNode : public ConNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
116 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
117 ConDNode( const TypeD *t ) : ConNode(t) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
118 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
119
a61af66fc99e Initial load
duke
parents:
diff changeset
120 // Factory method:
a61af66fc99e Initial load
duke
parents:
diff changeset
121 static ConDNode* make( Compile *C, double con ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
122 return new (C, 1) ConDNode( TypeD::make(con) );
a61af66fc99e Initial load
duke
parents:
diff changeset
123 }
a61af66fc99e Initial load
duke
parents:
diff changeset
124
a61af66fc99e Initial load
duke
parents:
diff changeset
125 };
a61af66fc99e Initial load
duke
parents:
diff changeset
126
a61af66fc99e Initial load
duke
parents:
diff changeset
127 //------------------------------BinaryNode-------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
128 // Place holder for the 2 conditional inputs to a CMove. CMove needs 4
a61af66fc99e Initial load
duke
parents:
diff changeset
129 // inputs: the Bool (for the lt/gt/eq/ne bits), the flags (result of some
a61af66fc99e Initial load
duke
parents:
diff changeset
130 // compare), and the 2 values to select between. The Matcher requires a
a61af66fc99e Initial load
duke
parents:
diff changeset
131 // binary tree so we break it down like this:
a61af66fc99e Initial load
duke
parents:
diff changeset
132 // (CMove (Binary bol cmp) (Binary src1 src2))
a61af66fc99e Initial load
duke
parents:
diff changeset
133 class BinaryNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
134 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
135 BinaryNode( Node *n1, Node *n2 ) : Node(0,n1,n2) { }
a61af66fc99e Initial load
duke
parents:
diff changeset
136 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
137 virtual uint ideal_reg() const { return 0; }
a61af66fc99e Initial load
duke
parents:
diff changeset
138 };
a61af66fc99e Initial load
duke
parents:
diff changeset
139
a61af66fc99e Initial load
duke
parents:
diff changeset
140 //------------------------------CMoveNode--------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
141 // Conditional move
a61af66fc99e Initial load
duke
parents:
diff changeset
142 class CMoveNode : public TypeNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
143 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
144 enum { Control, // When is it safe to do this cmove?
a61af66fc99e Initial load
duke
parents:
diff changeset
145 Condition, // Condition controlling the cmove
a61af66fc99e Initial load
duke
parents:
diff changeset
146 IfFalse, // Value if condition is false
a61af66fc99e Initial load
duke
parents:
diff changeset
147 IfTrue }; // Value if condition is true
a61af66fc99e Initial load
duke
parents:
diff changeset
148 CMoveNode( Node *bol, Node *left, Node *right, const Type *t ) : TypeNode(t,4)
a61af66fc99e Initial load
duke
parents:
diff changeset
149 {
a61af66fc99e Initial load
duke
parents:
diff changeset
150 init_class_id(Class_CMove);
a61af66fc99e Initial load
duke
parents:
diff changeset
151 // all inputs are nullified in Node::Node(int)
a61af66fc99e Initial load
duke
parents:
diff changeset
152 // init_req(Control,NULL);
a61af66fc99e Initial load
duke
parents:
diff changeset
153 init_req(Condition,bol);
a61af66fc99e Initial load
duke
parents:
diff changeset
154 init_req(IfFalse,left);
a61af66fc99e Initial load
duke
parents:
diff changeset
155 init_req(IfTrue,right);
a61af66fc99e Initial load
duke
parents:
diff changeset
156 }
a61af66fc99e Initial load
duke
parents:
diff changeset
157 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
158 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
159 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
160 static CMoveNode *make( Compile *C, Node *c, Node *bol, Node *left, Node *right, const Type *t );
a61af66fc99e Initial load
duke
parents:
diff changeset
161 // Helper function to spot cmove graph shapes
a61af66fc99e Initial load
duke
parents:
diff changeset
162 static Node *is_cmove_id( PhaseTransform *phase, Node *cmp, Node *t, Node *f, BoolNode *b );
a61af66fc99e Initial load
duke
parents:
diff changeset
163 };
a61af66fc99e Initial load
duke
parents:
diff changeset
164
a61af66fc99e Initial load
duke
parents:
diff changeset
165 //------------------------------CMoveDNode-------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
166 class CMoveDNode : public CMoveNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
167 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
168 CMoveDNode( Node *bol, Node *left, Node *right, const Type* t) : CMoveNode(bol,left,right,t){}
a61af66fc99e Initial load
duke
parents:
diff changeset
169 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
170 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
171 };
a61af66fc99e Initial load
duke
parents:
diff changeset
172
a61af66fc99e Initial load
duke
parents:
diff changeset
173 //------------------------------CMoveFNode-------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
174 class CMoveFNode : public CMoveNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
175 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
176 CMoveFNode( Node *bol, Node *left, Node *right, const Type* t ) : CMoveNode(bol,left,right,t) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
177 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
178 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
179 };
a61af66fc99e Initial load
duke
parents:
diff changeset
180
a61af66fc99e Initial load
duke
parents:
diff changeset
181 //------------------------------CMoveINode-------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
182 class CMoveINode : public CMoveNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
183 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
184 CMoveINode( Node *bol, Node *left, Node *right, const TypeInt *ti ) : CMoveNode(bol,left,right,ti){}
a61af66fc99e Initial load
duke
parents:
diff changeset
185 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
186 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
187 };
a61af66fc99e Initial load
duke
parents:
diff changeset
188
a61af66fc99e Initial load
duke
parents:
diff changeset
189 //------------------------------CMoveLNode-------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
190 class CMoveLNode : public CMoveNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
191 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
192 CMoveLNode(Node *bol, Node *left, Node *right, const TypeLong *tl ) : CMoveNode(bol,left,right,tl){}
a61af66fc99e Initial load
duke
parents:
diff changeset
193 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
194 };
a61af66fc99e Initial load
duke
parents:
diff changeset
195
a61af66fc99e Initial load
duke
parents:
diff changeset
196 //------------------------------CMovePNode-------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
197 class CMovePNode : public CMoveNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
198 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
199 CMovePNode( Node *c, Node *bol, Node *left, Node *right, const TypePtr* t ) : CMoveNode(bol,left,right,t) { init_req(Control,c); }
a61af66fc99e Initial load
duke
parents:
diff changeset
200 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
201 };
a61af66fc99e Initial load
duke
parents:
diff changeset
202
164
c436414a719e 6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents: 163
diff changeset
203 //------------------------------CMoveNNode-------------------------------------
c436414a719e 6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents: 163
diff changeset
204 class CMoveNNode : public CMoveNode {
c436414a719e 6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents: 163
diff changeset
205 public:
c436414a719e 6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents: 163
diff changeset
206 CMoveNNode( Node *c, Node *bol, Node *left, Node *right, const Type* t ) : CMoveNode(bol,left,right,t) { init_req(Control,c); }
c436414a719e 6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents: 163
diff changeset
207 virtual int Opcode() const;
c436414a719e 6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents: 163
diff changeset
208 };
c436414a719e 6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents: 163
diff changeset
209
c436414a719e 6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents: 163
diff changeset
210 //------------------------------ConstraintCastNode-----------------------------
0
a61af66fc99e Initial load
duke
parents:
diff changeset
211 // cast to a different range
a61af66fc99e Initial load
duke
parents:
diff changeset
212 class ConstraintCastNode: public TypeNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
213 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
214 ConstraintCastNode (Node *n, const Type *t ): TypeNode(t,2) {
a61af66fc99e Initial load
duke
parents:
diff changeset
215 init_class_id(Class_ConstraintCast);
a61af66fc99e Initial load
duke
parents:
diff changeset
216 init_req(1, n);
a61af66fc99e Initial load
duke
parents:
diff changeset
217 }
a61af66fc99e Initial load
duke
parents:
diff changeset
218 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
219 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
220 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
221 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
222 virtual uint ideal_reg() const = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
223 virtual Node *Ideal_DU_postCCP( PhaseCCP * );
a61af66fc99e Initial load
duke
parents:
diff changeset
224 };
a61af66fc99e Initial load
duke
parents:
diff changeset
225
a61af66fc99e Initial load
duke
parents:
diff changeset
226 //------------------------------CastIINode-------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
227 // cast integer to integer (different range)
a61af66fc99e Initial load
duke
parents:
diff changeset
228 class CastIINode: public ConstraintCastNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
229 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
230 CastIINode (Node *n, const Type *t ): ConstraintCastNode(n,t) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
231 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
232 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
233 };
a61af66fc99e Initial load
duke
parents:
diff changeset
234
a61af66fc99e Initial load
duke
parents:
diff changeset
235 //------------------------------CastPPNode-------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
236 // cast pointer to pointer (different type)
a61af66fc99e Initial load
duke
parents:
diff changeset
237 class CastPPNode: public ConstraintCastNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
238 public:
126
72f4a668df19 6625997: CastPP, CheckCastPP and Proj nodes are not dead loop safe
kvn
parents: 124
diff changeset
239 CastPPNode (Node *n, const Type *t ): ConstraintCastNode(n, t) {}
0
a61af66fc99e Initial load
duke
parents:
diff changeset
240 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
241 virtual uint ideal_reg() const { return Op_RegP; }
a61af66fc99e Initial load
duke
parents:
diff changeset
242 virtual Node *Ideal_DU_postCCP( PhaseCCP * );
a61af66fc99e Initial load
duke
parents:
diff changeset
243 };
a61af66fc99e Initial load
duke
parents:
diff changeset
244
a61af66fc99e Initial load
duke
parents:
diff changeset
245 //------------------------------CheckCastPPNode--------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
246 // for _checkcast, cast pointer to pointer (different type), without JOIN,
a61af66fc99e Initial load
duke
parents:
diff changeset
247 class CheckCastPPNode: public TypeNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
248 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
249 CheckCastPPNode( Node *c, Node *n, const Type *t ) : TypeNode(t,2) {
a61af66fc99e Initial load
duke
parents:
diff changeset
250 init_class_id(Class_CheckCastPP);
a61af66fc99e Initial load
duke
parents:
diff changeset
251 init_req(0, c);
a61af66fc99e Initial load
duke
parents:
diff changeset
252 init_req(1, n);
a61af66fc99e Initial load
duke
parents:
diff changeset
253 }
126
72f4a668df19 6625997: CastPP, CheckCastPP and Proj nodes are not dead loop safe
kvn
parents: 124
diff changeset
254
0
a61af66fc99e Initial load
duke
parents:
diff changeset
255 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
256 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
257 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
258 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
259 virtual uint ideal_reg() const { return Op_RegP; }
a61af66fc99e Initial load
duke
parents:
diff changeset
260 // No longer remove CheckCast after CCP as it gives me a place to hang
a61af66fc99e Initial load
duke
parents:
diff changeset
261 // the proper address type - which is required to compute anti-deps.
a61af66fc99e Initial load
duke
parents:
diff changeset
262 //virtual Node *Ideal_DU_postCCP( PhaseCCP * );
a61af66fc99e Initial load
duke
parents:
diff changeset
263 };
a61af66fc99e Initial load
duke
parents:
diff changeset
264
113
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
265
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
266 //------------------------------EncodeP--------------------------------
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
267 // Encodes an oop pointers into its compressed form
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
268 // Takes an extra argument which is the real heap base as a long which
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
269 // may be useful for code generation in the backend.
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
270 class EncodePNode : public TypeNode {
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
271 public:
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
272 EncodePNode(Node* value, const Type* type):
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
273 TypeNode(type, 2) {
168
7793bd37a336 6705887: Compressed Oops: generate x64 addressing and implicit null checks with narrow oops
kvn
parents: 164
diff changeset
274 init_class_id(Class_EncodeP);
113
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
275 init_req(0, NULL);
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
276 init_req(1, value);
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
277 }
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
278 virtual int Opcode() const;
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
279 virtual Node *Identity( PhaseTransform *phase );
124
b130b98db9cf 6689060: Escape Analysis does not work with Compressed Oops
kvn
parents: 113
diff changeset
280 virtual const Type *Value( PhaseTransform *phase ) const;
113
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
281 virtual uint ideal_reg() const { return Op_RegN; }
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
282
164
c436414a719e 6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents: 163
diff changeset
283 static Node* encode(PhaseTransform* phase, Node* value);
163
885ed790ecf0 6695810: null oop passed to encode_heap_oop_not_null
kvn
parents: 126
diff changeset
284 virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp );
113
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
285 };
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
286
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
287 //------------------------------DecodeN--------------------------------
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
288 // Converts a narrow oop into a real oop ptr.
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
289 // Takes an extra argument which is the real heap base as a long which
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
290 // may be useful for code generation in the backend.
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
291 class DecodeNNode : public TypeNode {
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
292 public:
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
293 DecodeNNode(Node* value, const Type* type):
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
294 TypeNode(type, 2) {
168
7793bd37a336 6705887: Compressed Oops: generate x64 addressing and implicit null checks with narrow oops
kvn
parents: 164
diff changeset
295 init_class_id(Class_DecodeN);
113
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
296 init_req(0, NULL);
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
297 init_req(1, value);
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
298 }
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
299 virtual int Opcode() const;
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
300 virtual Node *Identity( PhaseTransform *phase );
124
b130b98db9cf 6689060: Escape Analysis does not work with Compressed Oops
kvn
parents: 113
diff changeset
301 virtual const Type *Value( PhaseTransform *phase ) const;
113
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
302 virtual uint ideal_reg() const { return Op_RegP; }
124
b130b98db9cf 6689060: Escape Analysis does not work with Compressed Oops
kvn
parents: 113
diff changeset
303
164
c436414a719e 6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents: 163
diff changeset
304 static Node* decode(PhaseTransform* phase, Node* value);
113
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
305 };
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
306
0
a61af66fc99e Initial load
duke
parents:
diff changeset
307 //------------------------------Conv2BNode-------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
308 // Convert int/pointer to a Boolean. Map zero to zero, all else to 1.
a61af66fc99e Initial load
duke
parents:
diff changeset
309 class Conv2BNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
310 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
311 Conv2BNode( Node *i ) : Node(0,i) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
312 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
313 virtual const Type *bottom_type() const { return TypeInt::BOOL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
314 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
315 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
316 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
317 };
a61af66fc99e Initial load
duke
parents:
diff changeset
318
a61af66fc99e Initial load
duke
parents:
diff changeset
319 // The conversions operations are all Alpha sorted. Please keep it that way!
a61af66fc99e Initial load
duke
parents:
diff changeset
320 //------------------------------ConvD2FNode------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
321 // Convert double to float
a61af66fc99e Initial load
duke
parents:
diff changeset
322 class ConvD2FNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
323 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
324 ConvD2FNode( Node *in1 ) : Node(0,in1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
325 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
326 virtual const Type *bottom_type() const { return Type::FLOAT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
327 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
328 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
329 virtual uint ideal_reg() const { return Op_RegF; }
a61af66fc99e Initial load
duke
parents:
diff changeset
330 };
a61af66fc99e Initial load
duke
parents:
diff changeset
331
a61af66fc99e Initial load
duke
parents:
diff changeset
332 //------------------------------ConvD2INode------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
333 // Convert Double to Integer
a61af66fc99e Initial load
duke
parents:
diff changeset
334 class ConvD2INode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
335 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
336 ConvD2INode( Node *in1 ) : Node(0,in1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
337 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
338 virtual const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
339 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
340 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
341 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
342 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
343 };
a61af66fc99e Initial load
duke
parents:
diff changeset
344
a61af66fc99e Initial load
duke
parents:
diff changeset
345 //------------------------------ConvD2LNode------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
346 // Convert Double to Long
a61af66fc99e Initial load
duke
parents:
diff changeset
347 class ConvD2LNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
348 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
349 ConvD2LNode( Node *dbl ) : Node(0,dbl) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
350 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
351 virtual const Type *bottom_type() const { return TypeLong::LONG; }
a61af66fc99e Initial load
duke
parents:
diff changeset
352 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
353 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
354 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
355 virtual uint ideal_reg() const { return Op_RegL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
356 };
a61af66fc99e Initial load
duke
parents:
diff changeset
357
a61af66fc99e Initial load
duke
parents:
diff changeset
358 //------------------------------ConvF2DNode------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
359 // Convert Float to a Double.
a61af66fc99e Initial load
duke
parents:
diff changeset
360 class ConvF2DNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
361 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
362 ConvF2DNode( Node *in1 ) : Node(0,in1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
363 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
364 virtual const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
365 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
366 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
367 };
a61af66fc99e Initial load
duke
parents:
diff changeset
368
a61af66fc99e Initial load
duke
parents:
diff changeset
369 //------------------------------ConvF2INode------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
370 // Convert float to integer
a61af66fc99e Initial load
duke
parents:
diff changeset
371 class ConvF2INode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
372 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
373 ConvF2INode( Node *in1 ) : Node(0,in1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
374 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
375 virtual const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
376 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
377 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
378 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
379 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
380 };
a61af66fc99e Initial load
duke
parents:
diff changeset
381
a61af66fc99e Initial load
duke
parents:
diff changeset
382 //------------------------------ConvF2LNode------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
383 // Convert float to long
a61af66fc99e Initial load
duke
parents:
diff changeset
384 class ConvF2LNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
385 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
386 ConvF2LNode( Node *in1 ) : Node(0,in1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
387 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
388 virtual const Type *bottom_type() const { return TypeLong::LONG; }
a61af66fc99e Initial load
duke
parents:
diff changeset
389 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
390 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
391 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
392 virtual uint ideal_reg() const { return Op_RegL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
393 };
a61af66fc99e Initial load
duke
parents:
diff changeset
394
a61af66fc99e Initial load
duke
parents:
diff changeset
395 //------------------------------ConvI2DNode------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
396 // Convert Integer to Double
a61af66fc99e Initial load
duke
parents:
diff changeset
397 class ConvI2DNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
398 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
399 ConvI2DNode( Node *in1 ) : Node(0,in1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
400 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
401 virtual const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
402 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
403 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
404 };
a61af66fc99e Initial load
duke
parents:
diff changeset
405
a61af66fc99e Initial load
duke
parents:
diff changeset
406 //------------------------------ConvI2FNode------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
407 // Convert Integer to Float
a61af66fc99e Initial load
duke
parents:
diff changeset
408 class ConvI2FNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
409 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
410 ConvI2FNode( Node *in1 ) : Node(0,in1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
411 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
412 virtual const Type *bottom_type() const { return Type::FLOAT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
413 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
414 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
415 virtual uint ideal_reg() const { return Op_RegF; }
a61af66fc99e Initial load
duke
parents:
diff changeset
416 };
a61af66fc99e Initial load
duke
parents:
diff changeset
417
a61af66fc99e Initial load
duke
parents:
diff changeset
418 //------------------------------ConvI2LNode------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
419 // Convert integer to long
a61af66fc99e Initial load
duke
parents:
diff changeset
420 class ConvI2LNode : public TypeNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
421 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
422 ConvI2LNode(Node *in1, const TypeLong* t = TypeLong::INT)
a61af66fc99e Initial load
duke
parents:
diff changeset
423 : TypeNode(t, 2)
a61af66fc99e Initial load
duke
parents:
diff changeset
424 { init_req(1, in1); }
a61af66fc99e Initial load
duke
parents:
diff changeset
425 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
426 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
427 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
428 virtual uint ideal_reg() const { return Op_RegL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
429 };
a61af66fc99e Initial load
duke
parents:
diff changeset
430
a61af66fc99e Initial load
duke
parents:
diff changeset
431 //------------------------------ConvL2DNode------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
432 // Convert Long to Double
a61af66fc99e Initial load
duke
parents:
diff changeset
433 class ConvL2DNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
434 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
435 ConvL2DNode( Node *in1 ) : Node(0,in1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
436 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
437 virtual const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
438 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
439 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
440 };
a61af66fc99e Initial load
duke
parents:
diff changeset
441
a61af66fc99e Initial load
duke
parents:
diff changeset
442 //------------------------------ConvL2FNode------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
443 // Convert Long to Float
a61af66fc99e Initial load
duke
parents:
diff changeset
444 class ConvL2FNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
445 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
446 ConvL2FNode( Node *in1 ) : Node(0,in1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
447 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
448 virtual const Type *bottom_type() const { return Type::FLOAT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
449 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
450 virtual uint ideal_reg() const { return Op_RegF; }
a61af66fc99e Initial load
duke
parents:
diff changeset
451 };
a61af66fc99e Initial load
duke
parents:
diff changeset
452
a61af66fc99e Initial load
duke
parents:
diff changeset
453 //------------------------------ConvL2INode------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
454 // Convert long to integer
a61af66fc99e Initial load
duke
parents:
diff changeset
455 class ConvL2INode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
456 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
457 ConvL2INode( Node *in1 ) : Node(0,in1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
458 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
459 virtual const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
460 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
461 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
462 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
463 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
464 };
a61af66fc99e Initial load
duke
parents:
diff changeset
465
a61af66fc99e Initial load
duke
parents:
diff changeset
466 //------------------------------CastX2PNode-------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
467 // convert a machine-pointer-sized integer to a raw pointer
a61af66fc99e Initial load
duke
parents:
diff changeset
468 class CastX2PNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
469 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
470 CastX2PNode( Node *n ) : Node(NULL, n) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
471 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
472 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
473 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
474 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
475 virtual uint ideal_reg() const { return Op_RegP; }
a61af66fc99e Initial load
duke
parents:
diff changeset
476 virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; }
a61af66fc99e Initial load
duke
parents:
diff changeset
477 };
a61af66fc99e Initial load
duke
parents:
diff changeset
478
a61af66fc99e Initial load
duke
parents:
diff changeset
479 //------------------------------CastP2XNode-------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
480 // Used in both 32-bit and 64-bit land.
a61af66fc99e Initial load
duke
parents:
diff changeset
481 // Used for card-marks and unsafe pointer math.
a61af66fc99e Initial load
duke
parents:
diff changeset
482 class CastP2XNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
483 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
484 CastP2XNode( Node *ctrl, Node *n ) : Node(ctrl, n) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
485 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
486 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
487 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
488 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
489 virtual uint ideal_reg() const { return Op_RegX; }
a61af66fc99e Initial load
duke
parents:
diff changeset
490 virtual const Type *bottom_type() const { return TypeX_X; }
a61af66fc99e Initial load
duke
parents:
diff changeset
491 // Return false to keep node from moving away from an associated card mark.
a61af66fc99e Initial load
duke
parents:
diff changeset
492 virtual bool depends_only_on_test() const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
493 };
a61af66fc99e Initial load
duke
parents:
diff changeset
494
a61af66fc99e Initial load
duke
parents:
diff changeset
495 //------------------------------MemMoveNode------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
496 // Memory to memory move. Inserted very late, after allocation.
a61af66fc99e Initial load
duke
parents:
diff changeset
497 class MemMoveNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
498 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
499 MemMoveNode( Node *dst, Node *src ) : Node(0,dst,src) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
500 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
501 };
a61af66fc99e Initial load
duke
parents:
diff changeset
502
a61af66fc99e Initial load
duke
parents:
diff changeset
503 //------------------------------ThreadLocalNode--------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
504 // Ideal Node which returns the base of ThreadLocalStorage.
a61af66fc99e Initial load
duke
parents:
diff changeset
505 class ThreadLocalNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
506 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
507 ThreadLocalNode( ) : Node((Node*)Compile::current()->root()) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
508 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
509 virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM;}
a61af66fc99e Initial load
duke
parents:
diff changeset
510 virtual uint ideal_reg() const { return Op_RegP; }
a61af66fc99e Initial load
duke
parents:
diff changeset
511 };
a61af66fc99e Initial load
duke
parents:
diff changeset
512
a61af66fc99e Initial load
duke
parents:
diff changeset
513 //------------------------------LoadReturnPCNode-------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
514 class LoadReturnPCNode: public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
515 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
516 LoadReturnPCNode(Node *c) : Node(c) { }
a61af66fc99e Initial load
duke
parents:
diff changeset
517 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
518 virtual uint ideal_reg() const { return Op_RegP; }
a61af66fc99e Initial load
duke
parents:
diff changeset
519 };
a61af66fc99e Initial load
duke
parents:
diff changeset
520
a61af66fc99e Initial load
duke
parents:
diff changeset
521
a61af66fc99e Initial load
duke
parents:
diff changeset
522 //-----------------------------RoundFloatNode----------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
523 class RoundFloatNode: public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
524 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
525 RoundFloatNode(Node* c, Node *in1): Node(c, in1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
526 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
527 virtual const Type *bottom_type() const { return Type::FLOAT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
528 virtual uint ideal_reg() const { return Op_RegF; }
a61af66fc99e Initial load
duke
parents:
diff changeset
529 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
530 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
531 };
a61af66fc99e Initial load
duke
parents:
diff changeset
532
a61af66fc99e Initial load
duke
parents:
diff changeset
533
a61af66fc99e Initial load
duke
parents:
diff changeset
534 //-----------------------------RoundDoubleNode---------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
535 class RoundDoubleNode: public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
536 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
537 RoundDoubleNode(Node* c, Node *in1): Node(c, in1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
538 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
539 virtual const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
540 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
541 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
542 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
543 };
a61af66fc99e Initial load
duke
parents:
diff changeset
544
a61af66fc99e Initial load
duke
parents:
diff changeset
545 //------------------------------Opaque1Node------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
546 // A node to prevent unwanted optimizations. Allows constant folding.
a61af66fc99e Initial load
duke
parents:
diff changeset
547 // Stops value-numbering, Ideal calls or Identity functions.
a61af66fc99e Initial load
duke
parents:
diff changeset
548 class Opaque1Node : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
549 virtual uint hash() const ; // { return NO_HASH; }
a61af66fc99e Initial load
duke
parents:
diff changeset
550 virtual uint cmp( const Node &n ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
551 public:
216
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 168
diff changeset
552 Opaque1Node( Compile* C, Node *n ) : Node(0,n) {
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 168
diff changeset
553 // Put it on the Macro nodes list to removed during macro nodes expansion.
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 168
diff changeset
554 init_flags(Flag_is_macro);
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 168
diff changeset
555 C->add_macro_node(this);
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 168
diff changeset
556 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
557 // Special version for the pre-loop to hold the original loop limit
a61af66fc99e Initial load
duke
parents:
diff changeset
558 // which is consumed by range check elimination.
216
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 168
diff changeset
559 Opaque1Node( Compile* C, Node *n, Node* orig_limit ) : Node(0,n,orig_limit) {
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 168
diff changeset
560 // Put it on the Macro nodes list to removed during macro nodes expansion.
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 168
diff changeset
561 init_flags(Flag_is_macro);
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 168
diff changeset
562 C->add_macro_node(this);
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 168
diff changeset
563 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
564 Node* original_loop_limit() { return req()==3 ? in(2) : NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
565 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
566 virtual const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
567 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
568 };
a61af66fc99e Initial load
duke
parents:
diff changeset
569
a61af66fc99e Initial load
duke
parents:
diff changeset
570 //------------------------------Opaque2Node------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
571 // A node to prevent unwanted optimizations. Allows constant folding. Stops
a61af66fc99e Initial load
duke
parents:
diff changeset
572 // value-numbering, most Ideal calls or Identity functions. This Node is
a61af66fc99e Initial load
duke
parents:
diff changeset
573 // specifically designed to prevent the pre-increment value of a loop trip
a61af66fc99e Initial load
duke
parents:
diff changeset
574 // counter from being live out of the bottom of the loop (hence causing the
a61af66fc99e Initial load
duke
parents:
diff changeset
575 // pre- and post-increment values both being live and thus requiring an extra
a61af66fc99e Initial load
duke
parents:
diff changeset
576 // temp register and an extra move). If we "accidentally" optimize through
a61af66fc99e Initial load
duke
parents:
diff changeset
577 // this kind of a Node, we'll get slightly pessimal, but correct, code. Thus
a61af66fc99e Initial load
duke
parents:
diff changeset
578 // it's OK to be slightly sloppy on optimizations here.
a61af66fc99e Initial load
duke
parents:
diff changeset
579 class Opaque2Node : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
580 virtual uint hash() const ; // { return NO_HASH; }
a61af66fc99e Initial load
duke
parents:
diff changeset
581 virtual uint cmp( const Node &n ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
582 public:
216
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 168
diff changeset
583 Opaque2Node( Compile* C, Node *n ) : Node(0,n) {
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 168
diff changeset
584 // Put it on the Macro nodes list to removed during macro nodes expansion.
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 168
diff changeset
585 init_flags(Flag_is_macro);
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 168
diff changeset
586 C->add_macro_node(this);
8d191a7697e2 6715633: when matching a memory node the adr_type should not change
kvn
parents: 168
diff changeset
587 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
588 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
589 virtual const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
590 };
a61af66fc99e Initial load
duke
parents:
diff changeset
591
a61af66fc99e Initial load
duke
parents:
diff changeset
592 //----------------------PartialSubtypeCheckNode--------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
593 // The 2nd slow-half of a subtype check. Scan the subklass's 2ndary superklass
a61af66fc99e Initial load
duke
parents:
diff changeset
594 // array for an instance of the superklass. Set a hidden internal cache on a
a61af66fc99e Initial load
duke
parents:
diff changeset
595 // hit (cache is checked with exposed code in gen_subtype_check()). Return
a61af66fc99e Initial load
duke
parents:
diff changeset
596 // not zero for a miss or zero for a hit.
a61af66fc99e Initial load
duke
parents:
diff changeset
597 class PartialSubtypeCheckNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
598 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
599 PartialSubtypeCheckNode(Node* c, Node* sub, Node* super) : Node(c,sub,super) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
600 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
601 virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; }
a61af66fc99e Initial load
duke
parents:
diff changeset
602 virtual uint ideal_reg() const { return Op_RegP; }
a61af66fc99e Initial load
duke
parents:
diff changeset
603 };
a61af66fc99e Initial load
duke
parents:
diff changeset
604
a61af66fc99e Initial load
duke
parents:
diff changeset
605 //
a61af66fc99e Initial load
duke
parents:
diff changeset
606 class MoveI2FNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
607 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
608 MoveI2FNode( Node *value ) : Node(0,value) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
609 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
610 virtual const Type *bottom_type() const { return Type::FLOAT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
611 virtual uint ideal_reg() const { return Op_RegF; }
a61af66fc99e Initial load
duke
parents:
diff changeset
612 virtual const Type* Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
613 };
a61af66fc99e Initial load
duke
parents:
diff changeset
614
a61af66fc99e Initial load
duke
parents:
diff changeset
615 class MoveL2DNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
616 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
617 MoveL2DNode( Node *value ) : Node(0,value) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
618 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
619 virtual const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
620 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
621 virtual const Type* Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
622 };
a61af66fc99e Initial load
duke
parents:
diff changeset
623
a61af66fc99e Initial load
duke
parents:
diff changeset
624 class MoveF2INode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
625 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
626 MoveF2INode( Node *value ) : Node(0,value) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
627 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
628 virtual const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
629 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
630 virtual const Type* Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
631 };
a61af66fc99e Initial load
duke
parents:
diff changeset
632
a61af66fc99e Initial load
duke
parents:
diff changeset
633 class MoveD2LNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
634 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
635 MoveD2LNode( Node *value ) : Node(0,value) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
636 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
637 virtual const Type *bottom_type() const { return TypeLong::LONG; }
a61af66fc99e Initial load
duke
parents:
diff changeset
638 virtual uint ideal_reg() const { return Op_RegL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
639 virtual const Type* Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
640 };