hotspot/src/share/vm/opto/phaseX.hpp
changeset 34503 57d1a0e76091
parent 34164 a9e6034d7707
child 35545 a8f29dfd62b2
equal deleted inserted replaced
34502:1cfcb971cb17 34503:57d1a0e76091
   146 class PhaseRemoveUseless : public Phase {
   146 class PhaseRemoveUseless : public Phase {
   147 protected:
   147 protected:
   148   Unique_Node_List _useful;   // Nodes reachable from root
   148   Unique_Node_List _useful;   // Nodes reachable from root
   149                               // list is allocated from current resource area
   149                               // list is allocated from current resource area
   150 public:
   150 public:
   151   PhaseRemoveUseless( PhaseGVN *gvn, Unique_Node_List *worklist );
   151   PhaseRemoveUseless(PhaseGVN *gvn, Unique_Node_List *worklist, PhaseNumber phase_num = Remove_Useless);
   152 
   152 
   153   Unique_Node_List *get_useful() { return &_useful; }
   153   Unique_Node_List *get_useful() { return &_useful; }
       
   154 };
       
   155 
       
   156 //------------------------------PhaseRenumber----------------------------------
       
   157 // Phase that first performs a PhaseRemoveUseless, then it renumbers compiler
       
   158 // structures accordingly.
       
   159 class PhaseRenumberLive : public PhaseRemoveUseless {
       
   160 public:
       
   161   PhaseRenumberLive(PhaseGVN* gvn,
       
   162                     Unique_Node_List* worklist, Unique_Node_List* new_worklist,
       
   163                     PhaseNumber phase_num = Remove_Useless_And_Renumber_Live);
   154 };
   164 };
   155 
   165 
   156 
   166 
   157 //------------------------------PhaseTransform---------------------------------
   167 //------------------------------PhaseTransform---------------------------------
   158 // Phases that analyze, then transform.  Constructing the Phase object does any
   168 // Phases that analyze, then transform.  Constructing the Phase object does any
   160 // transformation pass.  When the Phase object is deleted the cached analysis
   170 // transformation pass.  When the Phase object is deleted the cached analysis
   161 // results are deleted.
   171 // results are deleted.
   162 class PhaseTransform : public Phase {
   172 class PhaseTransform : public Phase {
   163 protected:
   173 protected:
   164   Arena*     _arena;
   174   Arena*     _arena;
   165   Node_Array _nodes;           // Map old node indices to new nodes.
   175   Node_List  _nodes;           // Map old node indices to new nodes.
   166   Type_Array _types;           // Map old node indices to Types.
   176   Type_Array _types;           // Map old node indices to Types.
   167 
   177 
   168   // ConNode caches:
   178   // ConNode caches:
   169   enum { _icon_min = -1 * HeapWordSize,
   179   enum { _icon_min = -1 * HeapWordSize,
   170          _icon_max = 16 * HeapWordSize,
   180          _icon_max = 16 * HeapWordSize,
   185   PhaseTransform( Arena *arena, PhaseNumber pnum );
   195   PhaseTransform( Arena *arena, PhaseNumber pnum );
   186   PhaseTransform( PhaseTransform *phase, PhaseNumber pnum );
   196   PhaseTransform( PhaseTransform *phase, PhaseNumber pnum );
   187 
   197 
   188   Arena*      arena()   { return _arena; }
   198   Arena*      arena()   { return _arena; }
   189   Type_Array& types()   { return _types; }
   199   Type_Array& types()   { return _types; }
       
   200   void replace_types(Type_Array new_types) {
       
   201     _types = new_types;
       
   202   }
   190   // _nodes is used in varying ways by subclasses, which define local accessors
   203   // _nodes is used in varying ways by subclasses, which define local accessors
       
   204   uint nodes_size() {
       
   205     return _nodes.size();
       
   206   }
   191 
   207 
   192 public:
   208 public:
   193   // Get a previously recorded type for the node n.
   209   // Get a previously recorded type for the node n.
   194   // This type must already have been recorded.
   210   // This type must already have been recorded.
   195   // If you want the type of a very new (untransformed) node,
   211   // If you want the type of a very new (untransformed) node,