25 #ifndef SHARE_GC_SHARED_CARDTABLEBARRIERSET_INLINE_HPP |
25 #ifndef SHARE_GC_SHARED_CARDTABLEBARRIERSET_INLINE_HPP |
26 #define SHARE_GC_SHARED_CARDTABLEBARRIERSET_INLINE_HPP |
26 #define SHARE_GC_SHARED_CARDTABLEBARRIERSET_INLINE_HPP |
27 |
27 |
28 #include "gc/shared/cardTableBarrierSet.hpp" |
28 #include "gc/shared/cardTableBarrierSet.hpp" |
29 #include "gc/shared/cardTable.hpp" |
29 #include "gc/shared/cardTable.hpp" |
30 #include "runtime/orderAccess.hpp" |
30 #include "runtime/atomic.hpp" |
31 |
31 |
32 template <DecoratorSet decorators, typename T> |
32 template <DecoratorSet decorators, typename T> |
33 inline void CardTableBarrierSet::write_ref_field_post(T* field, oop newVal) { |
33 inline void CardTableBarrierSet::write_ref_field_post(T* field, oop newVal) { |
34 volatile CardValue* byte = _card_table->byte_for(field); |
34 volatile CardValue* byte = _card_table->byte_for(field); |
35 if (_card_table->scanned_concurrently()) { |
35 if (_card_table->scanned_concurrently()) { |
36 // Perform a releasing store if the card table is scanned concurrently |
36 // Perform a releasing store if the card table is scanned concurrently |
37 OrderAccess::release_store(byte, CardTable::dirty_card_val()); |
37 Atomic::release_store(byte, CardTable::dirty_card_val()); |
38 } else { |
38 } else { |
39 *byte = CardTable::dirty_card_val(); |
39 *byte = CardTable::dirty_card_val(); |
40 } |
40 } |
41 } |
41 } |
42 |
42 |