src/hotspot/share/gc/g1/g1RemSet.cpp
changeset 50113 caf115bb98ad
parent 49911 358be4680d12
child 51332 c25572739e7c
equal deleted inserted replaced
50112:7a2a740815b7 50113:caf115bb98ad
    42 #include "gc/shared/suspendibleThreadSet.hpp"
    42 #include "gc/shared/suspendibleThreadSet.hpp"
    43 #include "memory/iterator.hpp"
    43 #include "memory/iterator.hpp"
    44 #include "memory/resourceArea.hpp"
    44 #include "memory/resourceArea.hpp"
    45 #include "oops/access.inline.hpp"
    45 #include "oops/access.inline.hpp"
    46 #include "oops/oop.inline.hpp"
    46 #include "oops/oop.inline.hpp"
       
    47 #include "runtime/os.hpp"
    47 #include "utilities/align.hpp"
    48 #include "utilities/align.hpp"
    48 #include "utilities/globalDefinitions.hpp"
    49 #include "utilities/globalDefinitions.hpp"
    49 #include "utilities/intHisto.hpp"
    50 #include "utilities/intHisto.hpp"
    50 #include "utilities/stack.inline.hpp"
    51 #include "utilities/stack.inline.hpp"
    51 #include "utilities/ticks.inline.hpp"
    52 #include "utilities/ticks.hpp"
    52 
    53 
    53 // Collects information about the overall remembered set scan progress during an evacuation.
    54 // Collects information about the overall remembered set scan progress during an evacuation.
    54 class G1RemSetScanState : public CHeapObj<mtGC> {
    55 class G1RemSetScanState : public CHeapObj<mtGC> {
    55 private:
    56 private:
    56   class G1ClearCardTableTask : public AbstractGangTask {
    57   class G1ClearCardTableTask : public AbstractGangTask {
   426   G1ScanRSForRegionClosure cl(_scan_state, &scan_cl, pss, worker_i);
   427   G1ScanRSForRegionClosure cl(_scan_state, &scan_cl, pss, worker_i);
   427   _g1h->collection_set_iterate_from(&cl, worker_i);
   428   _g1h->collection_set_iterate_from(&cl, worker_i);
   428 
   429 
   429   G1GCPhaseTimes* p = _g1p->phase_times();
   430   G1GCPhaseTimes* p = _g1p->phase_times();
   430 
   431 
   431   p->record_time_secs(G1GCPhaseTimes::ScanRS, worker_i, TicksToTimeHelper::seconds(cl.rem_set_root_scan_time()));
   432   p->record_time_secs(G1GCPhaseTimes::ScanRS, worker_i, cl.rem_set_root_scan_time().seconds());
   432   p->add_time_secs(G1GCPhaseTimes::ObjCopy, worker_i, TicksToTimeHelper::seconds(cl.rem_set_trim_partially_time()));
   433   p->add_time_secs(G1GCPhaseTimes::ObjCopy, worker_i, cl.rem_set_trim_partially_time().seconds());
   433 
   434 
   434   p->record_thread_work_item(G1GCPhaseTimes::ScanRS, worker_i, cl.cards_scanned(), G1GCPhaseTimes::ScanRSScannedCards);
   435   p->record_thread_work_item(G1GCPhaseTimes::ScanRS, worker_i, cl.cards_scanned(), G1GCPhaseTimes::ScanRSScannedCards);
   435   p->record_thread_work_item(G1GCPhaseTimes::ScanRS, worker_i, cl.cards_claimed(), G1GCPhaseTimes::ScanRSClaimedCards);
   436   p->record_thread_work_item(G1GCPhaseTimes::ScanRS, worker_i, cl.cards_claimed(), G1GCPhaseTimes::ScanRSClaimedCards);
   436   p->record_thread_work_item(G1GCPhaseTimes::ScanRS, worker_i, cl.cards_skipped(), G1GCPhaseTimes::ScanRSSkippedCards);
   437   p->record_thread_work_item(G1GCPhaseTimes::ScanRS, worker_i, cl.cards_skipped(), G1GCPhaseTimes::ScanRSSkippedCards);
   437 
   438 
   438   p->record_time_secs(G1GCPhaseTimes::CodeRoots, worker_i, TicksToTimeHelper::seconds(cl.strong_code_root_scan_time()));
   439   p->record_time_secs(G1GCPhaseTimes::CodeRoots, worker_i, cl.strong_code_root_scan_time().seconds());
   439   p->add_time_secs(G1GCPhaseTimes::ObjCopy, worker_i, TicksToTimeHelper::seconds(cl.strong_code_root_trim_partially_time()));
   440   p->add_time_secs(G1GCPhaseTimes::ObjCopy, worker_i, cl.strong_code_root_trim_partially_time().seconds());
   440 }
   441 }
   441 
   442 
   442 // Closure used for updating rem sets. Only called during an evacuation pause.
   443 // Closure used for updating rem sets. Only called during an evacuation pause.
   443 class G1RefineCardClosure: public CardTableEntryClosure {
   444 class G1RefineCardClosure: public CardTableEntryClosure {
   444   G1RemSet* _g1rs;
   445   G1RemSet* _g1rs;
   933                                         "bot " PTR_FORMAT " "
   934                                         "bot " PTR_FORMAT " "
   934                                         "TAMS " PTR_FORMAT " "
   935                                         "TAMS " PTR_FORMAT " "
   935                                         "TARS " PTR_FORMAT,
   936                                         "TARS " PTR_FORMAT,
   936                                         region_idx,
   937                                         region_idx,
   937                                         _cm->liveness(region_idx) * HeapWordSize,
   938                                         _cm->liveness(region_idx) * HeapWordSize,
   938                                         TicksToTimeHelper::seconds(time) * 1000.0,
   939                                         time.seconds() * 1000.0,
   939                                         marked_bytes,
   940                                         marked_bytes,
   940                                         p2i(hr->bottom()),
   941                                         p2i(hr->bottom()),
   941                                         p2i(top_at_mark_start),
   942                                         p2i(top_at_mark_start),
   942                                         p2i(top_at_rebuild_start));
   943                                         p2i(top_at_rebuild_start));
   943 
   944