src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp

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


 161   g1_barrier_set()->g1_mark_as_young(mr);
 162 }
 163 
 164 inline RefToScanQueue* G1CollectedHeap::task_queue(int i) const {
 165   return _task_queues->queue(i);
 166 }
 167 
 168 inline bool G1CollectedHeap::isMarkedPrev(oop obj) const {
 169   return _cm->prevMarkBitMap()->isMarked((HeapWord *)obj);
 170 }
 171 
 172 inline bool G1CollectedHeap::isMarkedNext(oop obj) const {
 173   return _cm->nextMarkBitMap()->isMarked((HeapWord *)obj);
 174 }
 175 
 176 
 177 // This is a fast test on whether a reference points into the
 178 // collection set or not. Assume that the reference
 179 // points into the heap.
 180 inline bool G1CollectedHeap::in_cset_fast_test(oop obj) {
 181   assert(_in_cset_fast_test != NULL, "sanity");
 182   assert(_g1_committed.contains((HeapWord*) obj), err_msg("Given reference outside of heap, is "PTR_FORMAT, p2i((HeapWord*)obj)));
 183   // no need to subtract the bottom of the heap from obj,
 184   // _in_cset_fast_test is biased
 185   uintx index = cast_from_oop<uintx>(obj) >> HeapRegion::LogOfHRGrainBytes;
 186   bool ret = _in_cset_fast_test[index];
 187   // let's make sure the result is consistent with what the slower
 188   // test returns
 189   assert( ret || !obj_in_cs(obj), "sanity");
 190   assert(!ret ||  obj_in_cs(obj), "sanity");
 191   return ret;
 192 }
 193 
 194 #ifndef PRODUCT
 195 // Support for G1EvacuationFailureALot
 196 
 197 inline bool
 198 G1CollectedHeap::evacuation_failure_alot_for_gc_type(bool gcs_are_young,
 199                                                      bool during_initial_mark,
 200                                                      bool during_marking) {
 201   bool res = false;
 202   if (during_marking) {
 203     res |= G1EvacuationFailureALotDuringConcMark;
 204   }
 205   if (during_initial_mark) {
 206     res |= G1EvacuationFailureALotDuringInitialMark;




 161   g1_barrier_set()->g1_mark_as_young(mr);
 162 }
 163 
 164 inline RefToScanQueue* G1CollectedHeap::task_queue(int i) const {
 165   return _task_queues->queue(i);
 166 }
 167 
 168 inline bool G1CollectedHeap::isMarkedPrev(oop obj) const {
 169   return _cm->prevMarkBitMap()->isMarked((HeapWord *)obj);
 170 }
 171 
 172 inline bool G1CollectedHeap::isMarkedNext(oop obj) const {
 173   return _cm->nextMarkBitMap()->isMarked((HeapWord *)obj);
 174 }
 175 
 176 
 177 // This is a fast test on whether a reference points into the
 178 // collection set or not. Assume that the reference
 179 // points into the heap.
 180 inline bool G1CollectedHeap::in_cset_fast_test(oop obj) {
 181   bool ret = _in_cset_fast_test.get_by_address((HeapWord*)obj);





 182   // let's make sure the result is consistent with what the slower
 183   // test returns
 184   assert( ret || !obj_in_cs(obj), "sanity");
 185   assert(!ret ||  obj_in_cs(obj), "sanity");
 186   return ret;
 187 }
 188 
 189 #ifndef PRODUCT
 190 // Support for G1EvacuationFailureALot
 191 
 192 inline bool
 193 G1CollectedHeap::evacuation_failure_alot_for_gc_type(bool gcs_are_young,
 194                                                      bool during_initial_mark,
 195                                                      bool during_marking) {
 196   bool res = false;
 197   if (during_marking) {
 198     res |= G1EvacuationFailureALotDuringConcMark;
 199   }
 200   if (during_initial_mark) {
 201     res |= G1EvacuationFailureALotDuringInitialMark;