Sat, 07 Mar 2009 11:07:36 -0500
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
src/share/vm/gc_implementation/g1/sparsePRT.cpp | file | annotate | diff | comparison | revisions | |
src/share/vm/gc_implementation/g1/sparsePRT.hpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/gc_implementation/g1/sparsePRT.cpp Fri Mar 06 13:50:14 2009 -0800 1.2 +++ b/src/share/vm/gc_implementation/g1/sparsePRT.cpp Sat Mar 07 11:07:36 2009 -0500 1.3 @@ -504,6 +504,7 @@ 1.4 // Make sure that the current and next tables agree. (Another mechanism 1.5 // takes care of deleting now-unused tables.) 1.6 _cur = _next; 1.7 + set_expanded(false); 1.8 } 1.9 1.10 void SparsePRT::expand() {
2.1 --- a/src/share/vm/gc_implementation/g1/sparsePRT.hpp Fri Mar 06 13:50:14 2009 -0800 2.2 +++ b/src/share/vm/gc_implementation/g1/sparsePRT.hpp Sat Mar 07 11:07:36 2009 -0500 2.3 @@ -274,7 +274,7 @@ 2.4 2.5 // Clean up all tables on the expanded list. Called single threaded. 2.6 static void cleanup_all(); 2.7 - RSHashTable* next() const { return _next; } 2.8 + RSHashTable* cur() const { return _cur; } 2.9 2.10 2.11 void init_iterator(SparsePRTIter* sprt_iter); 2.12 @@ -300,7 +300,7 @@ 2.13 {} 2.14 2.15 void init(const SparsePRT* sprt) { 2.16 - RSHashTableIter::init(sprt->next()); 2.17 + RSHashTableIter::init(sprt->cur()); 2.18 } 2.19 bool has_next(size_t& card_index) { 2.20 return RSHashTableIter::has_next(card_index);