315 store = store_oop_to_object(control(), obj, adr, adr_type, val, field_type, bt, mo); 316 } else { 317 store = store_to_memory(control(), adr, val, bt, adr_type, mo, is_vol); 318 } 319 320 // If reference is volatile, prevent following volatiles ops from 321 // floating up before the volatile write. 322 if (is_vol) { 323 // If not multiple copy atomic, we do the MemBarVolatile before the load. 324 if (!support_IRIW_for_not_multiple_copy_atomic_cpu) { 325 insert_mem_bar(Op_MemBarVolatile); // Use fat membar 326 } 327 // Remember we wrote a volatile field. 328 // For not multiple copy atomic cpu (ppc64) a barrier should be issued 329 // in constructors which have such stores. See do_exits() in parse1.cpp. 330 if (is_field) { 331 set_wrote_volatile(true); 332 } 333 } 334 335 // If the field is final, the rules of Java say we are in <init> or <clinit>. 336 // Note the presence of writes to final non-static fields, so that we 337 // can insert a memory barrier later on to keep the writes from floating 338 // out of the constructor. 339 // Any method can write a @Stable field; insert memory barriers after those also. 340 if (is_field && (field->is_final() || field->is_stable())) { 341 set_wrote_final(true); 342 // Preserve allocation ptr to create precedent edge to it in membar 343 // generated on exit from constructor. 344 if (C->eliminate_boxing() && 345 adr_type->isa_oopptr() && adr_type->is_oopptr()->is_ptr_to_boxed_value() && 346 AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) { 347 set_alloc_with_final(obj); 348 } 349 } 350 } 351 352 353 354 bool Parse::push_constant(ciConstant constant, bool require_constant, bool is_autobox_cache, const Type* stable_type) { | 315 store = store_oop_to_object(control(), obj, adr, adr_type, val, field_type, bt, mo); 316 } else { 317 store = store_to_memory(control(), adr, val, bt, adr_type, mo, is_vol); 318 } 319 320 // If reference is volatile, prevent following volatiles ops from 321 // floating up before the volatile write. 322 if (is_vol) { 323 // If not multiple copy atomic, we do the MemBarVolatile before the load. 324 if (!support_IRIW_for_not_multiple_copy_atomic_cpu) { 325 insert_mem_bar(Op_MemBarVolatile); // Use fat membar 326 } 327 // Remember we wrote a volatile field. 328 // For not multiple copy atomic cpu (ppc64) a barrier should be issued 329 // in constructors which have such stores. See do_exits() in parse1.cpp. 330 if (is_field) { 331 set_wrote_volatile(true); 332 } 333 } 334 335 if (is_field) { 336 set_wrote_fields(true); 337 } 338 339 // If the field is final, the rules of Java say we are in <init> or <clinit>. 340 // Note the presence of writes to final non-static fields, so that we 341 // can insert a memory barrier later on to keep the writes from floating 342 // out of the constructor. 343 // Any method can write a @Stable field; insert memory barriers after those also. 344 if (is_field && (field->is_final() || field->is_stable())) { 345 set_wrote_final(true); 346 // Preserve allocation ptr to create precedent edge to it in membar 347 // generated on exit from constructor. 348 if (C->eliminate_boxing() && 349 adr_type->isa_oopptr() && adr_type->is_oopptr()->is_ptr_to_boxed_value() && 350 AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) { 351 set_alloc_with_final(obj); 352 } 353 } 354 } 355 356 357 358 bool Parse::push_constant(ciConstant constant, bool require_constant, bool is_autobox_cache, const Type* stable_type) { |