Mercurial > hg > truffle
comparison src/share/vm/opto/parse1.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 |
---|---|
389 _method = parse_method; | 389 _method = parse_method; |
390 _expected_uses = expected_uses; | 390 _expected_uses = expected_uses; |
391 _depth = 1 + (caller->has_method() ? caller->depth() : 0); | 391 _depth = 1 + (caller->has_method() ? caller->depth() : 0); |
392 _wrote_final = false; | 392 _wrote_final = false; |
393 _wrote_volatile = false; | 393 _wrote_volatile = false; |
394 _wrote_stable = false; | |
395 _wrote_fields = false; | |
396 _alloc_with_final = NULL; | 394 _alloc_with_final = NULL; |
397 _entry_bci = InvocationEntryBci; | 395 _entry_bci = InvocationEntryBci; |
398 _tf = NULL; | 396 _tf = NULL; |
399 _block = NULL; | 397 _block = NULL; |
400 debug_only(_block_count = -1); | 398 debug_only(_block_count = -1); |
908 _exits.set_control(gvn().transform(region)); | 906 _exits.set_control(gvn().transform(region)); |
909 | 907 |
910 Node* iophi = _exits.i_o(); | 908 Node* iophi = _exits.i_o(); |
911 _exits.set_i_o(gvn().transform(iophi)); | 909 _exits.set_i_o(gvn().transform(iophi)); |
912 | 910 |
913 // Figure out if we need to emit the trailing barrier. The barrier is only | 911 // On PPC64, also add MemBarRelease for constructors which write |
914 // needed in the constructors, and only in three cases: | 912 // volatile fields. As support_IRIW_for_not_multiple_copy_atomic_cpu |
915 // | 913 // is set on PPC64, no sync instruction is issued after volatile |
916 // 1. The constructor wrote a final. The effects of all initializations | 914 // stores. We want to quarantee the same behaviour as on platforms |
917 // must be committed to memory before any code after the constructor | 915 // with total store order, although this is not required by the Java |
918 // publishes the reference to the newly constructed object. Rather | 916 // memory model. So as with finals, we add a barrier here. |
919 // than wait for the publication, we simply block the writes here. | 917 if (wrote_final() PPC64_ONLY(|| (wrote_volatile() && method()->is_initializer()))) { |
920 // Rather than put a barrier on only those writes which are required | 918 // This method (which must be a constructor by the rules of Java) |
921 // to complete, we force all writes to complete. | 919 // wrote a final. The effects of all initializations must be |
922 // | 920 // committed to memory before any code after the constructor |
923 // 2. On PPC64, also add MemBarRelease for constructors which write | 921 // publishes the reference to the newly constructor object. |
924 // volatile fields. As support_IRIW_for_not_multiple_copy_atomic_cpu | 922 // Rather than wait for the publication, we simply block the |
925 // is set on PPC64, no sync instruction is issued after volatile | 923 // writes here. Rather than put a barrier on only those writes |
926 // stores. We want to guarantee the same behavior as on platforms | 924 // which are required to complete, we force all writes to complete. |
927 // with total store order, although this is not required by the Java | 925 // |
928 // memory model. So as with finals, we add a barrier here. | 926 // "All bets are off" unless the first publication occurs after a |
929 // | 927 // normal return from the constructor. We do not attempt to detect |
930 // 3. Experimental VM option is used to force the barrier if any field | 928 // such unusual early publications. But no barrier is needed on |
931 // was written out in the constructor. | 929 // exceptional returns, since they cannot publish normally. |
932 // | 930 // |
933 // "All bets are off" unless the first publication occurs after a | |
934 // normal return from the constructor. We do not attempt to detect | |
935 // such unusual early publications. But no barrier is needed on | |
936 // exceptional returns, since they cannot publish normally. | |
937 // | |
938 if (method()->is_initializer() && | |
939 (wrote_final() || | |
940 PPC64_ONLY(wrote_volatile() ||) | |
941 (AlwaysSafeConstructors && wrote_fields()))) { | |
942 _exits.insert_mem_bar(Op_MemBarRelease, alloc_with_final()); | 931 _exits.insert_mem_bar(Op_MemBarRelease, alloc_with_final()); |
943 #ifndef PRODUCT | 932 #ifndef PRODUCT |
944 if (PrintOpto && (Verbose || WizardMode)) { | 933 if (PrintOpto && (Verbose || WizardMode)) { |
945 method()->print_name(); | 934 method()->print_name(); |
946 tty->print_cr(" writes finals and needs a memory barrier"); | 935 tty->print_cr(" writes finals and needs a memory barrier"); |
947 } | |
948 #endif | |
949 } | |
950 | |
951 // Any method can write a @Stable field; insert memory barriers after | |
952 // those also. If there is a predecessor allocation node, bind the | |
953 // barrier there. | |
954 if (wrote_stable()) { | |
955 _exits.insert_mem_bar(Op_MemBarRelease, alloc_with_final()); | |
956 #ifndef PRODUCT | |
957 if (PrintOpto && (Verbose || WizardMode)) { | |
958 method()->print_name(); | |
959 tty->print_cr(" writes @Stable and needs a memory barrier"); | |
960 } | 936 } |
961 #endif | 937 #endif |
962 } | 938 } |
963 | 939 |
964 for (MergeMemStream mms(_exits.merged_memory()); mms.next_non_empty(); ) { | 940 for (MergeMemStream mms(_exits.merged_memory()); mms.next_non_empty(); ) { |