src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp
changeset 49643 a3453bbd5418
parent 49635 e79bbf1635da
child 49719 a0f5f7868091
equal deleted inserted replaced
49642:7bad9c9efdf3 49643:a3453bbd5418
   150 
   150 
   151 #ifndef PRODUCT
   151 #ifndef PRODUCT
   152 // Support for G1EvacuationFailureALot
   152 // Support for G1EvacuationFailureALot
   153 
   153 
   154 inline bool
   154 inline bool
   155 G1CollectedHeap::evacuation_failure_alot_for_gc_type(bool gcs_are_young,
   155 G1CollectedHeap::evacuation_failure_alot_for_gc_type(bool for_young_gc,
   156                                                      bool during_initial_mark,
   156                                                      bool during_initial_mark,
   157                                                      bool during_marking) {
   157                                                      bool mark_or_rebuild_in_progress) {
   158   bool res = false;
   158   bool res = false;
   159   if (during_marking) {
   159   if (mark_or_rebuild_in_progress) {
   160     res |= G1EvacuationFailureALotDuringConcMark;
   160     res |= G1EvacuationFailureALotDuringConcMark;
   161   }
   161   }
   162   if (during_initial_mark) {
   162   if (during_initial_mark) {
   163     res |= G1EvacuationFailureALotDuringInitialMark;
   163     res |= G1EvacuationFailureALotDuringInitialMark;
   164   }
   164   }
   165   if (gcs_are_young) {
   165   if (for_young_gc) {
   166     res |= G1EvacuationFailureALotDuringYoungGC;
   166     res |= G1EvacuationFailureALotDuringYoungGC;
   167   } else {
   167   } else {
   168     // GCs are mixed
   168     // GCs are mixed
   169     res |= G1EvacuationFailureALotDuringMixedGC;
   169     res |= G1EvacuationFailureALotDuringMixedGC;
   170   }
   170   }
   184     const size_t elapsed_gcs = gc_num - _evacuation_failure_alot_gc_number;
   184     const size_t elapsed_gcs = gc_num - _evacuation_failure_alot_gc_number;
   185 
   185 
   186     _evacuation_failure_alot_for_current_gc = (elapsed_gcs >= G1EvacuationFailureALotInterval);
   186     _evacuation_failure_alot_for_current_gc = (elapsed_gcs >= G1EvacuationFailureALotInterval);
   187 
   187 
   188     // Now check if G1EvacuationFailureALot is enabled for the current GC type.
   188     // Now check if G1EvacuationFailureALot is enabled for the current GC type.
   189     const bool gcs_are_young = collector_state()->gcs_are_young();
   189     const bool in_young_only_phase = collector_state()->in_young_only_phase();
   190     const bool during_im = collector_state()->during_initial_mark_pause();
   190     const bool in_initial_mark_gc = collector_state()->in_initial_mark_gc();
   191     const bool during_marking = collector_state()->mark_in_progress();
   191     const bool mark_or_rebuild_in_progress = collector_state()->mark_or_rebuild_in_progress();
   192 
   192 
   193     _evacuation_failure_alot_for_current_gc &=
   193     _evacuation_failure_alot_for_current_gc &=
   194       evacuation_failure_alot_for_gc_type(gcs_are_young,
   194       evacuation_failure_alot_for_gc_type(in_young_only_phase,
   195                                           during_im,
   195                                           in_initial_mark_gc,
   196                                           during_marking);
   196                                           mark_or_rebuild_in_progress);
   197   }
   197   }
   198 }
   198 }
   199 
   199 
   200 inline bool G1CollectedHeap::evacuation_should_fail() {
   200 inline bool G1CollectedHeap::evacuation_should_fail() {
   201   if (!G1EvacuationFailureALot || !_evacuation_failure_alot_for_current_gc) {
   201   if (!G1EvacuationFailureALot || !_evacuation_failure_alot_for_current_gc) {