comparison src/share/vm/gc_implementation/g1/concurrentMark.cpp @ 8034:bce1ac447f6b

7052429: G1: Avoid unnecessary scanning of humongous regions during concurrent marking Summary: Skip unnecessary scanning of bitmap for unmarked humongous objects/regions. Reviewed-by: jwilhelm, johnc Contributed-by: Tao Mao <tao.mao@oracle.com>
author johnc
date Wed, 06 Feb 2013 14:50:37 -0800
parents f90b9bceb8e5
children 5e401ef52ec0
comparison
equal deleted inserted replaced
8015:50d3b37d5bcd 8034:bce1ac447f6b
4064 "["PTR_FORMAT", "PTR_FORMAT") " 4064 "["PTR_FORMAT", "PTR_FORMAT") "
4065 "of region "PTR_FORMAT, 4065 "of region "PTR_FORMAT,
4066 _worker_id, _finger, _region_limit, _curr_region); 4066 _worker_id, _finger, _region_limit, _curr_region);
4067 } 4067 }
4068 4068
4069 // Let's iterate over the bitmap of the part of the 4069 HeapRegion* hr = _g1h->heap_region_containing(mr.start());
4070 // region that is left. 4070 assert(!hr->isHumongous() || mr.start() == hr->bottom(),
4071 if (mr.is_empty() || _nextMarkBitMap->iterate(&bitmap_closure, mr)) { 4071 "the start of HeapRegion and MemRegion should be consistent for humongous regions");
4072 // We successfully completed iterating over the region. Now, 4072
4073 // let's give up the region. 4073 // The special case of the bitmap of a humongous region with its first
4074 // bit NOT marked should be avoided from (wasteful) iterating.
4075 // Note that the alternative case of the bitmap of a humongous region
4076 // with its first bit marked is handled properly in the iterate() routine.
4077 // Then, let's iterate over the bitmap of the part of the region that is
4078 // left.
4079 // If the iteration is successful, give up the region.
4080 // Also note that the case of the bitmap of a humongous region with its
4081 // first bit NOT marked is considered "successful", leveraging the fact
4082 // that the entire bitmap consists of all 0's in such case.
4083 if (mr.is_empty() ||
4084 (hr != NULL && hr->isHumongous() && !_nextMarkBitMap->isMarked(mr.start())) ||
4085 _nextMarkBitMap->iterate(&bitmap_closure, mr)) {
4074 giveup_current_region(); 4086 giveup_current_region();
4075 regular_clock_call(); 4087 regular_clock_call();
4076 } else { 4088 } else {
4077 assert(has_aborted(), "currently the only way to do so"); 4089 assert(has_aborted(), "currently the only way to do so");
4078 // The only way to abort the bitmap iteration is to return 4090 // The only way to abort the bitmap iteration is to return