< prev index next >

src/share/vm/gc/shenandoah/shenandoahPartialGC.cpp

Print this page
rev 14452 : [mq]: onebitmap.patch


 142     }
 143     return false;
 144   }
 145 };
 146 
 147 class ShenandoahPartialCollectionCleanupTask : public AbstractGangTask {
 148 private:
 149   ShenandoahHeap* _heap;
 150 public:
 151   ShenandoahPartialCollectionCleanupTask() :
 152           AbstractGangTask("Shenandoah Partial Collection Cleanup"),
 153           _heap(ShenandoahHeap::heap()) {
 154     _heap->collection_set()->clear_current_index();
 155   }
 156 
 157   void work(uint worker_id) {
 158     ShenandoahCollectionSet* cset = _heap->collection_set();
 159     ShenandoahHeapRegion* r = cset->claim_next();
 160     while (r != NULL) {
 161       HeapWord* bottom = r->bottom();
 162       HeapWord* top = _heap->complete_top_at_mark_start(r->bottom());
 163       if (top > bottom) {
 164         _heap->complete_mark_bit_map()->clear_range_large(MemRegion(bottom, top));
 165       }
 166       r = cset->claim_next();
 167     }
 168   }
 169 
 170 };
 171 
 172 ShenandoahPartialGC::ShenandoahPartialGC(ShenandoahHeap* heap, size_t num_regions) :
 173   _heap(heap),
 174   _matrix(heap->connection_matrix()),
 175   _root_regions(new ShenandoahHeapRegionSet(num_regions)),
 176   _task_queues(new ShenandoahObjToScanQueueSet(heap->max_workers())) {
 177 
 178   assert(_matrix != NULL, "need matrix");
 179 
 180   uint num_queues = heap->max_workers();
 181   for (uint i = 0; i < num_queues; ++i) {
 182     ShenandoahObjToScanQueue* task_queue = new ShenandoahObjToScanQueue();
 183     task_queue->initialize();
 184     _task_queues->register_queue(i, task_queue);




 142     }
 143     return false;
 144   }
 145 };
 146 
 147 class ShenandoahPartialCollectionCleanupTask : public AbstractGangTask {
 148 private:
 149   ShenandoahHeap* _heap;
 150 public:
 151   ShenandoahPartialCollectionCleanupTask() :
 152           AbstractGangTask("Shenandoah Partial Collection Cleanup"),
 153           _heap(ShenandoahHeap::heap()) {
 154     _heap->collection_set()->clear_current_index();
 155   }
 156 
 157   void work(uint worker_id) {
 158     ShenandoahCollectionSet* cset = _heap->collection_set();
 159     ShenandoahHeapRegion* r = cset->claim_next();
 160     while (r != NULL) {
 161       HeapWord* bottom = r->bottom();
 162       HeapWord* top = _heap->top_at_mark_start(r->bottom());
 163       if (top > bottom) {
 164         _heap->mark_bit_map()->clear_range_large(MemRegion(bottom, top));
 165       }
 166       r = cset->claim_next();
 167     }
 168   }
 169 
 170 };
 171 
 172 ShenandoahPartialGC::ShenandoahPartialGC(ShenandoahHeap* heap, size_t num_regions) :
 173   _heap(heap),
 174   _matrix(heap->connection_matrix()),
 175   _root_regions(new ShenandoahHeapRegionSet(num_regions)),
 176   _task_queues(new ShenandoahObjToScanQueueSet(heap->max_workers())) {
 177 
 178   assert(_matrix != NULL, "need matrix");
 179 
 180   uint num_queues = heap->max_workers();
 181   for (uint i = 0; i < num_queues; ++i) {
 182     ShenandoahObjToScanQueue* task_queue = new ShenandoahObjToScanQueue();
 183     task_queue->initialize();
 184     _task_queues->register_queue(i, task_queue);


< prev index next >