< prev index next >

src/hotspot/share/opto/cfgnode.hpp

Print this page

 84     const Node* r = _in[Region];
 85     if (r == NULL)
 86       return nonnull_req();
 87     return NULL;  // not a copy!
 88   }
 89   PhiNode* has_phi() const;        // returns an arbitrary phi user, or NULL
 90   PhiNode* has_unique_phi() const; // returns the unique phi user, or NULL
 91   // Is this region node unreachable from root?
 92   bool is_unreachable_region(const PhaseGVN* phase);
 93   virtual int Opcode() const;
 94   virtual uint size_of() const { return sizeof(*this); }
 95   virtual bool pinned() const { return (const Node*)in(0) == this; }
 96   virtual bool is_CFG() const { return true; }
 97   virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash
 98   virtual bool depends_only_on_test() const { return false; }
 99   virtual const Type* bottom_type() const { return Type::CONTROL; }
100   virtual const Type* Value(PhaseGVN* phase) const;
101   virtual Node* Identity(PhaseGVN* phase);
102   virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
103   virtual const RegMask &out_RegMask() const;
104   bool try_clean_mem_phi(PhaseGVN* phase);
105   bool optimize_trichotomy(PhaseIterGVN* igvn);
106 };
107 
108 //------------------------------JProjNode--------------------------------------
109 // jump projection for node that produces multiple control-flow paths
110 class JProjNode : public ProjNode {
111  public:
112   JProjNode( Node* ctrl, uint idx ) : ProjNode(ctrl,idx) {}
113   virtual int Opcode() const;
114   virtual bool  is_CFG() const { return true; }
115   virtual uint  hash() const { return NO_HASH; }  // CFG nodes do not hash
116   virtual const Node* is_block_proj() const { return in(0); }
117   virtual const RegMask& out_RegMask() const;
118   virtual uint  ideal_reg() const { return 0; }
119 };
120 
121 //------------------------------PhiNode----------------------------------------
122 // PhiNodes merge values from different Control paths.  Slot 0 points to the
123 // controlling RegionNode.  Other slots map 1-for-1 with incoming control flow
124 // paths to the RegionNode.

200   // Is it unsafe data loop? It becomes a dead loop if this phi node removed.
201   bool is_unsafe_data_reference(Node *in) const;
202   int  is_diamond_phi(bool check_control_only = false) const;
203   virtual int Opcode() const;
204   virtual bool pinned() const { return in(0) != 0; }
205   virtual const TypePtr *adr_type() const { verify_adr_type(true); return _adr_type; }
206 
207   void  set_inst_mem_id(int inst_mem_id) { _inst_mem_id = inst_mem_id; }
208   const int inst_mem_id() const { return _inst_mem_id; }
209   const int inst_id()     const { return _inst_id; }
210   const int inst_index()  const { return _inst_index; }
211   const int inst_offset() const { return _inst_offset; }
212   bool is_same_inst_field(const Type* tp, int mem_id, int id, int index, int offset) {
213     return type()->basic_type() == tp->basic_type() &&
214            inst_mem_id() == mem_id &&
215            inst_id()     == id     &&
216            inst_index()  == index  &&
217            inst_offset() == offset &&
218            type()->higher_equal(tp);
219   }



220 
221   virtual const Type* Value(PhaseGVN* phase) const;
222   virtual Node* Identity(PhaseGVN* phase);
223   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
224   virtual const RegMask &out_RegMask() const;
225   virtual const RegMask &in_RegMask(uint) const;
226 #ifndef PRODUCT
227   virtual void dump_spec(outputStream *st) const;
228 #endif
229 #ifdef ASSERT
230   void verify_adr_type(VectorSet& visited, const TypePtr* at) const;
231   void verify_adr_type(bool recursive = false) const;
232 #else //ASSERT
233   void verify_adr_type(bool recursive = false) const {}
234 #endif //ASSERT
235 };
236 
237 //------------------------------GotoNode---------------------------------------
238 // GotoNodes perform direct branches.
239 class GotoNode : public Node {

382     init_class_id(Class_If);
383     init_req(0,control);
384     init_req(1,b);
385   }
386   virtual int Opcode() const;
387   virtual bool pinned() const { return true; }
388   virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; }
389   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
390   virtual const Type* Value(PhaseGVN* phase) const;
391   virtual int required_outcnt() const { return 2; }
392   virtual const RegMask &out_RegMask() const;
393   Node* fold_compares(PhaseIterGVN* phase);
394   static Node* up_one_dom(Node* curr, bool linear_only = false);
395   Node* dominated_by(Node* prev_dom, PhaseIterGVN* igvn);
396 
397   // Takes the type of val and filters it through the test represented
398   // by if_proj and returns a more refined type if one is produced.
399   // Returns NULL is it couldn't improve the type.
400   static const TypeInt* filtered_int_type(PhaseGVN* phase, Node* val, Node* if_proj);
401 


402 #ifndef PRODUCT
403   virtual void dump_spec(outputStream *st) const;
404 #endif
405 };
406 
407 class RangeCheckNode : public IfNode {
408 private:
409   int is_range_check(Node* &range, Node* &index, jint &offset);
410 
411 public:
412   RangeCheckNode(Node* control, Node *b, float p, float fcnt)
413     : IfNode(control, b, p, fcnt) {
414     init_class_id(Class_RangeCheck);
415   }
416 
417   virtual int Opcode() const;
418   virtual Node* Ideal(PhaseGVN *phase, bool can_reshape);
419 };
420 
421 class IfProjNode : public CProjNode {

 84     const Node* r = _in[Region];
 85     if (r == NULL)
 86       return nonnull_req();
 87     return NULL;  // not a copy!
 88   }
 89   PhiNode* has_phi() const;        // returns an arbitrary phi user, or NULL
 90   PhiNode* has_unique_phi() const; // returns the unique phi user, or NULL
 91   // Is this region node unreachable from root?
 92   bool is_unreachable_region(const PhaseGVN* phase);
 93   virtual int Opcode() const;
 94   virtual uint size_of() const { return sizeof(*this); }
 95   virtual bool pinned() const { return (const Node*)in(0) == this; }
 96   virtual bool is_CFG() const { return true; }
 97   virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash
 98   virtual bool depends_only_on_test() const { return false; }
 99   virtual const Type* bottom_type() const { return Type::CONTROL; }
