Mercurial > hg > graal-jvmci-8
comparison src/cpu/x86/vm/c1_Runtime1_x86.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 | f98f5d48f511 |
children | 096c224171c4 61746b5f0ed3 |
comparison
equal
deleted
inserted
replaced
12834:04b18a42c2f3 | 12835:69944b868a32 |
---|---|
36 #include "runtime/sharedRuntime.hpp" | 36 #include "runtime/sharedRuntime.hpp" |
37 #include "runtime/signature.hpp" | 37 #include "runtime/signature.hpp" |
38 #include "runtime/vframeArray.hpp" | 38 #include "runtime/vframeArray.hpp" |
39 #include "utilities/macros.hpp" | 39 #include "utilities/macros.hpp" |
40 #include "vmreg_x86.inline.hpp" | 40 #include "vmreg_x86.inline.hpp" |
41 #if INCLUDE_ALL_GCS | |
42 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" | |
43 #endif | |
41 | 44 |
42 | 45 |
43 // Implementation of StubAssembler | 46 // Implementation of StubAssembler |
44 | 47 |
45 int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry, int args_size) { | 48 int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry, int args_size) { |
1751 | 1754 |
1752 Address index(noreg, card_index, Address::times_1); | 1755 Address index(noreg, card_index, Address::times_1); |
1753 __ leal(card_addr, __ as_Address(ArrayAddress(cardtable, index))); | 1756 __ leal(card_addr, __ as_Address(ArrayAddress(cardtable, index))); |
1754 #endif | 1757 #endif |
1755 | 1758 |
1756 __ cmpb(Address(card_addr, 0), 0); | 1759 __ cmpb(Address(card_addr, 0), (int)G1SATBCardTableModRefBS::g1_young_card_val()); |
1760 __ jcc(Assembler::equal, done); | |
1761 | |
1762 __ membar(Assembler::Membar_mask_bits(Assembler::StoreLoad)); | |
1763 __ cmpb(Address(card_addr, 0), (int)CardTableModRefBS::dirty_card_val()); | |
1757 __ jcc(Assembler::equal, done); | 1764 __ jcc(Assembler::equal, done); |
1758 | 1765 |
1759 // storing region crossing non-NULL, card is clean. | 1766 // storing region crossing non-NULL, card is clean. |
1760 // dirty card and log. | 1767 // dirty card and log. |
1761 | 1768 |
1762 __ movb(Address(card_addr, 0), 0); | 1769 __ movb(Address(card_addr, 0), (int)CardTableModRefBS::dirty_card_val()); |
1763 | 1770 |
1764 __ cmpl(queue_index, 0); | 1771 __ cmpl(queue_index, 0); |
1765 __ jcc(Assembler::equal, runtime); | 1772 __ jcc(Assembler::equal, runtime); |
1766 __ subl(queue_index, wordSize); | 1773 __ subl(queue_index, wordSize); |
1767 | 1774 |