< prev index next >

src/hotspot/share/gc/g1/g1ParScanThreadState.cpp

Print this page
rev 49680 : imported patch 6672778-partial-queue-trimming
rev 49681 : imported patch 6672778-refactoring
rev 49682 : [mq]: 6672778-stefanj-review

@@ -43,19 +43,16 @@
     _dcq(&g1h->dirty_card_queue_set()),
     _ct(g1h->card_table()),
     _closures(NULL),
     _plab_allocator(NULL),
     _age_table(false),
-//  _dest
     _tenuring_threshold(g1h->g1_policy()->tenuring_threshold()),
     _scanner(g1h, this),
     _hash_seed(17),
     _worker_id(worker_id),
     _stack_drain_upper_threshold(GCDrainStackTargetSize * 2 + 1),
     _stack_drain_lower_threshold(GCDrainStackTargetSize),
-//    _surviving_young_words(NULL),
-//    _surviving_young_words_base(NULL),
     _trim_ticks(),
     _old_gen_is_full(false)
 {
   // we allocate G1YoungSurvRateNumRegions plus one entries, since
   // we "sacrifice" entry 0 to keep track of surviving bytes for

@@ -143,20 +140,12 @@
 #endif // ASSERT
 
 void G1ParScanThreadState::trim_queue() {
   StarTask ref;
   do {
-    // Drain the overflow stack first, so other threads can steal.
-    while (_refs->pop_overflow(ref)) {
-      if (!_refs->try_push_to_taskqueue(ref)) {
-        dispatch_reference(ref);
-      }
-    }
-
-    while (_refs->pop_local(ref)) {
-      dispatch_reference(ref);
-    }
+    // Fully drain the queue.
+    trim_queue_to_threshold(0);
   } while (!_refs->is_empty());
 }
 
 HeapWord* G1ParScanThreadState::allocate_in_next_plab(InCSetState const state,
                                                       InCSetState* dest,
< prev index next >