451
452 ALL_SINCE_SAVE_MARKS_CLOSURES(GCH_SINCE_SAVE_MARKS_ITERATE_DECL)
453
454 #undef GCH_SINCE_SAVE_MARKS_ITERATE_DECL
455
456 // Returns "true" iff no allocations have occurred in any generation at
457 // "level" or above since the last
458 // call to "save_marks".
459 bool no_allocs_since_save_marks(int level);
460
461 // Returns true if an incremental collection is likely to fail.
462 // We optionally consult the young gen, if asked to do so;
463 // otherwise we base our answer on whether the previous incremental
464 // collection attempt failed with no corrective action as of yet.
465 bool incremental_collection_will_fail(bool consult_young) {
466 // Assumes a 2-generation system; the first disjunct remembers if an
467 // incremental collection failed, even when we thought (second disjunct)
468 // that it would not.
469 assert(heap()->collector_policy()->is_two_generation_policy(),
470 "the following definition may not be suitable for an n(>2)-generation system");
471 return incremental_collection_failed() ||
472 (consult_young && !get_gen(0)->collection_attempt_is_safe());
473 }
474
475 // If a generation bails out of an incremental collection,
476 // it sets this flag.
477 bool incremental_collection_failed() const {
478 return _incremental_collection_failed;
479 }
480 void set_incremental_collection_failed() {
481 _incremental_collection_failed = true;
482 }
483 void clear_incremental_collection_failed() {
484 _incremental_collection_failed = false;
485 }
486
487 // Promotion of obj into gen failed. Try to promote obj to higher
488 // gens in ascending order; return the new location of obj if successful.
489 // Otherwise, try expand-and-allocate for obj in each generation starting at
490 // gen; return the new location of obj if successful. Otherwise, return NULL.
491 oop handle_failed_promotion(Generation* gen,
492 oop obj,
|
451
452 ALL_SINCE_SAVE_MARKS_CLOSURES(GCH_SINCE_SAVE_MARKS_ITERATE_DECL)
453
454 #undef GCH_SINCE_SAVE_MARKS_ITERATE_DECL
455
456 // Returns "true" iff no allocations have occurred in any generation at
457 // "level" or above since the last
458 // call to "save_marks".
459 bool no_allocs_since_save_marks(int level);
460
461 // Returns true if an incremental collection is likely to fail.
462 // We optionally consult the young gen, if asked to do so;
463 // otherwise we base our answer on whether the previous incremental
464 // collection attempt failed with no corrective action as of yet.
465 bool incremental_collection_will_fail(bool consult_young) {
466 // Assumes a 2-generation system; the first disjunct remembers if an
467 // incremental collection failed, even when we thought (second disjunct)
468 // that it would not.
469 assert(heap()->collector_policy()->is_two_generation_policy(),
470 "the following definition may not be suitable for an n(>2)-generation system");
471 Generation *gen = get_gen(0);
472 return gen == NULL || incremental_collection_failed() ||
473 (consult_young && !gen->collection_attempt_is_safe());
474 }
475
476 // If a generation bails out of an incremental collection,
477 // it sets this flag.
478 bool incremental_collection_failed() const {
479 return _incremental_collection_failed;
480 }
481 void set_incremental_collection_failed() {
482 _incremental_collection_failed = true;
483 }
484 void clear_incremental_collection_failed() {
485 _incremental_collection_failed = false;
486 }
487
488 // Promotion of obj into gen failed. Try to promote obj to higher
489 // gens in ascending order; return the new location of obj if successful.
490 // Otherwise, try expand-and-allocate for obj in each generation starting at
491 // gen; return the new location of obj if successful. Otherwise, return NULL.
492 oop handle_failed_promotion(Generation* gen,
493 oop obj,
|