src/share/vm/utilities/bitMap.inline.hpp
Print this page
@@ -128,11 +128,11 @@
}
}
inline void BitMap::set_range_of_words(idx_t beg, idx_t end) {
bm_word_t* map = _map;
- for (idx_t i = beg; i < end; ++i) map[i] = ~(uintptr_t)0;
+ for (idx_t i = beg; i < end; ++i) map[i] = ~(bm_word_t)0;
}
inline void BitMap::clear_range_of_words(idx_t beg, idx_t end) {
bm_word_t* map = _map;
@@ -170,12 +170,12 @@
idx_t r_index = word_index(r_offset-1) + 1;
idx_t res_offset = l_offset;
// check bits including and to the _left_ of offset's position
idx_t pos = bit_in_word(res_offset);
- idx_t res = map(index) >> pos;
- if (res != (uintptr_t)NoBits) {
+ bm_word_t res = map(index) >> pos;
+ if (res != 0) {
// find the position of the 1-bit
for (; !(res & 1); res_offset++) {
res = res >> 1;
}
@@ -205,11 +205,11 @@
return MIN2(res_offset, r_offset);
}
// skip over all word length 0-bit runs
for (index++; index < r_index; index++) {
res = map(index);
- if (res != (uintptr_t)NoBits) {
+ if (res != 0) {
// found a 1, return the offset
for (res_offset = bit_index(index); !(res & 1); res_offset++) {
res = res >> 1;
}
assert(res & 1, "tautology; see loop condition");
@@ -233,24 +233,24 @@
idx_t r_index = word_index(r_offset-1) + 1;
idx_t res_offset = l_offset;
// check bits including and to the _left_ of offset's position
idx_t pos = res_offset & (BitsPerWord - 1);
- idx_t res = (map(index) >> pos) | left_n_bits((int)pos);
+ bm_word_t res = (map(index) >> pos) | left_n_bits((int)pos);
- if (res != (uintptr_t)AllBits) {
+ if (res != ~(bm_word_t)0) {
// find the position of the 0-bit
for (; res & 1; res_offset++) {
res = res >> 1;
}
assert(res_offset >= l_offset, "just checking");
return MIN2(res_offset, r_offset);
}
// skip over all word length 1-bit runs
for (index++; index < r_index; index++) {
res = map(index);
- if (res != (uintptr_t)AllBits) {
+ if (res != ~(bm_word_t)0) {
// found a 0, return the offset
for (res_offset = index << LogBitsPerWord; res & 1;
res_offset++) {
res = res >> 1;
}
@@ -275,12 +275,12 @@
idx_t index = word_index(l_offset);
idx_t r_index = word_index(r_offset);
idx_t res_offset = l_offset;
// check bits including and to the _left_ of offset's position
- idx_t res = map(index) >> bit_in_word(res_offset);
- if (res != (uintptr_t)NoBits) {
+ bm_word_t res = map(index) >> bit_in_word(res_offset);
+ if (res != 0) {
// find the position of the 1-bit
for (; !(res & 1); res_offset++) {
res = res >> 1;
}
assert(res_offset >= l_offset &&
@@ -288,11 +288,11 @@
return res_offset;
}
// skip over all word length 0-bit runs
for (index++; index < r_index; index++) {
res = map(index);
- if (res != (uintptr_t)NoBits) {
+ if (res != 0) {
// found a 1, return the offset
for (res_offset = bit_index(index); !(res & 1); res_offset++) {
res = res >> 1;
}
assert(res & 1, "tautology; see loop condition");
@@ -319,15 +319,15 @@
}
return mask;
}
inline void BitMap::set_large_range_of_words(idx_t beg, idx_t end) {
- memset(_map + beg, ~(unsigned char)0, (end - beg) * sizeof(uintptr_t));
+ memset(_map + beg, ~(unsigned char)0, (end - beg) * sizeof(bm_word_t));
}
inline void BitMap::clear_large_range_of_words(idx_t beg, idx_t end) {
- memset(_map + beg, 0, (end - beg) * sizeof(uintptr_t));
+ 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.