diff src/share/vm/gc_implementation/g1/g1RemSet.cpp @ 10182:5c93c1f61226

8011724: G1: Stack allocate instances of HeapRegionRemSetIterator Summary: Stack allocate instances of HeapRegionRemSetIterator during RSet scanning. Reviewed-by: brutisso, jwilhelm
author johnc
date Thu, 18 Apr 2013 10:09:23 -0700
parents da91efe96a93
children 194f52aa2f23
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/g1RemSet.cpp	Tue Apr 23 08:39:55 2013 +0200
+++ b/src/share/vm/gc_implementation/g1/g1RemSet.cpp	Thu Apr 18 10:09:23 2013 -0700
@@ -169,14 +169,13 @@
     //   _try_claimed || r->claim_iter()
     // is true: either we're supposed to work on claimed-but-not-complete
     // regions, or we successfully claimed the region.
-    HeapRegionRemSetIterator* iter = _g1h->rem_set_iterator(_worker_i);
-    hrrs->init_iterator(iter);
+    HeapRegionRemSetIterator iter(hrrs);
     size_t card_index;
 
     // We claim cards in block so as to recude the contention. The block size is determined by
     // the G1RSetScanBlockSize parameter.
     size_t jump_to_card = hrrs->iter_claimed_next(_block_size);
-    for (size_t current_card = 0; iter->has_next(card_index); current_card++) {
+    for (size_t current_card = 0; iter.has_next(card_index); current_card++) {
       if (current_card >= jump_to_card + _block_size) {
         jump_to_card = hrrs->iter_claimed_next(_block_size);
       }