# HG changeset patch # User tschatzl # Date 1453989813 -3600 # Node ID b5e595dbaa556bf13edbc27c67e808c5ce6e60a5 # Parent 6c93eabea7c2adef4f282ca6adc829a58389b5ea# Parent 8ea0b4b0bcc8c235686b881ce32424d889e7990f Merge diff -r 6c93eabea7c2 -r b5e595dbaa55 hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp Thu Jan 28 14:58:57 2016 +0300 +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp Thu Jan 28 15:03:33 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -110,7 +110,9 @@ public: - HeapRegion* hr() const { return _hr; } + HeapRegion* hr() const { + return (HeapRegion*) OrderAccess::load_ptr_acquire(&_hr); + } jint occupied() const { // Overkill, but if we ever need it... @@ -123,10 +125,12 @@ set_next(NULL); set_prev(NULL); } - _hr = hr; _collision_list_next = NULL; _occupied = 0; _bm.clear(); + // Make sure that the bitmap clearing above has been finished before publishing + // this PRT to concurrent threads. + OrderAccess::release_store_ptr(&_hr, hr); } void add_reference(OopOrNarrowOopStar from) { @@ -357,7 +361,7 @@ int from_card = (int)(uintptr_t(from) >> CardTableModRefBS::card_shift); if (G1FromCardCache::contains_or_replace(tid, cur_hrm_ind, from_card)) { - assert(contains_reference(from), "We just added it!"); + assert(contains_reference(from), "We just found " PTR_FORMAT " in the FromCardCache", p2i(from)); return; } @@ -367,7 +371,7 @@ // If the region is already coarsened, return. if (_coarse_map.at(from_hrm_ind)) { - assert(contains_reference(from), "We just added it!"); + assert(contains_reference(from), "We just found " PTR_FORMAT " in the Coarse table", p2i(from)); return; } @@ -388,7 +392,7 @@ "Must be in range."); if (G1HRRSUseSparseTable && _sparse_table.add_card(from_hrm_ind, card_index)) { - assert(contains_reference_locked(from), "We just added it!"); + assert(contains_reference_locked(from), "We just added " PTR_FORMAT " to the Sparse table", p2i(from)); return; } @@ -438,7 +442,7 @@ assert(prt != NULL, "Inv"); prt->add_reference(from); - assert(contains_reference(from), "We just added it!"); + assert(contains_reference(from), "We just added " PTR_FORMAT " to the PRT", p2i(from)); } PerRegionTable*