# HG changeset patch # User tonyp # Date 1236442056 18000 # Node ID 61babb9fbd6f474e64363a6af92983418eda13f3 # Parent 032f4652700c304448818a8e7168786cf4b849c3 6810698: G1: two small bugs in the sparse remembered sets Summary: The _expanded flag of the sparse RSets is not reset and this can leave a RSet in an inconsistent state if it is expanded more than once. Also, we should be iterating over the _cur, instead of the _next, sparse table Reviewed-by: apetrusenko, iveresov diff -r 032f4652700c -r 61babb9fbd6f hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp --- a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp Fri Mar 06 13:50:14 2009 -0800 +++ b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp Sat Mar 07 11:07:36 2009 -0500 @@ -504,6 +504,7 @@ // Make sure that the current and next tables agree. (Another mechanism // takes care of deleting now-unused tables.) _cur = _next; + set_expanded(false); } void SparsePRT::expand() { diff -r 032f4652700c -r 61babb9fbd6f hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp --- a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp Fri Mar 06 13:50:14 2009 -0800 +++ b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp Sat Mar 07 11:07:36 2009 -0500 @@ -274,7 +274,7 @@ // Clean up all tables on the expanded list. Called single threaded. static void cleanup_all(); - RSHashTable* next() const { return _next; } + RSHashTable* cur() const { return _cur; } void init_iterator(SparsePRTIter* sprt_iter); @@ -300,7 +300,7 @@ {} void init(const SparsePRT* sprt) { - RSHashTableIter::init(sprt->next()); + RSHashTableIter::init(sprt->cur()); } bool has_next(size_t& card_index) { return RSHashTableIter::has_next(card_index);