src/share/vm/opto/parse1.cpp

changeset 6502
3514ee402842
parent 6479
2113136690bc
child 6503
a9becfeecd1b
     1.1 --- a/src/share/vm/opto/parse1.cpp	Tue Jan 07 17:24:59 2014 +0100
     1.2 +++ b/src/share/vm/opto/parse1.cpp	Thu Jan 16 14:25:51 2014 +0100
     1.3 @@ -390,6 +390,7 @@
     1.4    _expected_uses = expected_uses;
     1.5    _depth = 1 + (caller->has_method() ? caller->depth() : 0);
     1.6    _wrote_final = false;
     1.7 +  _wrote_volatile = false;
     1.8    _alloc_with_final = NULL;
     1.9    _entry_bci = InvocationEntryBci;
    1.10    _tf = NULL;
    1.11 @@ -907,7 +908,13 @@
    1.12    Node* iophi = _exits.i_o();
    1.13    _exits.set_i_o(gvn().transform(iophi));
    1.14  
    1.15 -  if (wrote_final()) {
    1.16 +  // On PPC64, also add MemBarRelease for constructors which write
    1.17 +  // volatile fields. As support_IRIW_for_not_multiple_copy_atomic_cpu
    1.18 +  // is set on PPC64, no sync instruction is issued after volatile
    1.19 +  // stores. We want to quarantee the same behaviour as on platforms
    1.20 +  // with total store order, although this is not required by the Java
    1.21 +  // memory model. So as with finals, we add a barrier here.
    1.22 +  if (wrote_final() PPC64_ONLY(|| (wrote_volatile() && method()->is_initializer()))) {
    1.23      // This method (which must be a constructor by the rules of Java)
    1.24      // wrote a final.  The effects of all initializations must be
    1.25      // committed to memory before any code after the constructor

mercurial