Skip to content

Commit

Permalink
8330972: Serial: Inline Generation::max_contiguous_available
Browse files Browse the repository at this point in the history
Reviewed-by: ayang
  • Loading branch information
lgxbslgx committed Apr 25, 2024
1 parent 87e864b commit b1b953c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
10 changes: 0 additions & 10 deletions src/hotspot/share/gc/serial/generation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,3 @@ void Generation::print_summary_info_on(outputStream* st) {
sr->invocations,
sr->invocations > 0 ? time / sr->invocations : 0.0);
}

size_t Generation::max_contiguous_available() const {
// The largest number of contiguous free words in this or any higher generation.
size_t avail = contiguous_available();
size_t old_avail = 0;
if (SerialHeap::heap()->is_young_gen(this)) {
old_avail = SerialHeap::heap()->old_gen()->contiguous_available();
}
return MAX2(avail, old_avail);
}
2 changes: 0 additions & 2 deletions src/hotspot/share/gc/serial/generation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ class Generation: public CHeapObj<mtGC> {
// The largest number of contiguous free bytes in the generation,
// including expansion (Assumes called at a safepoint.)
virtual size_t contiguous_available() const = 0;
// The largest number of contiguous free bytes in this or any higher generation.
virtual size_t max_contiguous_available() const;

MemRegion reserved() const { return _reserved; }

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/serial/tenuredGeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ void TenuredGeneration::update_counters() {
}

bool TenuredGeneration::promotion_attempt_is_safe(size_t max_promotion_in_bytes) const {
size_t available = max_contiguous_available();
size_t available = contiguous_available();
size_t av_promo = (size_t)_avg_promoted->padded_average();
bool res = (available >= av_promo) || (available >= max_promotion_in_bytes);

Expand Down

0 comments on commit b1b953c

Please sign in to comment.