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; }
94 virtual const Type* Value(PhaseGVN* phase) const;
95 virtual Node* Identity(PhaseGVN* phase);
96 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
97 virtual const RegMask &out_RegMask() const;
98 bool try_clean_mem_phi(PhaseGVN *phase);
99 bool optimize_trichotomy(PhaseIterGVN* igvn);
100 };
101
102 //------------------------------JProjNode--------------------------------------
103 // jump projection for node that produces multiple control-flow paths
104 class JProjNode : public ProjNode {
105 public:
106 JProjNode( Node* ctrl, uint idx ) : ProjNode(ctrl,idx) {}
107 virtual int Opcode() const;
108 virtual bool is_CFG() const { return true; }
109 virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash
110 virtual const Node* is_block_proj() const { return in(0); }
111 virtual const RegMask& out_RegMask() const;
112 virtual uint ideal_reg() const { return 0; }
113 };
114
115 //------------------------------PhiNode----------------------------------------
116 // PhiNodes merge values from different Control paths. Slot 0 points to the
117 // controlling RegionNode. Other slots map 1-for-1 with incoming control flow
118 // paths to the RegionNode. For speed reasons (to avoid another pass) we
198 // Is it unsafe data loop? It becomes a dead loop if this phi node removed.
199 bool is_unsafe_data_reference(Node *in) const;
200 int is_diamond_phi(bool check_control_only = false) const;
201 virtual int Opcode() const;
202 virtual bool pinned() const { return in(0) != 0; }
203 virtual const TypePtr *adr_type() const { verify_adr_type(true); return _adr_type; }
204
205 void set_inst_mem_id(int inst_mem_id) { _inst_mem_id = inst_mem_id; }
206 const int inst_mem_id() const { return _inst_mem_id; }
207 const int inst_id() const { return _inst_id; }
208 const int inst_index() const { return _inst_index; }
209 const int inst_offset() const { return _inst_offset; }
210 bool is_same_inst_field(const Type* tp, int mem_id, int id, int index, int offset) {
211 return type()->basic_type() == tp->basic_type() &&
212 inst_mem_id() == mem_id &&
213 inst_id() == id &&
214 inst_index() == index &&
215 inst_offset() == offset &&
216 type()->higher_equal(tp);
217 }
218
219 virtual const Type* Value(PhaseGVN* phase) const;
220 virtual Node* Identity(PhaseGVN* phase);
221 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
222 virtual const RegMask &out_RegMask() const;
223 virtual const RegMask &in_RegMask(uint) const;
224 #ifndef PRODUCT
225 virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
226 virtual void dump_spec(outputStream *st) const;
227 #endif
228 #ifdef ASSERT
229 void verify_adr_type(VectorSet& visited, const TypePtr* at) const;
230 void verify_adr_type(bool recursive = false) const;
231 #else //ASSERT
232 void verify_adr_type(bool recursive = false) const {}
233 #endif //ASSERT
234 };
235
236 //------------------------------GotoNode---------------------------------------
237 // GotoNodes perform direct branches.
|
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; }
94 virtual const Type* Value(PhaseGVN* phase) const;
95 virtual Node* Identity(PhaseGVN* phase);
96 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
97 virtual const RegMask &out_RegMask() const;
98 bool optimize_trichotomy(PhaseIterGVN* igvn);
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
197 // Is it unsafe data loop? It becomes a dead loop if this phi node removed.
198 bool is_unsafe_data_reference(Node *in) const;
199 int is_diamond_phi(bool check_control_only = false) const;
200 virtual int Opcode() const;
201 virtual bool pinned() const { return in(0) != 0; }
202 virtual const TypePtr *adr_type() const { verify_adr_type(true); return _adr_type; }
203
204 void set_inst_mem_id(int inst_mem_id) { _inst_mem_id = inst_mem_id; }
205 const int inst_mem_id() const { return _inst_mem_id; }
206 const int inst_id() const { return _inst_id; }
207 const int inst_index() const { return _inst_index; }
208 const int inst_offset() const { return _inst_offset; }
209 bool is_same_inst_field(const Type* tp, int mem_id, int id, int index, int offset) {
210 return type()->basic_type() == tp->basic_type() &&
211 inst_mem_id() == mem_id &&
212 inst_id() == id &&
213 inst_index() == index &&
214 inst_offset() == offset &&
215 type()->higher_equal(tp);
216 }
217 Node* try_clean_mem_phi(PhaseGVN *phase);
218
219 virtual const Type* Value(PhaseGVN* phase) const;
220 virtual Node* Identity(PhaseGVN* phase);
221 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
222 virtual const RegMask &out_RegMask() const;
223 virtual const RegMask &in_RegMask(uint) const;
224 #ifndef PRODUCT
225 virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
226 virtual void dump_spec(outputStream *st) const;
227 #endif
228 #ifdef ASSERT
229 void verify_adr_type(VectorSet& visited, const TypePtr* at) const;
230 void verify_adr_type(bool recursive = false) const;
231 #else //ASSERT
232 void verify_adr_type(bool recursive = false) const {}
233 #endif //ASSERT
234 };
235
236 //------------------------------GotoNode---------------------------------------
237 // GotoNodes perform direct branches.
|