1.1 --- a/src/share/vm/opto/escape.cpp Mon Feb 20 13:11:08 2012 -0800 1.2 +++ b/src/share/vm/opto/escape.cpp Tue Feb 21 11:55:05 2012 -0800 1.3 @@ -2035,40 +2035,14 @@ 1.4 Node* store = ini->find_captured_store(offset, type2aelembytes(ft), phase); 1.5 if (store != NULL && store->is_Store()) { 1.6 value = store->in(MemNode::ValueIn); 1.7 - } else if (ptn->edge_count() > 0) { // Are there oop stores? 1.8 - // Check for a store which follows allocation without branches. 1.9 + } else { 1.10 + // There could be initializing stores which follow allocation. 1.11 // For example, a volatile field store is not collected 1.12 - // by Initialize node. TODO: it would be nice to use idom() here. 1.13 + // by Initialize node. 1.14 // 1.15 - // Search all references to the same field which use different 1.16 - // AddP nodes, for example, in the next case: 1.17 - // 1.18 - // Point p[] = new Point[1]; 1.19 - // if ( x ) { p[0] = new Point(); p[0].x = x; } 1.20 - // if ( p[0] != null ) { y = p[0].x; } // has CastPP 1.21 - // 1.22 - for (uint next = ei; (next < ae_cnt) && (value == NULL); next++) { 1.23 - uint fpi = pta->edge_target(next); // Field (AddP) 1.24 - PointsToNode *ptf = ptnode_adr(fpi); 1.25 - if (ptf->offset() == offset) { 1.26 - Node* nf = ptf->_node; 1.27 - for (DUIterator_Fast imax, i = nf->fast_outs(imax); i < imax; i++) { 1.28 - store = nf->fast_out(i); 1.29 - if (store->is_Store() && store->in(0) != NULL) { 1.30 - Node* ctrl = store->in(0); 1.31 - while(!(ctrl == ini || ctrl == alloc || ctrl == NULL || 1.32 - ctrl == C->root() || ctrl == C->top() || ctrl->is_Region() || 1.33 - ctrl->is_IfTrue() || ctrl->is_IfFalse())) { 1.34 - ctrl = ctrl->in(0); 1.35 - } 1.36 - if (ctrl == ini || ctrl == alloc) { 1.37 - value = store->in(MemNode::ValueIn); 1.38 - break; 1.39 - } 1.40 - } 1.41 - } 1.42 - } 1.43 - } 1.44 + // Need to check for dependent loads to separate such stores from 1.45 + // stores which follow loads. For now, add initial value NULL so 1.46 + // that compare pointers optimization works correctly. 1.47 } 1.48 } 1.49 if (value == NULL || value != ptnode_adr(value->_idx)->_node) {