< 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 related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
228   virtual void dump_spec(outputStream *st) const;
229 #endif
230 #ifdef ASSERT
231   void verify_adr_type(VectorSet& visited, const TypePtr* at) const;
232   void verify_adr_type(bool recursive = false) const;
233 #else //ASSERT
234   void verify_adr_type(bool recursive = false) const {}
235 #endif //ASSERT
236 };
237 
238 //------------------------------GotoNode---------------------------------------
239 // GotoNodes perform direct branches.

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


407 #ifndef PRODUCT
408   virtual void dump_spec(outputStream *st) const;
409   virtual void related(GrowableArray <Node *> *in_rel, GrowableArray <Node *> *out_rel, bool compact) const;
410 #endif
411 };
412 
413 class RangeCheckNode : public IfNode {
414 private:
415   int is_range_check(Node* &range, Node* &index, jint &offset);
416 
417 public:
418   RangeCheckNode(Node* control, Node *b, float p, float fcnt)
419     : IfNode(control, b, p, fcnt) {
420     init_class_id(Class_RangeCheck);
421   }
422 
423   virtual int Opcode() const;
424   virtual Node* Ideal(PhaseGVN *phase, bool can_reshape);
425 };
426 

 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 related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
230   virtual void dump_spec(outputStream *st) const;
231 #endif
232 #ifdef ASSERT
233   void verify_adr_type(VectorSet& visited, const TypePtr* at) const;
234   void verify_adr_type(bool recursive = false) const;
235 #else //ASSERT
236   void verify_adr_type(bool recursive = false) const {}
237 #endif //ASSERT
238 };
239 
240 //------------------------------GotoNode---------------------------------------
241 // GotoNodes perform direct branches.

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