Print this page
rev 6911 : 8065305: Make it possible to extend the G1CollectorPolicy
Summary: Added a G1CollectorPolicyExt where it is possible to extend the class.
Reviewed-by: sjohanss, tschatzl

Split Split Close
Expand all
Collapse all
          --- old/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp
          +++ new/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp
↓ open down ↓ 18 lines elided ↑ open up ↑
  19   19   * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20   20   * or visit www.oracle.com if you need additional information or have any
  21   21   * questions.
  22   22   *
  23   23   */
  24   24  
  25   25  #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTORPOLICY_HPP
  26   26  #define SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTORPOLICY_HPP
  27   27  
  28   28  #include "gc_implementation/g1/collectionSetChooser.hpp"
       29 +#include "gc_implementation/g1/g1Allocator.hpp"
  29   30  #include "gc_implementation/g1/g1MMUTracker.hpp"
  30   31  #include "memory/collectorPolicy.hpp"
  31   32  
  32   33  // A G1CollectorPolicy makes policy decisions that determine the
  33   34  // characteristics of the collector.  Examples include:
  34   35  //   * choice of collection set.
  35   36  //   * when to collect.
  36   37  
  37   38  class HeapRegion;
  38   39  class CollectionSetChooser;
↓ open down ↓ 757 lines elided ↑ open up ↑
 796  797    // This is called at the very beginning of an evacuation pause (it
 797  798    // has to be the first thing that the pause does). If
 798  799    // initiate_conc_mark_if_possible() is true, and the concurrent
 799  800    // marking thread has completed its work during the previous cycle,
 800  801    // it will set during_initial_mark_pause() to so that the pause does
 801  802    // the initial-mark work and start a marking cycle.
 802  803    void decide_on_conc_mark_initiation();
 803  804  
 804  805    // If an expansion would be appropriate, because recent GC overhead had
 805  806    // exceeded the desired limit, return an amount to expand by.
 806      -  size_t expansion_amount();
      807 +  virtual size_t expansion_amount();
 807  808  
 808  809    // Print tracing information.
 809  810    void print_tracing_info() const;
 810  811  
 811  812    // Print stats on young survival ratio
 812  813    void print_yg_surv_rate_info() const;
 813  814  
 814  815    void finished_recalculating_age_indexes(bool is_survivors) {
 815  816      if (is_survivors) {
 816  817        _survivor_surv_rate_group->finished_recalculating_age_indexes();
 817  818      } else {
 818  819        _short_lived_surv_rate_group->finished_recalculating_age_indexes();
 819  820      }
 820  821      // do that for any other surv rate groups
 821  822    }
 822  823  
 823  824    size_t young_list_target_length() const { return _young_list_target_length; }
 824  825  
 825      -  bool is_young_list_full() {
 826      -    uint young_list_length = _g1->young_list()->length();
 827      -    uint young_list_target_length = _young_list_target_length;
 828      -    return young_list_length >= young_list_target_length;
 829      -  }
      826 +  bool is_young_list_full();
 830  827  
 831      -  bool can_expand_young_list() {
 832      -    uint young_list_length = _g1->young_list()->length();
 833      -    uint young_list_max_length = _young_list_max_length;
 834      -    return young_list_length < young_list_max_length;
 835      -  }
      828 +  bool can_expand_young_list();
 836  829  
 837  830    uint young_list_max_length() {
 838  831      return _young_list_max_length;
 839  832    }
 840  833  
 841  834    bool gcs_are_young() {
 842  835      return _gcs_are_young;
 843  836    }
 844  837    void set_gcs_are_young(bool gcs_are_young) {
 845  838      _gcs_are_young = gcs_are_young;
↓ open down ↓ 109 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX