48
48
#include " runtime/globals_extension.hpp"
49
49
#include " utilities/powerOfTwo.hpp"
50
50
51
- int HeapRegion::LogOfHRGrainBytes = 0 ;
52
- int HeapRegion::LogCardsPerRegion = 0 ;
51
+ uint HeapRegion::LogOfHRGrainBytes = 0 ;
52
+ uint HeapRegion::LogCardsPerRegion = 0 ;
53
53
size_t HeapRegion::GrainBytes = 0 ;
54
54
size_t HeapRegion::GrainWords = 0 ;
55
55
size_t HeapRegion::CardsPerRegion = 0 ;
@@ -78,12 +78,9 @@ void HeapRegion::setup_heap_region_size(size_t max_heap_size) {
78
78
// Now make sure that we don't go over or under our limits.
79
79
region_size = clamp (region_size, HeapRegionBounds::min_size (), HeapRegionBounds::max_size ());
80
80
81
- // Calculate the log for the region size.
82
- int region_size_log = log2i_exact (region_size);
83
-
84
81
// Now, set up the globals.
85
82
guarantee (LogOfHRGrainBytes == 0 , " we should only set it once" );
86
- LogOfHRGrainBytes = region_size_log ;
83
+ LogOfHRGrainBytes = log2i_exact (region_size) ;
87
84
88
85
guarantee (GrainBytes == 0 , " we should only set it once" );
89
86
GrainBytes = region_size;
@@ -94,7 +91,7 @@ void HeapRegion::setup_heap_region_size(size_t max_heap_size) {
94
91
guarantee (CardsPerRegion == 0 , " we should only set it once" );
95
92
CardsPerRegion = GrainBytes >> G1CardTable::card_shift ();
96
93
97
- LogCardsPerRegion = log2i (CardsPerRegion);
94
+ LogCardsPerRegion = log2i_exact (CardsPerRegion);
98
95
99
96
if (G1HeapRegionSize != GrainBytes) {
100
97
FLAG_SET_ERGO (G1HeapRegionSize, GrainBytes);
0 commit comments