src/hotspot/share/gc/g1/g1CollectedHeap.hpp
changeset 47885 5caa1d5f74c1
parent 47790 4925ee84b4ac
child 48100 ab188c22d4b6
equal deleted inserted replaced
47884:3cfab71d6c81 47885:5caa1d5f74c1
  1044   G1NewTracer* gc_tracer_stw() const { return _gc_tracer_stw; }
  1044   G1NewTracer* gc_tracer_stw() const { return _gc_tracer_stw; }
  1045 
  1045 
  1046   // The Concurrent Marking reference processor...
  1046   // The Concurrent Marking reference processor...
  1047   ReferenceProcessor* ref_processor_cm() const { return _ref_processor_cm; }
  1047   ReferenceProcessor* ref_processor_cm() const { return _ref_processor_cm; }
  1048 
  1048 
       
  1049   size_t unused_committed_regions_in_bytes() const;
  1049   virtual size_t capacity() const;
  1050   virtual size_t capacity() const;
  1050   virtual size_t used() const;
  1051   virtual size_t used() const;
  1051   // This should be called when we're not holding the heap lock. The
  1052   // This should be called when we're not holding the heap lock. The
  1052   // result might be a bit inaccurate.
  1053   // result might be a bit inaccurate.
  1053   size_t used_unlocked() const;
  1054   size_t used_unlocked() const;
  1179 
  1180 
  1180   G1SATBCardTableLoggingModRefBS* g1_barrier_set() {
  1181   G1SATBCardTableLoggingModRefBS* g1_barrier_set() {
  1181     return barrier_set_cast<G1SATBCardTableLoggingModRefBS>(barrier_set());
  1182     return barrier_set_cast<G1SATBCardTableLoggingModRefBS>(barrier_set());
  1182   }
  1183   }
  1183 
  1184 
       
  1185   G1HotCardCache* g1_hot_card_cache() const { return _hot_card_cache; }
       
  1186 
  1184   // Iteration functions.
  1187   // Iteration functions.
  1185 
  1188 
  1186   // Iterate over all objects, calling "cl.do_object" on each.
  1189   // Iterate over all objects, calling "cl.do_object" on each.
  1187   virtual void object_iterate(ObjectClosure* cl);
  1190   virtual void object_iterate(ObjectClosure* cl);
  1188 
  1191 
  1205   // within the heap.
  1208   // within the heap.
  1206   inline uint addr_to_region(HeapWord* addr) const;
  1209   inline uint addr_to_region(HeapWord* addr) const;
  1207 
  1210 
  1208   inline HeapWord* bottom_addr_for_region(uint index) const;
  1211   inline HeapWord* bottom_addr_for_region(uint index) const;
  1209 
  1212 
  1210   // Iterate over the heap regions in parallel. Assumes that this will be called
  1213   // Two functions to iterate over the heap regions in parallel. Threads
  1211   // in parallel by a number of worker threads with distinct worker ids
  1214   // compete using the HeapRegionClaimer to claim the regions before
  1212   // in the range passed to the HeapRegionClaimer. Applies "blk->doHeapRegion"
  1215   // applying the closure on them.
  1213   // to each of the regions, by attempting to claim the region using the
  1216   // The _from_worker_offset version uses the HeapRegionClaimer and
  1214   // HeapRegionClaimer and, if successful, applying the closure to the claimed
  1217   // the worker id to calculate a start offset to prevent all workers to
  1215   // region.
  1218   // start from the point.
  1216   void heap_region_par_iterate(HeapRegionClosure* cl,
  1219   void heap_region_par_iterate_from_worker_offset(HeapRegionClosure* cl,
  1217                                uint worker_id,
  1220                                                   HeapRegionClaimer* hrclaimer,
  1218                                HeapRegionClaimer* hrclaimer) const;
  1221                                                   uint worker_id) const;
       
  1222 
       
  1223   void heap_region_par_iterate_from_start(HeapRegionClosure* cl,
       
  1224                                           HeapRegionClaimer* hrclaimer) const;
  1219 
  1225 
  1220   // Iterate over the regions (if any) in the current collection set.
  1226   // Iterate over the regions (if any) in the current collection set.
  1221   void collection_set_iterate(HeapRegionClosure* blk);
  1227   void collection_set_iterate(HeapRegionClosure* blk);
  1222 
  1228 
  1223   // Iterate over the regions (if any) in the current collection set. Starts the
  1229   // Iterate over the regions (if any) in the current collection set. Starts the
  1224   // iteration over the entire collection set so that the start regions of a given
  1230   // iteration over the entire collection set so that the start regions of a given
  1225   // worker id over the set active_workers are evenly spread across the set of
  1231   // worker id over the set active_workers are evenly spread across the set of
  1226   // collection set regions.
  1232   // collection set regions.
  1227   void collection_set_iterate_from(HeapRegionClosure *blk, uint worker_id);
  1233   void collection_set_iterate_from(HeapRegionClosure *blk, uint worker_id);
  1228 
       
  1229   HeapRegion* next_compaction_region(const HeapRegion* from) const;
       
  1230 
  1234 
  1231   // Returns the HeapRegion that contains addr. addr must not be NULL.
  1235   // Returns the HeapRegion that contains addr. addr must not be NULL.
  1232   template <class T>
  1236   template <class T>
  1233   inline HeapRegion* heap_region_containing(const T addr) const;
  1237   inline HeapRegion* heap_region_containing(const T addr) const;
  1234 
  1238 
  1389 
  1393 
  1390   inline bool is_obj_dead(const oop obj) const;
  1394   inline bool is_obj_dead(const oop obj) const;
  1391 
  1395 
  1392   inline bool is_obj_ill(const oop obj) const;
  1396   inline bool is_obj_ill(const oop obj) const;
  1393 
  1397 
       
  1398   inline bool is_obj_dead_full(const oop obj, const HeapRegion* hr) const;
       
  1399   inline bool is_obj_dead_full(const oop obj) const;
       
  1400 
  1394   G1ConcurrentMark* concurrent_mark() const { return _cm; }
  1401   G1ConcurrentMark* concurrent_mark() const { return _cm; }
  1395 
  1402 
  1396   // Refinement
  1403   // Refinement
  1397 
  1404 
  1398   G1ConcurrentRefine* concurrent_refine() const { return _cr; }
  1405   G1ConcurrentRefine* concurrent_refine() const { return _cr; }
  1433   // Perform any cleanup actions necessary before allowing a verification.
  1440   // Perform any cleanup actions necessary before allowing a verification.
  1434   virtual void prepare_for_verify();
  1441   virtual void prepare_for_verify();
  1435 
  1442 
  1436   // Perform verification.
  1443   // Perform verification.
  1437 
  1444 
  1438   // vo == UsePrevMarking  -> use "prev" marking information,
  1445   // vo == UsePrevMarking -> use "prev" marking information,
  1439   // vo == UseNextMarking -> use "next" marking information
  1446   // vo == UseNextMarking -> use "next" marking information
  1440   // vo == UseMarkWord    -> use the mark word in the object header
  1447   // vo == UseFullMarking -> use "next" marking bitmap but no TAMS
  1441   //
  1448   //
  1442   // NOTE: Only the "prev" marking information is guaranteed to be
  1449   // NOTE: Only the "prev" marking information is guaranteed to be
  1443   // consistent most of the time, so most calls to this should use
  1450   // consistent most of the time, so most calls to this should use
  1444   // vo == UsePrevMarking.
  1451   // vo == UsePrevMarking.
  1445   // Currently, there is only one case where this is called with
  1452   // Currently, there is only one case where this is called with
  1446   // vo == UseNextMarking, which is to verify the "next" marking
  1453   // vo == UseNextMarking, which is to verify the "next" marking
  1447   // information at the end of remark.
  1454   // information at the end of remark.
  1448   // Currently there is only one place where this is called with
  1455   // Currently there is only one place where this is called with
  1449   // vo == UseMarkWord, which is to verify the marking during a
  1456   // vo == UseFullMarking, which is to verify the marking during a
  1450   // full GC.
  1457   // full GC.
  1451   void verify(VerifyOption vo);
  1458   void verify(VerifyOption vo);
  1452 
  1459 
  1453   // WhiteBox testing support.
  1460   // WhiteBox testing support.
  1454   virtual bool supports_concurrent_phase_control() const;
  1461   virtual bool supports_concurrent_phase_control() const;