File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
src/hotspot/share/gc/shenandoah Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -225,10 +225,11 @@ class ShenandoahMarkTask
225225class ShenandoahMarkTask
226226{
227227private:
228- enum {
229- chunk_bits = 10 ,
230- pow_bits = 5 ,
231- };
228+ static const uint8_t chunk_bits = 10 ;
229+ static const uint8_t pow_bits = 5 ;
230+
231+ static const int chunk_max = nth_bit(chunk_bits) - 1 ;
232+ static const int pow_max = nth_bit(pow_bits) - 1 ;
232233
233234 oop _obj;
234235 int _chunk;
@@ -237,8 +238,8 @@ class ShenandoahMarkTask
237238public:
238239 ShenandoahMarkTask (oop o = NULL , int chunk = 0 , int pow = 0 ):
239240 _obj (o), _chunk(chunk), _pow(pow) {
240- assert (0 <= chunk && chunk < nth_bit (chunk_bits) , " chunk is sane : %d" , chunk);
241- assert (0 <= pow && pow < nth_bit (pow_bits) , " pow is sane : %d" , pow);
241+ assert (0 <= chunk && chunk <= chunk_max , " chunk is in range : %d" , chunk);
242+ assert (0 <= pow && pow <= pow_max , " pow is in range : %d" , pow);
242243 }
243244
244245 // Trivially copyable.
You can’t perform that action at this time.
0 commit comments