Skip to content

Commit

Permalink
Remove temp init variable, update code after rebase.
Browse files Browse the repository at this point in the history
  • Loading branch information
adityamandaleeka committed Apr 22, 2021
1 parent 4ec80ab commit 66fa097
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
4 changes: 0 additions & 4 deletions src/hotspot/share/gc/g1/g1CollectedHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,6 @@ G1CollectedHeap::G1CollectedHeap() :
_archive_set("Archive Region Set", new ArchiveRegionSetChecker()),
_humongous_set("Humongous Region Set", new HumongousRegionSetChecker()),
_bot(NULL),
zzinit_complete(false),
_listener(),
_numa(G1NUMA::create()),
_hrm(),
Expand Down Expand Up @@ -1790,9 +1789,6 @@ void G1CollectedHeap::safepoint_synchronize_end() {
void G1CollectedHeap::post_initialize() {
CollectedHeap::post_initialize();
ref_processing_init();

// TODO: temporary... is there a better way to do this?
zzinit_complete = true;
}

void G1CollectedHeap::ref_processing_init() {
Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/share/gc/g1/g1CollectedHeap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,6 @@ class G1CollectedHeap : public CollectedHeap {
public:
void prepare_region_for_full_compaction(HeapRegion* hr);

bool zzinit_complete;

private:
// Rebuilds the region sets / lists so that they are repopulated to
// reflect the contents of the heap. The only exception is the
Expand Down
6 changes: 2 additions & 4 deletions src/hotspot/share/gc/g1/g1Policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1416,10 +1416,8 @@ static size_t get_num_regions_adjust_for_plab_waste(size_t byte_count) {
}

bool G1Policy::proactive_collection_required(uint alloc_region_count) {
if (!_g1h->zzinit_complete) {
if (!Universe::is_fully_initialized()) {
// Don't attempt any proactive GC's before initialization is complete.
// TODO: Is there a better way to do this without adding a new variable to hold
// init state?
return false;
}

Expand Down Expand Up @@ -1476,7 +1474,7 @@ void G1Policy::update_survival_estimates_for_next_collection() {

// Use the minimum old gen collection set as conservative estimate for the number
// of regions to take for this calculation.
uint iterate_count = MIN2(candidates->num_remaining(), calc_min_old_cset_length());
uint iterate_count = MIN2(candidates->num_remaining(), calc_min_old_cset_length(candidates));
uint current_index = candidates->cur_idx();
size_t old_bytes = 0;
for (uint i = 0; i < iterate_count; i++) {
Expand Down

0 comments on commit 66fa097

Please sign in to comment.