src/share/vm/memory/cardTableModRefBS.cpp

Print this page




 412   }
 413   // Touch the last card of the covered region to show that it
 414   // is committed (or SEGV).
 415   debug_only((void) (*byte_for(_covered[ind].last()));)
 416   debug_only(verify_guard();)
 417 }
 418 
 419 // Note that these versions are precise!  The scanning code has to handle the
 420 // fact that the write barrier may be either precise or imprecise.
 421 
 422 void CardTableModRefBS::write_ref_field_work(void* field, oop newVal, bool release) {
 423   inline_write_ref_field(field, newVal, release);
 424 }
 425 
 426 
 427 void CardTableModRefBS::non_clean_card_iterate_possibly_parallel(Space* sp,
 428                                                                  MemRegion mr,
 429                                                                  OopsInGenClosure* cl,
 430                                                                  CardTableRS* ct) {
 431   if (!mr.is_empty()) {
 432     // Caller (process_strong_roots()) claims that all GC threads
 433     // execute this call.  With UseDynamicNumberOfGCThreads now all
 434     // active GC threads execute this call.  The number of active GC
 435     // threads needs to be passed to par_non_clean_card_iterate_work()
 436     // to get proper partitioning and termination.
 437     //
 438     // This is an example of where n_par_threads() is used instead
 439     // of workers()->active_workers().  n_par_threads can be set to 0 to
 440     // turn off parallelism.  For example when this code is called as
 441     // part of verification and SharedHeap::process_strong_roots() is being
 442     // used, then n_par_threads() may have been set to 0.  active_workers
 443     // is not overloaded with the meaning that it is a switch to disable
 444     // parallelism and so keeps the meaning of the number of
 445     // active gc workers.  If parallelism has not been shut off by
 446     // setting n_par_threads to 0, then n_par_threads should be
 447     // equal to active_workers.  When a different mechanism for shutting
 448     // off parallelism is used, then active_workers can be used in
 449     // place of n_par_threads.
 450     //  This is an example of a path where n_par_threads is
 451     // set to 0 to turn off parallelism.
 452     //  [7] CardTableModRefBS::non_clean_card_iterate()
 453     //  [8] CardTableRS::younger_refs_in_space_iterate()
 454     //  [9] Generation::younger_refs_in_space_iterate()
 455     //  [10] OneContigSpaceCardGeneration::younger_refs_iterate()
 456     //  [11] CompactingPermGenGen::younger_refs_iterate()
 457     //  [12] CardTableRS::younger_refs_iterate()
 458     //  [13] SharedHeap::process_strong_roots()
 459     //  [14] G1CollectedHeap::verify()
 460     //  [15] Universe::verify()
 461     //  [16] G1CollectedHeap::do_collection_pause_at_safepoint()




 412   }
 413   // Touch the last card of the covered region to show that it
 414   // is committed (or SEGV).
 415   debug_only((void) (*byte_for(_covered[ind].last()));)
 416   debug_only(verify_guard();)
 417 }
 418 
 419 // Note that these versions are precise!  The scanning code has to handle the
 420 // fact that the write barrier may be either precise or imprecise.
 421 
 422 void CardTableModRefBS::write_ref_field_work(void* field, oop newVal, bool release) {
 423   inline_write_ref_field(field, newVal, release);
 424 }
 425 
 426 
 427 void CardTableModRefBS::non_clean_card_iterate_possibly_parallel(Space* sp,
 428                                                                  MemRegion mr,
 429                                                                  OopsInGenClosure* cl,
 430                                                                  CardTableRS* ct) {
 431   if (!mr.is_empty()) {
 432     // Caller (process_roots()) claims that all GC threads
 433     // execute this call.  With UseDynamicNumberOfGCThreads now all
 434     // active GC threads execute this call.  The number of active GC
 435     // threads needs to be passed to par_non_clean_card_iterate_work()
 436     // to get proper partitioning and termination.
 437     //
 438     // This is an example of where n_par_threads() is used instead
 439     // of workers()->active_workers().  n_par_threads can be set to 0 to
 440     // turn off parallelism.  For example when this code is called as
 441     // part of verification and SharedHeap::process_roots() is being
 442     // used, then n_par_threads() may have been set to 0.  active_workers
 443     // is not overloaded with the meaning that it is a switch to disable
 444     // parallelism and so keeps the meaning of the number of
 445     // active gc workers.  If parallelism has not been shut off by
 446     // setting n_par_threads to 0, then n_par_threads should be
 447     // equal to active_workers.  When a different mechanism for shutting
 448     // off parallelism is used, then active_workers can be used in
 449     // place of n_par_threads.
 450     //  This is an example of a path where n_par_threads is
 451     // set to 0 to turn off parallelism.
 452     //  [7] CardTableModRefBS::non_clean_card_iterate()
 453     //  [8] CardTableRS::younger_refs_in_space_iterate()
 454     //  [9] Generation::younger_refs_in_space_iterate()
 455     //  [10] OneContigSpaceCardGeneration::younger_refs_iterate()
 456     //  [11] CompactingPermGenGen::younger_refs_iterate()
 457     //  [12] CardTableRS::younger_refs_iterate()
 458     //  [13] SharedHeap::process_strong_roots()
 459     //  [14] G1CollectedHeap::verify()
 460     //  [15] Universe::verify()
 461     //  [16] G1CollectedHeap::do_collection_pause_at_safepoint()