Skip to content

Commit

Permalink
8184134: HeapRegion::LogOfHRGrainWords is unused
Browse files Browse the repository at this point in the history
Reviewed-by: kbarrett, sjohanss
  • Loading branch information
albertnetymk committed Apr 26, 2021
1 parent 41daa88 commit cb29b19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
5 changes: 0 additions & 5 deletions src/hotspot/share/gc/g1/heapRegion.cpp
Expand Up @@ -48,7 +48,6 @@
#include "utilities/powerOfTwo.hpp"

int HeapRegion::LogOfHRGrainBytes = 0;
int HeapRegion::LogOfHRGrainWords = 0;
int HeapRegion::LogCardsPerRegion = 0;
size_t HeapRegion::GrainBytes = 0;
size_t HeapRegion::GrainWords = 0;
Expand Down Expand Up @@ -84,17 +83,13 @@ void HeapRegion::setup_heap_region_size(size_t max_heap_size) {
guarantee(LogOfHRGrainBytes == 0, "we should only set it once");
LogOfHRGrainBytes = region_size_log;

guarantee(LogOfHRGrainWords == 0, "we should only set it once");
LogOfHRGrainWords = LogOfHRGrainBytes - LogHeapWordSize;

guarantee(GrainBytes == 0, "we should only set it once");
// The cast to int is safe, given that we've bounded region_size by
// MIN_REGION_SIZE and MAX_REGION_SIZE.
GrainBytes = region_size;

guarantee(GrainWords == 0, "we should only set it once");
GrainWords = GrainBytes >> LogHeapWordSize;
guarantee((size_t) 1 << LogOfHRGrainWords == GrainWords, "sanity");

guarantee(CardsPerRegion == 0, "we should only set it once");
CardsPerRegion = GrainBytes >> G1CardTable::card_shift;
Expand Down
10 changes: 4 additions & 6 deletions src/hotspot/share/gc/g1/heapRegion.hpp
Expand Up @@ -293,7 +293,6 @@ class HeapRegion : public CHeapObj<mtGC> {
void initialize(bool clear_space = false, bool mangle_space = SpaceDecorator::Mangle);

static int LogOfHRGrainBytes;
static int LogOfHRGrainWords;
static int LogCardsPerRegion;

static size_t GrainBytes;
Expand All @@ -316,11 +315,10 @@ class HeapRegion : public CHeapObj<mtGC> {
static size_t max_region_size();
static size_t min_region_size_in_words();

// It sets up the heap region size (GrainBytes / GrainWords), as
// well as other related fields that are based on the heap region
// size (LogOfHRGrainBytes / LogOfHRGrainWords /
// CardsPerRegion). All those fields are considered constant
// throughout the JVM's execution, therefore they should only be set
// It sets up the heap region size (GrainBytes / GrainWords), as well as
// other related fields that are based on the heap region size
// (LogOfHRGrainBytes / CardsPerRegion). All those fields are considered
// constant throughout the JVM's execution, therefore they should only be set
// up once during initialization time.
static void setup_heap_region_size(size_t max_heap_size);

Expand Down

1 comment on commit cb29b19

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.