Mercurial > hg > graal-jvmci-8
comparison src/share/vm/opto/graphKit.cpp @ 12835:69944b868a32
8014555: G1: Memory ordering problem with Conc refinement and card marking
Summary: Add a StoreLoad barrier in the G1 post-barrier to fix a race with concurrent refinement. Also-reviewed-by: martin.doerr@sap.com
Reviewed-by: iveresov, tschatzl, brutisso, roland, kvn
author | mgerdin |
---|---|
date | Tue, 08 Oct 2013 17:35:51 +0200 |
parents | edb5ab0f3fe5 |
children | aa6f2ea19d8f |
comparison
equal
deleted
inserted
replaced
12834:04b18a42c2f3 | 12835:69944b868a32 |
---|---|
3711 Node* tls = __ thread(); // ThreadLocalStorage | 3711 Node* tls = __ thread(); // ThreadLocalStorage |
3712 | 3712 |
3713 Node* no_base = __ top(); | 3713 Node* no_base = __ top(); |
3714 float likely = PROB_LIKELY(0.999); | 3714 float likely = PROB_LIKELY(0.999); |
3715 float unlikely = PROB_UNLIKELY(0.999); | 3715 float unlikely = PROB_UNLIKELY(0.999); |
3716 Node* zero = __ ConI(0); | 3716 Node* young_card = __ ConI((jint)G1SATBCardTableModRefBS::g1_young_card_val()); |
3717 Node* dirty_card = __ ConI((jint)CardTableModRefBS::dirty_card_val()); | |
3717 Node* zeroX = __ ConX(0); | 3718 Node* zeroX = __ ConX(0); |
3718 | 3719 |
3719 // Get the alias_index for raw card-mark memory | 3720 // Get the alias_index for raw card-mark memory |
3720 const TypePtr* card_type = TypeRawPtr::BOTTOM; | 3721 const TypePtr* card_type = TypeRawPtr::BOTTOM; |
3721 | 3722 |
3767 // Ok must mark the card if not already dirty | 3768 // Ok must mark the card if not already dirty |
3768 | 3769 |
3769 // load the original value of the card | 3770 // load the original value of the card |
3770 Node* card_val = __ load(__ ctrl(), card_adr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw); | 3771 Node* card_val = __ load(__ ctrl(), card_adr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw); |
3771 | 3772 |
3772 __ if_then(card_val, BoolTest::ne, zero); { | 3773 __ if_then(card_val, BoolTest::ne, young_card); { |
3773 g1_mark_card(ideal, card_adr, oop_store, alias_idx, index, index_adr, buffer, tf); | 3774 sync_kit(ideal); |
3775 // Use Op_MemBarVolatile to achieve the effect of a StoreLoad barrier. | |
3776 insert_mem_bar(Op_MemBarVolatile, oop_store); | |
3777 __ sync_kit(this); | |
3778 | |
3779 Node* card_val_reload = __ load(__ ctrl(), card_adr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw); | |
3780 __ if_then(card_val_reload, BoolTest::ne, dirty_card); { | |
3781 g1_mark_card(ideal, card_adr, oop_store, alias_idx, index, index_adr, buffer, tf); | |
3782 } __ end_if(); | |
3774 } __ end_if(); | 3783 } __ end_if(); |
3775 } __ end_if(); | 3784 } __ end_if(); |
3776 } __ end_if(); | 3785 } __ end_if(); |
3777 } else { | 3786 } else { |
3778 // Object.clone() instrinsic uses this path. | 3787 // Object.clone() instrinsic uses this path. |