src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp

Print this page




1378   // Iteration functions.
1379 
1380   // Iterate over all the ref-containing fields of all objects, calling
1381   // "cl.do_oop" on each.
1382   virtual void oop_iterate(ExtendedOopClosure* cl);
1383 
1384   // Iterate over all objects, calling "cl.do_object" on each.
1385   virtual void object_iterate(ObjectClosure* cl);
1386 
1387   virtual void safe_object_iterate(ObjectClosure* cl) {
1388     object_iterate(cl);
1389   }
1390 
1391   // Iterate over all spaces in use in the heap, in ascending address order.
1392   virtual void space_iterate(SpaceClosure* cl);
1393 
1394   // Iterate over heap regions, in address order, terminating the
1395   // iteration early if the "doHeapRegion" method returns "true".
1396   void heap_region_iterate(HeapRegionClosure* blk) const;
1397 




1398   // Return the region with the given index. It assumes the index is valid.
1399   inline HeapRegion* region_at(uint index) const;
1400 
1401   // Calculate the region index of the given address. Given address must be
1402   // within the heap.
1403   inline uint addr_to_region(HeapWord* addr) const;
1404 
1405   inline HeapWord* bottom_addr_for_region(uint index) const;
1406 
1407   // Divide the heap region sequence into "chunks" of some size (the number
1408   // of regions divided by the number of parallel threads times some
1409   // overpartition factor, currently 4).  Assumes that this will be called
1410   // in parallel by ParallelGCThreads worker threads with distinct worker
1411   // ids in the range [0..max(ParallelGCThreads-1, 1)], that all parallel
1412   // calls will use the same "claim_value", and that that claim value is
1413   // different from the claim_value of any heap region before the start of
1414   // the iteration.  Applies "blk->doHeapRegion" to each of the regions, by
1415   // attempting to claim the first region in each chunk, and, if
1416   // successful, applying the closure to each region in the chunk (and
1417   // setting the claim value of the second and subsequent regions of the




1378   // Iteration functions.
1379 
1380   // Iterate over all the ref-containing fields of all objects, calling
1381   // "cl.do_oop" on each.
1382   virtual void oop_iterate(ExtendedOopClosure* cl);
1383 
1384   // Iterate over all objects, calling "cl.do_object" on each.
1385   virtual void object_iterate(ObjectClosure* cl);
1386 
1387   virtual void safe_object_iterate(ObjectClosure* cl) {
1388     object_iterate(cl);
1389   }
1390 
1391   // Iterate over all spaces in use in the heap, in ascending address order.
1392   virtual void space_iterate(SpaceClosure* cl);
1393 
1394   // Iterate over heap regions, in address order, terminating the
1395   // iteration early if the "doHeapRegion" method returns "true".
1396   void heap_region_iterate(HeapRegionClosure* blk) const;
1397 
1398   // Iterate over heap regions in the interval [start, end), applying the given closure.
1399   // Terminates early if closure "doHeapRegion" returns true.
1400   void heap_region_iterate_range(HeapRegionClosure* cl, uint start, uint end) const;
1401 
1402   // Return the region with the given index. It assumes the index is valid.
1403   inline HeapRegion* region_at(uint index) const;
1404 
1405   // Calculate the region index of the given address. Given address must be
1406   // within the heap.
1407   inline uint addr_to_region(HeapWord* addr) const;
1408 
1409   inline HeapWord* bottom_addr_for_region(uint index) const;
1410 
1411   // Divide the heap region sequence into "chunks" of some size (the number
1412   // of regions divided by the number of parallel threads times some
1413   // overpartition factor, currently 4).  Assumes that this will be called
1414   // in parallel by ParallelGCThreads worker threads with distinct worker
1415   // ids in the range [0..max(ParallelGCThreads-1, 1)], that all parallel
1416   // calls will use the same "claim_value", and that that claim value is
1417   // different from the claim_value of any heap region before the start of
1418   // the iteration.  Applies "blk->doHeapRegion" to each of the regions, by
1419   // attempting to claim the first region in each chunk, and, if
1420   // successful, applying the closure to each region in the chunk (and
1421   // setting the claim value of the second and subsequent regions of the