comparison src/share/vm/gc_implementation/g1/survRateGroup.hpp @ 577:58054a18d735

6484959: G1: introduce survivor spaces 6797754: G1: combined bugfix Summary: Implemented a policy to control G1 survivor space parameters. Reviewed-by: tonyp, iveresov
author apetrusenko
date Fri, 06 Feb 2009 01:38:50 +0300
parents 37f87013dfd8
children 0fbdb4381b99
comparison
equal deleted inserted replaced
0:766b50be2450 1:7eb9c054504f
27 class SurvRateGroup : public CHeapObj { 27 class SurvRateGroup : public CHeapObj {
28 private: 28 private:
29 G1CollectorPolicy* _g1p; 29 G1CollectorPolicy* _g1p;
30 const char* _name; 30 const char* _name;
31 31
32 size_t _array_length; 32 size_t _stats_arrays_length;
33 double* _surv_rate; 33 double* _surv_rate;
34 double* _accum_surv_rate_pred; 34 double* _accum_surv_rate_pred;
35 double _last_pred; 35 double _last_pred;
36 double _accum_surv_rate; 36 double _accum_surv_rate;
37 TruncatedSeq** _surv_rate_pred; 37 TruncatedSeq** _surv_rate_pred;
38 NumberSeq** _summary_surv_rates; 38 NumberSeq** _summary_surv_rates;
39 size_t _summary_surv_rates_len; 39 size_t _summary_surv_rates_len;
40 size_t _summary_surv_rates_max_len; 40 size_t _summary_surv_rates_max_len;
41 41
42 int _all_regions_allocated; 42 int _all_regions_allocated;
43 size_t _curr_length; 43 size_t _region_num;
44 size_t _scan_only_prefix; 44 size_t _scan_only_prefix;
45 size_t _setup_seq_num; 45 size_t _setup_seq_num;
46 46
47 public: 47 public:
48 SurvRateGroup(G1CollectorPolicy* g1p, 48 SurvRateGroup(G1CollectorPolicy* g1p,
49 const char* name, 49 const char* name,
50 size_t summary_surv_rates_len); 50 size_t summary_surv_rates_len);
51 void reset();
51 void start_adding_regions(); 52 void start_adding_regions();
52 void stop_adding_regions(); 53 void stop_adding_regions();
53 void record_scan_only_prefix(size_t scan_only_prefix); 54 void record_scan_only_prefix(size_t scan_only_prefix);
54 void record_surviving_words(int age_in_group, size_t surv_words); 55 void record_surviving_words(int age_in_group, size_t surv_words);
55 void all_surviving_words_recorded(bool propagate); 56 void all_surviving_words_recorded(bool propagate);
56 const char* name() { return _name; } 57 const char* name() { return _name; }
57 58
58 size_t region_num() { return _curr_length; } 59 size_t region_num() { return _region_num; }
59 size_t scan_only_length() { return _scan_only_prefix; } 60 size_t scan_only_length() { return _scan_only_prefix; }
60 double accum_surv_rate_pred(int age) { 61 double accum_surv_rate_pred(int age) {
61 assert(age >= 0, "must be"); 62 assert(age >= 0, "must be");
62 if ((size_t)age < _array_length) 63 if ((size_t)age < _stats_arrays_length)
63 return _accum_surv_rate_pred[age]; 64 return _accum_surv_rate_pred[age];
64 else { 65 else {
65 double diff = (double) (age - _array_length + 1); 66 double diff = (double) (age - _stats_arrays_length + 1);
66 return _accum_surv_rate_pred[_array_length-1] + diff * _last_pred; 67 return _accum_surv_rate_pred[_stats_arrays_length-1] + diff * _last_pred;
67 } 68 }
68 } 69 }
69 70
70 double accum_surv_rate(size_t adjustment); 71 double accum_surv_rate(size_t adjustment);
71 72
72 TruncatedSeq* get_seq(size_t age) { 73 TruncatedSeq* get_seq(size_t age) {
73 guarantee( 0 <= age, "pre-condition" );
74 if (age >= _setup_seq_num) { 74 if (age >= _setup_seq_num) {
75 guarantee( _setup_seq_num > 0, "invariant" ); 75 guarantee( _setup_seq_num > 0, "invariant" );
76 age = _setup_seq_num-1; 76 age = _setup_seq_num-1;
77 } 77 }
78 TruncatedSeq* seq = _surv_rate_pred[age]; 78 TruncatedSeq* seq = _surv_rate_pred[age];