comparison src/share/vm/opto/memnode.cpp @ 17914:3636afd5ec1a

8039298: assert(base == NULL || t_adr->isa_rawptr() || !phase->type(base)->higher_equal(TypePtr::NULL_PTR)) Summary: Convert the assert into the runtime check to skip IGVN optimizations for problematic memory nodes. Eliminate dead nodes more aggressively. Reviewed-by: twisti, iveresov
author kvn
date Fri, 02 May 2014 16:44:54 -0700
parents 75ad4240c15c
children 78bbf4d43a14
comparison
equal deleted inserted replaced
17913:1eba0601f0dd 17914:3636afd5ec1a
304 // Note: C++ will not remove it since the call has side effect. 304 // Note: C++ will not remove it since the call has side effect.
305 if (t_adr->isa_oopptr()) { 305 if (t_adr->isa_oopptr()) {
306 int alias_idx = phase->C->get_alias_index(t_adr->is_ptr()); 306 int alias_idx = phase->C->get_alias_index(t_adr->is_ptr());
307 } 307 }
308 308
309 #ifdef ASSERT
310 Node* base = NULL; 309 Node* base = NULL;
311 if (address->is_AddP()) 310 if (address->is_AddP()) {
312 base = address->in(AddPNode::Base); 311 base = address->in(AddPNode::Base);
312 }
313 if (base != NULL && phase->type(base)->higher_equal(TypePtr::NULL_PTR) && 313 if (base != NULL && phase->type(base)->higher_equal(TypePtr::NULL_PTR) &&
314 !t_adr->isa_rawptr()) { 314 !t_adr->isa_rawptr()) {
315 // Note: raw address has TOP base and top->higher_equal(TypePtr::NULL_PTR) is true. 315 // Note: raw address has TOP base and top->higher_equal(TypePtr::NULL_PTR) is true.
316 Compile* C = phase->C; 316 // Skip this node optimization if its address has TOP base.
317 tty->cr(); 317 return NodeSentinel; // caller will return NULL
318 tty->print_cr("===== NULL+offs not RAW address ====="); 318 }
319 if (C->is_dead_node(this->_idx)) tty->print_cr("'this' is dead");
320 if ((ctl != NULL) && C->is_dead_node(ctl->_idx)) tty->print_cr("'ctl' is dead");
321 if (C->is_dead_node(mem->_idx)) tty->print_cr("'mem' is dead");
322 if (C->is_dead_node(address->_idx)) tty->print_cr("'address' is dead");
323 if (C->is_dead_node(base->_idx)) tty->print_cr("'base' is dead");
324 tty->cr();
325 base->dump(1);
326 tty->cr();
327 this->dump(2);
328 tty->print("this->adr_type(): "); adr_type()->dump(); tty->cr();
329 tty->print("phase->type(address): "); t_adr->dump(); tty->cr();
330 tty->print("phase->type(base): "); phase->type(address)->dump(); tty->cr();
331 tty->cr();
332 }
333 assert(base == NULL || t_adr->isa_rawptr() ||
334 !phase->type(base)->higher_equal(TypePtr::NULL_PTR), "NULL+offs not RAW address?");
335 #endif
336 319
337 // Avoid independent memory operations 320 // Avoid independent memory operations
338 Node* old_mem = mem; 321 Node* old_mem = mem;
339 322
340 // The code which unhooks non-raw memories from complete (macro-expanded) 323 // The code which unhooks non-raw memories from complete (macro-expanded)