annotate src/share/vm/opto/addnode.hpp @ 1721:413ad0331a0c

6977924: Changes for 6975078 produce build error with certain gcc versions Summary: The changes introduced for 6975078 assign badHeapOopVal to the _allocation field in the ResourceObj class. In 32 bit linux builds with certain versions of gcc this assignment will be flagged as an error while compiling allocation.cpp. In 32 bit builds the constant value badHeapOopVal (which is cast to an intptr_t) is negative. The _allocation field is typed as an unsigned intptr_t and gcc catches this as an error. Reviewed-by: jcoomes, ysr, phh
author johnc
date Wed, 18 Aug 2010 10:59:06 -0700
parents c18cbe5936b8
children f95d63e2154a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1541
diff changeset
2 * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1541
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1541
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1541
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 // Portions of code courtesy of Clifford Click
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 class PhaseTransform;
a61af66fc99e Initial load
duke
parents:
diff changeset
28
a61af66fc99e Initial load
duke
parents:
diff changeset
29 //------------------------------AddNode----------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
30 // Classic Add functionality. This covers all the usual 'add' behaviors for
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // an algebraic ring. Add-integer, add-float, add-double, and binary-or are
a61af66fc99e Initial load
duke
parents:
diff changeset
32 // all inherited from this class. The various identity values are supplied
a61af66fc99e Initial load
duke
parents:
diff changeset
33 // by virtual functions.
a61af66fc99e Initial load
duke
parents:
diff changeset
34 class AddNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
35 virtual uint hash() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
36 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
37 AddNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {
a61af66fc99e Initial load
duke
parents:
diff changeset
38 init_class_id(Class_Add);
a61af66fc99e Initial load
duke
parents:
diff changeset
39 }
a61af66fc99e Initial load
duke
parents:
diff changeset
40
a61af66fc99e Initial load
duke
parents:
diff changeset
41 // Handle algebraic identities here. If we have an identity, return the Node
a61af66fc99e Initial load
duke
parents:
diff changeset
42 // we are equivalent to. We look for "add of zero" as an identity.
a61af66fc99e Initial load
duke
parents:
diff changeset
43 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
44
a61af66fc99e Initial load
duke
parents:
diff changeset
45 // We also canonicalize the Node, moving constants to the right input,
a61af66fc99e Initial load
duke
parents:
diff changeset
46 // and flatten expressions (so that 1+x+2 becomes x+3).
a61af66fc99e Initial load
duke
parents:
diff changeset
47 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
48
a61af66fc99e Initial load
duke
parents:
diff changeset
49 // Compute a new Type for this node. Basically we just do the pre-check,
a61af66fc99e Initial load
duke
parents:
diff changeset
50 // then call the virtual add() to set the type.
a61af66fc99e Initial load
duke
parents:
diff changeset
51 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53 // Check if this addition involves the additive identity
a61af66fc99e Initial load
duke
parents:
diff changeset
54 virtual const Type *add_of_identity( const Type *t1, const Type *t2 ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
55
a61af66fc99e Initial load
duke
parents:
diff changeset
56 // Supplied function returns the sum of the inputs.
a61af66fc99e Initial load
duke
parents:
diff changeset
57 // This also type-checks the inputs for sanity. Guaranteed never to
a61af66fc99e Initial load
duke
parents:
diff changeset
58 // be passed a TOP or BOTTOM type, these are filtered out by a pre-check.
a61af66fc99e Initial load
duke
parents:
diff changeset
59 virtual const Type *add_ring( const Type *, const Type * ) const = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61 // Supplied function to return the additive identity type
a61af66fc99e Initial load
duke
parents:
diff changeset
62 virtual const Type *add_id() const = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
63
a61af66fc99e Initial load
duke
parents:
diff changeset
64 };
a61af66fc99e Initial load
duke
parents:
diff changeset
65
a61af66fc99e Initial load
duke
parents:
diff changeset
66 //------------------------------AddINode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
67 // Add 2 integers
a61af66fc99e Initial load
duke
parents:
diff changeset
68 class AddINode : public AddNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
69 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
70 AddINode( Node *in1, Node *in2 ) : AddNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
71 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
72 virtual const Type *add_ring( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
73 virtual const Type *add_id() const { return TypeInt::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
74 virtual const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
75 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
76 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
77 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
78 };
a61af66fc99e Initial load
duke
parents:
diff changeset
79
a61af66fc99e Initial load
duke
parents:
diff changeset
80 //------------------------------AddLNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
81 // Add 2 longs
a61af66fc99e Initial load
duke
parents:
diff changeset
82 class AddLNode : public AddNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
83 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
84 AddLNode( Node *in1, Node *in2 ) : AddNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
85 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
86 virtual const Type *add_ring( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
87 virtual const Type *add_id() const { return TypeLong::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
88 virtual const Type *bottom_type() const { return TypeLong::LONG; }
a61af66fc99e Initial load
duke
parents:
diff changeset
89 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
90 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
91 virtual uint ideal_reg() const { return Op_RegL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
92 };
a61af66fc99e Initial load
duke
parents:
diff changeset
93
a61af66fc99e Initial load
duke
parents:
diff changeset
94 //------------------------------AddFNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
95 // Add 2 floats
a61af66fc99e Initial load
duke
parents:
diff changeset
96 class AddFNode : public AddNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
97 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
98 AddFNode( Node *in1, Node *in2 ) : AddNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
99 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
100 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
101 virtual const Type *add_of_identity( const Type *t1, const Type *t2 ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
102 virtual const Type *add_ring( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
103 virtual const Type *add_id() const { return TypeF::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
104 virtual const Type *bottom_type() const { return Type::FLOAT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
105 virtual Node *Identity( PhaseTransform *phase ) { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
106 virtual uint ideal_reg() const { return Op_RegF; }
a61af66fc99e Initial load
duke
parents:
diff changeset
107 };
a61af66fc99e Initial load
duke
parents:
diff changeset
108
a61af66fc99e Initial load
duke
parents:
diff changeset
109 //------------------------------AddDNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
110 // Add 2 doubles
a61af66fc99e Initial load
duke
parents:
diff changeset
111 class AddDNode : public AddNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
112 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
113 AddDNode( Node *in1, Node *in2 ) : AddNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
114 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
115 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
116 virtual const Type *add_of_identity( const Type *t1, const Type *t2 ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
117 virtual const Type *add_ring( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
118 virtual const Type *add_id() const { return TypeD::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
119 virtual const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
120 virtual Node *Identity( PhaseTransform *phase ) { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
121 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
122 };
a61af66fc99e Initial load
duke
parents:
diff changeset
123
a61af66fc99e Initial load
duke
parents:
diff changeset
124 //------------------------------AddPNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
125 // Add pointer plus integer to get pointer. NOT commutative, really.
a61af66fc99e Initial load
duke
parents:
diff changeset
126 // So not really an AddNode. Lives here, because people associate it with
a61af66fc99e Initial load
duke
parents:
diff changeset
127 // an add.
a61af66fc99e Initial load
duke
parents:
diff changeset
128 class AddPNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
129 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
130 enum { Control, // When is it safe to do this add?
a61af66fc99e Initial load
duke
parents:
diff changeset
131 Base, // Base oop, for GC purposes
a61af66fc99e Initial load
duke
parents:
diff changeset
132 Address, // Actually address, derived from base
a61af66fc99e Initial load
duke
parents:
diff changeset
133 Offset } ; // Offset added to address
a61af66fc99e Initial load
duke
parents:
diff changeset
134 AddPNode( Node *base, Node *ptr, Node *off ) : Node(0,base,ptr,off) {
a61af66fc99e Initial load
duke
parents:
diff changeset
135 init_class_id(Class_AddP);
a61af66fc99e Initial load
duke
parents:
diff changeset
136 }
a61af66fc99e Initial load
duke
parents:
diff changeset
137 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
138 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
139 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
140 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
141 virtual const Type *bottom_type() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
142 virtual uint ideal_reg() const { return Op_RegP; }
a61af66fc99e Initial load
duke
parents:
diff changeset
143 Node *base_node() { assert( req() > Base, "Missing base"); return in(Base); }
a61af66fc99e Initial load
duke
parents:
diff changeset
144 static Node* Ideal_base_and_offset(Node* ptr, PhaseTransform* phase,
a61af66fc99e Initial load
duke
parents:
diff changeset
145 // second return value:
a61af66fc99e Initial load
duke
parents:
diff changeset
146 intptr_t& offset);
17
ff5961f4c095 6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents: 0
diff changeset
147
ff5961f4c095 6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents: 0
diff changeset
148 // Collect the AddP offset values into the elements array, giving up
ff5961f4c095 6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents: 0
diff changeset
149 // if there are more than length.
ff5961f4c095 6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents: 0
diff changeset
150 int unpack_offsets(Node* elements[], int length);
ff5961f4c095 6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents: 0
diff changeset
151
0
a61af66fc99e Initial load
duke
parents:
diff changeset
152 // Do not match base-ptr edge
a61af66fc99e Initial load
duke
parents:
diff changeset
153 virtual uint match_edge(uint idx) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
154 };
a61af66fc99e Initial load
duke
parents:
diff changeset
155
a61af66fc99e Initial load
duke
parents:
diff changeset
156 //------------------------------OrINode----------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
157 // Logically OR 2 integers. Included with the ADD nodes because it inherits
a61af66fc99e Initial load
duke
parents:
diff changeset
158 // all the behavior of addition on a ring.
a61af66fc99e Initial load
duke
parents:
diff changeset
159 class OrINode : public AddNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
160 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
161 OrINode( Node *in1, Node *in2 ) : AddNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
162 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
163 virtual const Type *add_ring( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
164 virtual const Type *add_id() const { return TypeInt::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
165 virtual const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
166 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
167 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
168 };
a61af66fc99e Initial load
duke
parents:
diff changeset
169
a61af66fc99e Initial load
duke
parents:
diff changeset
170 //------------------------------OrLNode----------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
171 // Logically OR 2 longs. Included with the ADD nodes because it inherits
a61af66fc99e Initial load
duke
parents:
diff changeset
172 // all the behavior of addition on a ring.
a61af66fc99e Initial load
duke
parents:
diff changeset
173 class OrLNode : public AddNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
174 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
175 OrLNode( Node *in1, Node *in2 ) : AddNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
176 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
177 virtual const Type *add_ring( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
178 virtual const Type *add_id() const { return TypeLong::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
179 virtual const Type *bottom_type() const { return TypeLong::LONG; }
a61af66fc99e Initial load
duke
parents:
diff changeset
180 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
181 virtual uint ideal_reg() const { return Op_RegL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
182 };
a61af66fc99e Initial load
duke
parents:
diff changeset
183
a61af66fc99e Initial load
duke
parents:
diff changeset
184 //------------------------------XorINode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
185 // XOR'ing 2 integers
a61af66fc99e Initial load
duke
parents:
diff changeset
186 class XorINode : public AddNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
187 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
188 XorINode( Node *in1, Node *in2 ) : AddNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
189 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
190 virtual const Type *add_ring( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
191 virtual const Type *add_id() const { return TypeInt::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
192 virtual const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
193 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
194 };
a61af66fc99e Initial load
duke
parents:
diff changeset
195
a61af66fc99e Initial load
duke
parents:
diff changeset
196 //------------------------------XorINode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
197 // XOR'ing 2 longs
a61af66fc99e Initial load
duke
parents:
diff changeset
198 class XorLNode : public AddNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
199 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
200 XorLNode( Node *in1, Node *in2 ) : AddNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
201 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
202 virtual const Type *add_ring( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
203 virtual const Type *add_id() const { return TypeLong::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
204 virtual const Type *bottom_type() const { return TypeLong::LONG; }
a61af66fc99e Initial load
duke
parents:
diff changeset
205 virtual uint ideal_reg() const { return Op_RegL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
206 };
a61af66fc99e Initial load
duke
parents:
diff changeset
207
a61af66fc99e Initial load
duke
parents:
diff changeset
208 //------------------------------MaxNode----------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
209 // Max (or min) of 2 values. Included with the ADD nodes because it inherits
a61af66fc99e Initial load
duke
parents:
diff changeset
210 // all the behavior of addition on a ring. Only new thing is that we allow
a61af66fc99e Initial load
duke
parents:
diff changeset
211 // 2 equal inputs to be equal.
a61af66fc99e Initial load
duke
parents:
diff changeset
212 class MaxNode : public AddNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
213 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
214 MaxNode( Node *in1, Node *in2 ) : AddNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
215 virtual int Opcode() const = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
216 };
a61af66fc99e Initial load
duke
parents:
diff changeset
217
a61af66fc99e Initial load
duke
parents:
diff changeset
218 //------------------------------MaxINode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
219 // Maximum of 2 integers. Included with the ADD nodes because it inherits
a61af66fc99e Initial load
duke
parents:
diff changeset
220 // all the behavior of addition on a ring.
a61af66fc99e Initial load
duke
parents:
diff changeset
221 class MaxINode : public MaxNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
222 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
223 MaxINode( Node *in1, Node *in2 ) : MaxNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
224 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
225 virtual const Type *add_ring( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
226 virtual const Type *add_id() const { return TypeInt::make(min_jint); }
a61af66fc99e Initial load
duke
parents:
diff changeset
227 virtual const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
228 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
229 };
a61af66fc99e Initial load
duke
parents:
diff changeset
230
a61af66fc99e Initial load
duke
parents:
diff changeset
231 //------------------------------MinINode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
232 // MINimum of 2 integers. Included with the ADD nodes because it inherits
a61af66fc99e Initial load
duke
parents:
diff changeset
233 // all the behavior of addition on a ring.
a61af66fc99e Initial load
duke
parents:
diff changeset
234 class MinINode : public MaxNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
235 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
236 MinINode( Node *in1, Node *in2 ) : MaxNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
237 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
238 virtual const Type *add_ring( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
239 virtual const Type *add_id() const { return TypeInt::make(max_jint); }
a61af66fc99e Initial load
duke
parents:
diff changeset
240 virtual const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
241 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
242 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
243 };