src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp

Print this page
rev 6323 : 8027553: Change the in_cset_fast_test functionality to use the G1BiasedArray abstraction
Summary: Instead of using a manually managed array for the in_cset_fast_test array, use a G1BiasedArray instance.
Reviewed-by: brutisso, mgerdin

*** 1509,1521 **** // Start a new incremental collection set for the next pause assert(g1_policy()->collection_set() == NULL, "must be"); g1_policy()->start_incremental_cset_building(); - // Clear the _cset_fast_test bitmap in anticipation of adding - // regions to the incremental collection set for the next - // evacuation pause. clear_cset_fast_test(); init_mutator_alloc_region(); double end = os::elapsedTime(); --- 1509,1518 ----
*** 1931,1942 **** _expand_heap_after_alloc_failure(true), _surviving_young_words(NULL), _old_marking_cycles_started(0), _old_marking_cycles_completed(0), _concurrent_cycle_started(false), ! _in_cset_fast_test(NULL), ! _in_cset_fast_test_base(NULL), _dirty_cards_region_list(NULL), _worker_cset_start_region(NULL), _worker_cset_start_region_time_stamp(NULL), _gc_timer_stw(new (ResourceObj::C_HEAP, mtGC) STWGCTimer()), _gc_timer_cm(new (ResourceObj::C_HEAP, mtGC) ConcurrentGCTimer()), --- 1928,1938 ---- _expand_heap_after_alloc_failure(true), _surviving_young_words(NULL), _old_marking_cycles_started(0), _old_marking_cycles_completed(0), _concurrent_cycle_started(false), ! _in_cset_fast_test(), _dirty_cards_region_list(NULL), _worker_cset_start_region(NULL), _worker_cset_start_region_time_stamp(NULL), _gc_timer_stw(new (ResourceObj::C_HEAP, mtGC) STWGCTimer()), _gc_timer_cm(new (ResourceObj::C_HEAP, mtGC) ConcurrentGCTimer()),
*** 2074,2097 **** _bot_shared = new G1BlockOffsetSharedArray(_reserved, heap_word_size(init_byte_size)); _g1h = this; ! _in_cset_fast_test_length = max_regions(); ! _in_cset_fast_test_base = ! NEW_C_HEAP_ARRAY(bool, (size_t) _in_cset_fast_test_length, mtGC); ! ! // We're biasing _in_cset_fast_test to avoid subtracting the ! // beginning of the heap every time we want to index; basically ! // it's the same with what we do with the card table. ! _in_cset_fast_test = _in_cset_fast_test_base - ! ((uintx) _g1_reserved.start() >> HeapRegion::LogOfHRGrainBytes); ! ! // Clear the _cset_fast_test bitmap in anticipation of adding ! // regions to the incremental collection set for the first ! // evacuation pause. ! clear_cset_fast_test(); // Create the ConcurrentMark data structure and thread. // (Must do this late, so that "max_regions" is defined.) _cm = new ConcurrentMark(this, heap_rs); if (_cm == NULL || !_cm->completed_initialization()) { --- 2070,2080 ---- _bot_shared = new G1BlockOffsetSharedArray(_reserved, heap_word_size(init_byte_size)); _g1h = this; ! _in_cset_fast_test.initialize(_g1_reserved.start(), _g1_reserved.end(), HeapRegion::GrainBytes); // Create the ConcurrentMark data structure and thread. // (Must do this late, so that "max_regions" is defined.) _cm = new ConcurrentMark(this, heap_rs); if (_cm == NULL || !_cm->completed_initialization()) {
*** 4143,4155 **** cleanup_surviving_young_words(); // Start a new incremental collection set for the next pause. g1_policy()->start_incremental_cset_building(); - // Clear the _cset_fast_test bitmap in anticipation of adding - // regions to the incremental collection set for the next - // evacuation pause. clear_cset_fast_test(); _young_list->reset_sampled_info(); // Don't check the whole heap at this point as the --- 4126,4135 ----