annotate src/share/vm/opto/divnode.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: 0
diff changeset
2 * Copyright (c) 1997, 2005, 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: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
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: 0
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 // Optimization - Graph Style
a61af66fc99e Initial load
duke
parents:
diff changeset
28
a61af66fc99e Initial load
duke
parents:
diff changeset
29
a61af66fc99e Initial load
duke
parents:
diff changeset
30 //------------------------------DivINode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // Integer division
a61af66fc99e Initial load
duke
parents:
diff changeset
32 // Note: this is division as defined by JVMS, i.e., MinInt/-1 == MinInt.
a61af66fc99e Initial load
duke
parents:
diff changeset
33 // On processors which don't naturally support this special case (e.g., x86),
a61af66fc99e Initial load
duke
parents:
diff changeset
34 // the matcher or runtime system must take care of this.
a61af66fc99e Initial load
duke
parents:
diff changeset
35 class DivINode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
36 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
37 DivINode( Node *c, Node *dividend, Node *divisor ) : Node(c, dividend, divisor ) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
38 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
39 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
40 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
41 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
42 virtual const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
43 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
44 };
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 //------------------------------DivLNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
47 // Long division
a61af66fc99e Initial load
duke
parents:
diff changeset
48 class DivLNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
49 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
50 DivLNode( Node *c, Node *dividend, Node *divisor ) : Node(c, dividend, divisor ) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
51 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
52 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
53 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
54 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
55 virtual const Type *bottom_type() const { return TypeLong::LONG; }
a61af66fc99e Initial load
duke
parents:
diff changeset
56 virtual uint ideal_reg() const { return Op_RegL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
57 };
a61af66fc99e Initial load
duke
parents:
diff changeset
58
a61af66fc99e Initial load
duke
parents:
diff changeset
59 //------------------------------DivFNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
60 // Float division
a61af66fc99e Initial load
duke
parents:
diff changeset
61 class DivFNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
62 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
63 DivFNode( Node *c, Node *dividend, Node *divisor ) : Node(c, dividend, divisor) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
64 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
65 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
66 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
67 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
68 virtual const Type *bottom_type() const { return Type::FLOAT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
69 virtual uint ideal_reg() const { return Op_RegF; }
a61af66fc99e Initial load
duke
parents:
diff changeset
70 };
a61af66fc99e Initial load
duke
parents:
diff changeset
71
a61af66fc99e Initial load
duke
parents:
diff changeset
72 //------------------------------DivDNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
73 // Double division
a61af66fc99e Initial load
duke
parents:
diff changeset
74 class DivDNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
75 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
76 DivDNode( Node *c, Node *dividend, Node *divisor ) : Node(c,dividend, divisor) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
77 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
78 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
79 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
80 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
81 virtual const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
82 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
83 };
a61af66fc99e Initial load
duke
parents:
diff changeset
84
a61af66fc99e Initial load
duke
parents:
diff changeset
85 //------------------------------ModINode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
86 // Integer modulus
a61af66fc99e Initial load
duke
parents:
diff changeset
87 class ModINode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
88 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
89 ModINode( Node *c, Node *in1, Node *in2 ) : Node(c,in1, in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
90 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
91 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
92 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
93 virtual const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
94 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
95 };
a61af66fc99e Initial load
duke
parents:
diff changeset
96
a61af66fc99e Initial load
duke
parents:
diff changeset
97 //------------------------------ModLNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
98 // Long modulus
a61af66fc99e Initial load
duke
parents:
diff changeset
99 class ModLNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
100 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
101 ModLNode( Node *c, Node *in1, Node *in2 ) : Node(c,in1, in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
102 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
103 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
104 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
105 virtual const Type *bottom_type() const { return TypeLong::LONG; }
a61af66fc99e Initial load
duke
parents:
diff changeset
106 virtual uint ideal_reg() const { return Op_RegL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
107 };
a61af66fc99e Initial load
duke
parents:
diff changeset
108
a61af66fc99e Initial load
duke
parents:
diff changeset
109 //------------------------------ModFNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
110 // Float Modulus
a61af66fc99e Initial load
duke
parents:
diff changeset
111 class ModFNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
112 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
113 ModFNode( Node *c, Node *in1, Node *in2 ) : Node(c,in1, in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
114 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
115 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
116 virtual const Type *bottom_type() const { return Type::FLOAT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
117 virtual uint ideal_reg() const { return Op_RegF; }
a61af66fc99e Initial load
duke
parents:
diff changeset
118 };
a61af66fc99e Initial load
duke
parents:
diff changeset
119
a61af66fc99e Initial load
duke
parents:
diff changeset
120 //------------------------------ModDNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
121 // Double Modulus
a61af66fc99e Initial load
duke
parents:
diff changeset
122 class ModDNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
123 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
124 ModDNode( Node *c, Node *in1, Node *in2 ) : Node(c, in1, in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
125 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
126 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
127 virtual const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
128 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
129 };
a61af66fc99e Initial load
duke
parents:
diff changeset
130
a61af66fc99e Initial load
duke
parents:
diff changeset
131 //------------------------------DivModNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
132 // Division with remainder result.
a61af66fc99e Initial load
duke
parents:
diff changeset
133 class DivModNode : public MultiNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
134 protected:
a61af66fc99e Initial load
duke
parents:
diff changeset
135 DivModNode( Node *c, Node *dividend, Node *divisor );
a61af66fc99e Initial load
duke
parents:
diff changeset
136 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
137 enum {
a61af66fc99e Initial load
duke
parents:
diff changeset
138 div_proj_num = 0, // quotient
a61af66fc99e Initial load
duke
parents:
diff changeset
139 mod_proj_num = 1 // remainder
a61af66fc99e Initial load
duke
parents:
diff changeset
140 };
a61af66fc99e Initial load
duke
parents:
diff changeset
141 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
142 virtual Node *Identity( PhaseTransform *phase ) { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
143 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape) { return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
144 virtual const Type *Value( PhaseTransform *phase ) const { return bottom_type(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
145 virtual uint hash() const { return Node::hash(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
146 virtual bool is_CFG() const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
147 virtual uint ideal_reg() const { return NotAMachineReg; }
a61af66fc99e Initial load
duke
parents:
diff changeset
148
a61af66fc99e Initial load
duke
parents:
diff changeset
149 ProjNode* div_proj() { return proj_out(div_proj_num); }
a61af66fc99e Initial load
duke
parents:
diff changeset
150 ProjNode* mod_proj() { return proj_out(mod_proj_num); }
a61af66fc99e Initial load
duke
parents:
diff changeset
151 };
a61af66fc99e Initial load
duke
parents:
diff changeset
152
a61af66fc99e Initial load
duke
parents:
diff changeset
153 //------------------------------DivModINode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
154 // Integer division with remainder result.
a61af66fc99e Initial load
duke
parents:
diff changeset
155 class DivModINode : public DivModNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
156 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
157 DivModINode( Node *c, Node *dividend, Node *divisor ) : DivModNode(c, dividend, divisor) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
158 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
159 virtual const Type *bottom_type() const { return TypeTuple::INT_PAIR; }
a61af66fc99e Initial load
duke
parents:
diff changeset
160 virtual Node *match( const ProjNode *proj, const Matcher *m );
a61af66fc99e Initial load
duke
parents:
diff changeset
161
a61af66fc99e Initial load
duke
parents:
diff changeset
162 // Make a divmod and associated projections from a div or mod.
a61af66fc99e Initial load
duke
parents:
diff changeset
163 static DivModINode* make(Compile* C, Node* div_or_mod);
a61af66fc99e Initial load
duke
parents:
diff changeset
164 };
a61af66fc99e Initial load
duke
parents:
diff changeset
165
a61af66fc99e Initial load
duke
parents:
diff changeset
166 //------------------------------DivModLNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
167 // Long division with remainder result.
a61af66fc99e Initial load
duke
parents:
diff changeset
168 class DivModLNode : public DivModNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
169 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
170 DivModLNode( Node *c, Node *dividend, Node *divisor ) : DivModNode(c, dividend, divisor) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
171 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
172 virtual const Type *bottom_type() const { return TypeTuple::LONG_PAIR; }
a61af66fc99e Initial load
duke
parents:
diff changeset
173 virtual Node *match( const ProjNode *proj, const Matcher *m );
a61af66fc99e Initial load
duke
parents:
diff changeset
174
a61af66fc99e Initial load
duke
parents:
diff changeset
175 // Make a divmod and associated projections from a div or mod.
a61af66fc99e Initial load
duke
parents:
diff changeset
176 static DivModLNode* make(Compile* C, Node* div_or_mod);
a61af66fc99e Initial load
duke
parents:
diff changeset
177 };