4848#include " runtime/globals_extension.hpp"
4949#include " utilities/powerOfTwo.hpp"
5050
51- int HeapRegion::LogOfHRGrainBytes = 0 ;
52- int HeapRegion::LogCardsPerRegion = 0 ;
51+ uint HeapRegion::LogOfHRGrainBytes = 0 ;
52+ uint HeapRegion::LogCardsPerRegion = 0 ;
5353size_t HeapRegion::GrainBytes = 0 ;
5454size_t HeapRegion::GrainWords = 0 ;
5555size_t HeapRegion::CardsPerRegion = 0 ;
@@ -78,12 +78,9 @@ void HeapRegion::setup_heap_region_size(size_t max_heap_size) {
7878 // Now make sure that we don't go over or under our limits.
7979 region_size = clamp (region_size, HeapRegionBounds::min_size (), HeapRegionBounds::max_size ());
8080
81- // Calculate the log for the region size.
82- int region_size_log = log2i_exact (region_size);
83-
8481 // Now, set up the globals.
8582 guarantee (LogOfHRGrainBytes == 0 , " we should only set it once" );
86- LogOfHRGrainBytes = region_size_log ;
83+ LogOfHRGrainBytes = log2i_exact (region_size) ;
8784
8885 guarantee (GrainBytes == 0 , " we should only set it once" );
8986 GrainBytes = region_size;
@@ -94,7 +91,7 @@ void HeapRegion::setup_heap_region_size(size_t max_heap_size) {
9491 guarantee (CardsPerRegion == 0 , " we should only set it once" );
9592 CardsPerRegion = GrainBytes >> G1CardTable::card_shift ();
9693
97- LogCardsPerRegion = log2i (CardsPerRegion);
94+ LogCardsPerRegion = log2i_exact (CardsPerRegion);
9895
9996 if (G1HeapRegionSize != GrainBytes) {
10097 FLAG_SET_ERGO (G1HeapRegionSize, GrainBytes);
0 commit comments