1.1 --- a/src/share/vm/opto/escape.cpp Fri Dec 20 10:31:14 2013 +0100 1.2 +++ b/src/share/vm/opto/escape.cpp Thu Dec 26 21:00:23 2013 -0800 1.3 @@ -1579,9 +1579,20 @@ 1.4 jobj->set_scalar_replaceable(false); 1.5 return; 1.6 } 1.7 + // 2. An object is not scalar replaceable if the field into which it is 1.8 + // stored has multiple bases one of which is null. 1.9 + if (field->base_count() > 1) { 1.10 + for (BaseIterator i(field); i.has_next(); i.next()) { 1.11 + PointsToNode* base = i.get(); 1.12 + if (base == null_obj) { 1.13 + jobj->set_scalar_replaceable(false); 1.14 + return; 1.15 + } 1.16 + } 1.17 + } 1.18 } 1.19 assert(use->is_Field() || use->is_LocalVar(), "sanity"); 1.20 - // 2. An object is not scalar replaceable if it is merged with other objects. 1.21 + // 3. An object is not scalar replaceable if it is merged with other objects. 1.22 for (EdgeIterator j(use); j.has_next(); j.next()) { 1.23 PointsToNode* ptn = j.get(); 1.24 if (ptn->is_JavaObject() && ptn != jobj) { 1.25 @@ -1600,13 +1611,13 @@ 1.26 FieldNode* field = j.get()->as_Field(); 1.27 int offset = field->as_Field()->offset(); 1.28 1.29 - // 3. An object is not scalar replaceable if it has a field with unknown 1.30 + // 4. An object is not scalar replaceable if it has a field with unknown 1.31 // offset (array's element is accessed in loop). 1.32 if (offset == Type::OffsetBot) { 1.33 jobj->set_scalar_replaceable(false); 1.34 return; 1.35 } 1.36 - // 4. Currently an object is not scalar replaceable if a LoadStore node 1.37 + // 5. Currently an object is not scalar replaceable if a LoadStore node 1.38 // access its field since the field value is unknown after it. 1.39 // 1.40 Node* n = field->ideal_node(); 1.41 @@ -1617,7 +1628,7 @@ 1.42 } 1.43 } 1.44 1.45 - // 5. Or the address may point to more then one object. This may produce 1.46 + // 6. Or the address may point to more then one object. This may produce 1.47 // the false positive result (set not scalar replaceable) 1.48 // since the flow-insensitive escape analysis can't separate 1.49 // the case when stores overwrite the field's value from the case