src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp

Wed, 27 Apr 2016 01:25:04 +0800

author
aoqi
date
Wed, 27 Apr 2016 01:25:04 +0800
changeset 0
f90c822e73f8
child 6876
710a3c8b516e
permissions
-rw-r--r--

Initial load
http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/
changeset: 6782:28b50d07f6f8
tag: jdk8u25-b17

aoqi@0 1 /*
aoqi@0 2 * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 *
aoqi@0 5 * This code is free software; you can redistribute it and/or modify it
aoqi@0 6 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 * published by the Free Software Foundation.
aoqi@0 8 *
aoqi@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 12 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 13 * accompanied this code).
aoqi@0 14 *
aoqi@0 15 * You should have received a copy of the GNU General Public License version
aoqi@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 18 *
aoqi@0 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 20 * or visit www.oracle.com if you need additional information or have any
aoqi@0 21 * questions.
aoqi@0 22 *
aoqi@0 23 */
aoqi@0 24
aoqi@0 25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARK_INLINE_HPP
aoqi@0 26 #define SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARK_INLINE_HPP
aoqi@0 27
aoqi@0 28 #include "gc_implementation/g1/concurrentMark.hpp"
aoqi@0 29 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
aoqi@0 30
aoqi@0 31 // Utility routine to set an exclusive range of cards on the given
aoqi@0 32 // card liveness bitmap
aoqi@0 33 inline void ConcurrentMark::set_card_bitmap_range(BitMap* card_bm,
aoqi@0 34 BitMap::idx_t start_idx,
aoqi@0 35 BitMap::idx_t end_idx,
aoqi@0 36 bool is_par) {
aoqi@0 37
aoqi@0 38 // Set the exclusive bit range [start_idx, end_idx).
aoqi@0 39 assert((end_idx - start_idx) > 0, "at least one card");
aoqi@0 40 assert(end_idx <= card_bm->size(), "sanity");
aoqi@0 41
aoqi@0 42 // Silently clip the end index
aoqi@0 43 end_idx = MIN2(end_idx, card_bm->size());
aoqi@0 44
aoqi@0 45 // For small ranges use a simple loop; otherwise use set_range or
aoqi@0 46 // use par_at_put_range (if parallel). The range is made up of the
aoqi@0 47 // cards that are spanned by an object/mem region so 8 cards will
aoqi@0 48 // allow up to object sizes up to 4K to be handled using the loop.
aoqi@0 49 if ((end_idx - start_idx) <= 8) {
aoqi@0 50 for (BitMap::idx_t i = start_idx; i < end_idx; i += 1) {
aoqi@0 51 if (is_par) {
aoqi@0 52 card_bm->par_set_bit(i);
aoqi@0 53 } else {
aoqi@0 54 card_bm->set_bit(i);
aoqi@0 55 }
aoqi@0 56 }
aoqi@0 57 } else {
aoqi@0 58 // Note BitMap::par_at_put_range() and BitMap::set_range() are exclusive.
aoqi@0 59 if (is_par) {
aoqi@0 60 card_bm->par_at_put_range(start_idx, end_idx, true);
aoqi@0 61 } else {
aoqi@0 62 card_bm->set_range(start_idx, end_idx);
aoqi@0 63 }
aoqi@0 64 }
aoqi@0 65 }
aoqi@0 66
aoqi@0 67 // Returns the index in the liveness accounting card bitmap
aoqi@0 68 // for the given address
aoqi@0 69 inline BitMap::idx_t ConcurrentMark::card_bitmap_index_for(HeapWord* addr) {
aoqi@0 70 // Below, the term "card num" means the result of shifting an address
aoqi@0 71 // by the card shift -- address 0 corresponds to card number 0. One
aoqi@0 72 // must subtract the card num of the bottom of the heap to obtain a
aoqi@0 73 // card table index.
aoqi@0 74 intptr_t card_num = intptr_t(uintptr_t(addr) >> CardTableModRefBS::card_shift);
aoqi@0 75 return card_num - heap_bottom_card_num();
aoqi@0 76 }
aoqi@0 77
aoqi@0 78 // Counts the given memory region in the given task/worker
aoqi@0 79 // counting data structures.
aoqi@0 80 inline void ConcurrentMark::count_region(MemRegion mr, HeapRegion* hr,
aoqi@0 81 size_t* marked_bytes_array,
aoqi@0 82 BitMap* task_card_bm) {
aoqi@0 83 G1CollectedHeap* g1h = _g1h;
aoqi@0 84 CardTableModRefBS* ct_bs = g1h->g1_barrier_set();
aoqi@0 85
aoqi@0 86 HeapWord* start = mr.start();
aoqi@0 87 HeapWord* end = mr.end();
aoqi@0 88 size_t region_size_bytes = mr.byte_size();
aoqi@0 89 uint index = hr->hrs_index();
aoqi@0 90
aoqi@0 91 assert(!hr->continuesHumongous(), "should not be HC region");
aoqi@0 92 assert(hr == g1h->heap_region_containing(start), "sanity");
aoqi@0 93 assert(hr == g1h->heap_region_containing(mr.last()), "sanity");
aoqi@0 94 assert(marked_bytes_array != NULL, "pre-condition");
aoqi@0 95 assert(task_card_bm != NULL, "pre-condition");
aoqi@0 96
aoqi@0 97 // Add to the task local marked bytes for this region.
aoqi@0 98 marked_bytes_array[index] += region_size_bytes;
aoqi@0 99
aoqi@0 100 BitMap::idx_t start_idx = card_bitmap_index_for(start);
aoqi@0 101 BitMap::idx_t end_idx = card_bitmap_index_for(end);
aoqi@0 102
aoqi@0 103 // Note: if we're looking at the last region in heap - end
aoqi@0 104 // could be actually just beyond the end of the heap; end_idx
aoqi@0 105 // will then correspond to a (non-existent) card that is also
aoqi@0 106 // just beyond the heap.
aoqi@0 107 if (g1h->is_in_g1_reserved(end) && !ct_bs->is_card_aligned(end)) {
aoqi@0 108 // end of region is not card aligned - incremement to cover
aoqi@0 109 // all the cards spanned by the region.
aoqi@0 110 end_idx += 1;
aoqi@0 111 }
aoqi@0 112 // The card bitmap is task/worker specific => no need to use
aoqi@0 113 // the 'par' BitMap routines.
aoqi@0 114 // Set bits in the exclusive bit range [start_idx, end_idx).
aoqi@0 115 set_card_bitmap_range(task_card_bm, start_idx, end_idx, false /* is_par */);
aoqi@0 116 }
aoqi@0 117
aoqi@0 118 // Counts the given memory region in the task/worker counting
aoqi@0 119 // data structures for the given worker id.
aoqi@0 120 inline void ConcurrentMark::count_region(MemRegion mr,
aoqi@0 121 HeapRegion* hr,
aoqi@0 122 uint worker_id) {
aoqi@0 123 size_t* marked_bytes_array = count_marked_bytes_array_for(worker_id);
aoqi@0 124 BitMap* task_card_bm = count_card_bitmap_for(worker_id);
aoqi@0 125 count_region(mr, hr, marked_bytes_array, task_card_bm);
aoqi@0 126 }
aoqi@0 127
aoqi@0 128 // Counts the given memory region, which may be a single object, in the
aoqi@0 129 // task/worker counting data structures for the given worker id.
aoqi@0 130 inline void ConcurrentMark::count_region(MemRegion mr, uint worker_id) {
aoqi@0 131 HeapWord* addr = mr.start();
aoqi@0 132 HeapRegion* hr = _g1h->heap_region_containing_raw(addr);
aoqi@0 133 count_region(mr, hr, worker_id);
aoqi@0 134 }
aoqi@0 135
aoqi@0 136 // Counts the given object in the given task/worker counting data structures.
aoqi@0 137 inline void ConcurrentMark::count_object(oop obj,
aoqi@0 138 HeapRegion* hr,
aoqi@0 139 size_t* marked_bytes_array,
aoqi@0 140 BitMap* task_card_bm) {
aoqi@0 141 MemRegion mr((HeapWord*)obj, obj->size());
aoqi@0 142 count_region(mr, hr, marked_bytes_array, task_card_bm);
aoqi@0 143 }
aoqi@0 144
aoqi@0 145 // Counts the given object in the task/worker counting data
aoqi@0 146 // structures for the given worker id.
aoqi@0 147 inline void ConcurrentMark::count_object(oop obj,
aoqi@0 148 HeapRegion* hr,
aoqi@0 149 uint worker_id) {
aoqi@0 150 size_t* marked_bytes_array = count_marked_bytes_array_for(worker_id);
aoqi@0 151 BitMap* task_card_bm = count_card_bitmap_for(worker_id);
aoqi@0 152 HeapWord* addr = (HeapWord*) obj;
aoqi@0 153 count_object(obj, hr, marked_bytes_array, task_card_bm);
aoqi@0 154 }
aoqi@0 155
aoqi@0 156 // Attempts to mark the given object and, if successful, counts
aoqi@0 157 // the object in the given task/worker counting structures.
aoqi@0 158 inline bool ConcurrentMark::par_mark_and_count(oop obj,
aoqi@0 159 HeapRegion* hr,
aoqi@0 160 size_t* marked_bytes_array,
aoqi@0 161 BitMap* task_card_bm) {
aoqi@0 162 HeapWord* addr = (HeapWord*)obj;
aoqi@0 163 if (_nextMarkBitMap->parMark(addr)) {
aoqi@0 164 // Update the task specific count data for the object.
aoqi@0 165 count_object(obj, hr, marked_bytes_array, task_card_bm);
aoqi@0 166 return true;
aoqi@0 167 }
aoqi@0 168 return false;
aoqi@0 169 }
aoqi@0 170
aoqi@0 171 // Attempts to mark the given object and, if successful, counts
aoqi@0 172 // the object in the task/worker counting structures for the
aoqi@0 173 // given worker id.
aoqi@0 174 inline bool ConcurrentMark::par_mark_and_count(oop obj,
aoqi@0 175 size_t word_size,
aoqi@0 176 HeapRegion* hr,
aoqi@0 177 uint worker_id) {
aoqi@0 178 HeapWord* addr = (HeapWord*)obj;
aoqi@0 179 if (_nextMarkBitMap->parMark(addr)) {
aoqi@0 180 MemRegion mr(addr, word_size);
aoqi@0 181 count_region(mr, hr, worker_id);
aoqi@0 182 return true;
aoqi@0 183 }
aoqi@0 184 return false;
aoqi@0 185 }
aoqi@0 186
aoqi@0 187 // Attempts to mark the given object and, if successful, counts
aoqi@0 188 // the object in the task/worker counting structures for the
aoqi@0 189 // given worker id.
aoqi@0 190 inline bool ConcurrentMark::par_mark_and_count(oop obj,
aoqi@0 191 HeapRegion* hr,
aoqi@0 192 uint worker_id) {
aoqi@0 193 HeapWord* addr = (HeapWord*)obj;
aoqi@0 194 if (_nextMarkBitMap->parMark(addr)) {
aoqi@0 195 // Update the task specific count data for the object.
aoqi@0 196 count_object(obj, hr, worker_id);
aoqi@0 197 return true;
aoqi@0 198 }
aoqi@0 199 return false;
aoqi@0 200 }
aoqi@0 201
aoqi@0 202 // As above - but we don't know the heap region containing the
aoqi@0 203 // object and so have to supply it.
aoqi@0 204 inline bool ConcurrentMark::par_mark_and_count(oop obj, uint worker_id) {
aoqi@0 205 HeapWord* addr = (HeapWord*)obj;
aoqi@0 206 HeapRegion* hr = _g1h->heap_region_containing_raw(addr);
aoqi@0 207 return par_mark_and_count(obj, hr, worker_id);
aoqi@0 208 }
aoqi@0 209
aoqi@0 210 // Similar to the above routine but we already know the size, in words, of
aoqi@0 211 // the object that we wish to mark/count
aoqi@0 212 inline bool ConcurrentMark::par_mark_and_count(oop obj,
aoqi@0 213 size_t word_size,
aoqi@0 214 uint worker_id) {
aoqi@0 215 HeapWord* addr = (HeapWord*)obj;
aoqi@0 216 if (_nextMarkBitMap->parMark(addr)) {
aoqi@0 217 // Update the task specific count data for the object.
aoqi@0 218 MemRegion mr(addr, word_size);
aoqi@0 219 count_region(mr, worker_id);
aoqi@0 220 return true;
aoqi@0 221 }
aoqi@0 222 return false;
aoqi@0 223 }
aoqi@0 224
aoqi@0 225 // Unconditionally mark the given object, and unconditinally count
aoqi@0 226 // the object in the counting structures for worker id 0.
aoqi@0 227 // Should *not* be called from parallel code.
aoqi@0 228 inline bool ConcurrentMark::mark_and_count(oop obj, HeapRegion* hr) {
aoqi@0 229 HeapWord* addr = (HeapWord*)obj;
aoqi@0 230 _nextMarkBitMap->mark(addr);
aoqi@0 231 // Update the task specific count data for the object.
aoqi@0 232 count_object(obj, hr, 0 /* worker_id */);
aoqi@0 233 return true;
aoqi@0 234 }
aoqi@0 235
aoqi@0 236 // As above - but we don't have the heap region containing the
aoqi@0 237 // object, so we have to supply it.
aoqi@0 238 inline bool ConcurrentMark::mark_and_count(oop obj) {
aoqi@0 239 HeapWord* addr = (HeapWord*)obj;
aoqi@0 240 HeapRegion* hr = _g1h->heap_region_containing_raw(addr);
aoqi@0 241 return mark_and_count(obj, hr);
aoqi@0 242 }
aoqi@0 243
aoqi@0 244 inline bool CMBitMapRO::iterate(BitMapClosure* cl, MemRegion mr) {
aoqi@0 245 HeapWord* start_addr = MAX2(startWord(), mr.start());
aoqi@0 246 HeapWord* end_addr = MIN2(endWord(), mr.end());
aoqi@0 247
aoqi@0 248 if (end_addr > start_addr) {
aoqi@0 249 // Right-open interval [start-offset, end-offset).
aoqi@0 250 BitMap::idx_t start_offset = heapWordToOffset(start_addr);
aoqi@0 251 BitMap::idx_t end_offset = heapWordToOffset(end_addr);
aoqi@0 252
aoqi@0 253 start_offset = _bm.get_next_one_offset(start_offset, end_offset);
aoqi@0 254 while (start_offset < end_offset) {
aoqi@0 255 if (!cl->do_bit(start_offset)) {
aoqi@0 256 return false;
aoqi@0 257 }
aoqi@0 258 HeapWord* next_addr = MIN2(nextObject(offsetToHeapWord(start_offset)), end_addr);
aoqi@0 259 BitMap::idx_t next_offset = heapWordToOffset(next_addr);
aoqi@0 260 start_offset = _bm.get_next_one_offset(next_offset, end_offset);
aoqi@0 261 }
aoqi@0 262 }
aoqi@0 263 return true;
aoqi@0 264 }
aoqi@0 265
aoqi@0 266 inline bool CMBitMapRO::iterate(BitMapClosure* cl) {
aoqi@0 267 MemRegion mr(startWord(), sizeInWords());
aoqi@0 268 return iterate(cl, mr);
aoqi@0 269 }
aoqi@0 270
aoqi@0 271 inline void CMTask::push(oop obj) {
aoqi@0 272 HeapWord* objAddr = (HeapWord*) obj;
aoqi@0 273 assert(_g1h->is_in_g1_reserved(objAddr), "invariant");
aoqi@0 274 assert(!_g1h->is_on_master_free_list(
aoqi@0 275 _g1h->heap_region_containing((HeapWord*) objAddr)), "invariant");
aoqi@0 276 assert(!_g1h->is_obj_ill(obj), "invariant");
aoqi@0 277 assert(_nextMarkBitMap->isMarked(objAddr), "invariant");
aoqi@0 278
aoqi@0 279 if (_cm->verbose_high()) {
aoqi@0 280 gclog_or_tty->print_cr("[%u] pushing " PTR_FORMAT, _worker_id, p2i((void*) obj));
aoqi@0 281 }
aoqi@0 282
aoqi@0 283 if (!_task_queue->push(obj)) {
aoqi@0 284 // The local task queue looks full. We need to push some entries
aoqi@0 285 // to the global stack.
aoqi@0 286
aoqi@0 287 if (_cm->verbose_medium()) {
aoqi@0 288 gclog_or_tty->print_cr("[%u] task queue overflow, "
aoqi@0 289 "moving entries to the global stack",
aoqi@0 290 _worker_id);
aoqi@0 291 }
aoqi@0 292 move_entries_to_global_stack();
aoqi@0 293
aoqi@0 294 // this should succeed since, even if we overflow the global
aoqi@0 295 // stack, we should have definitely removed some entries from the
aoqi@0 296 // local queue. So, there must be space on it.
aoqi@0 297 bool success = _task_queue->push(obj);
aoqi@0 298 assert(success, "invariant");
aoqi@0 299 }
aoqi@0 300
aoqi@0 301 statsOnly( int tmp_size = _task_queue->size();
aoqi@0 302 if (tmp_size > _local_max_size) {
aoqi@0 303 _local_max_size = tmp_size;
aoqi@0 304 }
aoqi@0 305 ++_local_pushes );
aoqi@0 306 }
aoqi@0 307
aoqi@0 308 // This determines whether the method below will check both the local
aoqi@0 309 // and global fingers when determining whether to push on the stack a
aoqi@0 310 // gray object (value 1) or whether it will only check the global one
aoqi@0 311 // (value 0). The tradeoffs are that the former will be a bit more
aoqi@0 312 // accurate and possibly push less on the stack, but it might also be
aoqi@0 313 // a little bit slower.
aoqi@0 314
aoqi@0 315 #define _CHECK_BOTH_FINGERS_ 1
aoqi@0 316
aoqi@0 317 inline void CMTask::deal_with_reference(oop obj) {
aoqi@0 318 if (_cm->verbose_high()) {
aoqi@0 319 gclog_or_tty->print_cr("[%u] we're dealing with reference = "PTR_FORMAT,
aoqi@0 320 _worker_id, p2i((void*) obj));
aoqi@0 321 }
aoqi@0 322
aoqi@0 323 ++_refs_reached;
aoqi@0 324
aoqi@0 325 HeapWord* objAddr = (HeapWord*) obj;
aoqi@0 326 assert(obj->is_oop_or_null(true /* ignore mark word */), "Error");
aoqi@0 327 if (_g1h->is_in_g1_reserved(objAddr)) {
aoqi@0 328 assert(obj != NULL, "null check is implicit");
aoqi@0 329 if (!_nextMarkBitMap->isMarked(objAddr)) {
aoqi@0 330 // Only get the containing region if the object is not marked on the
aoqi@0 331 // bitmap (otherwise, it's a waste of time since we won't do
aoqi@0 332 // anything with it).
aoqi@0 333 HeapRegion* hr = _g1h->heap_region_containing_raw(obj);
aoqi@0 334 if (!hr->obj_allocated_since_next_marking(obj)) {
aoqi@0 335 if (_cm->verbose_high()) {
aoqi@0 336 gclog_or_tty->print_cr("[%u] "PTR_FORMAT" is not considered marked",
aoqi@0 337 _worker_id, p2i((void*) obj));
aoqi@0 338 }
aoqi@0 339
aoqi@0 340 // we need to mark it first
aoqi@0 341 if (_cm->par_mark_and_count(obj, hr, _marked_bytes_array, _card_bm)) {
aoqi@0 342 // No OrderAccess:store_load() is needed. It is implicit in the
aoqi@0 343 // CAS done in CMBitMap::parMark() call in the routine above.
aoqi@0 344 HeapWord* global_finger = _cm->finger();
aoqi@0 345
aoqi@0 346 #if _CHECK_BOTH_FINGERS_
aoqi@0 347 // we will check both the local and global fingers
aoqi@0 348
aoqi@0 349 if (_finger != NULL && objAddr < _finger) {
aoqi@0 350 if (_cm->verbose_high()) {
aoqi@0 351 gclog_or_tty->print_cr("[%u] below the local finger ("PTR_FORMAT"), "
aoqi@0 352 "pushing it", _worker_id, p2i(_finger));
aoqi@0 353 }
aoqi@0 354 push(obj);
aoqi@0 355 } else if (_curr_region != NULL && objAddr < _region_limit) {
aoqi@0 356 // do nothing
aoqi@0 357 } else if (objAddr < global_finger) {
aoqi@0 358 // Notice that the global finger might be moving forward
aoqi@0 359 // concurrently. This is not a problem. In the worst case, we
aoqi@0 360 // mark the object while it is above the global finger and, by
aoqi@0 361 // the time we read the global finger, it has moved forward
aoqi@0 362 // passed this object. In this case, the object will probably
aoqi@0 363 // be visited when a task is scanning the region and will also
aoqi@0 364 // be pushed on the stack. So, some duplicate work, but no
aoqi@0 365 // correctness problems.
aoqi@0 366
aoqi@0 367 if (_cm->verbose_high()) {
aoqi@0 368 gclog_or_tty->print_cr("[%u] below the global finger "
aoqi@0 369 "("PTR_FORMAT"), pushing it",
aoqi@0 370 _worker_id, p2i(global_finger));
aoqi@0 371 }
aoqi@0 372 push(obj);
aoqi@0 373 } else {
aoqi@0 374 // do nothing
aoqi@0 375 }
aoqi@0 376 #else // _CHECK_BOTH_FINGERS_
aoqi@0 377 // we will only check the global finger
aoqi@0 378
aoqi@0 379 if (objAddr < global_finger) {
aoqi@0 380 // see long comment above
aoqi@0 381
aoqi@0 382 if (_cm->verbose_high()) {
aoqi@0 383 gclog_or_tty->print_cr("[%u] below the global finger "
aoqi@0 384 "("PTR_FORMAT"), pushing it",
aoqi@0 385 _worker_id, p2i(global_finger));
aoqi@0 386 }
aoqi@0 387 push(obj);
aoqi@0 388 }
aoqi@0 389 #endif // _CHECK_BOTH_FINGERS_
aoqi@0 390 }
aoqi@0 391 }
aoqi@0 392 }
aoqi@0 393 }
aoqi@0 394 }
aoqi@0 395
aoqi@0 396 inline void ConcurrentMark::markPrev(oop p) {
aoqi@0 397 assert(!_prevMarkBitMap->isMarked((HeapWord*) p), "sanity");
aoqi@0 398 // Note we are overriding the read-only view of the prev map here, via
aoqi@0 399 // the cast.
aoqi@0 400 ((CMBitMap*)_prevMarkBitMap)->mark((HeapWord*) p);
aoqi@0 401 }
aoqi@0 402
aoqi@0 403 inline void ConcurrentMark::grayRoot(oop obj, size_t word_size,
aoqi@0 404 uint worker_id, HeapRegion* hr) {
aoqi@0 405 assert(obj != NULL, "pre-condition");
aoqi@0 406 HeapWord* addr = (HeapWord*) obj;
aoqi@0 407 if (hr == NULL) {
aoqi@0 408 hr = _g1h->heap_region_containing_raw(addr);
aoqi@0 409 } else {
aoqi@0 410 assert(hr->is_in(addr), "pre-condition");
aoqi@0 411 }
aoqi@0 412 assert(hr != NULL, "sanity");
aoqi@0 413 // Given that we're looking for a region that contains an object
aoqi@0 414 // header it's impossible to get back a HC region.
aoqi@0 415 assert(!hr->continuesHumongous(), "sanity");
aoqi@0 416
aoqi@0 417 // We cannot assert that word_size == obj->size() given that obj
aoqi@0 418 // might not be in a consistent state (another thread might be in
aoqi@0 419 // the process of copying it). So the best thing we can do is to
aoqi@0 420 // assert that word_size is under an upper bound which is its
aoqi@0 421 // containing region's capacity.
aoqi@0 422 assert(word_size * HeapWordSize <= hr->capacity(),
aoqi@0 423 err_msg("size: "SIZE_FORMAT" capacity: "SIZE_FORMAT" "HR_FORMAT,
aoqi@0 424 word_size * HeapWordSize, hr->capacity(),
aoqi@0 425 HR_FORMAT_PARAMS(hr)));
aoqi@0 426
aoqi@0 427 if (addr < hr->next_top_at_mark_start()) {
aoqi@0 428 if (!_nextMarkBitMap->isMarked(addr)) {
aoqi@0 429 par_mark_and_count(obj, word_size, hr, worker_id);
aoqi@0 430 }
aoqi@0 431 }
aoqi@0 432 }
aoqi@0 433
aoqi@0 434 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARK_INLINE_HPP

mercurial