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) { 355 const Type* con_type = Type::make_from_constant(constant, require_constant, is_autobox_cache); 356 switch (constant.basic_type()) { 357 case T_ARRAY: 358 case T_OBJECT: 359 // cases: 360 // can_be_constant = (oop not scavengable || ScavengeRootsInCode != 0) 361 // should_be_constant = (oop not scavengable || ScavengeRootsInCode >= 2) | 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 if (field->is_final()) { 346 set_wrote_final(true); 347 } 348 if (field->is_stable()) { 349 set_wrote_stable(true); 350 } 351 352 // Preserve allocation ptr to create precedent edge to it in membar 353 // generated on exit from constructor. 354 if (C->eliminate_boxing() && 355 adr_type->isa_oopptr() && adr_type->is_oopptr()->is_ptr_to_boxed_value() && 356 AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) { 357 set_alloc_with_final(obj); 358 } 359 } 360 } 361 362 363 364 bool Parse::push_constant(ciConstant constant, bool require_constant, bool is_autobox_cache, const Type* stable_type) { 365 const Type* con_type = Type::make_from_constant(constant, require_constant, is_autobox_cache); 366 switch (constant.basic_type()) { 367 case T_ARRAY: 368 case T_OBJECT: 369 // cases: 370 // can_be_constant = (oop not scavengable || ScavengeRootsInCode != 0) 371 // should_be_constant = (oop not scavengable || ScavengeRootsInCode >= 2) |