100   virtual const Type* Value(PhaseGVN* phase) const;
101   virtual Node* Identity(PhaseGVN* phase);
102   virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
103   virtual const RegMask &out_RegMask() const;

104   bool optimize_trichotomy(PhaseIterGVN* igvn);
105 };
106 
107 //------------------------------JProjNode--------------------------------------
108 // jump projection for node that produces multiple control-flow paths
109 class JProjNode : public ProjNode {
110  public:
111   JProjNode( Node* ctrl, uint idx ) : ProjNode(ctrl,idx) {}
112   virtual int Opcode() const;
113   virtual bool  is_CFG() const { return true; }
114   virtual uint  hash() const { return NO_HASH; }  // CFG nodes do not hash
115   virtual const Node* is_block_proj() const { return in(0); }
116   virtual const RegMask& out_RegMask() const;
117   virtual uint  ideal_reg() const { return 0; }
118 };
119 
120 //------------------------------PhiNode----------------------------------------
121 // PhiNodes merge values from different Control paths.  Slot 0 points to the
122 // controlling RegionNode.  Other slots map 1-for-1 with incoming control flow
123 // paths to the RegionNode.

199   // Is it unsafe data loop? It becomes a dead loop if this phi node removed.
200   bool is_unsafe_data_reference(Node *in) const;
201   int  is_diamond_phi(bool check_control_only = false) const;
202   virtual int Opcode() const;
203   virtual bool pinned() const { return in(0) != 0; }
204   virtual const TypePtr *adr_type() const { verify_adr_type(true); return _adr_type; }
205 
206   void  set_inst_mem_id(int inst_mem_id) { _inst_mem_id = inst_mem_id; }
207   const int inst_mem_id() const { return _inst_mem_id; }
208   const int inst_id()     const { return _inst_id; }
209   const int inst_index()  const { return _inst_index; }
210   const int inst_offset() const { return _inst_offset; }
211   bool is_same_inst_field(const Type* tp, int mem_id, int id, int index, int offset) {
212     return type()->basic_type() == tp->basic_type() &&
213            inst_mem_id() == mem_id &&
214            inst_id()     == id     &&
215            inst_index()  == index  &&
216            inst_offset() == offset &&
217            type()->higher_equal(tp);
218   }
219   Node* try_clean_mem_phi(PhaseGVN *phase);
220 
221   InlineTypeBaseNode* push_inline_types_through(PhaseGVN* phase, bool can_reshape, ciInlineKlass* vk, bool is_init);
222 
223   virtual const Type* Value(PhaseGVN* phase) const;
224   virtual Node* Identity(PhaseGVN* phase);
225   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
226   virtual const RegMask &out_RegMask() const;
227   virtual const RegMask &in_RegMask(uint) const;
228 #ifndef PRODUCT
229   virtual void dump_spec(outputStream *st) const;
230 #endif
231 #ifdef ASSERT
232   void verify_adr_type(VectorSet& visited, const TypePtr* at) const;
233   void verify_adr_type(bool recursive = false) const;
234 #else //ASSERT
235   void verify_adr_type(bool recursive = false) const {}
236 #endif //ASSERT
237 };
238 
239 //------------------------------GotoNode---------------------------------------
240 // GotoNodes perform direct branches.
241 class GotoNode : public Node {

384     init_class_id(Class_If);
385     init_req(0,control);
386     init_req(1,b);
387   }
388   virtual int Opcode() const;
389   virtual bool pinned() const { return true; }
390   virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; }
391   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
392   virtual const Type* Value(PhaseGVN* phase) const;
393   virtual int required_outcnt() const { return 2; }
394   virtual const RegMask &out_RegMask() const;
395   Node* fold_compares(PhaseIterGVN* phase);
396   static Node* up_one_dom(Node* curr, bool linear_only = false);
397   Node* dominated_by(Node* prev_dom, PhaseIterGVN* igvn);
398 
399   // Takes the type of val and filters it through the test represented
400   // by if_proj and returns a more refined type if one is produced.
401   // Returns NULL is it couldn't improve the type.
402   static const TypeInt* filtered_int_type(PhaseGVN* phase, Node* val, Node* if_proj);
403 
404   bool is_flat_array_check(PhaseTransform* phase, Node** array = NULL);
405 
406 #ifndef PRODUCT
407   virtual void dump_spec(outputStream *st) const;
408 #endif
409 };
410 
411 class RangeCheckNode : public IfNode {
412 private:
413   int is_range_check(Node* &range, Node* &index, jint &offset);
414 
415 public:
416   RangeCheckNode(Node* control, Node *b, float p, float fcnt)
417     : IfNode(control, b, p, fcnt) {
418     init_class_id(Class_RangeCheck);
419   }
420 
421   virtual int Opcode() const;
422   virtual Node* Ideal(PhaseGVN *phase, bool can_reshape);
423 };
424 
425 class IfProjNode : public CProjNode {
< prev index next >