diff -r f77a432b90f6 -r 34e5004f5acb hotspot/src/share/vm/opto/parse3.cpp --- a/hotspot/src/share/vm/opto/parse3.cpp Wed Oct 14 09:22:21 2015 -1000 +++ b/hotspot/src/share/vm/opto/parse3.cpp Thu Oct 15 09:40:45 2015 +0200 @@ -313,10 +313,19 @@ // Preserve allocation ptr to create precedent edge to it in membar // generated on exit from constructor. - if (C->eliminate_boxing() && - adr_type->isa_oopptr() && adr_type->is_oopptr()->is_ptr_to_boxed_value() && - AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) { - set_alloc_with_final(obj); + if (AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) { + if (field->is_final()) { + set_alloc_with_final(obj); + } + if (field->is_stable()) { + set_alloc_with_stable(obj); + } + } else if (field->is_stable()) { + // This stable field doesn't have an allocation, set + // alloc_with_stable as NULL: its initial value is NodeSentinel, + // if it is not set to NULL here, next set_alloc_with_stable + // call might set none-NULL value successfully. + set_alloc_with_stable(NULL); } } }