comparison src/share/vm/gc_implementation/g1/concurrentMark.cpp @ 4828:851b58c26def

7130334: G1: Change comments and error messages that refer to CMS in g1/concurrentMark.cpp/hpp Summary: Removed references to CMS in the concurrentMark.cpp/hpp files. Reviewed-by: tonyp, jmasa, johnc
author brutisso
date Mon, 16 Jan 2012 11:21:21 +0100
parents 2e966d967c5c
children 0b3d1ec6eaee
comparison
equal deleted inserted replaced
4827:2e966d967c5c 4828:851b58c26def
40 #include "memory/resourceArea.hpp" 40 #include "memory/resourceArea.hpp"
41 #include "oops/oop.inline.hpp" 41 #include "oops/oop.inline.hpp"
42 #include "runtime/handles.inline.hpp" 42 #include "runtime/handles.inline.hpp"
43 #include "runtime/java.hpp" 43 #include "runtime/java.hpp"
44 44
45 // 45 // Concurrent marking bit map wrapper
46 // CMS Bit Map Wrapper
47 46
48 CMBitMapRO::CMBitMapRO(ReservedSpace rs, int shifter) : 47 CMBitMapRO::CMBitMapRO(ReservedSpace rs, int shifter) :
49 _bm((uintptr_t*)NULL,0), 48 _bm((uintptr_t*)NULL,0),
50 _shifter(shifter) { 49 _shifter(shifter) {
51 _bmStartWord = (HeapWord*)(rs.base()); 50 _bmStartWord = (HeapWord*)(rs.base());
52 _bmWordSize = rs.size()/HeapWordSize; // rs.size() is in bytes 51 _bmWordSize = rs.size()/HeapWordSize; // rs.size() is in bytes
53 ReservedSpace brs(ReservedSpace::allocation_align_size_up( 52 ReservedSpace brs(ReservedSpace::allocation_align_size_up(
54 (_bmWordSize >> (_shifter + LogBitsPerByte)) + 1)); 53 (_bmWordSize >> (_shifter + LogBitsPerByte)) + 1));
55 54
56 guarantee(brs.is_reserved(), "couldn't allocate CMS bit map"); 55 guarantee(brs.is_reserved(), "couldn't allocate concurrent marking bit map");
57 // For now we'll just commit all of the bit map up fromt. 56 // For now we'll just commit all of the bit map up fromt.
58 // Later on we'll try to be more parsimonious with swap. 57 // Later on we'll try to be more parsimonious with swap.
59 guarantee(_virtual_space.initialize(brs, brs.size()), 58 guarantee(_virtual_space.initialize(brs, brs.size()),
60 "couldn't reseve backing store for CMS bit map"); 59 "couldn't reseve backing store for concurrent marking bit map");
61 assert(_virtual_space.committed_size() == brs.size(), 60 assert(_virtual_space.committed_size() == brs.size(),
62 "didn't reserve backing store for all of CMS bit map?"); 61 "didn't reserve backing store for all of concurrent marking bit map?");
63 _bm.set_map((uintptr_t*)_virtual_space.low()); 62 _bm.set_map((uintptr_t*)_virtual_space.low());
64 assert(_virtual_space.committed_size() << (_shifter + LogBitsPerByte) >= 63 assert(_virtual_space.committed_size() << (_shifter + LogBitsPerByte) >=
65 _bmWordSize, "inconsistency in bit map sizing"); 64 _bmWordSize, "inconsistency in bit map sizing");
66 _bm.set_size(_bmWordSize >> _shifter); 65 _bm.set_size(_bmWordSize >> _shifter);
67 } 66 }
418 oop newOop = pop(); 417 oop newOop = pop();
419 assert(G1CollectedHeap::heap()->is_in_reserved(newOop), "Bad pop"); 418 assert(G1CollectedHeap::heap()->is_in_reserved(newOop), "Bad pop");
420 assert(newOop->is_oop(), "Expected an oop"); 419 assert(newOop->is_oop(), "Expected an oop");
421 assert(bm == NULL || bm->isMarked((HeapWord*)newOop), 420 assert(bm == NULL || bm->isMarked((HeapWord*)newOop),
422 "only grey objects on this stack"); 421 "only grey objects on this stack");
423 // iterate over the oops in this oop, marking and pushing
424 // the ones in CMS generation.
425 newOop->oop_iterate(cl); 422 newOop->oop_iterate(cl);
426 if (yield_after && _cm->do_yield_check()) { 423 if (yield_after && _cm->do_yield_check()) {
427 res = false; 424 res = false;
428 break; 425 break;
429 } 426 }
736 733
737 ConcurrentMark::~ConcurrentMark() { 734 ConcurrentMark::~ConcurrentMark() {
738 // The ConcurrentMark instance is never freed. 735 // The ConcurrentMark instance is never freed.
739 ShouldNotReachHere(); 736 ShouldNotReachHere();
740 } 737 }
741
742 // This closure is used to mark refs into the g1 generation
743 // from external roots in the CMS bit map.
744 // Called at the first checkpoint.
745 //
746 738
747 void ConcurrentMark::clearNextBitmap() { 739 void ConcurrentMark::clearNextBitmap() {
748 G1CollectedHeap* g1h = G1CollectedHeap::heap(); 740 G1CollectedHeap* g1h = G1CollectedHeap::heap();
749 G1CollectorPolicy* g1p = g1h->g1_policy(); 741 G1CollectorPolicy* g1p = g1h->g1_policy();
750 742
3398 } 3390 }
3399 3391
3400 void ConcurrentMark::print_worker_threads_on(outputStream* st) const { 3392 void ConcurrentMark::print_worker_threads_on(outputStream* st) const {
3401 _parallel_workers->print_worker_threads_on(st); 3393 _parallel_workers->print_worker_threads_on(st);
3402 } 3394 }
3403
3404 // Closures
3405 // XXX: there seems to be a lot of code duplication here;
3406 // should refactor and consolidate the shared code.
3407
3408 // This closure is used to mark refs into the CMS generation in
3409 // the CMS bit map. Called at the first checkpoint.
3410 3395
3411 // We take a break if someone is trying to stop the world. 3396 // We take a break if someone is trying to stop the world.
3412 bool ConcurrentMark::do_yield_check(uint worker_id) { 3397 bool ConcurrentMark::do_yield_check(uint worker_id) {
3413 if (should_yield()) { 3398 if (should_yield()) {
3414 if (worker_id == 0) { 3399 if (worker_id == 0) {