--- old/src/share/vm/gc/g1/g1CollectedHeap.cpp 2016-04-06 17:17:19.194383605 +0200 +++ new/src/share/vm/gc/g1/g1CollectedHeap.cpp 2016-04-06 17:17:19.082383604 +0200 @@ -96,7 +96,7 @@ public: RefineCardTableEntryClosure() : _concurrent(true) { } - bool do_card_ptr(jbyte* card_ptr, uint worker_i) { + bool do_card_ptr(volatile jbyte* card_ptr, uint worker_i) { bool oops_into_cset = G1CollectedHeap::heap()->g1_rem_set()->refine_card(card_ptr, worker_i, false); // This path is executed by the concurrent refine or mutator threads, // concurrently, and so we do not care if card_ptr contains references @@ -121,7 +121,7 @@ G1CollectedHeap* _g1h; G1SATBCardTableLoggingModRefBS* _g1_bs; - HeapRegion* region_for_card(jbyte* card_ptr) const { + HeapRegion* region_for_card(volatile jbyte* card_ptr) const { return _g1h->heap_region_containing(_g1_bs->addr_for(card_ptr)); } @@ -135,7 +135,7 @@ RedirtyLoggedCardTableEntryClosure(G1CollectedHeap* g1h) : CardTableEntryClosure(), _num_dirtied(0), _g1h(g1h), _g1_bs(g1h->g1_barrier_set()) { } - bool do_card_ptr(jbyte* card_ptr, uint worker_i) { + bool do_card_ptr(volatile jbyte* card_ptr, uint worker_i) { HeapRegion* hr = region_for_card(card_ptr); // Should only dirty cards in regions that won't be freed. @@ -3017,7 +3017,7 @@ HeapRegionRemSetIterator hrrs(r->rem_set()); size_t card_index; while (hrrs.has_next(card_index)) { - jbyte* card_ptr = (jbyte*)bs->byte_for_index(card_index); + volatile jbyte* card_ptr = (volatile jbyte*)bs->byte_for_index(card_index); // The remembered set might contain references to already freed // regions. Filter out such entries to avoid failing card table // verification.