@@ -101,7 +101,7 @@ void ShenandoahHeuristics::choose_collection_set(ShenandoahCollectionSet* collec
101
101
bool is_generational = heap->mode ()->is_generational ();
102
102
103
103
assert (collection_set->count () == 0 , " Must be empty" );
104
- assert (_generation->generation_mode () != OLD , " Old GC invokes ShenandoahOldHeuristics::choose_collection_set()" );
104
+ assert (! _generation->is_old () , " Old GC invokes ShenandoahOldHeuristics::choose_collection_set()" );
105
105
106
106
// Check all pinned regions have updated status before choosing the collection set.
107
107
heap->assert_pinned_region_status ();
@@ -141,7 +141,7 @@ void ShenandoahHeuristics::choose_collection_set(ShenandoahCollectionSet* collec
141
141
immediate_garbage += garbage;
142
142
region->make_trash_immediate ();
143
143
} else {
144
- assert ( _generation->generation_mode () != OLD , " OLD is handled elsewhere" );
144
+ assert (! _generation->is_old () , " OLD is handled elsewhere" );
145
145
live_memory += region->get_live_data_bytes ();
146
146
// This is our candidate for later consideration.
147
147
candidates[cand_idx]._region = region;
@@ -369,15 +369,12 @@ double ShenandoahHeuristics::elapsed_cycle_time() const {
369
369
}
370
370
371
371
bool ShenandoahHeuristics::in_generation (ShenandoahHeapRegion* region) {
372
- return (( _generation->generation_mode () == GLOBAL )
373
- || (_generation->generation_mode () == YOUNG && region->affiliation () == YOUNG_GENERATION )
374
- || (_generation->generation_mode () == OLD && region->affiliation () == OLD_GENERATION ));
372
+ return _generation->is_global ( )
373
+ || (_generation->is_young () && region->is_young () )
374
+ || (_generation->is_old () && region->is_old ( ));
375
375
}
376
376
377
377
size_t ShenandoahHeuristics::min_free_threshold () {
378
- size_t min_free_threshold =
379
- _generation->generation_mode () == GenerationMode::OLD
380
- ? ShenandoahOldMinFreeThreshold
381
- : ShenandoahMinFreeThreshold;
378
+ size_t min_free_threshold = _generation->is_old () ? ShenandoahOldMinFreeThreshold : ShenandoahMinFreeThreshold;
382
379
return _generation->soft_max_capacity () / 100 * min_free_threshold;
383
380
}
0 commit comments