comparison src/share/vm/opto/parse3.cpp @ 14726:92aa6797d639

Backed out merge changeset: b51e29501f30 Backed out merge revision to its first parent (8f483e200405)
author Doug Simon <doug.simon@oracle.com>
date Mon, 24 Mar 2014 21:30:43 +0100
parents 3edd4a71588b
children
comparison
equal deleted inserted replaced
14719:0bdd0d157040 14726:92aa6797d639
231 insert_mem_bar(Op_MemBarVolatile); // StoreLoad barrier 231 insert_mem_bar(Op_MemBarVolatile); // StoreLoad barrier
232 } 232 }
233 // Build the load. 233 // Build the load.
234 // 234 //
235 MemNode::MemOrd mo = is_vol ? MemNode::acquire : MemNode::unordered; 235 MemNode::MemOrd mo = is_vol ? MemNode::acquire : MemNode::unordered;
236 bool needs_atomic_access = is_vol || AlwaysAtomicAccesses; 236 Node* ld = make_load(NULL, adr, type, bt, adr_type, mo, is_vol);
237 Node* ld = make_load(NULL, adr, type, bt, adr_type, mo, needs_atomic_access);
238 237
239 // Adjust Java stack 238 // Adjust Java stack
240 if (type2size[bt] == 1) 239 if (type2size[bt] == 1)
241 push(ld); 240 push(ld);
242 else 241 else
313 } else { 312 } else {
314 field_type = TypeOopPtr::make_from_klass(field->type()->as_klass()); 313 field_type = TypeOopPtr::make_from_klass(field->type()->as_klass());
315 } 314 }
316 store = store_oop_to_object(control(), obj, adr, adr_type, val, field_type, bt, mo); 315 store = store_oop_to_object(control(), obj, adr, adr_type, val, field_type, bt, mo);
317 } else { 316 } else {
318 bool needs_atomic_access = is_vol || AlwaysAtomicAccesses; 317 store = store_to_memory(control(), adr, val, bt, adr_type, mo, is_vol);
319 store = store_to_memory(control(), adr, val, bt, adr_type, mo, needs_atomic_access);
320 } 318 }
321 319
322 // If reference is volatile, prevent following volatiles ops from 320 // If reference is volatile, prevent following volatiles ops from
323 // floating up before the volatile write. 321 // floating up before the volatile write.
324 if (is_vol) { 322 if (is_vol) {
332 if (is_field) { 330 if (is_field) {
333 set_wrote_volatile(true); 331 set_wrote_volatile(true);
334 } 332 }
335 } 333 }
336 334
337 if (is_field) {
338 set_wrote_fields(true);
339 }
340
341 // If the field is final, the rules of Java say we are in <init> or <clinit>. 335 // If the field is final, the rules of Java say we are in <init> or <clinit>.
342 // Note the presence of writes to final non-static fields, so that we 336 // Note the presence of writes to final non-static fields, so that we
343 // can insert a memory barrier later on to keep the writes from floating 337 // can insert a memory barrier later on to keep the writes from floating
344 // out of the constructor. 338 // out of the constructor.
345 // Any method can write a @Stable field; insert memory barriers after those also. 339 // Any method can write a @Stable field; insert memory barriers after those also.
346 if (is_field && (field->is_final() || field->is_stable())) { 340 if (is_field && (field->is_final() || field->is_stable())) {
347 if (field->is_final()) { 341 set_wrote_final(true);
348 set_wrote_final(true);
349 }
350 if (field->is_stable()) {
351 set_wrote_stable(true);
352 }
353
354 // Preserve allocation ptr to create precedent edge to it in membar 342 // Preserve allocation ptr to create precedent edge to it in membar
355 // generated on exit from constructor. 343 // generated on exit from constructor.
356 if (C->eliminate_boxing() && 344 if (C->eliminate_boxing() &&
357 adr_type->isa_oopptr() && adr_type->is_oopptr()->is_ptr_to_boxed_value() && 345 adr_type->isa_oopptr() && adr_type->is_oopptr()->is_ptr_to_boxed_value() &&
358 AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) { 346 AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) {