--- old/src/share/vm/gc/shared/cardTableModRefBS.inline.hpp 2017-04-25 16:45:04.743174157 +0200 +++ new/src/share/vm/gc/shared/cardTableModRefBS.inline.hpp 2017-04-25 16:45:04.599174162 +0200 @@ -25,17 +25,18 @@ #ifndef SHARE_VM_GC_SHARED_CARDTABLEMODREFBS_INLINE_HPP #define SHARE_VM_GC_SHARED_CARDTABLEMODREFBS_INLINE_HPP +#include "gc/shared/cardTable.hpp" #include "gc/shared/cardTableModRefBS.hpp" -#include "oops/oopsHierarchy.hpp" -#include "runtime/orderAccess.inline.hpp" -template inline void CardTableModRefBS::inline_write_ref_field(T* field, oop newVal, bool release) { - jbyte* byte = byte_for((void*)field); - if (release) { - // Perform a releasing store if requested. - OrderAccess::release_store((volatile jbyte*) byte, dirty_card); +template +inline void CardTableModRefBS::write_ref_field_post(void* field, oop newVal) { + CardTable *const card_table = _card_table; + jbyte* byte = card_table->byte_for((void*)field); + if (DecoratorTest::HAS_MO_VOLATILE || card_table->scanned_concurrently()) { + // Perform a releasing store if required. + RawAccess::store(byte, CardTable::dirty_card_val()); } else { - *byte = dirty_card; + RawAccess::store(byte, CardTable::dirty_card_val()); } }