230 assert(end != 0, "does not work when end == 0");
231 assert(beg == end || word_index(beg) == word_index(end - 1),
232 "must be a single-word range");
233 bm_word_t mask = bit_mask(beg) - 1; // low (right) bits
234 if (bit_in_word(end) != 0) {
235 mask |= ~(bit_mask(end) - 1); // high (left) bits
236 }
237 return mask;
238 }
239
240 inline void BitMap::set_large_range_of_words(idx_t beg, idx_t end) {
241 assert(beg <= end, "underflow");
242 memset(_map + beg, ~(unsigned char)0, (end - beg) * sizeof(bm_word_t));
243 }
244
245 inline void BitMap::clear_large_range_of_words(idx_t beg, idx_t end) {
246 assert(beg <= end, "underflow");
247 memset(_map + beg, 0, (end - beg) * sizeof(bm_word_t));
248 }
249
250 inline BitMap::idx_t BitMap::word_index_round_up(idx_t bit) const {
251 return calc_size_in_words(bit);
252 }
253
254 inline bool BitMap2D::is_valid_index(idx_t slot_index, idx_t bit_within_slot_index) {
255 verify_bit_within_slot_index(bit_within_slot_index);
256 return (bit_index(slot_index, bit_within_slot_index) < size_in_bits());
257 }
258
259 inline bool BitMap2D::at(idx_t slot_index, idx_t bit_within_slot_index) const {
260 verify_bit_within_slot_index(bit_within_slot_index);
261 return _map.at(bit_index(slot_index, bit_within_slot_index));
262 }
263
264 inline void BitMap2D::set_bit(idx_t slot_index, idx_t bit_within_slot_index) {
265 verify_bit_within_slot_index(bit_within_slot_index);
266 _map.set_bit(bit_index(slot_index, bit_within_slot_index));
267 }
268
269 inline void BitMap2D::clear_bit(idx_t slot_index, idx_t bit_within_slot_index) {
270 verify_bit_within_slot_index(bit_within_slot_index);
271 _map.clear_bit(bit_index(slot_index, bit_within_slot_index));
|
230 assert(end != 0, "does not work when end == 0");
231 assert(beg == end || word_index(beg) == word_index(end - 1),
232 "must be a single-word range");
233 bm_word_t mask = bit_mask(beg) - 1; // low (right) bits
234 if (bit_in_word(end) != 0) {
235 mask |= ~(bit_mask(end) - 1); // high (left) bits
236 }
237 return mask;
238 }
239
240 inline void BitMap::set_large_range_of_words(idx_t beg, idx_t end) {
241 assert(beg <= end, "underflow");
242 memset(_map + beg, ~(unsigned char)0, (end - beg) * sizeof(bm_word_t));
243 }
244
245 inline void BitMap::clear_large_range_of_words(idx_t beg, idx_t end) {
246 assert(beg <= end, "underflow");
247 memset(_map + beg, 0, (end - beg) * sizeof(bm_word_t));
248 }
249
250 inline BitMap::idx_t BitMap::range_begin_align_up(idx_t bit) {
251 return align_up(bit, BitsPerWord);
252 }
253
254 inline BitMap::idx_t BitMap::range_end_align_down(idx_t bit) {
255 return align_down(bit, BitsPerWord);
256 }
257
258 inline bool BitMap2D::is_valid_index(idx_t slot_index, idx_t bit_within_slot_index) {
259 verify_bit_within_slot_index(bit_within_slot_index);
260 return (bit_index(slot_index, bit_within_slot_index) < size_in_bits());
261 }
262
263 inline bool BitMap2D::at(idx_t slot_index, idx_t bit_within_slot_index) const {
264 verify_bit_within_slot_index(bit_within_slot_index);
265 return _map.at(bit_index(slot_index, bit_within_slot_index));
266 }
267
268 inline void BitMap2D::set_bit(idx_t slot_index, idx_t bit_within_slot_index) {
269 verify_bit_within_slot_index(bit_within_slot_index);
270 _map.set_bit(bit_index(slot_index, bit_within_slot_index));
271 }
272
273 inline void BitMap2D::clear_bit(idx_t slot_index, idx_t bit_within_slot_index) {
274 verify_bit_within_slot_index(bit_within_slot_index);
275 _map.clear_bit(bit_index(slot_index, bit_within_slot_index));
|