8184134: HeapRegion::LogOfHRGrainWords is unused

Reviewed-by: kbarrett, sjohanss
This commit is contained in:
Albert Mingkun Yang 2021-04-26 21:20:15 +00:00
parent 41daa88dcc
commit cb29b19fec
2 changed files with 4 additions and 11 deletions
src/hotspot/share/gc/g1

@ -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;
@ -84,9 +83,6 @@ 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.
@ -94,7 +90,6 @@ void HeapRegion::setup_heap_region_size(size_t max_heap_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;

@ -293,7 +293,6 @@ public:
void initialize(bool clear_space = false, bool mangle_space = SpaceDecorator::Mangle);
static int LogOfHRGrainBytes;
static int LogOfHRGrainWords;
static int LogCardsPerRegion;
static size_t GrainBytes;
@ -316,11 +315,10 @@ public:
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);