hotspot/src/share/vm/gc/g1/g1ConcurrentMark.cpp
changeset 41081 286019ba662d
parent 40922 d9f1eaf18f9a
child 41176 ff9f64534cff
--- a/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.cpp	Mon Sep 12 18:59:13 2016 +0000
+++ b/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.cpp	Tue Sep 13 11:32:45 2016 +0200
@@ -1904,7 +1904,8 @@
     assert(_g1h->is_in_g1_reserved(finger), "invariant");
 
     HeapRegion* curr_region = _g1h->heap_region_containing(finger);
-
+    // Make sure that the reads below do not float before loading curr_region.
+    OrderAccess::loadload();
     // Above heap_region_containing may return NULL as we always scan claim
     // until the end of the heap. In this case, just jump to the next region.
     HeapWord* end = curr_region != NULL ? curr_region->end() : finger + HeapRegion::GrainWords;