8325053: Serial: Move Generation::save_used_region to TenuredGeneration

Reviewed-by: stefank, ehelin
This commit is contained in:
Albert Mingkun Yang 2024-02-01 11:00:09 +00:00
parent d9331bfd49
commit cd11059f10
5 changed files with 7 additions and 20 deletions

View File

@ -441,10 +441,9 @@ void GenMarkSweep::invoke_at_safepoint(bool clear_all_softrefs) {
// Increment the invocation count
_total_invocations++;
// Capture used regions for each generation that will be
// subject to collection, so that card table adjustments can
// be made intelligently (see clear / invalidate further below).
gch->save_used_regions();
// Capture used regions for old-gen to reestablish old-to-young invariant
// after full-gc.
gch->old_gen()->save_used_region();
allocate_stacks();

View File

@ -58,9 +58,6 @@ class GCStats;
class Generation: public CHeapObj<mtGC> {
friend class VMStructs;
private:
MemRegion _prev_used_region; // for collectors that want to "remember" a value for
// used region at some specific point during collection.
GCMemoryManager* _gc_manager;
protected:
@ -120,9 +117,6 @@ class Generation: public CHeapObj<mtGC> {
// generation.
virtual MemRegion used_region() const { return _reserved; }
MemRegion prev_used_region() const { return _prev_used_region; }
virtual void save_used_region() { _prev_used_region = used_region(); }
/* Returns "TRUE" iff "p" points into the reserved area of the generation. */
bool is_in_reserved(const void* p) const {
return _reserved.contains(p);

View File

@ -294,11 +294,6 @@ size_t SerialHeap::used() const {
return _young_gen->used() + _old_gen->used();
}
void SerialHeap::save_used_regions() {
_old_gen->save_used_region();
_young_gen->save_used_region();
}
size_t SerialHeap::max_capacity() const {
return _young_gen->max_capacity() + _old_gen->max_capacity();
}

View File

@ -162,9 +162,6 @@ public:
size_t capacity() const override;
size_t used() const override;
// Save the "used_region" for both generations.
void save_used_regions();
size_t max_capacity() const override;
HeapWord* mem_allocate(size_t size, bool* gc_overhead_limit_was_exceeded) override;

View File

@ -45,7 +45,7 @@ class TenuredGeneration: public Generation {
// Abstractly, this is a subtype that gets access to protected fields.
friend class VM_PopulateDumpSharedSpace;
protected:
MemRegion _prev_used_region;
// This is shared with other generations.
CardTableRS* _rs;
@ -70,7 +70,6 @@ class TenuredGeneration: public Generation {
GenerationCounters* _gen_counters;
CSpaceCounters* _space_counters;
// Attempt to expand the generation by "bytes". Expand by at a
// minimum "expand_bytes". Return true if some amount (not
// necessarily the full "bytes") was done.
@ -95,6 +94,9 @@ class TenuredGeneration: public Generation {
size_t free() const;
MemRegion used_region() const;
MemRegion prev_used_region() const { return _prev_used_region; }
void save_used_region() { _prev_used_region = used_region(); }
void space_iterate(SpaceClosure* blk, bool usedOnly = false);
void younger_refs_iterate(OopIterateClosure* blk);