8326975: Parallel: Remove redundant PSOldGen::is_allocated

Reviewed-by: gli, tschatzl
This commit is contained in:
Albert Mingkun Yang 2024-02-29 14:36:44 +00:00
parent 430290066c
commit 8f6edd8dc8
5 changed files with 4 additions and 17 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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(); }

View File

@ -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();

View File

@ -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; }