src/share/vm/opto/cfgnode.hpp

changeset 8945
3b6372514697
parent 8940
eb9e617d6f64
child 9041
95a08233f46c
equal deleted inserted replaced
8944:072770c9a6b9 8945:3b6372514697
117 // paths to the RegionNode. For speed reasons (to avoid another pass) we 117 // paths to the RegionNode. For speed reasons (to avoid another pass) we
118 // can turn PhiNodes into copys in-place by NULL'ing out their RegionNode 118 // can turn PhiNodes into copys in-place by NULL'ing out their RegionNode
119 // input in slot 0. 119 // input in slot 0.
120 class PhiNode : public TypeNode { 120 class PhiNode : public TypeNode {
121 const TypePtr* const _adr_type; // non-null only for Type::MEMORY nodes. 121 const TypePtr* const _adr_type; // non-null only for Type::MEMORY nodes.
122 // The following fields are only used for data PhiNodes to indicate
123 // that the PhiNode represents the value of a known instance field.
124 int _inst_mem_id; // Instance memory id (node index of the memory Phi)
122 const int _inst_id; // Instance id of the memory slice. 125 const int _inst_id; // Instance id of the memory slice.
123 const int _inst_index; // Alias index of the instance memory slice. 126 const int _inst_index; // Alias index of the instance memory slice.
124 // Array elements references have the same alias_idx but different offset. 127 // Array elements references have the same alias_idx but different offset.
125 const int _inst_offset; // Offset of the instance memory slice. 128 const int _inst_offset; // Offset of the instance memory slice.
126 // Size is bigger to hold the _adr_type field. 129 // Size is bigger to hold the _adr_type field.
136 enum { Region, // Control input is the Phi's region. 139 enum { Region, // Control input is the Phi's region.
137 Input // Input values are [1..len) 140 Input // Input values are [1..len)
138 }; 141 };
139 142
140 PhiNode( Node *r, const Type *t, const TypePtr* at = NULL, 143 PhiNode( Node *r, const Type *t, const TypePtr* at = NULL,
144 const int imid = -1,
141 const int iid = TypeOopPtr::InstanceTop, 145 const int iid = TypeOopPtr::InstanceTop,
142 const int iidx = Compile::AliasIdxTop, 146 const int iidx = Compile::AliasIdxTop,
143 const int ioffs = Type::OffsetTop ) 147 const int ioffs = Type::OffsetTop )
144 : TypeNode(t,r->req()), 148 : TypeNode(t,r->req()),
145 _adr_type(at), 149 _adr_type(at),
150 _inst_mem_id(imid),
146 _inst_id(iid), 151 _inst_id(iid),
147 _inst_index(iidx), 152 _inst_index(iidx),
148 _inst_offset(ioffs) 153 _inst_offset(ioffs)
149 { 154 {
150 init_class_id(Class_Phi); 155 init_class_id(Class_Phi);
185 int is_diamond_phi(bool check_control_only = false) const; 190 int is_diamond_phi(bool check_control_only = false) const;
186 virtual int Opcode() const; 191 virtual int Opcode() const;
187 virtual bool pinned() const { return in(0) != 0; } 192 virtual bool pinned() const { return in(0) != 0; }
188 virtual const TypePtr *adr_type() const { verify_adr_type(true); return _adr_type; } 193 virtual const TypePtr *adr_type() const { verify_adr_type(true); return _adr_type; }
189 194
195 void set_inst_mem_id(int inst_mem_id) { _inst_mem_id = inst_mem_id; }
196 const int inst_mem_id() const { return _inst_mem_id; }
190 const int inst_id() const { return _inst_id; } 197 const int inst_id() const { return _inst_id; }
191 const int inst_index() const { return _inst_index; } 198 const int inst_index() const { return _inst_index; }
192 const int inst_offset() const { return _inst_offset; } 199 const int inst_offset() const { return _inst_offset; }
193 bool is_same_inst_field(const Type* tp, int id, int index, int offset) { 200 bool is_same_inst_field(const Type* tp, int mem_id, int id, int index, int offset) {
194 return type()->basic_type() == tp->basic_type() && 201 return type()->basic_type() == tp->basic_type() &&
202 inst_mem_id() == mem_id &&
195 inst_id() == id && 203 inst_id() == id &&
196 inst_index() == index && 204 inst_index() == index &&
197 inst_offset() == offset && 205 inst_offset() == offset &&
198 type()->higher_equal(tp); 206 type()->higher_equal(tp);
199 } 207 }

mercurial