< prev index next >
src/hotspot/share/utilities/bitMap.inline.hpp
Print this page
rev 54931 : [mq]: max_size
rev 54933 : [mq]: stefank_review
*** 24,33 ****
--- 24,34 ----
#ifndef SHARE_UTILITIES_BITMAP_INLINE_HPP
#define SHARE_UTILITIES_BITMAP_INLINE_HPP
#include "runtime/atomic.hpp"
+ #include "utilities/align.hpp"
#include "utilities/bitMap.hpp"
#include "utilities/count_trailing_zeros.hpp"
inline void BitMap::set_bit(idx_t bit) {
verify_index(bit);
*** 144,154 ****
template<BitMap::bm_word_t flip, bool aligned_right>
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");
// The first word often contains an interesting bit, either due to
// density or because of features of the calling algorithm. So it's
// important to examine that first word with a minimum of fuss,
// minimizing setup time for later words that will be wasted if the
--- 145,155 ----
template<BitMap::bm_word_t flip, bool aligned_right>
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_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
// important to examine that first word with a minimum of fuss,
// minimizing setup time for later words that will be wasted if the
*** 244,257 ****
inline void BitMap::clear_large_range_of_words(idx_t beg, idx_t end) {
assert(beg <= end, "underflow");
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 bool BitMap2D::is_valid_index(idx_t slot_index, idx_t bit_within_slot_index) {
verify_bit_within_slot_index(bit_within_slot_index);
return (bit_index(slot_index, bit_within_slot_index) < size_in_bits());
--- 245,260 ----
inline void BitMap::clear_large_range_of_words(idx_t beg, idx_t end) {
assert(beg <= end, "underflow");
memset(_map + beg, 0, (end - beg) * sizeof(bm_word_t));
}
! 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) {
verify_bit_within_slot_index(bit_within_slot_index);
return (bit_index(slot_index, bit_within_slot_index) < size_in_bits());
< prev index next >