comparison src/share/vm/opto/memnode.cpp @ 8695:ff55877839bc

8009472: Print additional information for 8004640 failure Summary: dump nodes and types in 8004640 case. Reviewed-by: roland
author kvn
date Wed, 06 Mar 2013 12:25:57 -0800
parents 6931f425c517
children 6f3fd5150b67
comparison
equal deleted inserted replaced
8694:8651f608fea4 8695:ff55877839bc
236 Node *ctl = in(MemNode::Control); 236 Node *ctl = in(MemNode::Control);
237 if (ctl && remove_dead_region(phase, can_reshape)) 237 if (ctl && remove_dead_region(phase, can_reshape))
238 return this; 238 return this;
239 ctl = in(MemNode::Control); 239 ctl = in(MemNode::Control);
240 // Don't bother trying to transform a dead node 240 // Don't bother trying to transform a dead node
241 if( ctl && ctl->is_top() ) return NodeSentinel; 241 if (ctl && ctl->is_top()) return NodeSentinel;
242 242
243 PhaseIterGVN *igvn = phase->is_IterGVN(); 243 PhaseIterGVN *igvn = phase->is_IterGVN();
244 // Wait if control on the worklist. 244 // Wait if control on the worklist.
245 if (ctl && can_reshape && igvn != NULL) { 245 if (ctl && can_reshape && igvn != NULL) {
246 Node* bol = NULL; 246 Node* bol = NULL;
260 return NodeSentinel; // caller will return NULL 260 return NodeSentinel; // caller will return NULL
261 } 261 }
262 } 262 }
263 // Ignore if memory is dead, or self-loop 263 // Ignore if memory is dead, or self-loop
264 Node *mem = in(MemNode::Memory); 264 Node *mem = in(MemNode::Memory);
265 if( phase->type( mem ) == Type::TOP ) return NodeSentinel; // caller will return NULL 265 if (phase->type( mem ) == Type::TOP) return NodeSentinel; // caller will return NULL
266 assert( mem != this, "dead loop in MemNode::Ideal" ); 266 assert(mem != this, "dead loop in MemNode::Ideal");
267 267
268 if (can_reshape && igvn != NULL && igvn->_worklist.member(mem)) { 268 if (can_reshape && igvn != NULL && igvn->_worklist.member(mem)) {
269 // This memory slice may be dead. 269 // This memory slice may be dead.
270 // Delay this mem node transformation until the memory is processed. 270 // Delay this mem node transformation until the memory is processed.
271 phase->is_IterGVN()->_worklist.push(this); 271 phase->is_IterGVN()->_worklist.push(this);
272 return NodeSentinel; // caller will return NULL 272 return NodeSentinel; // caller will return NULL
273 } 273 }
274 274
275 Node *address = in(MemNode::Address); 275 Node *address = in(MemNode::Address);
276 const Type *t_adr = phase->type( address ); 276 const Type *t_adr = phase->type(address);
277 if( t_adr == Type::TOP ) return NodeSentinel; // caller will return NULL 277 if (t_adr == Type::TOP) return NodeSentinel; // caller will return NULL
278 278
279 if( can_reshape && igvn != NULL && 279 if (can_reshape && igvn != NULL &&
280 (igvn->_worklist.member(address) || 280 (igvn->_worklist.member(address) ||
281 igvn->_worklist.size() > 0 && (phase->type(address) != adr_type())) ) { 281 igvn->_worklist.size() > 0 && (t_adr != adr_type())) ) {
282 // The address's base and type may change when the address is processed. 282 // The address's base and type may change when the address is processed.
283 // Delay this mem node transformation until the address is processed. 283 // Delay this mem node transformation until the address is processed.
284 phase->is_IterGVN()->_worklist.push(this); 284 phase->is_IterGVN()->_worklist.push(this);
285 return NodeSentinel; // caller will return NULL 285 return NodeSentinel; // caller will return NULL
286 } 286 }
287 287
288 // Do NOT remove or optimize the next lines: ensure a new alias index 288 // Do NOT remove or optimize the next lines: ensure a new alias index
289 // is allocated for an oop pointer type before Escape Analysis. 289 // is allocated for an oop pointer type before Escape Analysis.
290 // Note: C++ will not remove it since the call has side effect. 290 // Note: C++ will not remove it since the call has side effect.
291 if ( t_adr->isa_oopptr() ) { 291 if (t_adr->isa_oopptr()) {
292 int alias_idx = phase->C->get_alias_index(t_adr->is_ptr()); 292 int alias_idx = phase->C->get_alias_index(t_adr->is_ptr());
293 } 293 }
294 294
295 #ifdef ASSERT 295 #ifdef ASSERT
296 Node* base = NULL; 296 Node* base = NULL;
297 if (address->is_AddP()) 297 if (address->is_AddP())
298 base = address->in(AddPNode::Base); 298 base = address->in(AddPNode::Base);
299 if (base != NULL && phase->type(base)->higher_equal(TypePtr::NULL_PTR) &&
300 !t_adr->isa_rawptr()) {
301 // Note: raw address has TOP base and top->higher_equal(TypePtr::NULL_PTR) is true.
302 Compile* C = phase->C;
303 tty->cr();
304 tty->print_cr("===== NULL+offs not RAW address =====");
305 if (C->is_dead_node(this->_idx)) tty->print_cr("'this' is dead");
306 if ((ctl != NULL) && C->is_dead_node(ctl->_idx)) tty->print_cr("'ctl' is dead");
307 if (C->is_dead_node(mem->_idx)) tty->print_cr("'mem' is dead");
308 if (C->is_dead_node(address->_idx)) tty->print_cr("'address' is dead");
309 if (C->is_dead_node(base->_idx)) tty->print_cr("'base' is dead");
310 tty->cr();
311 base->dump(1);
312 tty->cr();
313 this->dump(2);
314 tty->print("this->adr_type(): "); adr_type()->dump(); tty->cr();
315 tty->print("phase->type(address): "); t_adr->dump(); tty->cr();
316 tty->print("phase->type(base): "); phase->type(address)->dump(); tty->cr();
317 tty->cr();
318 }
299 assert(base == NULL || t_adr->isa_rawptr() || 319 assert(base == NULL || t_adr->isa_rawptr() ||
300 !phase->type(base)->higher_equal(TypePtr::NULL_PTR), "NULL+offs not RAW address?"); 320 !phase->type(base)->higher_equal(TypePtr::NULL_PTR), "NULL+offs not RAW address?");
301 #endif 321 #endif
302 322
303 // Avoid independent memory operations 323 // Avoid independent memory operations