Tue, 07 Oct 2008 11:01:35 -0700
Merge
duke@435 | 1 | /* |
duke@435 | 2 | * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. |
duke@435 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 4 | * |
duke@435 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@435 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@435 | 7 | * published by the Free Software Foundation. |
duke@435 | 8 | * |
duke@435 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 13 | * accompanied this code). |
duke@435 | 14 | * |
duke@435 | 15 | * You should have received a copy of the GNU General Public License version |
duke@435 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 18 | * |
duke@435 | 19 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
duke@435 | 20 | * CA 95054 USA or visit www.sun.com if you need additional information or |
duke@435 | 21 | * have any questions. |
duke@435 | 22 | * |
duke@435 | 23 | */ |
duke@435 | 24 | |
duke@435 | 25 | class oopDesc; |
duke@435 | 26 | class ParMarkBitMapClosure; |
duke@435 | 27 | |
duke@435 | 28 | class ParMarkBitMap: public CHeapObj |
duke@435 | 29 | { |
duke@435 | 30 | public: |
duke@435 | 31 | typedef BitMap::idx_t idx_t; |
duke@435 | 32 | |
duke@435 | 33 | // Values returned by the iterate() methods. |
duke@435 | 34 | enum IterationStatus { incomplete, complete, full, would_overflow }; |
duke@435 | 35 | |
duke@435 | 36 | inline ParMarkBitMap(); |
duke@435 | 37 | inline ParMarkBitMap(MemRegion covered_region); |
duke@435 | 38 | bool initialize(MemRegion covered_region); |
duke@435 | 39 | |
duke@435 | 40 | // Atomically mark an object as live. |
duke@435 | 41 | bool mark_obj(HeapWord* addr, size_t size); |
duke@435 | 42 | inline bool mark_obj(oop obj, int size); |
duke@435 | 43 | inline bool mark_obj(oop obj); |
duke@435 | 44 | |
duke@435 | 45 | // Return whether the specified begin or end bit is set. |
duke@435 | 46 | inline bool is_obj_beg(idx_t bit) const; |
duke@435 | 47 | inline bool is_obj_end(idx_t bit) const; |
duke@435 | 48 | |
duke@435 | 49 | // Traditional interface for testing whether an object is marked or not (these |
duke@435 | 50 | // test only the begin bits). |
duke@435 | 51 | inline bool is_marked(idx_t bit) const; |
duke@435 | 52 | inline bool is_marked(HeapWord* addr) const; |
duke@435 | 53 | inline bool is_marked(oop obj) const; |
duke@435 | 54 | |
duke@435 | 55 | inline bool is_unmarked(idx_t bit) const; |
duke@435 | 56 | inline bool is_unmarked(HeapWord* addr) const; |
duke@435 | 57 | inline bool is_unmarked(oop obj) const; |
duke@435 | 58 | |
duke@435 | 59 | // Convert sizes from bits to HeapWords and back. An object that is n bits |
duke@435 | 60 | // long will be bits_to_words(n) words long. An object that is m words long |
duke@435 | 61 | // will take up words_to_bits(m) bits in the bitmap. |
duke@435 | 62 | inline static size_t bits_to_words(idx_t bits); |
duke@435 | 63 | inline static idx_t words_to_bits(size_t words); |
duke@435 | 64 | |
duke@435 | 65 | // Return the size in words of an object given a begin bit and an end bit, or |
duke@435 | 66 | // the equivalent beg_addr and end_addr. |
duke@435 | 67 | inline size_t obj_size(idx_t beg_bit, idx_t end_bit) const; |
duke@435 | 68 | inline size_t obj_size(HeapWord* beg_addr, HeapWord* end_addr) const; |
duke@435 | 69 | |
duke@435 | 70 | // Return the size in words of the object (a search is done for the end bit). |
duke@435 | 71 | inline size_t obj_size(idx_t beg_bit) const; |
duke@435 | 72 | inline size_t obj_size(HeapWord* addr) const; |
duke@435 | 73 | inline size_t obj_size(oop obj) const; |
duke@435 | 74 | |
duke@435 | 75 | // Synonyms for the above. |
duke@435 | 76 | size_t obj_size_in_words(oop obj) const { return obj_size((HeapWord*)obj); } |
duke@435 | 77 | size_t obj_size_in_words(HeapWord* addr) const { return obj_size(addr); } |
duke@435 | 78 | |
duke@435 | 79 | // Apply live_closure to each live object that lies completely within the |
duke@435 | 80 | // range [live_range_beg, live_range_end). This is used to iterate over the |
duke@435 | 81 | // compacted region of the heap. Return values: |
duke@435 | 82 | // |
duke@435 | 83 | // incomplete The iteration is not complete. The last object that |
duke@435 | 84 | // begins in the range does not end in the range; |
duke@435 | 85 | // closure->source() is set to the start of that object. |
duke@435 | 86 | // |
duke@435 | 87 | // complete The iteration is complete. All objects in the range |
duke@435 | 88 | // were processed and the closure is not full; |
duke@435 | 89 | // closure->source() is set one past the end of the range. |
duke@435 | 90 | // |
duke@435 | 91 | // full The closure is full; closure->source() is set to one |
duke@435 | 92 | // past the end of the last object processed. |
duke@435 | 93 | // |
duke@435 | 94 | // would_overflow The next object in the range would overflow the closure; |
duke@435 | 95 | // closure->source() is set to the start of that object. |
duke@435 | 96 | IterationStatus iterate(ParMarkBitMapClosure* live_closure, |
duke@435 | 97 | idx_t range_beg, idx_t range_end) const; |
duke@435 | 98 | inline IterationStatus iterate(ParMarkBitMapClosure* live_closure, |
duke@435 | 99 | HeapWord* range_beg, |
duke@435 | 100 | HeapWord* range_end) const; |
duke@435 | 101 | |
duke@435 | 102 | // Apply live closure as above and additionally apply dead_closure to all dead |
duke@435 | 103 | // space in the range [range_beg, dead_range_end). Note that dead_range_end |
duke@435 | 104 | // must be >= range_end. This is used to iterate over the dense prefix. |
duke@435 | 105 | // |
duke@435 | 106 | // This method assumes that if the first bit in the range (range_beg) is not |
duke@435 | 107 | // marked, then dead space begins at that point and the dead_closure is |
duke@435 | 108 | // applied. Thus callers must ensure that range_beg is not in the middle of a |
duke@435 | 109 | // live object. |
duke@435 | 110 | IterationStatus iterate(ParMarkBitMapClosure* live_closure, |
duke@435 | 111 | ParMarkBitMapClosure* dead_closure, |
duke@435 | 112 | idx_t range_beg, idx_t range_end, |
duke@435 | 113 | idx_t dead_range_end) const; |
duke@435 | 114 | inline IterationStatus iterate(ParMarkBitMapClosure* live_closure, |
duke@435 | 115 | ParMarkBitMapClosure* dead_closure, |
duke@435 | 116 | HeapWord* range_beg, |
duke@435 | 117 | HeapWord* range_end, |
duke@435 | 118 | HeapWord* dead_range_end) const; |
duke@435 | 119 | |
duke@435 | 120 | // Return the number of live words in the range [beg_addr, end_addr) due to |
duke@435 | 121 | // objects that start in the range. If a live object extends onto the range, |
duke@435 | 122 | // the caller must detect and account for any live words due to that object. |
duke@435 | 123 | // If a live object extends beyond the end of the range, only the words within |
duke@435 | 124 | // the range are included in the result. |
duke@435 | 125 | size_t live_words_in_range(HeapWord* beg_addr, HeapWord* end_addr) const; |
duke@435 | 126 | |
duke@435 | 127 | // Same as the above, except the end of the range must be a live object, which |
duke@435 | 128 | // is the case when updating pointers. This allows a branch to be removed |
duke@435 | 129 | // from inside the loop. |
duke@435 | 130 | size_t live_words_in_range(HeapWord* beg_addr, oop end_obj) const; |
duke@435 | 131 | |
duke@435 | 132 | inline HeapWord* region_start() const; |
duke@435 | 133 | inline HeapWord* region_end() const; |
duke@435 | 134 | inline size_t region_size() const; |
duke@435 | 135 | inline size_t size() const; |
duke@435 | 136 | |
duke@435 | 137 | // Convert a heap address to/from a bit index. |
duke@435 | 138 | inline idx_t addr_to_bit(HeapWord* addr) const; |
duke@435 | 139 | inline HeapWord* bit_to_addr(idx_t bit) const; |
duke@435 | 140 | |
duke@435 | 141 | // Return the bit index of the first marked object that begins (or ends, |
duke@435 | 142 | // respectively) in the range [beg, end). If no object is found, return end. |
duke@435 | 143 | inline idx_t find_obj_beg(idx_t beg, idx_t end) const; |
duke@435 | 144 | inline idx_t find_obj_end(idx_t beg, idx_t end) const; |
duke@435 | 145 | |
duke@435 | 146 | inline HeapWord* find_obj_beg(HeapWord* beg, HeapWord* end) const; |
duke@435 | 147 | inline HeapWord* find_obj_end(HeapWord* beg, HeapWord* end) const; |
duke@435 | 148 | |
duke@435 | 149 | // Clear a range of bits or the entire bitmap (both begin and end bits are |
duke@435 | 150 | // cleared). |
duke@435 | 151 | inline void clear_range(idx_t beg, idx_t end); |
duke@435 | 152 | inline void clear() { clear_range(0, size()); } |
duke@435 | 153 | |
duke@435 | 154 | // Return the number of bits required to represent the specified number of |
duke@435 | 155 | // HeapWords, or the specified region. |
duke@435 | 156 | static inline idx_t bits_required(size_t words); |
duke@435 | 157 | static inline idx_t bits_required(MemRegion covered_region); |
duke@435 | 158 | static inline idx_t words_required(MemRegion covered_region); |
duke@435 | 159 | |
duke@435 | 160 | #ifndef PRODUCT |
duke@435 | 161 | // CAS statistics. |
duke@435 | 162 | size_t cas_tries() { return _cas_tries; } |
duke@435 | 163 | size_t cas_retries() { return _cas_retries; } |
duke@435 | 164 | size_t cas_by_another() { return _cas_by_another; } |
duke@435 | 165 | |
duke@435 | 166 | void reset_counters(); |
duke@435 | 167 | #endif // #ifndef PRODUCT |
duke@435 | 168 | |
duke@435 | 169 | #ifdef ASSERT |
duke@435 | 170 | void verify_clear() const; |
duke@435 | 171 | inline void verify_bit(idx_t bit) const; |
duke@435 | 172 | inline void verify_addr(HeapWord* addr) const; |
duke@435 | 173 | #endif // #ifdef ASSERT |
duke@435 | 174 | |
duke@435 | 175 | private: |
duke@435 | 176 | // Each bit in the bitmap represents one unit of 'object granularity.' Objects |
duke@435 | 177 | // are double-word aligned in 32-bit VMs, but not in 64-bit VMs, so the 32-bit |
duke@435 | 178 | // granularity is 2, 64-bit is 1. |
duke@435 | 179 | static inline size_t obj_granularity() { return size_t(MinObjAlignment); } |
duke@435 | 180 | |
duke@435 | 181 | HeapWord* _region_start; |
duke@435 | 182 | size_t _region_size; |
duke@435 | 183 | BitMap _beg_bits; |
duke@435 | 184 | BitMap _end_bits; |
duke@435 | 185 | PSVirtualSpace* _virtual_space; |
duke@435 | 186 | |
duke@435 | 187 | #ifndef PRODUCT |
duke@435 | 188 | size_t _cas_tries; |
duke@435 | 189 | size_t _cas_retries; |
duke@435 | 190 | size_t _cas_by_another; |
duke@435 | 191 | #endif // #ifndef PRODUCT |
duke@435 | 192 | }; |
duke@435 | 193 | |
duke@435 | 194 | inline ParMarkBitMap::ParMarkBitMap(): |
ysr@777 | 195 | _beg_bits(), |
ysr@777 | 196 | _end_bits() |
duke@435 | 197 | { |
duke@435 | 198 | _region_start = 0; |
duke@435 | 199 | _virtual_space = 0; |
duke@435 | 200 | } |
duke@435 | 201 | |
duke@435 | 202 | inline ParMarkBitMap::ParMarkBitMap(MemRegion covered_region): |
ysr@777 | 203 | _beg_bits(), |
ysr@777 | 204 | _end_bits() |
duke@435 | 205 | { |
duke@435 | 206 | initialize(covered_region); |
duke@435 | 207 | } |
duke@435 | 208 | |
duke@435 | 209 | inline void ParMarkBitMap::clear_range(idx_t beg, idx_t end) |
duke@435 | 210 | { |
duke@435 | 211 | _beg_bits.clear_range(beg, end); |
duke@435 | 212 | _end_bits.clear_range(beg, end); |
duke@435 | 213 | } |
duke@435 | 214 | |
duke@435 | 215 | inline ParMarkBitMap::idx_t |
duke@435 | 216 | ParMarkBitMap::bits_required(size_t words) |
duke@435 | 217 | { |
duke@435 | 218 | // Need two bits (one begin bit, one end bit) for each unit of 'object |
duke@435 | 219 | // granularity' in the heap. |
duke@435 | 220 | return words_to_bits(words * 2); |
duke@435 | 221 | } |
duke@435 | 222 | |
duke@435 | 223 | inline ParMarkBitMap::idx_t |
duke@435 | 224 | ParMarkBitMap::bits_required(MemRegion covered_region) |
duke@435 | 225 | { |
duke@435 | 226 | return bits_required(covered_region.word_size()); |
duke@435 | 227 | } |
duke@435 | 228 | |
duke@435 | 229 | inline ParMarkBitMap::idx_t |
duke@435 | 230 | ParMarkBitMap::words_required(MemRegion covered_region) |
duke@435 | 231 | { |
duke@435 | 232 | return bits_required(covered_region) / BitsPerWord; |
duke@435 | 233 | } |
duke@435 | 234 | |
duke@435 | 235 | inline HeapWord* |
duke@435 | 236 | ParMarkBitMap::region_start() const |
duke@435 | 237 | { |
duke@435 | 238 | return _region_start; |
duke@435 | 239 | } |
duke@435 | 240 | |
duke@435 | 241 | inline HeapWord* |
duke@435 | 242 | ParMarkBitMap::region_end() const |
duke@435 | 243 | { |
duke@435 | 244 | return region_start() + region_size(); |
duke@435 | 245 | } |
duke@435 | 246 | |
duke@435 | 247 | inline size_t |
duke@435 | 248 | ParMarkBitMap::region_size() const |
duke@435 | 249 | { |
duke@435 | 250 | return _region_size; |
duke@435 | 251 | } |
duke@435 | 252 | |
duke@435 | 253 | inline size_t |
duke@435 | 254 | ParMarkBitMap::size() const |
duke@435 | 255 | { |
duke@435 | 256 | return _beg_bits.size(); |
duke@435 | 257 | } |
duke@435 | 258 | |
duke@435 | 259 | inline bool ParMarkBitMap::is_obj_beg(idx_t bit) const |
duke@435 | 260 | { |
duke@435 | 261 | return _beg_bits.at(bit); |
duke@435 | 262 | } |
duke@435 | 263 | |
duke@435 | 264 | inline bool ParMarkBitMap::is_obj_end(idx_t bit) const |
duke@435 | 265 | { |
duke@435 | 266 | return _end_bits.at(bit); |
duke@435 | 267 | } |
duke@435 | 268 | |
duke@435 | 269 | inline bool ParMarkBitMap::is_marked(idx_t bit) const |
duke@435 | 270 | { |
duke@435 | 271 | return is_obj_beg(bit); |
duke@435 | 272 | } |
duke@435 | 273 | |
duke@435 | 274 | inline bool ParMarkBitMap::is_marked(HeapWord* addr) const |
duke@435 | 275 | { |
duke@435 | 276 | return is_marked(addr_to_bit(addr)); |
duke@435 | 277 | } |
duke@435 | 278 | |
duke@435 | 279 | inline bool ParMarkBitMap::is_marked(oop obj) const |
duke@435 | 280 | { |
duke@435 | 281 | return is_marked((HeapWord*)obj); |
duke@435 | 282 | } |
duke@435 | 283 | |
duke@435 | 284 | inline bool ParMarkBitMap::is_unmarked(idx_t bit) const |
duke@435 | 285 | { |
duke@435 | 286 | return !is_marked(bit); |
duke@435 | 287 | } |
duke@435 | 288 | |
duke@435 | 289 | inline bool ParMarkBitMap::is_unmarked(HeapWord* addr) const |
duke@435 | 290 | { |
duke@435 | 291 | return !is_marked(addr); |
duke@435 | 292 | } |
duke@435 | 293 | |
duke@435 | 294 | inline bool ParMarkBitMap::is_unmarked(oop obj) const |
duke@435 | 295 | { |
duke@435 | 296 | return !is_marked(obj); |
duke@435 | 297 | } |
duke@435 | 298 | |
duke@435 | 299 | inline size_t |
duke@435 | 300 | ParMarkBitMap::bits_to_words(idx_t bits) |
duke@435 | 301 | { |
duke@435 | 302 | return bits * obj_granularity(); |
duke@435 | 303 | } |
duke@435 | 304 | |
duke@435 | 305 | inline ParMarkBitMap::idx_t |
duke@435 | 306 | ParMarkBitMap::words_to_bits(size_t words) |
duke@435 | 307 | { |
duke@435 | 308 | return words / obj_granularity(); |
duke@435 | 309 | } |
duke@435 | 310 | |
duke@435 | 311 | inline size_t ParMarkBitMap::obj_size(idx_t beg_bit, idx_t end_bit) const |
duke@435 | 312 | { |
duke@435 | 313 | DEBUG_ONLY(verify_bit(beg_bit);) |
duke@435 | 314 | DEBUG_ONLY(verify_bit(end_bit);) |
duke@435 | 315 | return bits_to_words(end_bit - beg_bit + 1); |
duke@435 | 316 | } |
duke@435 | 317 | |
duke@435 | 318 | inline size_t |
duke@435 | 319 | ParMarkBitMap::obj_size(HeapWord* beg_addr, HeapWord* end_addr) const |
duke@435 | 320 | { |
duke@435 | 321 | DEBUG_ONLY(verify_addr(beg_addr);) |
duke@435 | 322 | DEBUG_ONLY(verify_addr(end_addr);) |
duke@435 | 323 | return pointer_delta(end_addr, beg_addr) + obj_granularity(); |
duke@435 | 324 | } |
duke@435 | 325 | |
duke@435 | 326 | inline size_t ParMarkBitMap::obj_size(idx_t beg_bit) const |
duke@435 | 327 | { |
ysr@777 | 328 | const idx_t end_bit = _end_bits.get_next_one_offset_inline(beg_bit, size()); |
duke@435 | 329 | assert(is_marked(beg_bit), "obj not marked"); |
duke@435 | 330 | assert(end_bit < size(), "end bit missing"); |
duke@435 | 331 | return obj_size(beg_bit, end_bit); |
duke@435 | 332 | } |
duke@435 | 333 | |
duke@435 | 334 | inline size_t ParMarkBitMap::obj_size(HeapWord* addr) const |
duke@435 | 335 | { |
duke@435 | 336 | return obj_size(addr_to_bit(addr)); |
duke@435 | 337 | } |
duke@435 | 338 | |
duke@435 | 339 | inline size_t ParMarkBitMap::obj_size(oop obj) const |
duke@435 | 340 | { |
duke@435 | 341 | return obj_size((HeapWord*)obj); |
duke@435 | 342 | } |
duke@435 | 343 | |
duke@435 | 344 | inline ParMarkBitMap::IterationStatus |
duke@435 | 345 | ParMarkBitMap::iterate(ParMarkBitMapClosure* live_closure, |
duke@435 | 346 | HeapWord* range_beg, |
duke@435 | 347 | HeapWord* range_end) const |
duke@435 | 348 | { |
duke@435 | 349 | return iterate(live_closure, addr_to_bit(range_beg), addr_to_bit(range_end)); |
duke@435 | 350 | } |
duke@435 | 351 | |
duke@435 | 352 | inline ParMarkBitMap::IterationStatus |
duke@435 | 353 | ParMarkBitMap::iterate(ParMarkBitMapClosure* live_closure, |
duke@435 | 354 | ParMarkBitMapClosure* dead_closure, |
duke@435 | 355 | HeapWord* range_beg, |
duke@435 | 356 | HeapWord* range_end, |
duke@435 | 357 | HeapWord* dead_range_end) const |
duke@435 | 358 | { |
duke@435 | 359 | return iterate(live_closure, dead_closure, |
duke@435 | 360 | addr_to_bit(range_beg), addr_to_bit(range_end), |
duke@435 | 361 | addr_to_bit(dead_range_end)); |
duke@435 | 362 | } |
duke@435 | 363 | |
duke@435 | 364 | inline bool |
duke@435 | 365 | ParMarkBitMap::mark_obj(oop obj, int size) |
duke@435 | 366 | { |
duke@435 | 367 | return mark_obj((HeapWord*)obj, (size_t)size); |
duke@435 | 368 | } |
duke@435 | 369 | |
duke@435 | 370 | inline BitMap::idx_t |
duke@435 | 371 | ParMarkBitMap::addr_to_bit(HeapWord* addr) const |
duke@435 | 372 | { |
duke@435 | 373 | DEBUG_ONLY(verify_addr(addr);) |
duke@435 | 374 | return words_to_bits(pointer_delta(addr, region_start())); |
duke@435 | 375 | } |
duke@435 | 376 | |
duke@435 | 377 | inline HeapWord* |
duke@435 | 378 | ParMarkBitMap::bit_to_addr(idx_t bit) const |
duke@435 | 379 | { |
duke@435 | 380 | DEBUG_ONLY(verify_bit(bit);) |
duke@435 | 381 | return region_start() + bits_to_words(bit); |
duke@435 | 382 | } |
duke@435 | 383 | |
duke@435 | 384 | inline ParMarkBitMap::idx_t |
duke@435 | 385 | ParMarkBitMap::find_obj_beg(idx_t beg, idx_t end) const |
duke@435 | 386 | { |
ysr@777 | 387 | return _beg_bits.get_next_one_offset_inline_aligned_right(beg, end); |
duke@435 | 388 | } |
duke@435 | 389 | |
duke@435 | 390 | inline ParMarkBitMap::idx_t |
duke@435 | 391 | ParMarkBitMap::find_obj_end(idx_t beg, idx_t end) const |
duke@435 | 392 | { |
ysr@777 | 393 | return _end_bits.get_next_one_offset_inline_aligned_right(beg, end); |
duke@435 | 394 | } |
duke@435 | 395 | |
duke@435 | 396 | inline HeapWord* |
duke@435 | 397 | ParMarkBitMap::find_obj_beg(HeapWord* beg, HeapWord* end) const |
duke@435 | 398 | { |
duke@435 | 399 | const idx_t beg_bit = addr_to_bit(beg); |
duke@435 | 400 | const idx_t end_bit = addr_to_bit(end); |
duke@435 | 401 | const idx_t search_end = BitMap::word_align_up(end_bit); |
duke@435 | 402 | const idx_t res_bit = MIN2(find_obj_beg(beg_bit, search_end), end_bit); |
duke@435 | 403 | return bit_to_addr(res_bit); |
duke@435 | 404 | } |
duke@435 | 405 | |
duke@435 | 406 | inline HeapWord* |
duke@435 | 407 | ParMarkBitMap::find_obj_end(HeapWord* beg, HeapWord* end) const |
duke@435 | 408 | { |
duke@435 | 409 | const idx_t beg_bit = addr_to_bit(beg); |
duke@435 | 410 | const idx_t end_bit = addr_to_bit(end); |
duke@435 | 411 | const idx_t search_end = BitMap::word_align_up(end_bit); |
duke@435 | 412 | const idx_t res_bit = MIN2(find_obj_end(beg_bit, search_end), end_bit); |
duke@435 | 413 | return bit_to_addr(res_bit); |
duke@435 | 414 | } |
duke@435 | 415 | |
duke@435 | 416 | #ifdef ASSERT |
duke@435 | 417 | inline void ParMarkBitMap::verify_bit(idx_t bit) const { |
duke@435 | 418 | // Allow one past the last valid bit; useful for loop bounds. |
duke@435 | 419 | assert(bit <= _beg_bits.size(), "bit out of range"); |
duke@435 | 420 | } |
duke@435 | 421 | |
duke@435 | 422 | inline void ParMarkBitMap::verify_addr(HeapWord* addr) const { |
duke@435 | 423 | // Allow one past the last valid address; useful for loop bounds. |
duke@435 | 424 | assert(addr >= region_start(), "addr too small"); |
duke@435 | 425 | assert(addr <= region_start() + region_size(), "addr too big"); |
duke@435 | 426 | } |
duke@435 | 427 | #endif // #ifdef ASSERT |