diff --git a/src/hotspot/share/gc/serial/defNewGeneration.hpp b/src/hotspot/share/gc/serial/defNewGeneration.hpp index 8203c625183..2bacd94bb6a 100644 --- a/src/hotspot/share/gc/serial/defNewGeneration.hpp +++ b/src/hotspot/share/gc/serial/defNewGeneration.hpp @@ -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" @@ -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 diff --git a/src/hotspot/share/gc/serial/generation.cpp b/src/hotspot/share/gc/serial/generation.cpp index 302f8f231e7..86fc3300e30 100644 --- a/src/hotspot/share/gc/serial/generation.cpp +++ b/src/hotspot/share/gc/serial/generation.cpp @@ -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"); diff --git a/src/hotspot/share/gc/serial/generation.hpp b/src/hotspot/share/gc/serial/generation.hpp index bba9ac810c2..70df097a574 100644 --- a/src/hotspot/share/gc/serial/generation.hpp +++ b/src/hotspot/share/gc/serial/generation.hpp @@ -122,12 +122,6 @@ class Generation: public CHeapObj { // 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 diff --git a/src/hotspot/share/gc/serial/tenuredGeneration.hpp b/src/hotspot/share/gc/serial/tenuredGeneration.hpp index 7c0cd2ffd7b..2a1ae18b541 100644 --- a/src/hotspot/share/gc/serial/tenuredGeneration.hpp +++ b/src/hotspot/share/gc/serial/tenuredGeneration.hpp @@ -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; diff --git a/src/hotspot/share/gc/serial/vmStructs_serial.hpp b/src/hotspot/share/gc/serial/vmStructs_serial.hpp index 4c2e4417a30..f4941401314 100644 --- a/src/hotspot/share/gc/serial/vmStructs_serial.hpp +++ b/src/hotspot/share/gc/serial/vmStructs_serial.hpp @@ -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*) \