< 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.

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 
218   virtual const Type* Value(PhaseGVN* phase) const;
219   virtual Node* Identity(PhaseGVN* phase);
220   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
221   virtual const RegMask &out_RegMask() const;
222   virtual const RegMask &in_RegMask(uint) const;
223 #ifndef PRODUCT
224   virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
225   virtual void dump_spec(outputStream *st) const;
226 #endif
227 #ifdef ASSERT
228   void verify_adr_type(VectorSet& visited, const TypePtr* at) const;
229   void verify_adr_type(bool recursive = false) const;
230 #else //ASSERT
231   void verify_adr_type(bool recursive = false) const {}
232 #endif //ASSERT
233 };
234 
235 //------------------------------GotoNode---------------------------------------
236 // GotoNodes perform direct branches.

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

 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.

196   // Is it unsafe data loop? It becomes a dead loop if this phi node removed.
197   bool is_unsafe_data_reference(Node *in) const;
198   int  is_diamond_phi(bool check_control_only = false) const;
199   virtual int Opcode() const;
200   virtual bool pinned() const { return in(0) != 0; }
201   virtual const TypePtr *adr_type() const { verify_adr_type(true); return _adr_type; }
202 
203   void  set_inst_mem_id(int inst_mem_id) { _inst_mem_id = inst_mem_id; }
204   const int inst_mem_id() const { return _inst_mem_id; }
205   const int inst_id()     const { return _inst_id; }
206   const int inst_index()  const { return _inst_index; }
207   const int inst_offset() const { return _inst_offset; }
208   bool is_same_inst_field(const Type* tp, int mem_id, int id, int index, int offset) {
209     return type()->basic_type() == tp->basic_type() &&
210            inst_mem_id() == mem_id &&
211            inst_id()     == id     &&
212            inst_index()  == index  &&
213            inst_offset() == offset &&
214            type()->higher_equal(tp);
215   }
216   Node* try_clean_mem_phi(PhaseGVN *phase);
217 
218   InlineTypeBaseNode* push_inline_types_through(PhaseGVN* phase, bool can_reshape, ciInlineKlass* vk, bool is_init);
219 
220   virtual const Type* Value(PhaseGVN* phase) const;
221   virtual Node* Identity(PhaseGVN* phase);
222   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
223   virtual const RegMask &out_RegMask() const;
224   virtual const RegMask &in_RegMask(uint) const;
225 #ifndef PRODUCT
226   virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
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.

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