author | roland |
Fri, 17 Aug 2018 17:13:12 +0200 | |
changeset 51521 | 76a51e26d0ac |
parent 49877 | d84f06a0cae1 |
child 52143 | ad6384355aa3 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
32084
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
30183
diff
changeset
|
2 |
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1432
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1432
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1432
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#ifndef SHARE_VM_OPTO_CFGNODE_HPP |
26 |
#define SHARE_VM_OPTO_CFGNODE_HPP |
|
27 |
||
28 |
#include "opto/multnode.hpp" |
|
29 |
#include "opto/node.hpp" |
|
30 |
#include "opto/opcodes.hpp" |
|
31 |
#include "opto/type.hpp" |
|
32 |
||
1 | 33 |
// Portions of code courtesy of Clifford Click |
34 |
||
35 |
// Optimization - Graph Style |
|
36 |
||
37 |
class Matcher; |
|
38 |
class Node; |
|
39 |
class RegionNode; |
|
40 |
class TypeNode; |
|
41 |
class PhiNode; |
|
42 |
class GotoNode; |
|
43 |
class MultiNode; |
|
44 |
class MultiBranchNode; |
|
45 |
class IfNode; |
|
46 |
class PCTableNode; |
|
47 |
class JumpNode; |
|
48 |
class CatchNode; |
|
49 |
class NeverBranchNode; |
|
50 |
class ProjNode; |
|
51 |
class CProjNode; |
|
52 |
class IfTrueNode; |
|
53 |
class IfFalseNode; |
|
54 |
class CatchProjNode; |
|
55 |
class JProjNode; |
|
56 |
class JumpProjNode; |
|
57 |
class SCMemProjNode; |
|
58 |
class PhaseIdealLoop; |
|
59 |
||
60 |
//------------------------------RegionNode------------------------------------- |
|
61 |
// The class of RegionNodes, which can be mapped to basic blocks in the |
|
62 |
// program. Their inputs point to Control sources. PhiNodes (described |
|
63 |
// below) have an input point to a RegionNode. Merged data inputs to PhiNodes |
|
64 |
// correspond 1-to-1 with RegionNode inputs. The zero input of a PhiNode is |
|
65 |
// the RegionNode, and the zero input of the RegionNode is itself. |
|
66 |
class RegionNode : public Node { |
|
67 |
public: |
|
68 |
// Node layout (parallels PhiNode): |
|
69 |
enum { Region, // Generally points to self. |
|
70 |
Control // Control arcs are [1..len) |
|
71 |
}; |
|
72 |
||
73 |
RegionNode( uint required ) : Node(required) { |
|
74 |
init_class_id(Class_Region); |
|
75 |
init_req(0,this); |
|
76 |
} |
|
77 |
||
78 |
Node* is_copy() const { |
|
79 |
const Node* r = _in[Region]; |
|
80 |
if (r == NULL) |
|
81 |
return nonnull_req(); |
|
82 |
return NULL; // not a copy! |
|
83 |
} |
|
84 |
PhiNode* has_phi() const; // returns an arbitrary phi user, or NULL |
|
85 |
PhiNode* has_unique_phi() const; // returns the unique phi user, or NULL |
|
86 |
// Is this region node unreachable from root? |
|
87 |
bool is_unreachable_region(PhaseGVN *phase) const; |
|
88 |
virtual int Opcode() const; |
|
89 |
virtual bool pinned() const { return (const Node *)in(0) == this; } |
|
90 |
virtual bool is_CFG () const { return true; } |
|
91 |
virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash |
|
92 |
virtual bool depends_only_on_test() const { return false; } |
|
93 |
virtual const Type *bottom_type() const { return Type::CONTROL; } |
|
35551
36ef3841fb34
8146629: Make phase->is_IterGVN() accessible from Node::Identity and Node::Value
thartmann
parents:
35545
diff
changeset
|
94 |
virtual const Type* Value(PhaseGVN* phase) const; |
36ef3841fb34
8146629: Make phase->is_IterGVN() accessible from Node::Identity and Node::Value
thartmann
parents:
35545
diff
changeset
|
95 |
virtual Node* Identity(PhaseGVN* phase); |
1 | 96 |
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
97 |
virtual const RegMask &out_RegMask() const; |
|
15113 | 98 |
bool try_clean_mem_phi(PhaseGVN *phase); |
1 | 99 |
}; |
100 |
||
101 |
//------------------------------JProjNode-------------------------------------- |
|
102 |
// jump projection for node that produces multiple control-flow paths |
|
103 |
class JProjNode : public ProjNode { |
|
104 |
public: |
|
105 |
JProjNode( Node* ctrl, uint idx ) : ProjNode(ctrl,idx) {} |
|
106 |
virtual int Opcode() const; |
|
107 |
virtual bool is_CFG() const { return true; } |
|
108 |
virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash |
|
109 |
virtual const Node* is_block_proj() const { return in(0); } |
|
110 |
virtual const RegMask& out_RegMask() const; |
|
111 |
virtual uint ideal_reg() const { return 0; } |
|
112 |
}; |
|
113 |
||
114 |
//------------------------------PhiNode---------------------------------------- |
|
115 |
// PhiNodes merge values from different Control paths. Slot 0 points to the |
|
116 |
// controlling RegionNode. Other slots map 1-for-1 with incoming control flow |
|
117 |
// paths to the RegionNode. For speed reasons (to avoid another pass) we |
|
118 |
// can turn PhiNodes into copys in-place by NULL'ing out their RegionNode |
|
119 |
// input in slot 0. |
|
120 |
class PhiNode : public TypeNode { |
|
121 |
const TypePtr* const _adr_type; // non-null only for Type::MEMORY nodes. |
|
40871
82848b0654f8
8038348: Instance field load is replaced by wrong data Phi
thartmann
parents:
35574
diff
changeset
|
122 |
// The following fields are only used for data PhiNodes to indicate |
82848b0654f8
8038348: Instance field load is replaced by wrong data Phi
thartmann
parents:
35574
diff
changeset
|
123 |
// that the PhiNode represents the value of a known instance field. |
82848b0654f8
8038348: Instance field load is replaced by wrong data Phi
thartmann
parents:
35574
diff
changeset
|
124 |
int _inst_mem_id; // Instance memory id (node index of the memory Phi) |
237
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
125 |
const int _inst_id; // Instance id of the memory slice. |
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
126 |
const int _inst_index; // Alias index of the instance memory slice. |
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
127 |
// Array elements references have the same alias_idx but different offset. |
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
128 |
const int _inst_offset; // Offset of the instance memory slice. |
1 | 129 |
// Size is bigger to hold the _adr_type field. |
130 |
virtual uint hash() const; // Check the type |
|
131 |
virtual uint cmp( const Node &n ) const; |
|
132 |
virtual uint size_of() const { return sizeof(*this); } |
|
133 |
||
134 |
// Determine if CMoveNode::is_cmove_id can be used at this join point. |
|
135 |
Node* is_cmove_id(PhaseTransform* phase, int true_path); |
|
136 |
||
137 |
public: |
|
138 |
// Node layout (parallels RegionNode): |
|
139 |
enum { Region, // Control input is the Phi's region. |
|
140 |
Input // Input values are [1..len) |
|
141 |
}; |
|
142 |
||
237
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
143 |
PhiNode( Node *r, const Type *t, const TypePtr* at = NULL, |
40871
82848b0654f8
8038348: Instance field load is replaced by wrong data Phi
thartmann
parents:
35574
diff
changeset
|
144 |
const int imid = -1, |
769 | 145 |
const int iid = TypeOopPtr::InstanceTop, |
237
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
146 |
const int iidx = Compile::AliasIdxTop, |
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
147 |
const int ioffs = Type::OffsetTop ) |
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
148 |
: TypeNode(t,r->req()), |
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
149 |
_adr_type(at), |
40871
82848b0654f8
8038348: Instance field load is replaced by wrong data Phi
thartmann
parents:
35574
diff
changeset
|
150 |
_inst_mem_id(imid), |
237
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
151 |
_inst_id(iid), |
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
152 |
_inst_index(iidx), |
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
153 |
_inst_offset(ioffs) |
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
154 |
{ |
1 | 155 |
init_class_id(Class_Phi); |
156 |
init_req(0, r); |
|
157 |
verify_adr_type(); |
|
158 |
} |
|
159 |
// create a new phi with in edges matching r and set (initially) to x |
|
160 |
static PhiNode* make( Node* r, Node* x ); |
|
161 |
// extra type arguments override the new phi's bottom_type and adr_type |
|
162 |
static PhiNode* make( Node* r, Node* x, const Type *t, const TypePtr* at = NULL ); |
|
163 |
// create a new phi with narrowed memory type |
|
164 |
PhiNode* slice_memory(const TypePtr* adr_type) const; |
|
247
2aeab9ac7fea
6674600: (Escape Analysis) Optimize memory graph for instance's fields
kvn
parents:
237
diff
changeset
|
165 |
PhiNode* split_out_instance(const TypePtr* at, PhaseIterGVN *igvn) const; |
1 | 166 |
// like make(r, x), but does not initialize the in edges to x |
167 |
static PhiNode* make_blank( Node* r, Node* x ); |
|
168 |
||
169 |
// Accessors |
|
170 |
RegionNode* region() const { Node* r = in(Region); assert(!r || r->is_Region(), ""); return (RegionNode*)r; } |
|
171 |
||
172 |
Node* is_copy() const { |
|
173 |
// The node is a real phi if _in[0] is a Region node. |
|
174 |
DEBUG_ONLY(const Node* r = _in[Region];) |
|
175 |
assert(r != NULL && r->is_Region(), "Not valid control"); |
|
176 |
return NULL; // not a copy! |
|
177 |
} |
|
178 |
||
1432
44f076e3d2a4
6667595: Set probability FAIR for pre-, post- loops and ALWAYS for main loop
kvn
parents:
781
diff
changeset
|
179 |
bool is_tripcount() const; |
44f076e3d2a4
6667595: Set probability FAIR for pre-, post- loops and ALWAYS for main loop
kvn
parents:
781
diff
changeset
|
180 |
|
237
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
181 |
// Determine a unique non-trivial input, if any. |
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
182 |
// Ignore casts if it helps. Return NULL on failure. |
35545
a8f29dfd62b2
8139771: Eliminating CastPP nodes at Phis when they all come from a unique input may cause crash
roland
parents:
34164
diff
changeset
|
183 |
Node* unique_input(PhaseTransform *phase, bool uncast); |
a8f29dfd62b2
8139771: Eliminating CastPP nodes at Phis when they all come from a unique input may cause crash
roland
parents:
34164
diff
changeset
|
184 |
Node* unique_input(PhaseTransform *phase) { |
a8f29dfd62b2
8139771: Eliminating CastPP nodes at Phis when they all come from a unique input may cause crash
roland
parents:
34164
diff
changeset
|
185 |
Node* uin = unique_input(phase, false); |
a8f29dfd62b2
8139771: Eliminating CastPP nodes at Phis when they all come from a unique input may cause crash
roland
parents:
34164
diff
changeset
|
186 |
if (uin == NULL) { |
a8f29dfd62b2
8139771: Eliminating CastPP nodes at Phis when they all come from a unique input may cause crash
roland
parents:
34164
diff
changeset
|
187 |
uin = unique_input(phase, true); |
a8f29dfd62b2
8139771: Eliminating CastPP nodes at Phis when they all come from a unique input may cause crash
roland
parents:
34164
diff
changeset
|
188 |
} |
a8f29dfd62b2
8139771: Eliminating CastPP nodes at Phis when they all come from a unique input may cause crash
roland
parents:
34164
diff
changeset
|
189 |
return uin; |
a8f29dfd62b2
8139771: Eliminating CastPP nodes at Phis when they all come from a unique input may cause crash
roland
parents:
34164
diff
changeset
|
190 |
} |
237
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
191 |
|
1 | 192 |
// Check for a simple dead loop. |
193 |
enum LoopSafety { Safe = 0, Unsafe, UnsafeLoop }; |
|
194 |
LoopSafety simple_data_loop_check(Node *in) const; |
|
195 |
// Is it unsafe data loop? It becomes a dead loop if this phi node removed. |
|
196 |
bool is_unsafe_data_reference(Node *in) const; |
|
15113 | 197 |
int is_diamond_phi(bool check_control_only = false) const; |
1 | 198 |
virtual int Opcode() const; |
199 |
virtual bool pinned() const { return in(0) != 0; } |
|
200 |
virtual const TypePtr *adr_type() const { verify_adr_type(true); return _adr_type; } |
|
237
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
201 |
|
40871
82848b0654f8
8038348: Instance field load is replaced by wrong data Phi
thartmann
parents:
35574
diff
changeset
|
202 |
void set_inst_mem_id(int inst_mem_id) { _inst_mem_id = inst_mem_id; } |
82848b0654f8
8038348: Instance field load is replaced by wrong data Phi
thartmann
parents:
35574
diff
changeset
|
203 |
const int inst_mem_id() const { return _inst_mem_id; } |
237
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
204 |
const int inst_id() const { return _inst_id; } |
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
205 |
const int inst_index() const { return _inst_index; } |
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
206 |
const int inst_offset() const { return _inst_offset; } |
40871
82848b0654f8
8038348: Instance field load is replaced by wrong data Phi
thartmann
parents:
35574
diff
changeset
|
207 |
bool is_same_inst_field(const Type* tp, int mem_id, int id, int index, int offset) { |
237
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
208 |
return type()->basic_type() == tp->basic_type() && |
40871
82848b0654f8
8038348: Instance field load is replaced by wrong data Phi
thartmann
parents:
35574
diff
changeset
|
209 |
inst_mem_id() == mem_id && |
237
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
210 |
inst_id() == id && |
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
211 |
inst_index() == index && |
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
212 |
inst_offset() == offset && |
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
213 |
type()->higher_equal(tp); |
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
214 |
} |
fba97e902303
6673473: (Escape Analysis) Add the instance's field information to PhiNode
kvn
parents:
190
diff
changeset
|
215 |
|
35551
36ef3841fb34
8146629: Make phase->is_IterGVN() accessible from Node::Identity and Node::Value
thartmann
parents:
35545
diff
changeset
|
216 |
virtual const Type* Value(PhaseGVN* phase) const; |
36ef3841fb34
8146629: Make phase->is_IterGVN() accessible from Node::Identity and Node::Value
thartmann
parents:
35545
diff
changeset
|
217 |
virtual Node* Identity(PhaseGVN* phase); |
1 | 218 |
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
219 |
virtual const RegMask &out_RegMask() const; |
|
220 |
virtual const RegMask &in_RegMask(uint) const; |
|
221 |
#ifndef PRODUCT |
|
32084
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
30183
diff
changeset
|
222 |
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const; |
1 | 223 |
virtual void dump_spec(outputStream *st) const; |
224 |
#endif |
|
225 |
#ifdef ASSERT |
|
226 |
void verify_adr_type(VectorSet& visited, const TypePtr* at) const; |
|
227 |
void verify_adr_type(bool recursive = false) const; |
|
228 |
#else //ASSERT |
|
229 |
void verify_adr_type(bool recursive = false) const {} |
|
230 |
#endif //ASSERT |
|
231 |
}; |
|
232 |
||
233 |
//------------------------------GotoNode--------------------------------------- |
|
234 |
// GotoNodes perform direct branches. |
|
235 |
class GotoNode : public Node { |
|
236 |
public: |
|
10255 | 237 |
GotoNode( Node *control ) : Node(control) {} |
1 | 238 |
virtual int Opcode() const; |
239 |
virtual bool pinned() const { return true; } |
|
240 |
virtual bool is_CFG() const { return true; } |
|
241 |
virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash |
|
242 |
virtual const Node *is_block_proj() const { return this; } |
|
243 |
virtual bool depends_only_on_test() const { return false; } |
|
244 |
virtual const Type *bottom_type() const { return Type::CONTROL; } |
|
35551
36ef3841fb34
8146629: Make phase->is_IterGVN() accessible from Node::Identity and Node::Value
thartmann
parents:
35545
diff
changeset
|
245 |
virtual const Type* Value(PhaseGVN* phase) const; |
36ef3841fb34
8146629: Make phase->is_IterGVN() accessible from Node::Identity and Node::Value
thartmann
parents:
35545
diff
changeset
|
246 |
virtual Node* Identity(PhaseGVN* phase); |
1 | 247 |
virtual const RegMask &out_RegMask() const; |
32084
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
30183
diff
changeset
|
248 |
|
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
30183
diff
changeset
|
249 |
#ifndef PRODUCT |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
30183
diff
changeset
|
250 |
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const; |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
30183
diff
changeset
|
251 |
#endif |
1 | 252 |
}; |
253 |
||
254 |
//------------------------------CProjNode-------------------------------------- |
|
255 |
// control projection for node that produces multiple control-flow paths |
|
256 |
class CProjNode : public ProjNode { |
|
257 |
public: |
|
258 |
CProjNode( Node *ctrl, uint idx ) : ProjNode(ctrl,idx) {} |
|
259 |
virtual int Opcode() const; |
|
260 |
virtual bool is_CFG() const { return true; } |
|
261 |
virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash |
|
262 |
virtual const Node *is_block_proj() const { return in(0); } |
|
263 |
virtual const RegMask &out_RegMask() const; |
|
264 |
virtual uint ideal_reg() const { return 0; } |
|
265 |
}; |
|
266 |
||
267 |
//---------------------------MultiBranchNode----------------------------------- |
|
268 |
// This class defines a MultiBranchNode, a MultiNode which yields multiple |
|
269 |
// control values. These are distinguished from other types of MultiNodes |
|
270 |
// which yield multiple values, but control is always and only projection #0. |
|
271 |
class MultiBranchNode : public MultiNode { |
|
272 |
public: |
|
273 |
MultiBranchNode( uint required ) : MultiNode(required) { |
|
274 |
init_class_id(Class_MultiBranch); |
|
275 |
} |
|
374 | 276 |
// returns required number of users to be well formed. |
277 |
virtual int required_outcnt() const = 0; |
|
1 | 278 |
}; |
279 |
||
280 |
//------------------------------IfNode----------------------------------------- |
|
281 |
// Output selected Control, based on a boolean test |
|
282 |
class IfNode : public MultiBranchNode { |
|
283 |
// Size is bigger to hold the probability field. However, _prob does not |
|
284 |
// change the semantics so it does not appear in the hash & cmp functions. |
|
285 |
virtual uint size_of() const { return sizeof(*this); } |
|
30183 | 286 |
|
287 |
private: |
|
288 |
// Helper methods for fold_compares |
|
289 |
bool cmpi_folds(PhaseIterGVN* igvn); |
|
290 |
bool is_ctrl_folds(Node* ctrl, PhaseIterGVN* igvn); |
|
291 |
bool has_shared_region(ProjNode* proj, ProjNode*& success, ProjNode*& fail); |
|
292 |
bool has_only_uncommon_traps(ProjNode* proj, ProjNode*& success, ProjNode*& fail, PhaseIterGVN* igvn); |
|
34164
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
293 |
Node* merge_uncommon_traps(ProjNode* proj, ProjNode* success, ProjNode* fail, PhaseIterGVN* igvn); |
30183 | 294 |
static void improve_address_types(Node* l, Node* r, ProjNode* fail, PhaseIterGVN* igvn); |
295 |
bool is_cmp_with_loadrange(ProjNode* proj); |
|
296 |
bool is_null_check(ProjNode* proj, PhaseIterGVN* igvn); |
|
297 |
bool is_side_effect_free_test(ProjNode* proj, PhaseIterGVN* igvn); |
|
298 |
void reroute_side_effect_free_unc(ProjNode* proj, ProjNode* dom_proj, PhaseIterGVN* igvn); |
|
299 |
ProjNode* uncommon_trap_proj(CallStaticJavaNode*& call) const; |
|
300 |
bool fold_compares_helper(ProjNode* proj, ProjNode* success, ProjNode* fail, PhaseIterGVN* igvn); |
|
49875
6d1f26b1ddfd
8201368: IfNode::fold_compares() may lead to incorrect execution
roland
parents:
47216
diff
changeset
|
301 |
static bool is_dominator_unc(CallStaticJavaNode* dom_unc, CallStaticJavaNode* unc); |
30183 | 302 |
|
34164
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
303 |
protected: |
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
304 |
ProjNode* range_check_trap_proj(int& flip, Node*& l, Node*& r); |
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
305 |
Node* Ideal_common(PhaseGVN *phase, bool can_reshape); |
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
306 |
Node* dominated_by(Node* prev_dom, PhaseIterGVN* igvn); |
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
307 |
Node* search_identical(int dist); |
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
308 |
|
1 | 309 |
public: |
310 |
||
311 |
// Degrees of branch prediction probability by order of magnitude: |
|
312 |
// PROB_UNLIKELY_1e(N) is a 1 in 1eN chance. |
|
313 |
// PROB_LIKELY_1e(N) is a 1 - PROB_UNLIKELY_1e(N) |
|
314 |
#define PROB_UNLIKELY_MAG(N) (1e- ## N ## f) |
|
315 |
#define PROB_LIKELY_MAG(N) (1.0f-PROB_UNLIKELY_MAG(N)) |
|
316 |
||
317 |
// Maximum and minimum branch prediction probabilties |
|
318 |
// 1 in 1,000,000 (magnitude 6) |
|
319 |
// |
|
320 |
// Although PROB_NEVER == PROB_MIN and PROB_ALWAYS == PROB_MAX |
|
321 |
// they are used to distinguish different situations: |
|
322 |
// |
|
323 |
// The name PROB_MAX (PROB_MIN) is for probabilities which correspond to |
|
324 |
// very likely (unlikely) but with a concrete possibility of a rare |
|
325 |
// contrary case. These constants would be used for pinning |
|
326 |
// measurements, and as measures for assertions that have high |
|
327 |
// confidence, but some evidence of occasional failure. |
|
328 |
// |
|
329 |
// The name PROB_ALWAYS (PROB_NEVER) is to stand for situations for which |
|
330 |
// there is no evidence at all that the contrary case has ever occurred. |
|
331 |
||
332 |
#define PROB_NEVER PROB_UNLIKELY_MAG(6) |
|
333 |
#define PROB_ALWAYS PROB_LIKELY_MAG(6) |
|
334 |
||
335 |
#define PROB_MIN PROB_UNLIKELY_MAG(6) |
|
336 |
#define PROB_MAX PROB_LIKELY_MAG(6) |
|
337 |
||
338 |
// Static branch prediction probabilities |
|
339 |
// 1 in 10 (magnitude 1) |
|
340 |
#define PROB_STATIC_INFREQUENT PROB_UNLIKELY_MAG(1) |
|
341 |
#define PROB_STATIC_FREQUENT PROB_LIKELY_MAG(1) |
|
342 |
||
343 |
// Fair probability 50/50 |
|
344 |
#define PROB_FAIR (0.5f) |
|
345 |
||
346 |
// Unknown probability sentinel |
|
347 |
#define PROB_UNKNOWN (-1.0f) |
|
348 |
||
349 |
// Probability "constructors", to distinguish as a probability any manifest |
|
350 |
// constant without a names |
|
351 |
#define PROB_LIKELY(x) ((float) (x)) |
|
352 |
#define PROB_UNLIKELY(x) (1.0f - (float)(x)) |
|
353 |
||
354 |
// Other probabilities in use, but without a unique name, are documented |
|
355 |
// here for lack of a better place: |
|
356 |
// |
|
357 |
// 1 in 1000 probabilities (magnitude 3): |
|
358 |
// threshold for converting to conditional move |
|
359 |
// likelihood of null check failure if a null HAS been seen before |
|
360 |
// likelihood of slow path taken in library calls |
|
361 |
// |
|
362 |
// 1 in 10,000 probabilities (magnitude 4): |
|
363 |
// threshold for making an uncommon trap probability more extreme |
|
364 |
// threshold for for making a null check implicit |
|
365 |
// likelihood of needing a gc if eden top moves during an allocation |
|
366 |
// likelihood of a predicted call failure |
|
367 |
// |
|
368 |
// 1 in 100,000 probabilities (magnitude 5): |
|
369 |
// threshold for ignoring counts when estimating path frequency |
|
370 |
// likelihood of FP clipping failure |
|
371 |
// likelihood of catching an exception from a try block |
|
372 |
// likelihood of null check failure if a null has NOT been seen before |
|
373 |
// |
|
374 |
// Magic manifest probabilities such as 0.83, 0.7, ... can be found in |
|
375 |
// gen_subtype_check() and catch_inline_exceptions(). |
|
376 |
||
377 |
float _prob; // Probability of true path being taken. |
|
378 |
float _fcnt; // Frequency counter |
|
379 |
IfNode( Node *control, Node *b, float p, float fcnt ) |
|
380 |
: MultiBranchNode(2), _prob(p), _fcnt(fcnt) { |
|
381 |
init_class_id(Class_If); |
|
382 |
init_req(0,control); |
|
383 |
init_req(1,b); |
|
384 |
} |
|
385 |
virtual int Opcode() const; |
|
386 |
virtual bool pinned() const { return true; } |
|
387 |
virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; } |
|
388 |
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
|
35551
36ef3841fb34
8146629: Make phase->is_IterGVN() accessible from Node::Identity and Node::Value
thartmann
parents:
35545
diff
changeset
|
389 |
virtual const Type* Value(PhaseGVN* phase) const; |
374 | 390 |
virtual int required_outcnt() const { return 2; } |
1 | 391 |
virtual const RegMask &out_RegMask() const; |
30183 | 392 |
Node* fold_compares(PhaseIterGVN* phase); |
1 | 393 |
static Node* up_one_dom(Node* curr, bool linear_only = false); |
394 |
||
190
e9a0a9dcd4f6
6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents:
1
diff
changeset
|
395 |
// Takes the type of val and filters it through the test represented |
e9a0a9dcd4f6
6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents:
1
diff
changeset
|
396 |
// by if_proj and returns a more refined type if one is produced. |
e9a0a9dcd4f6
6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents:
1
diff
changeset
|
397 |
// Returns NULL is it couldn't improve the type. |
e9a0a9dcd4f6
6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents:
1
diff
changeset
|
398 |
static const TypeInt* filtered_int_type(PhaseGVN* phase, Node* val, Node* if_proj); |
e9a0a9dcd4f6
6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents:
1
diff
changeset
|
399 |
|
1 | 400 |
#ifndef PRODUCT |
401 |
virtual void dump_spec(outputStream *st) const; |
|
32084
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
30183
diff
changeset
|
402 |
virtual void related(GrowableArray <Node *> *in_rel, GrowableArray <Node *> *out_rel, bool compact) const; |
1 | 403 |
#endif |
404 |
}; |
|
405 |
||
34164
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
406 |
class RangeCheckNode : public IfNode { |
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
407 |
private: |
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
408 |
int is_range_check(Node* &range, Node* &index, jint &offset); |
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
409 |
|
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
410 |
public: |
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
411 |
RangeCheckNode(Node* control, Node *b, float p, float fcnt) |
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
412 |
: IfNode(control, b, p, fcnt) { |
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
413 |
init_class_id(Class_RangeCheck); |
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
414 |
} |
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
415 |
|
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
416 |
virtual int Opcode() const; |
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
417 |
virtual Node* Ideal(PhaseGVN *phase, bool can_reshape); |
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
418 |
}; |
a9e6034d7707
8137168: Replace IfNode with a new RangeCheckNode for range checks
roland
parents:
32084
diff
changeset
|
419 |
|
28486
b0df113b962e
8027626: assert(Opcode() != Op_If || outcnt() == 2) failed: bad if #1
roland
parents:
15113
diff
changeset
|
420 |
class IfProjNode : public CProjNode { |
1 | 421 |
public: |
28486
b0df113b962e
8027626: assert(Opcode() != Op_If || outcnt() == 2) failed: bad if #1
roland
parents:
15113
diff
changeset
|
422 |
IfProjNode(IfNode *ifnode, uint idx) : CProjNode(ifnode,idx) {} |
35551
36ef3841fb34
8146629: Make phase->is_IterGVN() accessible from Node::Identity and Node::Value
thartmann
parents:
35545
diff
changeset
|
423 |
virtual Node* Identity(PhaseGVN* phase); |
28486
b0df113b962e
8027626: assert(Opcode() != Op_If || outcnt() == 2) failed: bad if #1
roland
parents:
15113
diff
changeset
|
424 |
|
b0df113b962e
8027626: assert(Opcode() != Op_If || outcnt() == 2) failed: bad if #1
roland
parents:
15113
diff
changeset
|
425 |
protected: |
b0df113b962e
8027626: assert(Opcode() != Op_If || outcnt() == 2) failed: bad if #1
roland
parents:
15113
diff
changeset
|
426 |
// Type of If input when this branch is always taken |
b0df113b962e
8027626: assert(Opcode() != Op_If || outcnt() == 2) failed: bad if #1
roland
parents:
15113
diff
changeset
|
427 |
virtual bool always_taken(const TypeTuple* t) const = 0; |
32084
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
30183
diff
changeset
|
428 |
|
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
30183
diff
changeset
|
429 |
#ifndef PRODUCT |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
30183
diff
changeset
|
430 |
public: |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
30183
diff
changeset
|
431 |
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const; |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
30183
diff
changeset
|
432 |
#endif |
28486
b0df113b962e
8027626: assert(Opcode() != Op_If || outcnt() == 2) failed: bad if #1
roland
parents:
15113
diff
changeset
|
433 |
}; |
b0df113b962e
8027626: assert(Opcode() != Op_If || outcnt() == 2) failed: bad if #1
roland
parents:
15113
diff
changeset
|
434 |
|
b0df113b962e
8027626: assert(Opcode() != Op_If || outcnt() == 2) failed: bad if #1
roland
parents:
15113
diff
changeset
|
435 |
class IfTrueNode : public IfProjNode { |
b0df113b962e
8027626: assert(Opcode() != Op_If || outcnt() == 2) failed: bad if #1
roland
parents:
15113
diff
changeset
|
436 |
public: |
b0df113b962e
8027626: assert(Opcode() != Op_If || outcnt() == 2) failed: bad if #1
roland
parents:
15113
diff
changeset
|
437 |
IfTrueNode( IfNode *ifnode ) : IfProjNode(ifnode,1) { |
1 | 438 |
init_class_id(Class_IfTrue); |
439 |
} |
|
440 |
virtual int Opcode() const; |
|
28486
b0df113b962e
8027626: assert(Opcode() != Op_If || outcnt() == 2) failed: bad if #1
roland
parents:
15113
diff
changeset
|
441 |
|
b0df113b962e
8027626: assert(Opcode() != Op_If || outcnt() == 2) failed: bad if #1
roland
parents:
15113
diff
changeset
|
442 |
protected: |
b0df113b962e
8027626: assert(Opcode() != Op_If || outcnt() == 2) failed: bad if #1
roland
parents:
15113
diff
changeset
|
443 |
virtual bool always_taken(const TypeTuple* t) const { return t == TypeTuple::IFTRUE; } |
1 | 444 |
}; |
445 |
||
28486
b0df113b962e
8027626: assert(Opcode() != Op_If || outcnt() == 2) failed: bad if #1
roland
parents:
15113
diff
changeset
|
446 |
class IfFalseNode : public IfProjNode { |
1 | 447 |
public: |
28486
b0df113b962e
8027626: assert(Opcode() != Op_If || outcnt() == 2) failed: bad if #1
roland
parents:
15113
diff
changeset
|
448 |
IfFalseNode( IfNode *ifnode ) : IfProjNode(ifnode,0) { |
1 | 449 |
init_class_id(Class_IfFalse); |
450 |
} |
|
451 |
virtual int Opcode() const; |
|
28486
b0df113b962e
8027626: assert(Opcode() != Op_If || outcnt() == 2) failed: bad if #1
roland
parents:
15113
diff
changeset
|
452 |
|
b0df113b962e
8027626: assert(Opcode() != Op_If || outcnt() == 2) failed: bad if #1
roland
parents:
15113
diff
changeset
|
453 |
protected: |
b0df113b962e
8027626: assert(Opcode() != Op_If || outcnt() == 2) failed: bad if #1
roland
parents:
15113
diff
changeset
|
454 |
virtual bool always_taken(const TypeTuple* t) const { return t == TypeTuple::IFFALSE; } |
1 | 455 |
}; |
456 |
||
457 |
||
458 |
//------------------------------PCTableNode------------------------------------ |
|
459 |
// Build an indirect branch table. Given a control and a table index, |
|
460 |
// control is passed to the Projection matching the table index. Used to |
|
461 |
// implement switch statements and exception-handling capabilities. |
|
462 |
// Undefined behavior if passed-in index is not inside the table. |
|
463 |
class PCTableNode : public MultiBranchNode { |
|
464 |
virtual uint hash() const; // Target count; table size |
|
465 |
virtual uint cmp( const Node &n ) const; |
|
466 |
virtual uint size_of() const { return sizeof(*this); } |
|
467 |
||
468 |
public: |
|
469 |
const uint _size; // Number of targets |
|
470 |
||
471 |
PCTableNode( Node *ctrl, Node *idx, uint size ) : MultiBranchNode(2), _size(size) { |
|
472 |
init_class_id(Class_PCTable); |
|
473 |
init_req(0, ctrl); |
|
474 |
init_req(1, idx); |
|
475 |
} |
|
476 |
virtual int Opcode() const; |
|
35551
36ef3841fb34
8146629: Make phase->is_IterGVN() accessible from Node::Identity and Node::Value
thartmann
parents:
35545
diff
changeset
|
477 |
virtual const Type* Value(PhaseGVN* phase) const; |
1 | 478 |
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
479 |
virtual const Type *bottom_type() const; |
|
480 |
virtual bool pinned() const { return true; } |
|
374 | 481 |
virtual int required_outcnt() const { return _size; } |
1 | 482 |
}; |
483 |
||
484 |
//------------------------------JumpNode--------------------------------------- |
|
485 |
// Indirect branch. Uses PCTable above to implement a switch statement. |
|
486 |
// It emits as a table load and local branch. |
|
487 |
class JumpNode : public PCTableNode { |
|
49877
d84f06a0cae1
8200303: C2 should leverage profiling for lookupswitch/tableswitch
roland
parents:
49875
diff
changeset
|
488 |
virtual uint size_of() const { return sizeof(*this); } |
1 | 489 |
public: |
49877
d84f06a0cae1
8200303: C2 should leverage profiling for lookupswitch/tableswitch
roland
parents:
49875
diff
changeset
|
490 |
float* _probs; // probability of each projection |
d84f06a0cae1
8200303: C2 should leverage profiling for lookupswitch/tableswitch
roland
parents:
49875
diff
changeset
|
491 |
float _fcnt; // total number of times this Jump was executed |
d84f06a0cae1
8200303: C2 should leverage profiling for lookupswitch/tableswitch
roland
parents:
49875
diff
changeset
|
492 |
JumpNode( Node* control, Node* switch_val, uint size, float* probs, float cnt) |
d84f06a0cae1
8200303: C2 should leverage profiling for lookupswitch/tableswitch
roland
parents:
49875
diff
changeset
|
493 |
: PCTableNode(control, switch_val, size), |
d84f06a0cae1
8200303: C2 should leverage profiling for lookupswitch/tableswitch
roland
parents:
49875
diff
changeset
|
494 |
_probs(probs), _fcnt(cnt) { |
1 | 495 |
init_class_id(Class_Jump); |
496 |
} |
|
497 |
virtual int Opcode() const; |
|
498 |
virtual const RegMask& out_RegMask() const; |
|
499 |
virtual const Node* is_block_proj() const { return this; } |
|
32084
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
30183
diff
changeset
|
500 |
#ifndef PRODUCT |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
30183
diff
changeset
|
501 |
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const; |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
30183
diff
changeset
|
502 |
#endif |
1 | 503 |
}; |
504 |
||
505 |
class JumpProjNode : public JProjNode { |
|
506 |
virtual uint hash() const; |
|
507 |
virtual uint cmp( const Node &n ) const; |
|
508 |
virtual uint size_of() const { return sizeof(*this); } |
|
509 |
||
510 |
private: |
|
511 |
const int _dest_bci; |
|
512 |
const uint _proj_no; |
|
513 |
const int _switch_val; |
|
514 |
public: |
|
515 |
JumpProjNode(Node* jumpnode, uint proj_no, int dest_bci, int switch_val) |
|
516 |
: JProjNode(jumpnode, proj_no), _dest_bci(dest_bci), _proj_no(proj_no), _switch_val(switch_val) { |
|
517 |
init_class_id(Class_JumpProj); |
|
518 |
} |
|
519 |
||
520 |
virtual int Opcode() const; |
|
521 |
virtual const Type* bottom_type() const { return Type::CONTROL; } |
|
522 |
int dest_bci() const { return _dest_bci; } |
|
523 |
int switch_val() const { return _switch_val; } |
|
524 |
uint proj_no() const { return _proj_no; } |
|
525 |
#ifndef PRODUCT |
|
526 |
virtual void dump_spec(outputStream *st) const; |
|
32084
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
30183
diff
changeset
|
527 |
virtual void dump_compact_spec(outputStream *st) const; |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
30183
diff
changeset
|
528 |
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const; |
1 | 529 |
#endif |
530 |
}; |
|
531 |
||
532 |
//------------------------------CatchNode-------------------------------------- |
|
533 |
// Helper node to fork exceptions. "Catch" catches any exceptions thrown by |
|
534 |
// a just-prior call. Looks like a PCTableNode but emits no code - just the |
|
535 |
// table. The table lookup and branch is implemented by RethrowNode. |
|
536 |
class CatchNode : public PCTableNode { |
|
537 |
public: |
|
538 |
CatchNode( Node *ctrl, Node *idx, uint size ) : PCTableNode(ctrl,idx,size){ |
|
539 |
init_class_id(Class_Catch); |
|
540 |
} |
|
541 |
virtual int Opcode() const; |
|
35551
36ef3841fb34
8146629: Make phase->is_IterGVN() accessible from Node::Identity and Node::Value
thartmann
parents:
35545
diff
changeset
|
542 |
virtual const Type* Value(PhaseGVN* phase) const; |
1 | 543 |
}; |
544 |
||
545 |
// CatchProjNode controls which exception handler is targetted after a call. |
|
546 |
// It is passed in the bci of the target handler, or no_handler_bci in case |
|
547 |
// the projection doesn't lead to an exception handler. |
|
548 |
class CatchProjNode : public CProjNode { |
|
549 |
virtual uint hash() const; |
|
550 |
virtual uint cmp( const Node &n ) const; |
|
551 |
virtual uint size_of() const { return sizeof(*this); } |
|
552 |
||
553 |
private: |
|
554 |
const int _handler_bci; |
|
555 |
||
556 |
public: |
|
557 |
enum { |
|
558 |
fall_through_index = 0, // the fall through projection index |
|
559 |
catch_all_index = 1, // the projection index for catch-alls |
|
560 |
no_handler_bci = -1 // the bci for fall through or catch-all projs |
|
561 |
}; |
|
562 |
||
563 |
CatchProjNode(Node* catchnode, uint proj_no, int handler_bci) |
|
564 |
: CProjNode(catchnode, proj_no), _handler_bci(handler_bci) { |
|
565 |
init_class_id(Class_CatchProj); |
|
566 |
assert(proj_no != fall_through_index || handler_bci < 0, "fall through case must have bci < 0"); |
|
567 |
} |
|
568 |
||
569 |
virtual int Opcode() const; |
|
35551
36ef3841fb34
8146629: Make phase->is_IterGVN() accessible from Node::Identity and Node::Value
thartmann
parents:
35545
diff
changeset
|
570 |
virtual Node* Identity(PhaseGVN* phase); |
1 | 571 |
virtual const Type *bottom_type() const { return Type::CONTROL; } |
572 |
int handler_bci() const { return _handler_bci; } |
|
573 |
bool is_handler_proj() const { return _handler_bci >= 0; } |
|
574 |
#ifndef PRODUCT |
|
575 |
virtual void dump_spec(outputStream *st) const; |
|
576 |
#endif |
|
577 |
}; |
|
578 |
||
579 |
||
580 |
//---------------------------------CreateExNode-------------------------------- |
|
581 |
// Helper node to create the exception coming back from a call |
|
582 |
class CreateExNode : public TypeNode { |
|
583 |
public: |
|
584 |
CreateExNode(const Type* t, Node* control, Node* i_o) : TypeNode(t, 2) { |
|
585 |
init_req(0, control); |
|
586 |
init_req(1, i_o); |
|
587 |
} |
|
588 |
virtual int Opcode() const; |
|
35551
36ef3841fb34
8146629: Make phase->is_IterGVN() accessible from Node::Identity and Node::Value
thartmann
parents:
35545
diff
changeset
|
589 |
virtual Node* Identity(PhaseGVN* phase); |
1 | 590 |
virtual bool pinned() const { return true; } |
591 |
uint match_edge(uint idx) const { return 0; } |
|
592 |
virtual uint ideal_reg() const { return Op_RegP; } |
|
593 |
}; |
|
594 |
||
595 |
//------------------------------NeverBranchNode------------------------------- |
|
596 |
// The never-taken branch. Used to give the appearance of exiting infinite |
|
597 |
// loops to those algorithms that like all paths to be reachable. Encodes |
|
598 |
// empty. |
|
599 |
class NeverBranchNode : public MultiBranchNode { |
|
600 |
public: |
|
601 |
NeverBranchNode( Node *ctrl ) : MultiBranchNode(1) { init_req(0,ctrl); } |
|
602 |
virtual int Opcode() const; |
|
603 |
virtual bool pinned() const { return true; }; |
|
604 |
virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; } |
|
35551
36ef3841fb34
8146629: Make phase->is_IterGVN() accessible from Node::Identity and Node::Value
thartmann
parents:
35545
diff
changeset
|
605 |
virtual const Type* Value(PhaseGVN* phase) const; |
374 | 606 |
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
607 |
virtual int required_outcnt() const { return 2; } |
|
1 | 608 |
virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { } |
609 |
virtual uint size(PhaseRegAlloc *ra_) const { return 0; } |
|
610 |
#ifndef PRODUCT |
|
611 |
virtual void format( PhaseRegAlloc *, outputStream *st ) const; |
|
612 |
#endif |
|
613 |
}; |
|
7397 | 614 |
|
615 |
#endif // SHARE_VM_OPTO_CFGNODE_HPP |