hotspot/src/share/vm/opto/parse1.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot-comp Sdiff hotspot/src/share/vm/opto

hotspot/src/share/vm/opto/parse1.cpp

Print this page
rev 4963 : imported patch stable


 904   Node* region = _exits.control();
 905   _exits.set_control(gvn().transform(region));
 906 
 907   Node* iophi = _exits.i_o();
 908   _exits.set_i_o(gvn().transform(iophi));
 909 
 910   if (wrote_final()) {
 911     // This method (which must be a constructor by the rules of Java)
 912     // wrote a final.  The effects of all initializations must be
 913     // committed to memory before any code after the constructor
 914     // publishes the reference to the newly constructor object.
 915     // Rather than wait for the publication, we simply block the
 916     // writes here.  Rather than put a barrier on only those writes
 917     // which are required to complete, we force all writes to complete.
 918     //
 919     // "All bets are off" unless the first publication occurs after a
 920     // normal return from the constructor.  We do not attempt to detect
 921     // such unusual early publications.  But no barrier is needed on
 922     // exceptional returns, since they cannot publish normally.
 923     //
 924     _exits.insert_mem_bar(Op_MemBarRelease, alloc_with_final());

 925 #ifndef PRODUCT
 926     if (PrintOpto && (Verbose || WizardMode)) {
 927       method()->print_name();
 928       tty->print_cr(" writes finals and needs a memory barrier");
 929     }
 930 #endif
 931   }
 932 
 933   for (MergeMemStream mms(_exits.merged_memory()); mms.next_non_empty(); ) {
 934     // transform each slice of the original memphi:
 935     mms.set_memory(_gvn.transform(mms.memory()));
 936   }
 937 
 938   if (tf()->range()->cnt() > TypeFunc::Parms) {
 939     const Type* ret_type = tf()->range()->field_at(TypeFunc::Parms);
 940     Node*       ret_phi  = _gvn.transform( _exits.argument(0) );
 941     assert(_exits.control()->is_top() || !_gvn.type(ret_phi)->empty(), "return value must be well defined");
 942     _exits.push_node(ret_type->basic_type(), ret_phi);
 943   }
 944 




 904   Node* region = _exits.control();
 905   _exits.set_control(gvn().transform(region));
 906 
 907   Node* iophi = _exits.i_o();
 908   _exits.set_i_o(gvn().transform(iophi));
 909 
 910   if (wrote_final()) {
 911     // This method (which must be a constructor by the rules of Java)
 912     // wrote a final.  The effects of all initializations must be
 913     // committed to memory before any code after the constructor
 914     // publishes the reference to the newly constructor object.
 915     // Rather than wait for the publication, we simply block the
 916     // writes here.  Rather than put a barrier on only those writes
 917     // which are required to complete, we force all writes to complete.
 918     //
 919     // "All bets are off" unless the first publication occurs after a
 920     // normal return from the constructor.  We do not attempt to detect
 921     // such unusual early publications.  But no barrier is needed on
 922     // exceptional returns, since they cannot publish normally.
 923     //
 924     // Any method can write a @Stable field, and we give those the same treatment.
 925     _exits.insert_mem_bar(Op_MemBarRelease);
 926 #ifndef PRODUCT
 927     if (PrintOpto && (Verbose || WizardMode)) {
 928       method()->print_name();
 929       tty->print_cr(" writes finals and needs a memory barrier");
 930     }
 931 #endif
 932   }
 933 
 934   for (MergeMemStream mms(_exits.merged_memory()); mms.next_non_empty(); ) {
 935     // transform each slice of the original memphi:
 936     mms.set_memory(_gvn.transform(mms.memory()));
 937   }
 938 
 939   if (tf()->range()->cnt() > TypeFunc::Parms) {
 940     const Type* ret_type = tf()->range()->field_at(TypeFunc::Parms);
 941     Node*       ret_phi  = _gvn.transform( _exits.argument(0) );
 942     assert(_exits.control()->is_top() || !_gvn.type(ret_phi)->empty(), "return value must be well defined");
 943     _exits.push_node(ret_type->basic_type(), ret_phi);
 944   }
 945 


hotspot/src/share/vm/opto/parse1.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File