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

Print this page




 109   jbyte *const last = byte_after(mr.last());
 110 
 111   // Below we may use an explicit loop instead of memset() because on
 112   // certain platforms memset() can give concurrent readers phantom zeros.
 113   if (UseMemSetInBOT) {
 114     memset(first, g1_young_gen, last - first);
 115   } else {
 116     for (jbyte* i = first; i < last; i++) {
 117       *i = g1_young_gen;
 118     }
 119   }
 120 }
 121 
 122 #ifndef PRODUCT
 123 void G1SATBCardTableModRefBS::verify_g1_young_region(MemRegion mr) {
 124   verify_region(mr, g1_young_gen,  true);
 125 }
 126 #endif
 127 
 128 void G1SATBCardTableLoggingModRefBSChangedListener::on_commit(uint start_idx, size_t num_regions, bool zero_filled) {

 129   MemRegion mr(G1CollectedHeap::heap()->bottom_addr_for_region(start_idx), num_regions * HeapRegion::GrainWords);
 130   _card_table->clear(mr);
 131 }
 132 
 133 G1SATBCardTableLoggingModRefBS::
 134 G1SATBCardTableLoggingModRefBS(MemRegion whole_heap,
 135                                int max_covered_regions) :
 136   G1SATBCardTableModRefBS(whole_heap, max_covered_regions),
 137   _dcqs(JavaThread::dirty_card_queue_set()),
 138   _listener()
 139 {
 140   _kind = G1SATBCTLogging;
 141   _listener.set_card_table(this);
 142 }
 143 
 144 void G1SATBCardTableLoggingModRefBS::initialize(G1RegionToSpaceMapper* mapper) {
 145   mapper->set_mapping_changed_listener(&_listener);
 146 
 147   _byte_map_size = mapper->reserved().byte_size();
 148 




 109   jbyte *const last = byte_after(mr.last());
 110 
 111   // Below we may use an explicit loop instead of memset() because on
 112   // certain platforms memset() can give concurrent readers phantom zeros.
 113   if (UseMemSetInBOT) {
 114     memset(first, g1_young_gen, last - first);
 115   } else {
 116     for (jbyte* i = first; i < last; i++) {
 117       *i = g1_young_gen;
 118     }
 119   }
 120 }
 121 
 122 #ifndef PRODUCT
 123 void G1SATBCardTableModRefBS::verify_g1_young_region(MemRegion mr) {
 124   verify_region(mr, g1_young_gen,  true);
 125 }
 126 #endif
 127 
 128 void G1SATBCardTableLoggingModRefBSChangedListener::on_commit(uint start_idx, size_t num_regions, bool zero_filled) {
 129   // Default value for a clean card on the card table is -1. So we cannot take advantage of the zero_filled parameter.
 130   MemRegion mr(G1CollectedHeap::heap()->bottom_addr_for_region(start_idx), num_regions * HeapRegion::GrainWords);
 131   _card_table->clear(mr);
 132 }
 133 
 134 G1SATBCardTableLoggingModRefBS::
 135 G1SATBCardTableLoggingModRefBS(MemRegion whole_heap,
 136                                int max_covered_regions) :
 137   G1SATBCardTableModRefBS(whole_heap, max_covered_regions),
 138   _dcqs(JavaThread::dirty_card_queue_set()),
 139   _listener()
 140 {
 141   _kind = G1SATBCTLogging;
 142   _listener.set_card_table(this);
 143 }
 144 
 145 void G1SATBCardTableLoggingModRefBS::initialize(G1RegionToSpaceMapper* mapper) {
 146   mapper->set_mapping_changed_listener(&_listener);
 147 
 148   _byte_map_size = mapper->reserved().byte_size();
 149