Mercurial > hg > truffle
comparison src/share/vm/opto/parse3.cpp @ 14702:d4dd5204c0aa
Merge
author | ehelin |
---|---|
date | Fri, 14 Mar 2014 13:27:18 +0100 |
parents | 3edd4a71588b |
children | 92aa6797d639 |
comparison
equal
deleted
inserted
replaced
14701:d3ef21095134 | 14702:d4dd5204c0aa |
---|---|
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 Node* ld = make_load(NULL, adr, type, bt, adr_type, mo, is_vol); | 236 bool needs_atomic_access = is_vol || AlwaysAtomicAccesses; |
237 Node* ld = make_load(NULL, adr, type, bt, adr_type, mo, needs_atomic_access); | |
237 | 238 |
238 // Adjust Java stack | 239 // Adjust Java stack |
239 if (type2size[bt] == 1) | 240 if (type2size[bt] == 1) |
240 push(ld); | 241 push(ld); |
241 else | 242 else |
312 } else { | 313 } else { |
313 field_type = TypeOopPtr::make_from_klass(field->type()->as_klass()); | 314 field_type = TypeOopPtr::make_from_klass(field->type()->as_klass()); |
314 } | 315 } |
315 store = store_oop_to_object(control(), obj, adr, adr_type, val, field_type, bt, mo); | 316 store = store_oop_to_object(control(), obj, adr, adr_type, val, field_type, bt, mo); |
316 } else { | 317 } else { |
317 store = store_to_memory(control(), adr, val, bt, adr_type, mo, is_vol); | 318 bool needs_atomic_access = is_vol || AlwaysAtomicAccesses; |
319 store = store_to_memory(control(), adr, val, bt, adr_type, mo, needs_atomic_access); | |
318 } | 320 } |
319 | 321 |
320 // If reference is volatile, prevent following volatiles ops from | 322 // If reference is volatile, prevent following volatiles ops from |
321 // floating up before the volatile write. | 323 // floating up before the volatile write. |
322 if (is_vol) { | 324 if (is_vol) { |
330 if (is_field) { | 332 if (is_field) { |
331 set_wrote_volatile(true); | 333 set_wrote_volatile(true); |
332 } | 334 } |
333 } | 335 } |
334 | 336 |
337 if (is_field) { | |
338 set_wrote_fields(true); | |
339 } | |
340 | |
335 // 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>. |
336 // 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 |
337 // 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 |
338 // out of the constructor. | 344 // out of the constructor. |
339 // 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. |
340 if (is_field && (field->is_final() || field->is_stable())) { | 346 if (is_field && (field->is_final() || field->is_stable())) { |
341 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 | |
342 // Preserve allocation ptr to create precedent edge to it in membar | 354 // Preserve allocation ptr to create precedent edge to it in membar |
343 // generated on exit from constructor. | 355 // generated on exit from constructor. |
344 if (C->eliminate_boxing() && | 356 if (C->eliminate_boxing() && |
345 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() && |
346 AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) { | 358 AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) { |