--- old/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2013-06-26 14:23:58.964410070 -0700 +++ new/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2013-06-26 14:23:58.737749005 -0700 @@ -1176,14 +1176,16 @@ _g1h(g1h), _mr_bs(mr_bs) {} bool doHeapRegion(HeapRegion* r) { + HeapRegionRemSet* hrrs = r->rem_set(); + if (r->continuesHumongous()) { // We'll assert that the strong code root list is empty - assert(r->strong_code_root_list()->is_empty(), "sanity"); + assert(hrrs->strong_code_roots_list_length() == 0, "sanity"); return false; } + _g1h->reset_gc_time_stamps(r); - HeapRegionRemSet* hrrs = r->rem_set(); - if (hrrs != NULL) hrrs->clear(); + hrrs->clear(); // You might think here that we could clear just the cards // corresponding to the used region. But no: if we leave a dirty card // in a region we might allocate into, then it would prevent that card @@ -1191,9 +1193,6 @@ // Re: the performance cost: we shouldn't be doing full GC anyway! _mr_bs->clear(MemRegion(r->bottom(), r->end())); - // We'll also clear the strong code root list for this region - r->strong_code_root_list()->clear(); - return false; } }; @@ -3107,9 +3106,10 @@ // Now fetch the region containing the object HeapRegion* hr = _g1h->heap_region_containing(obj); + HeapRegionRemSet* hrrs = hr->rem_set(); // Verify that the strong code root list for this region // contains the nmethod - if (!hr->strong_code_root_list()->contains(_nm)) { + if (!hrrs->strong_code_roots_list_contains(_nm)) { gclog_or_tty->print_cr("Code root location "PTR_FORMAT" " "from nmethod "PTR_FORMAT" not in strong " "code roots for region ["PTR_FORMAT","PTR_FORMAT")", @@ -6558,7 +6558,7 @@ // entries but having duplicates is OK since we "mark" nmethods // as visited when we scan the strong code root lists during the GC. hr->add_strong_code_root(_nm); - assert(hr->strong_code_root_list()->contains(_nm), "push failed?"); + assert(hr->rem_set()->strong_code_roots_list_contains(_nm), "add failed?"); } } @@ -6581,7 +6581,7 @@ HeapRegion* hr = _g1h->heap_region_containing(obj); assert(!hr->isHumongous(), "code root in humongous region?"); hr->remove_strong_code_root(_nm); - assert(!hr->strong_code_root_list()->contains(_nm), "remove failed?"); + assert(!hr->rem_set()->strong_code_roots_list_contains(_nm), "remove failed?"); } } @@ -6687,9 +6687,10 @@ _g1h(g1h), _worker_id(worker_id) {} bool doHeapRegion(HeapRegion *hr) { + HeapRegionRemSet* hrrs = hr->rem_set(); if (hr->isHumongous()) { // Code roots should never be attached to a humongous region - assert(hr->strong_code_root_list()->is_empty(), "sanity"); + assert(hrrs->strong_code_roots_list_length() == 0, "sanity"); return false; }