src/share/vm/memory/genCollectedHeap.hpp

Print this page
rev 6796 : [mq]: templateOopIterate


 426                          bool only_strong_roots,
 427                          OopsInGenClosure* not_older_gens,
 428                          OopsInGenClosure* older_gens,
 429                          CLDClosure* cld_closure);
 430 
 431   // Apply "root_closure" to all the weak roots of the system.
 432   // These include JNI weak roots, string table,
 433   // and referents of reachable weak refs.
 434   void gen_process_weak_roots(OopClosure* root_closure);
 435 
 436   // Set the saved marks of generations, if that makes sense.
 437   // In particular, if any generation might iterate over the oops
 438   // in other generations, it should call this method.
 439   void save_marks();
 440 
 441   // Apply "cur->do_oop" or "older->do_oop" to all the oops in objects
 442   // allocated since the last call to save_marks in generations at or above
 443   // "level".  The "cur" closure is
 444   // applied to references in the generation at "level", and the "older"
 445   // closure to older generations.
 446 #define GCH_SINCE_SAVE_MARKS_ITERATE_DECL(OopClosureType, nv_suffix)    \
 447   void oop_since_save_marks_iterate(int level,                          \
 448                                     OopClosureType* cur,                \
 449                                     OopClosureType* older);
 450 
 451   ALL_SINCE_SAVE_MARKS_CLOSURES(GCH_SINCE_SAVE_MARKS_ITERATE_DECL)
 452 
 453 #undef GCH_SINCE_SAVE_MARKS_ITERATE_DECL
 454 
 455   // Returns "true" iff no allocations have occurred in any generation at
 456   // "level" or above since the last
 457   // call to "save_marks".
 458   bool no_allocs_since_save_marks(int level);
 459 
 460   // Returns true if an incremental collection is likely to fail.
 461   // We optionally consult the young gen, if asked to do so;
 462   // otherwise we base our answer on whether the previous incremental
 463   // collection attempt failed with no corrective action as of yet.
 464   bool incremental_collection_will_fail(bool consult_young) {
 465     // Assumes a 2-generation system; the first disjunct remembers if an
 466     // incremental collection failed, even when we thought (second disjunct)
 467     // that it would not.
 468     assert(heap()->collector_policy()->is_generation_policy(),
 469            "the following definition may not be suitable for an n(>2)-generation system");
 470     return incremental_collection_failed() ||
 471            (consult_young && !get_gen(0)->collection_attempt_is_safe());
 472   }
 473 




 426                          bool only_strong_roots,
 427                          OopsInGenClosure* not_older_gens,
 428                          OopsInGenClosure* older_gens,
 429                          CLDClosure* cld_closure);
 430 
 431   // Apply "root_closure" to all the weak roots of the system.
 432   // These include JNI weak roots, string table,
 433   // and referents of reachable weak refs.
 434   void gen_process_weak_roots(OopClosure* root_closure);
 435 
 436   // Set the saved marks of generations, if that makes sense.
 437   // In particular, if any generation might iterate over the oops
 438   // in other generations, it should call this method.
 439   void save_marks();
 440 
 441   // Apply "cur->do_oop" or "older->do_oop" to all the oops in objects
 442   // allocated since the last call to save_marks in generations at or above
 443   // "level".  The "cur" closure is
 444   // applied to references in the generation at "level", and the "older"
 445   // closure to older generations.
 446   template <bool nv, typename OopClosureType>
 447   void gch_oop_since_save_marks_iterate(int level,
 448                                     OopClosureType* cur,
 449                                     OopClosureType* older);




 450 
 451   // Returns "true" iff no allocations have occurred in any generation at
 452   // "level" or above since the last
 453   // call to "save_marks".
 454   bool no_allocs_since_save_marks(int level);
 455 
 456   // Returns true if an incremental collection is likely to fail.
 457   // We optionally consult the young gen, if asked to do so;
 458   // otherwise we base our answer on whether the previous incremental
 459   // collection attempt failed with no corrective action as of yet.
 460   bool incremental_collection_will_fail(bool consult_young) {
 461     // Assumes a 2-generation system; the first disjunct remembers if an
 462     // incremental collection failed, even when we thought (second disjunct)
 463     // that it would not.
 464     assert(heap()->collector_policy()->is_generation_policy(),
 465            "the following definition may not be suitable for an n(>2)-generation system");
 466     return incremental_collection_failed() ||
 467            (consult_young && !get_gen(0)->collection_attempt_is_safe());
 468   }
 469