Skip to content

Commit

Permalink
8323779: Serial: Remove Generation::promotion_attempt_is_safe
Browse files Browse the repository at this point in the history
Reviewed-by: stefank, cjplummer
  • Loading branch information
albertnetymk committed Jan 17, 2024
1 parent 22642ff commit f2a4ed6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 17 deletions.
4 changes: 3 additions & 1 deletion src/hotspot/share/gc/serial/defNewGeneration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include "gc/serial/cSpaceCounters.hpp"
#include "gc/serial/generation.hpp"
#include "gc/serial/tenuredGeneration.hpp"
#include "gc/shared/ageTable.hpp"
#include "gc/shared/copyFailedInfo.hpp"
#include "gc/shared/gc_globals.hpp"
Expand All @@ -52,7 +53,8 @@ class STWGCTimer;
class DefNewGeneration: public Generation {
friend class VMStructs;

Generation* _old_gen;
TenuredGeneration* _old_gen;

uint _tenuring_threshold; // Tenuring threshold for next collection.
AgeTable _age_table;
// Size of object to pretenure in words; command line provides bytes
Expand Down
8 changes: 0 additions & 8 deletions src/hotspot/share/gc/serial/generation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,6 @@ size_t Generation::max_contiguous_available() const {
return MAX2(avail, old_avail);
}

bool Generation::promotion_attempt_is_safe(size_t max_promotion_in_bytes) const {
size_t available = max_contiguous_available();
bool res = (available >= max_promotion_in_bytes);
log_trace(gc)("Generation: promo attempt is%s safe: available(" SIZE_FORMAT ") %s max_promo(" SIZE_FORMAT ")",
res? "":" not", available, res? ">=":"<", max_promotion_in_bytes);
return res;
}

// Ignores "ref" and calls allocate().
oop Generation::promote(oop obj, size_t obj_size) {
assert(obj_size == obj->size(), "bad obj_size passed in");
Expand Down
6 changes: 0 additions & 6 deletions src/hotspot/share/gc/serial/generation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,6 @@ class Generation: public CHeapObj<mtGC> {
// The largest number of contiguous free bytes in this or any higher generation.
virtual size_t max_contiguous_available() const;

// Returns true if promotions of the specified amount are
// likely to succeed without a promotion failure.
// Promotion of the full amount is not guaranteed but
// might be attempted in the worst case.
virtual bool promotion_attempt_is_safe(size_t max_promotion_in_bytes) const;

// Return an estimate of the maximum allocation that could be performed
// in the generation without triggering any collection or expansion
// activity. It is "unsafe" because no locks are taken; the result
Expand Down
6 changes: 5 additions & 1 deletion src/hotspot/share/gc/serial/tenuredGeneration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ class TenuredGeneration: public Generation {

virtual void update_gc_stats(Generation* current_generation, bool full);

virtual bool promotion_attempt_is_safe(size_t max_promoted_in_bytes) const;
// Returns true if promotions of the specified amount are
// likely to succeed without a promotion failure.
// Promotion of the full amount is not guaranteed but
// might be attempted in the worst case.
bool promotion_attempt_is_safe(size_t max_promoted_in_bytes) const;

virtual void verify();
virtual void print_on(outputStream* st) const;
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/serial/vmStructs_serial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
nonstatic_field(TenuredGeneration, _min_heap_delta_bytes, size_t) \
nonstatic_field(TenuredGeneration, _the_space, TenuredSpace*) \
\
nonstatic_field(DefNewGeneration, _old_gen, Generation*) \
nonstatic_field(DefNewGeneration, _old_gen, TenuredGeneration*) \
nonstatic_field(DefNewGeneration, _tenuring_threshold, uint) \
nonstatic_field(DefNewGeneration, _age_table, AgeTable) \
nonstatic_field(DefNewGeneration, _eden_space, ContiguousSpace*) \
Expand Down

1 comment on commit f2a4ed6

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.