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