--- old/src/hotspot/share/utilities/bitMap.inline.hpp 2019-06-10 20:15:57.538147033 -0400 +++ new/src/hotspot/share/utilities/bitMap.inline.hpp 2019-06-10 20:15:57.038120306 -0400 @@ -26,6 +26,7 @@ #define SHARE_UTILITIES_BITMAP_INLINE_HPP #include "runtime/atomic.hpp" +#include "utilities/align.hpp" #include "utilities/bitMap.hpp" #include "utilities/count_trailing_zeros.hpp" @@ -146,7 +147,7 @@ inline BitMap::idx_t BitMap::get_next_bit_impl(idx_t l_index, idx_t r_index) const { STATIC_ASSERT(flip == find_ones_flip || flip == find_zeros_flip); verify_range(l_index, r_index); - assert(!aligned_right || is_word_aligned(r_index), "r_index not aligned"); + assert(!aligned_right || is_aligned(r_index, BitsPerWord), "r_index not aligned"); // The first word often contains an interesting bit, either due to // density or because of features of the calling algorithm. So it's @@ -246,10 +247,12 @@ memset(_map + beg, 0, (end - beg) * sizeof(bm_word_t)); } -inline BitMap::idx_t BitMap::word_index_round_up(idx_t bit) const { - idx_t bit_rounded_up = bit + (BitsPerWord - 1); - // Check for integer arithmetic overflow. - return bit_rounded_up > bit ? word_index(bit_rounded_up) : size_in_words(); +inline BitMap::idx_t BitMap::range_begin_align_up(idx_t bit) { + return align_up(bit, BitsPerWord); +} + +inline BitMap::idx_t BitMap::range_end_align_down(idx_t bit) { + return align_down(bit, BitsPerWord); } inline bool BitMap2D::is_valid_index(idx_t slot_index, idx_t bit_within_slot_index) {