Mercurial > hg > graal-compiler
annotate src/share/vm/opto/connode.hpp @ 169:9148c65abefc
6695049: (coll) Create an x86 intrinsic for Arrays.equals
Summary: Intrinsify java/util/Arrays.equals(char[], char[])
Reviewed-by: kvn, never
author | rasbold |
---|---|
date | Thu, 29 May 2008 16:22:09 -0700 |
parents | 7793bd37a336 |
children | d1605aabd0a1 8d191a7697e2 |
rev | line source |
---|---|
0 | 1 /* |
2 * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. | |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
20 * CA 95054 USA or visit www.sun.com if you need additional information or | |
21 * have any questions. | |
22 * | |
23 */ | |
24 | |
25 class PhaseTransform; | |
26 class MachNode; | |
27 | |
28 //------------------------------ConNode---------------------------------------- | |
29 // Simple constants | |
30 class ConNode : public TypeNode { | |
31 public: | |
32 ConNode( const Type *t ) : TypeNode(t,1) { | |
33 init_req(0, (Node*)Compile::current()->root()); | |
34 init_flags(Flag_is_Con); | |
35 } | |
36 virtual int Opcode() const; | |
37 virtual uint hash() const; | |
38 virtual const RegMask &out_RegMask() const { return RegMask::Empty; } | |
39 virtual const RegMask &in_RegMask(uint) const { return RegMask::Empty; } | |
40 | |
41 // Polymorphic factory method: | |
42 static ConNode* make( Compile* C, const Type *t ); | |
43 }; | |
44 | |
45 //------------------------------ConINode--------------------------------------- | |
46 // Simple integer constants | |
47 class ConINode : public ConNode { | |
48 public: | |
49 ConINode( const TypeInt *t ) : ConNode(t) {} | |
50 virtual int Opcode() const; | |
51 | |
52 // Factory method: | |
53 static ConINode* make( Compile* C, int con ) { | |
54 return new (C, 1) ConINode( TypeInt::make(con) ); | |
55 } | |
56 | |
57 }; | |
58 | |
59 //------------------------------ConPNode--------------------------------------- | |
60 // Simple pointer constants | |
61 class ConPNode : public ConNode { | |
62 public: | |
63 ConPNode( const TypePtr *t ) : ConNode(t) {} | |
64 virtual int Opcode() const; | |
65 | |
66 // Factory methods: | |
67 static ConPNode* make( Compile *C ,address con ) { | |
68 if (con == NULL) | |
69 return new (C, 1) ConPNode( TypePtr::NULL_PTR ) ; | |
70 else | |
71 return new (C, 1) ConPNode( TypeRawPtr::make(con) ); | |
72 } | |
73 }; | |
74 | |
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 | 85 //------------------------------ConLNode--------------------------------------- |
86 // Simple long constants | |
87 class ConLNode : public ConNode { | |
88 public: | |
89 ConLNode( const TypeLong *t ) : ConNode(t) {} | |
90 virtual int Opcode() const; | |
91 | |
92 // Factory method: | |
93 static ConLNode* make( Compile *C ,jlong con ) { | |
94 return new (C, 1) ConLNode( TypeLong::make(con) ); | |
95 } | |
96 | |
97 }; | |
98 | |
99 //------------------------------ConFNode--------------------------------------- | |
100 // Simple float constants | |
101 class ConFNode : public ConNode { | |
102 public: | |
103 ConFNode( const TypeF *t ) : ConNode(t) {} | |
104 virtual int Opcode() const; | |
105 | |
106 // Factory method: | |
107 static ConFNode* make( Compile *C, float con ) { | |
108 return new (C, 1) ConFNode( TypeF::make(con) ); | |
109 } | |
110 | |
111 }; | |
112 | |
113 //------------------------------ConDNode--------------------------------------- | |
114 // Simple double constants | |
115 class ConDNode : public ConNode { | |
116 public: | |
117 ConDNode( const TypeD *t ) : ConNode(t) {} | |
118 virtual int Opcode() const; | |
119 | |
120 // Factory method: | |
121 static ConDNode* make( Compile *C, double con ) { | |
122 return new (C, 1) ConDNode( TypeD::make(con) ); | |
123 } | |
124 | |
125 }; | |
126 | |
127 //------------------------------BinaryNode------------------------------------- | |
128 // Place holder for the 2 conditional inputs to a CMove. CMove needs 4 | |
129 // inputs: the Bool (for the lt/gt/eq/ne bits), the flags (result of some | |
130 // compare), and the 2 values to select between. The Matcher requires a | |
131 // binary tree so we break it down like this: | |
132 // (CMove (Binary bol cmp) (Binary src1 src2)) | |
133 class BinaryNode : public Node { | |
134 public: | |
135 BinaryNode( Node *n1, Node *n2 ) : Node(0,n1,n2) { } | |
136 virtual int Opcode() const; | |
137 virtual uint ideal_reg() const { return 0; } | |
138 }; | |
139 | |
140 //------------------------------CMoveNode-------------------------------------- | |
141 // Conditional move | |
142 class CMoveNode : public TypeNode { | |
143 public: | |
144 enum { Control, // When is it safe to do this cmove? | |
145 Condition, // Condition controlling the cmove | |
146 IfFalse, // Value if condition is false | |
147 IfTrue }; // Value if condition is true | |
148 CMoveNode( Node *bol, Node *left, Node *right, const Type *t ) : TypeNode(t,4) | |
149 { | |
150 init_class_id(Class_CMove); | |
151 // all inputs are nullified in Node::Node(int) | |
152 // init_req(Control,NULL); | |
153 init_req(Condition,bol); | |
154 init_req(IfFalse,left); | |
155 init_req(IfTrue,right); | |
156 } | |
157 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); | |
158 virtual const Type *Value( PhaseTransform *phase ) const; | |
159 virtual Node *Identity( PhaseTransform *phase ); | |
160 static CMoveNode *make( Compile *C, Node *c, Node *bol, Node *left, Node *right, const Type *t ); | |
161 // Helper function to spot cmove graph shapes | |
162 static Node *is_cmove_id( PhaseTransform *phase, Node *cmp, Node *t, Node *f, BoolNode *b ); | |
163 }; | |
164 | |
165 //------------------------------CMoveDNode------------------------------------- | |
166 class CMoveDNode : public CMoveNode { | |
167 public: | |
168 CMoveDNode( Node *bol, Node *left, Node *right, const Type* t) : CMoveNode(bol,left,right,t){} | |
169 virtual int Opcode() const; | |
170 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); | |
171 }; | |
172 | |
173 //------------------------------CMoveFNode------------------------------------- | |
174 class CMoveFNode : public CMoveNode { | |
175 public: | |
176 CMoveFNode( Node *bol, Node *left, Node *right, const Type* t ) : CMoveNode(bol,left,right,t) {} | |
177 virtual int Opcode() const; | |
178 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); | |
179 }; | |
180 | |
181 //------------------------------CMoveINode------------------------------------- | |
182 class CMoveINode : public CMoveNode { | |
183 public: | |
184 CMoveINode( Node *bol, Node *left, Node *right, const TypeInt *ti ) : CMoveNode(bol,left,right,ti){} | |
185 virtual int Opcode() const; | |
186 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); | |
187 }; | |
188 | |
189 //------------------------------CMoveLNode------------------------------------- | |
190 class CMoveLNode : public CMoveNode { | |
191 public: | |
192 CMoveLNode(Node *bol, Node *left, Node *right, const TypeLong *tl ) : CMoveNode(bol,left,right,tl){} | |
193 virtual int Opcode() const; | |
194 }; | |
195 | |
196 //------------------------------CMovePNode------------------------------------- | |
197 class CMovePNode : public CMoveNode { | |
198 public: | |
199 CMovePNode( Node *c, Node *bol, Node *left, Node *right, const TypePtr* t ) : CMoveNode(bol,left,right,t) { init_req(Control,c); } | |
200 virtual int Opcode() const; | |
201 }; | |
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 | 211 // cast to a different range |
212 class ConstraintCastNode: public TypeNode { | |
213 public: | |
214 ConstraintCastNode (Node *n, const Type *t ): TypeNode(t,2) { | |
215 init_class_id(Class_ConstraintCast); | |
216 init_req(1, n); | |
217 } | |
218 virtual Node *Identity( PhaseTransform *phase ); | |
219 virtual const Type *Value( PhaseTransform *phase ) const; | |
220 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); | |
221 virtual int Opcode() const; | |
222 virtual uint ideal_reg() const = 0; | |
223 virtual Node *Ideal_DU_postCCP( PhaseCCP * ); | |
224 }; | |
225 | |
226 //------------------------------CastIINode------------------------------------- | |
227 // cast integer to integer (different range) | |
228 class CastIINode: public ConstraintCastNode { | |
229 public: | |
230 CastIINode (Node *n, const Type *t ): ConstraintCastNode(n,t) {} | |
231 virtual int Opcode() const; | |
232 virtual uint ideal_reg() const { return Op_RegI; } | |
233 }; | |
234 | |
235 //------------------------------CastPPNode------------------------------------- | |
236 // cast pointer to pointer (different type) | |
237 class CastPPNode: public ConstraintCastNode { | |
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 | 240 virtual int Opcode() const; |
241 virtual uint ideal_reg() const { return Op_RegP; } | |
242 virtual Node *Ideal_DU_postCCP( PhaseCCP * ); | |
243 }; | |
244 | |
245 //------------------------------CheckCastPPNode-------------------------------- | |
246 // for _checkcast, cast pointer to pointer (different type), without JOIN, | |
247 class CheckCastPPNode: public TypeNode { | |
248 public: | |
249 CheckCastPPNode( Node *c, Node *n, const Type *t ) : TypeNode(t,2) { | |
250 init_class_id(Class_CheckCastPP); | |
251 init_req(0, c); | |
252 init_req(1, n); | |
253 } | |
126
72f4a668df19
6625997: CastPP, CheckCastPP and Proj nodes are not dead loop safe
kvn
parents:
124
diff
changeset
|
254 |
0 | 255 virtual Node *Identity( PhaseTransform *phase ); |
256 virtual const Type *Value( PhaseTransform *phase ) const; | |
257 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); | |
258 virtual int Opcode() const; | |
259 virtual uint ideal_reg() const { return Op_RegP; } | |
260 // No longer remove CheckCast after CCP as it gives me a place to hang | |
261 // the proper address type - which is required to compute anti-deps. | |
262 //virtual Node *Ideal_DU_postCCP( PhaseCCP * ); | |
263 }; | |
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 | 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 | 307 //------------------------------Conv2BNode------------------------------------- |
308 // Convert int/pointer to a Boolean. Map zero to zero, all else to 1. | |
309 class Conv2BNode : public Node { | |
310 public: | |
311 Conv2BNode( Node *i ) : Node(0,i) {} | |
312 virtual int Opcode() const; | |
313 virtual const Type *bottom_type() const { return TypeInt::BOOL; } | |
314 virtual Node *Identity( PhaseTransform *phase ); | |
315 virtual const Type *Value( PhaseTransform *phase ) const; | |
316 virtual uint ideal_reg() const { return Op_RegI; } | |
317 }; | |
318 | |
319 // The conversions operations are all Alpha sorted. Please keep it that way! | |
320 //------------------------------ConvD2FNode------------------------------------ | |
321 // Convert double to float | |
322 class ConvD2FNode : public Node { | |
323 public: | |
324 ConvD2FNode( Node *in1 ) : Node(0,in1) {} | |
325 virtual int Opcode() const; | |
326 virtual const Type *bottom_type() const { return Type::FLOAT; } | |
327 virtual const Type *Value( PhaseTransform *phase ) const; | |
328 virtual Node *Identity( PhaseTransform *phase ); | |
329 virtual uint ideal_reg() const { return Op_RegF; } | |
330 }; | |
331 | |
332 //------------------------------ConvD2INode------------------------------------ | |
333 // Convert Double to Integer | |
334 class ConvD2INode : public Node { | |
335 public: | |
336 ConvD2INode( Node *in1 ) : Node(0,in1) {} | |
337 virtual int Opcode() const; | |
338 virtual const Type *bottom_type() const { return TypeInt::INT; } | |
339 virtual const Type *Value( PhaseTransform *phase ) const; | |
340 virtual Node *Identity( PhaseTransform *phase ); | |
341 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); | |
342 virtual uint ideal_reg() const { return Op_RegI; } | |
343 }; | |
344 | |
345 //------------------------------ConvD2LNode------------------------------------ | |
346 // Convert Double to Long | |
347 class ConvD2LNode : public Node { | |
348 public: | |
349 ConvD2LNode( Node *dbl ) : Node(0,dbl) {} | |
350 virtual int Opcode() const; | |
351 virtual const Type *bottom_type() const { return TypeLong::LONG; } | |
352 virtual const Type *Value( PhaseTransform *phase ) const; | |
353 virtual Node *Identity( PhaseTransform *phase ); | |
354 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); | |
355 virtual uint ideal_reg() const { return Op_RegL; } | |
356 }; | |
357 | |
358 //------------------------------ConvF2DNode------------------------------------ | |
359 // Convert Float to a Double. | |
360 class ConvF2DNode : public Node { | |
361 public: | |
362 ConvF2DNode( Node *in1 ) : Node(0,in1) {} | |
363 virtual int Opcode() const; | |
364 virtual const Type *bottom_type() const { return Type::DOUBLE; } | |
365 virtual const Type *Value( PhaseTransform *phase ) const; | |
366 virtual uint ideal_reg() const { return Op_RegD; } | |
367 }; | |
368 | |
369 //------------------------------ConvF2INode------------------------------------ | |
370 // Convert float to integer | |
371 class ConvF2INode : public Node { | |
372 public: | |
373 ConvF2INode( Node *in1 ) : Node(0,in1) {} | |
374 virtual int Opcode() const; | |
375 virtual const Type *bottom_type() const { return TypeInt::INT; } | |
376 virtual const Type *Value( PhaseTransform *phase ) const; | |
377 virtual Node *Identity( PhaseTransform *phase ); | |
378 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); | |
379 virtual uint ideal_reg() const { return Op_RegI; } | |
380 }; | |
381 | |
382 //------------------------------ConvF2LNode------------------------------------ | |
383 // Convert float to long | |
384 class ConvF2LNode : public Node { | |
385 public: | |
386 ConvF2LNode( Node *in1 ) : Node(0,in1) {} | |
387 virtual int Opcode() const; | |
388 virtual const Type *bottom_type() const { return TypeLong::LONG; } | |
389 virtual const Type *Value( PhaseTransform *phase ) const; | |
390 virtual Node *Identity( PhaseTransform *phase ); | |
391 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); | |
392 virtual uint ideal_reg() const { return Op_RegL; } | |
393 }; | |
394 | |
395 //------------------------------ConvI2DNode------------------------------------ | |
396 // Convert Integer to Double | |
397 class ConvI2DNode : public Node { | |
398 public: | |
399 ConvI2DNode( Node *in1 ) : Node(0,in1) {} | |
400 virtual int Opcode() const; | |
401 virtual const Type *bottom_type() const { return Type::DOUBLE; } | |
402 virtual const Type *Value( PhaseTransform *phase ) const; | |
403 virtual uint ideal_reg() const { return Op_RegD; } | |
404 }; | |
405 | |
406 //------------------------------ConvI2FNode------------------------------------ | |
407 // Convert Integer to Float | |
408 class ConvI2FNode : public Node { | |
409 public: | |
410 ConvI2FNode( Node *in1 ) : Node(0,in1) {} | |
411 virtual int Opcode() const; | |
412 virtual const Type *bottom_type() const { return Type::FLOAT; } | |
413 virtual const Type *Value( PhaseTransform *phase ) const; | |
414 virtual Node *Identity( PhaseTransform *phase ); | |
415 virtual uint ideal_reg() const { return Op_RegF; } | |
416 }; | |
417 | |
418 //------------------------------ConvI2LNode------------------------------------ | |
419 // Convert integer to long | |
420 class ConvI2LNode : public TypeNode { | |
421 public: | |
422 ConvI2LNode(Node *in1, const TypeLong* t = TypeLong::INT) | |
423 : TypeNode(t, 2) | |
424 { init_req(1, in1); } | |
425 virtual int Opcode() const; | |
426 virtual const Type *Value( PhaseTransform *phase ) const; | |
427 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); | |
428 virtual uint ideal_reg() const { return Op_RegL; } | |
429 }; | |
430 | |
431 //------------------------------ConvL2DNode------------------------------------ | |
432 // Convert Long to Double | |
433 class ConvL2DNode : public Node { | |
434 public: | |
435 ConvL2DNode( Node *in1 ) : Node(0,in1) {} | |
436 virtual int Opcode() const; | |
437 virtual const Type *bottom_type() const { return Type::DOUBLE; } | |
438 virtual const Type *Value( PhaseTransform *phase ) const; | |
439 virtual uint ideal_reg() const { return Op_RegD; } | |
440 }; | |
441 | |
442 //------------------------------ConvL2FNode------------------------------------ | |
443 // Convert Long to Float | |
444 class ConvL2FNode : public Node { | |
445 public: | |
446 ConvL2FNode( Node *in1 ) : Node(0,in1) {} | |
447 virtual int Opcode() const; | |
448 virtual const Type *bottom_type() const { return Type::FLOAT; } | |
449 virtual const Type *Value( PhaseTransform *phase ) const; | |
450 virtual uint ideal_reg() const { return Op_RegF; } | |
451 }; | |
452 | |
453 //------------------------------ConvL2INode------------------------------------ | |
454 // Convert long to integer | |
455 class ConvL2INode : public Node { | |
456 public: | |
457 ConvL2INode( Node *in1 ) : Node(0,in1) {} | |
458 virtual int Opcode() const; | |
459 virtual const Type *bottom_type() const { return TypeInt::INT; } | |
460 virtual Node *Identity( PhaseTransform *phase ); | |
461 virtual const Type *Value( PhaseTransform *phase ) const; | |
462 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); | |
463 virtual uint ideal_reg() const { return Op_RegI; } | |
464 }; | |
465 | |
466 //------------------------------CastX2PNode------------------------------------- | |
467 // convert a machine-pointer-sized integer to a raw pointer | |
468 class CastX2PNode : public Node { | |
469 public: | |
470 CastX2PNode( Node *n ) : Node(NULL, n) {} | |
471 virtual int Opcode() const; | |
472 virtual const Type *Value( PhaseTransform *phase ) const; | |
473 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); | |
474 virtual Node *Identity( PhaseTransform *phase ); | |
475 virtual uint ideal_reg() const { return Op_RegP; } | |
476 virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; } | |
477 }; | |
478 | |
479 //------------------------------CastP2XNode------------------------------------- | |
480 // Used in both 32-bit and 64-bit land. | |
481 // Used for card-marks and unsafe pointer math. | |
482 class CastP2XNode : public Node { | |
483 public: | |
484 CastP2XNode( Node *ctrl, Node *n ) : Node(ctrl, n) {} | |
485 virtual int Opcode() const; | |
486 virtual const Type *Value( PhaseTransform *phase ) const; | |
487 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); | |
488 virtual Node *Identity( PhaseTransform *phase ); | |
489 virtual uint ideal_reg() const { return Op_RegX; } | |
490 virtual const Type *bottom_type() const { return TypeX_X; } | |
491 // Return false to keep node from moving away from an associated card mark. | |
492 virtual bool depends_only_on_test() const { return false; } | |
493 }; | |
494 | |
495 //------------------------------MemMoveNode------------------------------------ | |
496 // Memory to memory move. Inserted very late, after allocation. | |
497 class MemMoveNode : public Node { | |
498 public: | |
499 MemMoveNode( Node *dst, Node *src ) : Node(0,dst,src) {} | |
500 virtual int Opcode() const; | |
501 }; | |
502 | |
503 //------------------------------ThreadLocalNode-------------------------------- | |
504 // Ideal Node which returns the base of ThreadLocalStorage. | |
505 class ThreadLocalNode : public Node { | |
506 public: | |
507 ThreadLocalNode( ) : Node((Node*)Compile::current()->root()) {} | |
508 virtual int Opcode() const; | |
509 virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM;} | |
510 virtual uint ideal_reg() const { return Op_RegP; } | |
511 }; | |
512 | |
513 //------------------------------LoadReturnPCNode------------------------------- | |
514 class LoadReturnPCNode: public Node { | |
515 public: | |
516 LoadReturnPCNode(Node *c) : Node(c) { } | |
517 virtual int Opcode() const; | |
518 virtual uint ideal_reg() const { return Op_RegP; } | |
519 }; | |
520 | |
521 | |
522 //-----------------------------RoundFloatNode---------------------------------- | |
523 class RoundFloatNode: public Node { | |
524 public: | |
525 RoundFloatNode(Node* c, Node *in1): Node(c, in1) {} | |
526 virtual int Opcode() const; | |
527 virtual const Type *bottom_type() const { return Type::FLOAT; } | |
528 virtual uint ideal_reg() const { return Op_RegF; } | |
529 virtual Node *Identity( PhaseTransform *phase ); | |
530 virtual const Type *Value( PhaseTransform *phase ) const; | |
531 }; | |
532 | |
533 | |
534 //-----------------------------RoundDoubleNode--------------------------------- | |
535 class RoundDoubleNode: public Node { | |
536 public: | |
537 RoundDoubleNode(Node* c, Node *in1): Node(c, in1) {} | |
538 virtual int Opcode() const; | |
539 virtual const Type *bottom_type() const { return Type::DOUBLE; } | |
540 virtual uint ideal_reg() const { return Op_RegD; } | |
541 virtual Node *Identity( PhaseTransform *phase ); | |
542 virtual const Type *Value( PhaseTransform *phase ) const; | |
543 }; | |
544 | |
545 //------------------------------Opaque1Node------------------------------------ | |
546 // A node to prevent unwanted optimizations. Allows constant folding. | |
547 // Stops value-numbering, Ideal calls or Identity functions. | |
548 class Opaque1Node : public Node { | |
549 virtual uint hash() const ; // { return NO_HASH; } | |
550 virtual uint cmp( const Node &n ) const; | |
551 public: | |
552 Opaque1Node( Node *n ) : Node(0,n) {} | |
553 // Special version for the pre-loop to hold the original loop limit | |
554 // which is consumed by range check elimination. | |
555 Opaque1Node( Node *n, Node* orig_limit ) : Node(0,n,orig_limit) {} | |
556 Node* original_loop_limit() { return req()==3 ? in(2) : NULL; } | |
557 virtual int Opcode() const; | |
558 virtual const Type *bottom_type() const { return TypeInt::INT; } | |
559 virtual Node *Identity( PhaseTransform *phase ); | |
560 }; | |
561 | |
562 //------------------------------Opaque2Node------------------------------------ | |
563 // A node to prevent unwanted optimizations. Allows constant folding. Stops | |
564 // value-numbering, most Ideal calls or Identity functions. This Node is | |
565 // specifically designed to prevent the pre-increment value of a loop trip | |
566 // counter from being live out of the bottom of the loop (hence causing the | |
567 // pre- and post-increment values both being live and thus requiring an extra | |
568 // temp register and an extra move). If we "accidentally" optimize through | |
569 // this kind of a Node, we'll get slightly pessimal, but correct, code. Thus | |
570 // it's OK to be slightly sloppy on optimizations here. | |
571 class Opaque2Node : public Node { | |
572 virtual uint hash() const ; // { return NO_HASH; } | |
573 virtual uint cmp( const Node &n ) const; | |
574 public: | |
575 Opaque2Node( Node *n ) : Node(0,n) {} | |
576 virtual int Opcode() const; | |
577 virtual const Type *bottom_type() const { return TypeInt::INT; } | |
578 }; | |
579 | |
580 //----------------------PartialSubtypeCheckNode-------------------------------- | |
581 // The 2nd slow-half of a subtype check. Scan the subklass's 2ndary superklass | |
582 // array for an instance of the superklass. Set a hidden internal cache on a | |
583 // hit (cache is checked with exposed code in gen_subtype_check()). Return | |
584 // not zero for a miss or zero for a hit. | |
585 class PartialSubtypeCheckNode : public Node { | |
586 public: | |
587 PartialSubtypeCheckNode(Node* c, Node* sub, Node* super) : Node(c,sub,super) {} | |
588 virtual int Opcode() const; | |
589 virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; } | |
590 virtual uint ideal_reg() const { return Op_RegP; } | |
591 }; | |
592 | |
593 // | |
594 class MoveI2FNode : public Node { | |
595 public: | |
596 MoveI2FNode( Node *value ) : Node(0,value) {} | |
597 virtual int Opcode() const; | |
598 virtual const Type *bottom_type() const { return Type::FLOAT; } | |
599 virtual uint ideal_reg() const { return Op_RegF; } | |
600 virtual const Type* Value( PhaseTransform *phase ) const; | |
601 }; | |
602 | |
603 class MoveL2DNode : public Node { | |
604 public: | |
605 MoveL2DNode( Node *value ) : Node(0,value) {} | |
606 virtual int Opcode() const; | |
607 virtual const Type *bottom_type() const { return Type::DOUBLE; } | |
608 virtual uint ideal_reg() const { return Op_RegD; } | |
609 virtual const Type* Value( PhaseTransform *phase ) const; | |
610 }; | |
611 | |
612 class MoveF2INode : public Node { | |
613 public: | |
614 MoveF2INode( Node *value ) : Node(0,value) {} | |
615 virtual int Opcode() const; | |
616 virtual const Type *bottom_type() const { return TypeInt::INT; } | |
617 virtual uint ideal_reg() const { return Op_RegI; } | |
618 virtual const Type* Value( PhaseTransform *phase ) const; | |
619 }; | |
620 | |
621 class MoveD2LNode : public Node { | |
622 public: | |
623 MoveD2LNode( Node *value ) : Node(0,value) {} | |
624 virtual int Opcode() const; | |
625 virtual const Type *bottom_type() const { return TypeLong::LONG; } | |
626 virtual uint ideal_reg() const { return Op_RegL; } | |
627 virtual const Type* Value( PhaseTransform *phase ) const; | |
628 }; |