comparison src/share/vm/opto/parse3.cpp @ 14663:3edd4a71588b

8031818: Experimental VM flag for enforcing safe object construction Summary: -XX:+AlwaysSafeConstructors to unconditionally emit the trailing constructor barrier. Reviewed-by: kvn, roland
author shade
date Mon, 03 Mar 2014 15:31:27 +0400
parents 3c3953fb3f2a
children 92aa6797d639
comparison
equal deleted inserted replaced
14662:3c3953fb3f2a 14663:3edd4a71588b
332 if (is_field) { 332 if (is_field) {
333 set_wrote_volatile(true); 333 set_wrote_volatile(true);
334 } 334 }
335 } 335 }
336 336
337 if (is_field) {
338 set_wrote_fields(true);
339 }
340
337 // If the field is final, the rules of Java say we are in <init> or <clinit>. 341 // If the field is final, the rules of Java say we are in <init> or <clinit>.
338 // Note the presence of writes to final non-static fields, so that we 342 // Note the presence of writes to final non-static fields, so that we
339 // can insert a memory barrier later on to keep the writes from floating 343 // can insert a memory barrier later on to keep the writes from floating
340 // out of the constructor. 344 // out of the constructor.
341 // Any method can write a @Stable field; insert memory barriers after those also. 345 // Any method can write a @Stable field; insert memory barriers after those also.
342 if (is_field && (field->is_final() || field->is_stable())) { 346 if (is_field && (field->is_final() || field->is_stable())) {
343 set_wrote_final(true); 347 if (field->is_final()) {
348 set_wrote_final(true);
349 }
350 if (field->is_stable()) {
351 set_wrote_stable(true);
352 }
353
344 // Preserve allocation ptr to create precedent edge to it in membar 354 // Preserve allocation ptr to create precedent edge to it in membar
345 // generated on exit from constructor. 355 // generated on exit from constructor.
346 if (C->eliminate_boxing() && 356 if (C->eliminate_boxing() &&
347 adr_type->isa_oopptr() && adr_type->is_oopptr()->is_ptr_to_boxed_value() && 357 adr_type->isa_oopptr() && adr_type->is_oopptr()->is_ptr_to_boxed_value() &&
348 AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) { 358 AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) {