1.1 --- a/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp Mon Jul 21 09:40:19 2014 +0200 1.2 +++ b/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp Mon Jul 21 09:40:19 2014 +0200 1.3 @@ -432,26 +432,24 @@ 1.4 }; 1.5 1.6 class HeapRegionRemSetIterator : public StackObj { 1.7 - 1.8 - // The region RSet over which we're iterating. 1.9 + private: 1.10 + // The region RSet over which we are iterating. 1.11 HeapRegionRemSet* _hrrs; 1.12 1.13 // Local caching of HRRS fields. 1.14 const BitMap* _coarse_map; 1.15 - PerRegionTable** _fine_grain_regions; 1.16 1.17 G1BlockOffsetSharedArray* _bosa; 1.18 G1CollectedHeap* _g1h; 1.19 1.20 - // The number yielded since initialization. 1.21 + // The number of cards yielded since initialization. 1.22 size_t _n_yielded_fine; 1.23 size_t _n_yielded_coarse; 1.24 size_t _n_yielded_sparse; 1.25 1.26 - // Indicates what granularity of table that we're currently iterating over. 1.27 + // Indicates what granularity of table that we are currently iterating over. 1.28 // We start iterating over the sparse table, progress to the fine grain 1.29 // table, and then finish with the coarse table. 1.30 - // See HeapRegionRemSetIterator::has_next(). 1.31 enum IterState { 1.32 Sparse, 1.33 Fine, 1.34 @@ -459,38 +457,30 @@ 1.35 }; 1.36 IterState _is; 1.37 1.38 - // In both kinds of iteration, heap offset of first card of current 1.39 - // region. 1.40 + // For both Coarse and Fine remembered set iteration this contains the 1.41 + // first card number of the heap region we currently iterate over. 1.42 size_t _cur_region_card_offset; 1.43 - // Card offset within cur region. 1.44 - size_t _cur_region_cur_card; 1.45 1.46 - // Coarse table iteration fields: 1.47 - 1.48 - // Current region index; 1.49 + // Current region index for the Coarse remembered set iteration. 1.50 int _coarse_cur_region_index; 1.51 size_t _coarse_cur_region_cur_card; 1.52 1.53 bool coarse_has_next(size_t& card_index); 1.54 1.55 - // Fine table iteration fields: 1.56 + // The PRT we are currently iterating over. 1.57 + PerRegionTable* _fine_cur_prt; 1.58 + // Card offset within the current PRT. 1.59 + size_t _cur_card_in_prt; 1.60 1.61 - // Index of bucket-list we're working on. 1.62 - int _fine_array_index; 1.63 - 1.64 - // Per Region Table we're doing within current bucket list. 1.65 - PerRegionTable* _fine_cur_prt; 1.66 - 1.67 - /* SparsePRT::*/ SparsePRTIter _sparse_iter; 1.68 - 1.69 - void fine_find_next_non_null_prt(); 1.70 - 1.71 + // Update internal variables when switching to the given PRT. 1.72 + void switch_to_prt(PerRegionTable* prt); 1.73 bool fine_has_next(); 1.74 bool fine_has_next(size_t& card_index); 1.75 1.76 -public: 1.77 - // We require an iterator to be initialized before use, so the 1.78 - // constructor does little. 1.79 + // The Sparse remembered set iterator. 1.80 + SparsePRTIter _sparse_iter; 1.81 + 1.82 + public: 1.83 HeapRegionRemSetIterator(HeapRegionRemSet* hrrs); 1.84 1.85 // If there remains one or more cards to be yielded, returns true and