--- old/src/share/vm/gc/shared/cardTableRS.hpp 2016-04-06 17:17:35.606383799 +0200 +++ new/src/share/vm/gc/shared/cardTableRS.hpp 2016-04-06 17:17:35.498383798 +0200 @@ -89,7 +89,7 @@ // used as the current value for a younger_refs_do iteration of that // portion of the table. The perm gen is index 0. The young gen is index 1, // but will always have the value "clean_card". The old gen is index 2. - jbyte* _last_cur_val_in_gen; + volatile jbyte* _last_cur_val_in_gen; jbyte _cur_youngergen_card_val; @@ -136,7 +136,7 @@ void younger_refs_iterate(Generation* g, OopsInGenClosure* blk, uint n_threads); void inline_write_ref_field_gc(void* field, oop new_val) { - jbyte* byte = _ct_bs->byte_for(field); + volatile jbyte* byte = _ct_bs->byte_for(field); *byte = youngergen_card; } void write_ref_field_gc_work(void* field, oop new_val) { @@ -168,9 +168,9 @@ return CardTableModRefBSForCTRS::ct_max_alignment_constraint(); } - jbyte* byte_for(void* p) { return _ct_bs->byte_for(p); } - jbyte* byte_after(void* p) { return _ct_bs->byte_after(p); } - HeapWord* addr_for(jbyte* p) { return _ct_bs->addr_for(p); } + volatile jbyte* byte_for(void* p) { return _ct_bs->byte_for(p); } + volatile jbyte* byte_after(void* p) { return _ct_bs->byte_after(p); } + HeapWord* addr_for(volatile jbyte* p) { return _ct_bs->addr_for(p); } bool is_prev_nonclean_card_val(jbyte v) { return @@ -192,12 +192,12 @@ private: // Clears the given card, return true if the corresponding card should be // processed. - inline bool clear_card(jbyte* entry); + inline bool clear_card(volatile jbyte* entry); // Work methods called by the clear_card() - inline bool clear_card_serial(jbyte* entry); - inline bool clear_card_parallel(jbyte* entry); + inline bool clear_card_serial(volatile jbyte* entry); + inline bool clear_card_parallel(volatile jbyte* entry); // check alignment of pointer - bool is_word_aligned(jbyte* entry); + bool is_word_aligned(volatile jbyte* entry); public: ClearNoncleanCardWrapper(DirtyCardToOopClosure* dirty_card_closure, CardTableRS* ct, bool is_par);