hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
changeset 27009 e7e723732b6b
parent 26846 7d4376f8560e
child 27149 9246fc481aa3
equal deleted inserted replaced
27008:10d6c1e39d87 27009:e7e723732b6b
   209   friend class G1ParCleanupCTTask;
   209   friend class G1ParCleanupCTTask;
   210 
   210 
   211   friend class G1FreeHumongousRegionClosure;
   211   friend class G1FreeHumongousRegionClosure;
   212   // Other related classes.
   212   // Other related classes.
   213   friend class G1MarkSweep;
   213   friend class G1MarkSweep;
       
   214   friend class HeapRegionClaimer;
   214 
   215 
   215 private:
   216 private:
   216   // The one and only G1CollectedHeap, so static functions can find it.
   217   // The one and only G1CollectedHeap, so static functions can find it.
   217   static G1CollectedHeap* _g1h;
   218   static G1CollectedHeap* _g1h;
   218 
   219 
  1375   // within the heap.
  1376   // within the heap.
  1376   inline uint addr_to_region(HeapWord* addr) const;
  1377   inline uint addr_to_region(HeapWord* addr) const;
  1377 
  1378 
  1378   inline HeapWord* bottom_addr_for_region(uint index) const;
  1379   inline HeapWord* bottom_addr_for_region(uint index) const;
  1379 
  1380 
  1380   // Divide the heap region sequence into "chunks" of some size (the number
  1381   // Iterate over the heap regions in parallel. Assumes that this will be called
  1381   // of regions divided by the number of parallel threads times some
  1382   // in parallel by ParallelGCThreads worker threads with distinct worker ids
  1382   // overpartition factor, currently 4).  Assumes that this will be called
  1383   // in the range [0..max(ParallelGCThreads-1, 1)]. Applies "blk->doHeapRegion"
  1383   // in parallel by ParallelGCThreads worker threads with distinct worker
  1384   // to each of the regions, by attempting to claim the region using the
  1384   // ids in the range [0..max(ParallelGCThreads-1, 1)], that all parallel
  1385   // HeapRegionClaimer and, if successful, applying the closure to the claimed
  1385   // calls will use the same "claim_value", and that that claim value is
  1386   // region.
  1386   // different from the claim_value of any heap region before the start of
  1387   void heap_region_par_iterate(HeapRegionClosure* cl,
  1387   // the iteration.  Applies "blk->doHeapRegion" to each of the regions, by
  1388                                uint worker_id,
  1388   // attempting to claim the first region in each chunk, and, if
  1389                                HeapRegionClaimer* hrclaimer) const;
  1389   // successful, applying the closure to each region in the chunk (and
       
  1390   // setting the claim value of the second and subsequent regions of the
       
  1391   // chunk.)  For now requires that "doHeapRegion" always returns "false",
       
  1392   // i.e., that a closure never attempt to abort a traversal.
       
  1393   void heap_region_par_iterate_chunked(HeapRegionClosure* cl,
       
  1394                                        uint worker_id,
       
  1395                                        uint num_workers,
       
  1396                                        jint claim_value) const;
       
  1397 
       
  1398   // It resets all the region claim values to the default.
       
  1399   void reset_heap_region_claim_values();
       
  1400 
       
  1401   // Resets the claim values of regions in the current
       
  1402   // collection set to the default.
       
  1403   void reset_cset_heap_region_claim_values();
       
  1404 
       
  1405 #ifdef ASSERT
       
  1406   bool check_heap_region_claim_values(jint claim_value);
       
  1407 
       
  1408   // Same as the routine above but only checks regions in the
       
  1409   // current collection set.
       
  1410   bool check_cset_heap_region_claim_values(jint claim_value);
       
  1411 #endif // ASSERT
       
  1412 
  1390 
  1413   // Clear the cached cset start regions and (more importantly)
  1391   // Clear the cached cset start regions and (more importantly)
  1414   // the time stamps. Called when we reset the GC time stamp.
  1392   // the time stamps. Called when we reset the GC time stamp.
  1415   void clear_cset_start_regions();
  1393   void clear_cset_start_regions();
  1416 
  1394