Skip to content

Commit

Permalink
8326975: Parallel: Remove redundant PSOldGen::is_allocated
Browse files Browse the repository at this point in the history
Reviewed-by: gli, tschatzl
  • Loading branch information
albertnetymk committed Feb 29, 2024
1 parent 4302900 commit 8f6edd8
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jint ParallelScavengeHeap::initialize() {
_gc_policy_counters =
new PSGCAdaptivePolicyCounters("ParScav:MSC", 2, 2, _size_policy);

if (!PSParallelCompact::initialize()) {
if (!PSParallelCompact::initialize_aux_data()) {
return JNI_ENOMEM;
}

Expand Down
6 changes: 0 additions & 6 deletions src/hotspot/share/gc/parallel/psOldGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,6 @@ void PSOldGen::initialize_performance_counters(const char* perf_data_name, int l
_object_space, _gen_counters);
}

// Assume that the generation has been allocated if its
// reserved size is not 0.
bool PSOldGen::is_allocated() {
return virtual_space()->reserved_size() != 0;
}

size_t PSOldGen::num_iterable_blocks() const {
return (object_space()->used_in_bytes() + IterateBlockSize - 1) / IterateBlockSize;
}
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/share/gc/parallel/psOldGen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ class PSOldGen : public CHeapObj<mtGC> {
ObjectStartArray* start_array() { return &_start_array; }
PSVirtualSpace* virtual_space() const { return _virtual_space;}

// Has the generation been successfully allocated?
bool is_allocated();

// Size info
size_t capacity_in_bytes() const { return object_space()->capacity_in_bytes(); }
size_t used_in_bytes() const { return object_space()->used_in_bytes(); }
Expand Down
8 changes: 2 additions & 6 deletions src/hotspot/share/gc/parallel/psParallelCompact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,14 +862,10 @@ void PSParallelCompact::post_initialize() {
ParCompactionManager::initialize(mark_bitmap());
}

bool PSParallelCompact::initialize() {
bool PSParallelCompact::initialize_aux_data() {
ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
MemRegion mr = heap->reserved_region();

// Was the old gen get allocated successfully?
if (!heap->old_gen()->is_allocated()) {
return false;
}
assert(mr.byte_size() != 0, "heap should be reserved");

initialize_space_info();
initialize_dead_wood_limiter();
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/parallel/psParallelCompact.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ class PSParallelCompact : AllStatic {
// allocations. This should be called during the VM initialization
// at a pointer where it would be appropriate to return a JNI_ENOMEM
// in the event of a failure.
static bool initialize();
static bool initialize_aux_data();

// Closure accessors
static BoolObjectClosure* is_alive_closure() { return &_is_alive_closure; }
Expand Down

0 comments on commit 8f6edd8

Please sign in to comment.