Skip to content

Commit 4ec1ae1

Browse files
author
Thomas Schatzl
committedJul 5, 2024
8331385: G1: Prefix HeapRegion helper classes with G1
Reviewed-by: ayang, dholmes
1 parent b9d8056 commit 4ec1ae1

File tree

66 files changed

+576
-578
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+576
-578
lines changed
 

‎src/hotspot/share/gc/g1/g1Arguments.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2017, Red Hat, Inc. and/or its affiliates.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -125,15 +125,13 @@ void G1Arguments::initialize_mark_stack_size() {
125125
MAX2(MarkStackSize, (size_t)ConcGCThreads * TASKQUEUE_SIZE));
126126
FLAG_SET_ERGO(MarkStackSize, mark_stack_size);
127127
}
128-
129128
}
130129

131-
132130
void G1Arguments::initialize_card_set_configuration() {
133131
assert(G1HeapRegion::LogOfHRGrainBytes != 0, "not initialized");
134132
// Array of Cards card set container globals.
135133
const uint LOG_M = 20;
136-
assert(log2i_exact(HeapRegionBounds::min_size()) == LOG_M, "inv");
134+
assert(log2i_exact(G1HeapRegionBounds::min_size()) == LOG_M, "inv");
137135
assert(G1HeapRegion::LogOfHRGrainBytes >= LOG_M, "from the above");
138136
uint region_size_log_mb = G1HeapRegion::LogOfHRGrainBytes - LOG_M;
139137

‎src/hotspot/share/gc/g1/g1CollectedHeap.cpp

+47-47
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ size_t G1CollectedHeap::_humongous_object_threshold_in_words = 0;
129129
// is done by clients of this interface.)
130130

131131
void G1RegionMappingChangedListener::reset_from_card_cache(uint start_idx, size_t num_regions) {
132-
HeapRegionRemSet::invalidate_from_card_cache(start_idx, num_regions);
132+
G1HeapRegionRemSet::invalidate_from_card_cache(start_idx, num_regions);
133133
}
134134

135135
void G1RegionMappingChangedListener::on_commit(uint start_idx, size_t num_regions, bool zero_filled) {
@@ -162,7 +162,7 @@ G1HeapRegion* G1CollectedHeap::new_heap_region(uint hrs_index,
162162
// Private methods.
163163

164164
G1HeapRegion* G1CollectedHeap::new_region(size_t word_size,
165-
HeapRegionType type,
165+
G1HeapRegionType type,
166166
bool do_expand,
167167
uint node_index) {
168168
assert(!is_humongous(word_size) || word_size <= G1HeapRegion::GrainWords,
@@ -710,7 +710,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_at_safepoint(size_t word_size,
710710
ShouldNotReachHere();
711711
}
712712

713-
class PostCompactionPrinterClosure: public HeapRegionClosure {
713+
class PostCompactionPrinterClosure: public G1HeapRegionClosure {
714714
public:
715715
bool do_heap_region(G1HeapRegion* hr) {
716716
assert(!hr->is_young(), "not expecting to find young regions");
@@ -1070,7 +1070,7 @@ void G1CollectedHeap::shrink(size_t shrink_bytes) {
10701070
_verifier->verify_region_sets_optional();
10711071
}
10721072

1073-
class OldRegionSetChecker : public HeapRegionSetChecker {
1073+
class OldRegionSetChecker : public G1HeapRegionSetChecker {
10741074
public:
10751075
void check_mt_safety() {
10761076
// Master Old Set MT safety protocol:
@@ -1098,7 +1098,7 @@ class OldRegionSetChecker : public HeapRegionSetChecker {
10981098
const char* get_description() { return "Old Regions"; }
10991099
};
11001100

1101-
class HumongousRegionSetChecker : public HeapRegionSetChecker {
1101+
class HumongousRegionSetChecker : public G1HeapRegionSetChecker {
11021102
public:
11031103
void check_mt_safety() {
11041104
// Humongous Set MT safety protocol:
@@ -1352,9 +1352,9 @@ jint G1CollectedHeap::initialize() {
13521352
guarantee(G1HeapRegion::CardsPerRegion < max_cards_per_region,
13531353
"too many cards per region");
13541354

1355-
HeapRegionRemSet::initialize(_reserved);
1355+
G1HeapRegionRemSet::initialize(_reserved);
13561356

1357-
FreeRegionList::set_unrealistically_long_length(max_regions() + 1);
1357+
G1FreeRegionList::set_unrealistically_long_length(max_regions() + 1);
13581358

13591359
_bot = new G1BlockOffsetTable(reserved(), bot_storage);
13601360

@@ -1536,7 +1536,7 @@ size_t G1CollectedHeap::used_unlocked() const {
15361536
return _summary_bytes_used;
15371537
}
15381538

1539-
class SumUsedClosure: public HeapRegionClosure {
1539+
class SumUsedClosure: public G1HeapRegionClosure {
15401540
size_t _used;
15411541
public:
15421542
SumUsedClosure() : _used(0) {}
@@ -1887,7 +1887,7 @@ bool G1CollectedHeap::is_in(const void* p) const {
18871887

18881888
// Iterates an ObjectClosure over all objects within a G1HeapRegion.
18891889

1890-
class IterateObjectClosureRegionClosure: public HeapRegionClosure {
1890+
class IterateObjectClosureRegionClosure: public G1HeapRegionClosure {
18911891
ObjectClosure* _cl;
18921892
public:
18931893
IterateObjectClosureRegionClosure(ObjectClosure* cl) : _cl(cl) {}
@@ -1907,7 +1907,7 @@ void G1CollectedHeap::object_iterate(ObjectClosure* cl) {
19071907
class G1ParallelObjectIterator : public ParallelObjectIteratorImpl {
19081908
private:
19091909
G1CollectedHeap* _heap;
1910-
HeapRegionClaimer _claimer;
1910+
G1HeapRegionClaimer _claimer;
19111911

19121912
public:
19131913
G1ParallelObjectIterator(uint thread_num) :
@@ -1923,7 +1923,7 @@ ParallelObjectIteratorImpl* G1CollectedHeap::parallel_object_iterator(uint threa
19231923
return new G1ParallelObjectIterator(thread_num);
19241924
}
19251925

1926-
void G1CollectedHeap::object_iterate_parallel(ObjectClosure* cl, uint worker_id, HeapRegionClaimer* claimer) {
1926+
void G1CollectedHeap::object_iterate_parallel(ObjectClosure* cl, uint worker_id, G1HeapRegionClaimer* claimer) {
19271927
IterateObjectClosureRegionClosure blk(cl);
19281928
heap_region_par_iterate_from_worker_offset(&blk, claimer, worker_id);
19291929
}
@@ -1932,43 +1932,43 @@ void G1CollectedHeap::keep_alive(oop obj) {
19321932
G1BarrierSet::enqueue_preloaded(obj);
19331933
}
19341934

1935-
void G1CollectedHeap::heap_region_iterate(HeapRegionClosure* cl) const {
1935+
void G1CollectedHeap::heap_region_iterate(G1HeapRegionClosure* cl) const {
19361936
_hrm.iterate(cl);
19371937
}
19381938

1939-
void G1CollectedHeap::heap_region_iterate(HeapRegionIndexClosure* cl) const {
1939+
void G1CollectedHeap::heap_region_iterate(G1HeapRegionIndexClosure* cl) const {
19401940
_hrm.iterate(cl);
19411941
}
19421942

1943-
void G1CollectedHeap::heap_region_par_iterate_from_worker_offset(HeapRegionClosure* cl,
1944-
HeapRegionClaimer *hrclaimer,
1943+
void G1CollectedHeap::heap_region_par_iterate_from_worker_offset(G1HeapRegionClosure* cl,
1944+
G1HeapRegionClaimer *hrclaimer,
19451945
uint worker_id) const {
19461946
_hrm.par_iterate(cl, hrclaimer, hrclaimer->offset_for_worker(worker_id));
19471947
}
19481948

1949-
void G1CollectedHeap::heap_region_par_iterate_from_start(HeapRegionClosure* cl,
1950-
HeapRegionClaimer *hrclaimer) const {
1949+
void G1CollectedHeap::heap_region_par_iterate_from_start(G1HeapRegionClosure* cl,
1950+
G1HeapRegionClaimer *hrclaimer) const {
19511951
_hrm.par_iterate(cl, hrclaimer, 0);
19521952
}
19531953

1954-
void G1CollectedHeap::collection_set_iterate_all(HeapRegionClosure* cl) {
1954+
void G1CollectedHeap::collection_set_iterate_all(G1HeapRegionClosure* cl) {
19551955
_collection_set.iterate(cl);
19561956
}
19571957

1958-
void G1CollectedHeap::collection_set_par_iterate_all(HeapRegionClosure* cl,
1959-
HeapRegionClaimer* hr_claimer,
1958+
void G1CollectedHeap::collection_set_par_iterate_all(G1HeapRegionClosure* cl,
1959+
G1HeapRegionClaimer* hr_claimer,
19601960
uint worker_id) {
19611961
_collection_set.par_iterate(cl, hr_claimer, worker_id);
19621962
}
19631963

1964-
void G1CollectedHeap::collection_set_iterate_increment_from(HeapRegionClosure *cl,
1965-
HeapRegionClaimer* hr_claimer,
1964+
void G1CollectedHeap::collection_set_iterate_increment_from(G1HeapRegionClosure *cl,
1965+
G1HeapRegionClaimer* hr_claimer,
19661966
uint worker_id) {
19671967
_collection_set.iterate_incremental_part_from(cl, hr_claimer, worker_id);
19681968
}
19691969

1970-
void G1CollectedHeap::par_iterate_regions_array(HeapRegionClosure* cl,
1971-
HeapRegionClaimer* hr_claimer,
1970+
void G1CollectedHeap::par_iterate_regions_array(G1HeapRegionClosure* cl,
1971+
G1HeapRegionClaimer* hr_claimer,
19721972
const uint regions[],
19731973
size_t length,
19741974
uint worker_id) const {
@@ -2046,10 +2046,10 @@ bool G1CollectedHeap::supports_concurrent_gc_breakpoints() const {
20462046
return true;
20472047
}
20482048

2049-
class PrintRegionClosure: public HeapRegionClosure {
2049+
class G1PrintRegionClosure: public G1HeapRegionClosure {
20502050
outputStream* _st;
20512051
public:
2052-
PrintRegionClosure(outputStream* st) : _st(st) {}
2052+
G1PrintRegionClosure(outputStream* st) : _st(st) {}
20532053
bool do_heap_region(G1HeapRegion* r) {
20542054
r->print_on(_st);
20552055
return false;
@@ -2121,7 +2121,7 @@ void G1CollectedHeap::print_regions_on(outputStream* st) const {
21212121
"CS=collection set, F=free, "
21222122
"TAMS=top-at-mark-start, "
21232123
"PB=parsable bottom");
2124-
PrintRegionClosure blk(st);
2124+
G1PrintRegionClosure blk(st);
21252125
heap_region_iterate(&blk);
21262126
}
21272127

@@ -2281,14 +2281,14 @@ void G1CollectedHeap::start_concurrent_cycle(bool concurrent_operation_is_full_m
22812281
bool G1CollectedHeap::is_potential_eager_reclaim_candidate(G1HeapRegion* r) const {
22822282
// We don't nominate objects with many remembered set entries, on
22832283
// the assumption that such objects are likely still live.
2284-
HeapRegionRemSet* rem_set = r->rem_set();
2284+
G1HeapRegionRemSet* rem_set = r->rem_set();
22852285

22862286
return rem_set->occupancy_less_or_equal_than(G1EagerReclaimRemSetThreshold);
22872287
}
22882288

22892289
#ifndef PRODUCT
22902290
void G1CollectedHeap::verify_region_attr_remset_is_tracked() {
2291-
class VerifyRegionAttrRemSet : public HeapRegionClosure {
2291+
class VerifyRegionAttrRemSet : public G1HeapRegionClosure {
22922292
public:
22932293
virtual bool do_heap_region(G1HeapRegion* r) {
22942294
G1CollectedHeap* g1h = G1CollectedHeap::heap();
@@ -2538,9 +2538,9 @@ void G1CollectedHeap::unload_classes_and_code(const char* description, BoolObjec
25382538
}
25392539

25402540
class G1BulkUnregisterNMethodTask : public WorkerTask {
2541-
HeapRegionClaimer _hrclaimer;
2541+
G1HeapRegionClaimer _hrclaimer;
25422542

2543-
class UnregisterNMethodsHeapRegionClosure : public HeapRegionClosure {
2543+
class UnregisterNMethodsHeapRegionClosure : public G1HeapRegionClosure {
25442544
public:
25452545

25462546
bool do_heap_region(G1HeapRegion* hr) {
@@ -2614,7 +2614,7 @@ void G1CollectedHeap::clear_bitmap_for_region(G1HeapRegion* hr) {
26142614
concurrent_mark()->clear_bitmap_for_region(hr);
26152615
}
26162616

2617-
void G1CollectedHeap::free_region(G1HeapRegion* hr, FreeRegionList* free_list) {
2617+
void G1CollectedHeap::free_region(G1HeapRegion* hr, G1FreeRegionList* free_list) {
26182618
assert(!hr->is_free(), "the region should not be free");
26192619
assert(!hr->is_empty(), "the region should not be empty");
26202620
assert(_hrm.is_available(hr->hrm_index()), "region should be committed");
@@ -2636,7 +2636,7 @@ void G1CollectedHeap::retain_region(G1HeapRegion* hr) {
26362636
}
26372637

26382638
void G1CollectedHeap::free_humongous_region(G1HeapRegion* hr,
2639-
FreeRegionList* free_list) {
2639+
G1FreeRegionList* free_list) {
26402640
assert(hr->is_humongous(), "this is only for humongous regions");
26412641
hr->clear_humongous();
26422642
free_region(hr, free_list);
@@ -2652,7 +2652,7 @@ void G1CollectedHeap::remove_from_old_gen_sets(const uint old_regions_removed,
26522652

26532653
}
26542654

2655-
void G1CollectedHeap::prepend_to_freelist(FreeRegionList* list) {
2655+
void G1CollectedHeap::prepend_to_freelist(G1FreeRegionList* list) {
26562656
assert(list != nullptr, "list can't be null");
26572657
if (!list->is_empty()) {
26582658
MutexLocker x(FreeList_lock, Mutex::_no_safepoint_check_flag);
@@ -2678,7 +2678,7 @@ void G1CollectedHeap::rebuild_free_region_list() {
26782678
phase_times()->record_total_rebuild_freelist_time_ms((Ticks::now() - start).seconds() * 1000.0);
26792679
}
26802680

2681-
class G1AbandonCollectionSetClosure : public HeapRegionClosure {
2681+
class G1AbandonCollectionSetClosure : public G1HeapRegionClosure {
26822682
public:
26832683
virtual bool do_heap_region(G1HeapRegion* r) {
26842684
assert(r->in_collection_set(), "Region %u must have been in collection set", r->hrm_index());
@@ -2707,7 +2707,7 @@ void G1CollectedHeap::set_region_short_lived_locked(G1HeapRegion* hr) {
27072707

27082708
#ifdef ASSERT
27092709

2710-
class NoYoungRegionsClosure: public HeapRegionClosure {
2710+
class NoYoungRegionsClosure: public G1HeapRegionClosure {
27112711
private:
27122712
bool _success;
27132713
public:
@@ -2768,22 +2768,22 @@ void G1CollectedHeap::set_used(size_t bytes) {
27682768
_summary_bytes_used = bytes;
27692769
}
27702770

2771-
class RebuildRegionSetsClosure : public HeapRegionClosure {
2771+
class RebuildRegionSetsClosure : public G1HeapRegionClosure {
27722772
private:
27732773
bool _free_list_only;
27742774

2775-
HeapRegionSet* _old_set;
2776-
HeapRegionSet* _humongous_set;
2775+
G1HeapRegionSet* _old_set;
2776+
G1HeapRegionSet* _humongous_set;
27772777

2778-
HeapRegionManager* _hrm;
2778+
G1HeapRegionManager* _hrm;
27792779

27802780
size_t _total_used;
27812781

27822782
public:
27832783
RebuildRegionSetsClosure(bool free_list_only,
2784-
HeapRegionSet* old_set,
2785-
HeapRegionSet* humongous_set,
2786-
HeapRegionManager* hrm) :
2784+
G1HeapRegionSet* old_set,
2785+
G1HeapRegionSet* humongous_set,
2786+
G1HeapRegionManager* hrm) :
27872787
_free_list_only(free_list_only), _old_set(old_set),
27882788
_humongous_set(humongous_set), _hrm(hrm), _total_used(0) {
27892789
assert(_hrm->num_free_regions() == 0, "pre-condition");
@@ -2849,7 +2849,7 @@ G1HeapRegion* G1CollectedHeap::new_mutator_alloc_region(size_t word_size,
28492849
bool should_allocate = policy()->should_allocate_mutator_region();
28502850
if (should_allocate) {
28512851
G1HeapRegion* new_alloc_region = new_region(word_size,
2852-
HeapRegionType::Eden,
2852+
G1HeapRegionType::Eden,
28532853
false /* do_expand */,
28542854
node_index);
28552855
if (new_alloc_region != nullptr) {
@@ -2895,11 +2895,11 @@ G1HeapRegion* G1CollectedHeap::new_gc_alloc_region(size_t word_size, G1HeapRegio
28952895
return nullptr;
28962896
}
28972897

2898-
HeapRegionType type;
2898+
G1HeapRegionType type;
28992899
if (dest.is_young()) {
2900-
type = HeapRegionType::Survivor;
2900+
type = G1HeapRegionType::Survivor;
29012901
} else {
2902-
type = HeapRegionType::Old;
2902+
type = G1HeapRegionType::Old;
29032903
}
29042904

29052905
G1HeapRegion* new_alloc_region = new_region(word_size,

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Jul 5, 2024

@openjdk-notifier[bot]
Please sign in to comment.