Wed, 06 Mar 2013 12:25:57 -0800
8009472: Print additional information for 8004640 failure
Summary: dump nodes and types in 8004640 case.
Reviewed-by: roland
src/share/vm/opto/compile.hpp | file | annotate | diff | comparison | revisions | |
src/share/vm/opto/memnode.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/opto/compile.hpp Wed Mar 06 10:28:38 2013 +0100 1.2 +++ b/src/share/vm/opto/compile.hpp Wed Mar 06 12:25:57 2013 -0800 1.3 @@ -678,6 +678,7 @@ 1.4 void record_dead_node(uint idx) { if (_dead_node_list.test_set(idx)) return; 1.5 _dead_node_count++; 1.6 } 1.7 + bool is_dead_node(uint idx) { return _dead_node_list.test(idx) != 0; } 1.8 uint dead_node_count() { return _dead_node_count; } 1.9 void reset_dead_node_list() { _dead_node_list.Reset(); 1.10 _dead_node_count = 0;
2.1 --- a/src/share/vm/opto/memnode.cpp Wed Mar 06 10:28:38 2013 +0100 2.2 +++ b/src/share/vm/opto/memnode.cpp Wed Mar 06 12:25:57 2013 -0800 2.3 @@ -238,7 +238,7 @@ 2.4 return this; 2.5 ctl = in(MemNode::Control); 2.6 // Don't bother trying to transform a dead node 2.7 - if( ctl && ctl->is_top() ) return NodeSentinel; 2.8 + if (ctl && ctl->is_top()) return NodeSentinel; 2.9 2.10 PhaseIterGVN *igvn = phase->is_IterGVN(); 2.11 // Wait if control on the worklist. 2.12 @@ -262,8 +262,8 @@ 2.13 } 2.14 // Ignore if memory is dead, or self-loop 2.15 Node *mem = in(MemNode::Memory); 2.16 - if( phase->type( mem ) == Type::TOP ) return NodeSentinel; // caller will return NULL 2.17 - assert( mem != this, "dead loop in MemNode::Ideal" ); 2.18 + if (phase->type( mem ) == Type::TOP) return NodeSentinel; // caller will return NULL 2.19 + assert(mem != this, "dead loop in MemNode::Ideal"); 2.20 2.21 if (can_reshape && igvn != NULL && igvn->_worklist.member(mem)) { 2.22 // This memory slice may be dead. 2.23 @@ -273,12 +273,12 @@ 2.24 } 2.25 2.26 Node *address = in(MemNode::Address); 2.27 - const Type *t_adr = phase->type( address ); 2.28 - if( t_adr == Type::TOP ) return NodeSentinel; // caller will return NULL 2.29 - 2.30 - if( can_reshape && igvn != NULL && 2.31 + const Type *t_adr = phase->type(address); 2.32 + if (t_adr == Type::TOP) return NodeSentinel; // caller will return NULL 2.33 + 2.34 + if (can_reshape && igvn != NULL && 2.35 (igvn->_worklist.member(address) || 2.36 - igvn->_worklist.size() > 0 && (phase->type(address) != adr_type())) ) { 2.37 + igvn->_worklist.size() > 0 && (t_adr != adr_type())) ) { 2.38 // The address's base and type may change when the address is processed. 2.39 // Delay this mem node transformation until the address is processed. 2.40 phase->is_IterGVN()->_worklist.push(this); 2.41 @@ -288,7 +288,7 @@ 2.42 // Do NOT remove or optimize the next lines: ensure a new alias index 2.43 // is allocated for an oop pointer type before Escape Analysis. 2.44 // Note: C++ will not remove it since the call has side effect. 2.45 - if ( t_adr->isa_oopptr() ) { 2.46 + if (t_adr->isa_oopptr()) { 2.47 int alias_idx = phase->C->get_alias_index(t_adr->is_ptr()); 2.48 } 2.49 2.50 @@ -296,6 +296,26 @@ 2.51 Node* base = NULL; 2.52 if (address->is_AddP()) 2.53 base = address->in(AddPNode::Base); 2.54 + if (base != NULL && phase->type(base)->higher_equal(TypePtr::NULL_PTR) && 2.55 + !t_adr->isa_rawptr()) { 2.56 + // Note: raw address has TOP base and top->higher_equal(TypePtr::NULL_PTR) is true. 2.57 + Compile* C = phase->C; 2.58 + tty->cr(); 2.59 + tty->print_cr("===== NULL+offs not RAW address ====="); 2.60 + if (C->is_dead_node(this->_idx)) tty->print_cr("'this' is dead"); 2.61 + if ((ctl != NULL) && C->is_dead_node(ctl->_idx)) tty->print_cr("'ctl' is dead"); 2.62 + if (C->is_dead_node(mem->_idx)) tty->print_cr("'mem' is dead"); 2.63 + if (C->is_dead_node(address->_idx)) tty->print_cr("'address' is dead"); 2.64 + if (C->is_dead_node(base->_idx)) tty->print_cr("'base' is dead"); 2.65 + tty->cr(); 2.66 + base->dump(1); 2.67 + tty->cr(); 2.68 + this->dump(2); 2.69 + tty->print("this->adr_type(): "); adr_type()->dump(); tty->cr(); 2.70 + tty->print("phase->type(address): "); t_adr->dump(); tty->cr(); 2.71 + tty->print("phase->type(base): "); phase->type(address)->dump(); tty->cr(); 2.72 + tty->cr(); 2.73 + } 2.74 assert(base == NULL || t_adr->isa_rawptr() || 2.75 !phase->type(base)->higher_equal(TypePtr::NULL_PTR), "NULL+offs not RAW address?"); 2.76 #endif