< prev index next >

src/share/vm/gc/shared/referenceProcessor.hpp

Print this page




 314                       BoolObjectClosure* is_alive,
 315                       OopClosure*        keep_alive,
 316                       VoidClosure*       complete_gc);
 317 
 318   // Enqueue references with a certain reachability level
 319   void enqueue_discovered_reflist(DiscoveredList& refs_list, HeapWord* pending_list_addr);
 320 
 321   // "Preclean" all the discovered reference lists
 322   // by removing references with strongly reachable referents.
 323   // The first argument is a predicate on an oop that indicates
 324   // its (strong) reachability and the second is a closure that
 325   // may be used to incrementalize or abort the precleaning process.
 326   // The caller is responsible for taking care of potential
 327   // interference with concurrent operations on these lists
 328   // (or predicates involved) by other threads. Currently
 329   // only used by the CMS collector.
 330   void preclean_discovered_references(BoolObjectClosure* is_alive,
 331                                       OopClosure*        keep_alive,
 332                                       VoidClosure*       complete_gc,
 333                                       YieldClosure*      yield,
 334                                       GCTimer*           gc_timer,
 335                                       GCId               gc_id);
 336 
 337   // Returns the name of the discovered reference list
 338   // occupying the i / _num_q slot.
 339   const char* list_name(uint i);
 340 
 341   void enqueue_discovered_reflists(HeapWord* pending_list_addr, AbstractRefProcTaskExecutor* task_executor);
 342 
 343  protected:
 344   // "Preclean" the given discovered reference list
 345   // by removing references with strongly reachable referents.
 346   // Currently used in support of CMS only.
 347   void preclean_discovered_reflist(DiscoveredList&    refs_list,
 348                                    BoolObjectClosure* is_alive,
 349                                    OopClosure*        keep_alive,
 350                                    VoidClosure*       complete_gc,
 351                                    YieldClosure*      yield);
 352 
 353   // round-robin mod _num_q (not: _not_ mode _max_num_q)
 354   uint next_id() {
 355     uint id = _next_id;


 424   // whether all enqueueing of weak references is complete
 425   bool enqueuing_is_done()  { return _enqueuing_is_done; }
 426   void set_enqueuing_is_done(bool v) { _enqueuing_is_done = v; }
 427 
 428   // iterate over oops
 429   void weak_oops_do(OopClosure* f);       // weak roots
 430 
 431   // Balance each of the discovered lists.
 432   void balance_all_queues();
 433   void verify_list(DiscoveredList& ref_list);
 434 
 435   // Discover a Reference object, using appropriate discovery criteria
 436   bool discover_reference(oop obj, ReferenceType rt);
 437 
 438   // Process references found during GC (called by the garbage collector)
 439   ReferenceProcessorStats
 440   process_discovered_references(BoolObjectClosure*           is_alive,
 441                                 OopClosure*                  keep_alive,
 442                                 VoidClosure*                 complete_gc,
 443                                 AbstractRefProcTaskExecutor* task_executor,
 444                                 GCTimer *gc_timer,
 445                                 GCId    gc_id);
 446 
 447   // Enqueue references at end of GC (called by the garbage collector)
 448   bool enqueue_discovered_references(AbstractRefProcTaskExecutor* task_executor = NULL);
 449 
 450   // If a discovery is in process that is being superceded, abandon it: all
 451   // the discovered lists will be empty, and all the objects on them will
 452   // have NULL discovered fields.  Must be called only at a safepoint.
 453   void abandon_partial_discovery();
 454 
 455   // debugging
 456   void verify_no_references_recorded() PRODUCT_RETURN;
 457   void verify_referent(oop obj)        PRODUCT_RETURN;
 458 };
 459 
 460 // A utility class to disable reference discovery in
 461 // the scope which contains it, for given ReferenceProcessor.
 462 class NoRefDiscovery: StackObj {
 463  private:
 464   ReferenceProcessor* _rp;
 465   bool _was_discovering_refs;




 314                       BoolObjectClosure* is_alive,
 315                       OopClosure*        keep_alive,
 316                       VoidClosure*       complete_gc);
 317 
 318   // Enqueue references with a certain reachability level
 319   void enqueue_discovered_reflist(DiscoveredList& refs_list, HeapWord* pending_list_addr);
 320 
 321   // "Preclean" all the discovered reference lists
 322   // by removing references with strongly reachable referents.
 323   // The first argument is a predicate on an oop that indicates
 324   // its (strong) reachability and the second is a closure that
 325   // may be used to incrementalize or abort the precleaning process.
 326   // The caller is responsible for taking care of potential
 327   // interference with concurrent operations on these lists
 328   // (or predicates involved) by other threads. Currently
 329   // only used by the CMS collector.
 330   void preclean_discovered_references(BoolObjectClosure* is_alive,
 331                                       OopClosure*        keep_alive,
 332                                       VoidClosure*       complete_gc,
 333                                       YieldClosure*      yield,
 334                                       GCTimer*           gc_timer);

 335 
 336   // Returns the name of the discovered reference list
 337   // occupying the i / _num_q slot.
 338   const char* list_name(uint i);
 339 
 340   void enqueue_discovered_reflists(HeapWord* pending_list_addr, AbstractRefProcTaskExecutor* task_executor);
 341 
 342  protected:
 343   // "Preclean" the given discovered reference list
 344   // by removing references with strongly reachable referents.
 345   // Currently used in support of CMS only.
 346   void preclean_discovered_reflist(DiscoveredList&    refs_list,
 347                                    BoolObjectClosure* is_alive,
 348                                    OopClosure*        keep_alive,
 349                                    VoidClosure*       complete_gc,
 350                                    YieldClosure*      yield);
 351 
 352   // round-robin mod _num_q (not: _not_ mode _max_num_q)
 353   uint next_id() {
 354     uint id = _next_id;


 423   // whether all enqueueing of weak references is complete
 424   bool enqueuing_is_done()  { return _enqueuing_is_done; }
 425   void set_enqueuing_is_done(bool v) { _enqueuing_is_done = v; }
 426 
 427   // iterate over oops
 428   void weak_oops_do(OopClosure* f);       // weak roots
 429 
 430   // Balance each of the discovered lists.
 431   void balance_all_queues();
 432   void verify_list(DiscoveredList& ref_list);
 433 
 434   // Discover a Reference object, using appropriate discovery criteria
 435   bool discover_reference(oop obj, ReferenceType rt);
 436 
 437   // Process references found during GC (called by the garbage collector)
 438   ReferenceProcessorStats
 439   process_discovered_references(BoolObjectClosure*           is_alive,
 440                                 OopClosure*                  keep_alive,
 441                                 VoidClosure*                 complete_gc,
 442                                 AbstractRefProcTaskExecutor* task_executor,
 443                                 GCTimer *gc_timer);

 444 
 445   // Enqueue references at end of GC (called by the garbage collector)
 446   bool enqueue_discovered_references(AbstractRefProcTaskExecutor* task_executor = NULL);
 447 
 448   // If a discovery is in process that is being superceded, abandon it: all
 449   // the discovered lists will be empty, and all the objects on them will
 450   // have NULL discovered fields.  Must be called only at a safepoint.
 451   void abandon_partial_discovery();
 452 
 453   // debugging
 454   void verify_no_references_recorded() PRODUCT_RETURN;
 455   void verify_referent(oop obj)        PRODUCT_RETURN;
 456 };
 457 
 458 // A utility class to disable reference discovery in
 459 // the scope which contains it, for given ReferenceProcessor.
 460 class NoRefDiscovery: StackObj {
 461  private:
 462   ReferenceProcessor* _rp;
 463   bool _was_discovering_refs;


< prev index next >