--- old/src/share/vm/utilities/bitMap.cpp 2014-09-30 17:17:27.547035464 +0400 +++ new/src/share/vm/utilities/bitMap.cpp 2014-09-30 17:17:27.499035463 +0400 @@ -344,7 +344,7 @@ for (idx_t index = 0; index < size; index++) { idx_t temp = map(index) | other_map[index]; changed = changed || (temp != map(index)); - map()[index] = temp; + dest_map[index] = temp; } return changed; } @@ -407,10 +407,10 @@ bm_word_t* word = map(); idx_t rest = size(); for (; rest >= (idx_t) BitsPerWord; rest -= BitsPerWord) { - if (*word != (bm_word_t) AllBits) return false; + if (*word != ~(bm_word_t)0) return false; word++; } - return rest == 0 || (*word | ~right_n_bits((int)rest)) == (bm_word_t) AllBits; + return rest == 0 || (*word | ~right_n_bits((int)rest)) == ~(bm_word_t)0; } @@ -418,10 +418,10 @@ bm_word_t* word = map(); idx_t rest = size(); for (; rest >= (idx_t) BitsPerWord; rest -= BitsPerWord) { - if (*word != (bm_word_t) NoBits) return false; + if (*word != 0) return false; word++; } - return rest == 0 || (*word & right_n_bits((int)rest)) == (bm_word_t) NoBits; + return rest == 0 || (*word & right_n_bits((int)rest)) == 0; } void BitMap::clear_large() { @@ -441,7 +441,7 @@ offset < rightOffset && index < endIndex; offset = (++index) << LogBitsPerWord) { idx_t rest = map(index) >> (offset & (BitsPerWord - 1)); - for (; offset < rightOffset && rest != (bm_word_t)NoBits; offset++) { + for (; offset < rightOffset && rest != 0; offset++) { if (rest & 1) { if (!blk->do_bit(offset)) return false; // resample at each closure application @@ -468,7 +468,7 @@ (intptr_t) NULL_WORD); if (res != NULL_WORD) { guarantee( _pop_count_table == (void*) res, "invariant" ); - FREE_C_HEAP_ARRAY(bm_word_t, table, mtInternal); + FREE_C_HEAP_ARRAY(idx_t, table, mtInternal); } } } --- old/src/share/vm/utilities/bitMap.hpp 2014-09-30 17:17:27.739035468 +0400 +++ new/src/share/vm/utilities/bitMap.hpp 2014-09-30 17:17:27.687035467 +0400 @@ -80,7 +80,7 @@ // Set a word to a specified value or to all ones; clear a word. void set_word (idx_t word, bm_word_t val) { _map[word] = val; } - void set_word (idx_t word) { set_word(word, ~(uintptr_t)0); } + void set_word (idx_t word) { set_word(word, ~(bm_word_t)0); } void clear_word(idx_t word) { _map[word] = 0; } // Utilities for ranges of bits. Ranges are half-open [beg, end). --- old/src/share/vm/utilities/bitMap.inline.hpp 2014-09-30 17:17:27.927035472 +0400 +++ new/src/share/vm/utilities/bitMap.inline.hpp 2014-09-30 17:17:27.875035471 +0400 @@ -130,7 +130,7 @@ 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; } @@ -172,8 +172,8 @@ // 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; @@ -207,7 +207,7 @@ // 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; @@ -235,9 +235,9 @@ // 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; @@ -248,7 +248,7 @@ // 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++) { @@ -277,8 +277,8 @@ 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; @@ -290,7 +290,7 @@ // 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; @@ -321,11 +321,11 @@ } 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 {