Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/shared/allocationStats.hpp @ 6028:f69a5d43dc19
7164144: Fix variable naming style in freeBlockDictionary.* and binaryTreeDictionary*
Summary: Fix naming style to be consistent with the predominant hotspot style.
Reviewed-by: ysr, brutisso
author | jmasa |
---|---|
date | Wed, 25 Apr 2012 09:55:55 -0700 |
parents | f75137faa7fe |
children | b9a9ed0f8eeb |
comparison
equal
deleted
inserted
replaced
6026:9f059abe8cf2 | 6028:f69a5d43dc19 |
---|---|
37 static float _threshold; | 37 static float _threshold; |
38 | 38 |
39 // We measure the demand between the end of the previous sweep and | 39 // We measure the demand between the end of the previous sweep and |
40 // beginning of this sweep: | 40 // beginning of this sweep: |
41 // Count(end_last_sweep) - Count(start_this_sweep) | 41 // Count(end_last_sweep) - Count(start_this_sweep) |
42 // + splitBirths(between) - splitDeaths(between) | 42 // + split_births(between) - split_deaths(between) |
43 // The above number divided by the time since the end of the | 43 // The above number divided by the time since the end of the |
44 // previous sweep gives us a time rate of demand for blocks | 44 // previous sweep gives us a time rate of demand for blocks |
45 // of this size. We compute a padded average of this rate as | 45 // of this size. We compute a padded average of this rate as |
46 // our current estimate for the time rate of demand for blocks | 46 // our current estimate for the time rate of demand for blocks |
47 // of this size. Similarly, we keep a padded average for the time | 47 // of this size. Similarly, we keep a padded average for the time |
49 // this size is then simply computed as the product of these two | 49 // this size is then simply computed as the product of these two |
50 // estimates. | 50 // estimates. |
51 AdaptivePaddedAverage _demand_rate_estimate; | 51 AdaptivePaddedAverage _demand_rate_estimate; |
52 | 52 |
53 ssize_t _desired; // Demand stimate computed as described above | 53 ssize_t _desired; // Demand stimate computed as described above |
54 ssize_t _coalDesired; // desired +/- small-percent for tuning coalescing | 54 ssize_t _coal_desired; // desired +/- small-percent for tuning coalescing |
55 | 55 |
56 ssize_t _surplus; // count - (desired +/- small-percent), | 56 ssize_t _surplus; // count - (desired +/- small-percent), |
57 // used to tune splitting in best fit | 57 // used to tune splitting in best fit |
58 ssize_t _bfrSurp; // surplus at start of current sweep | 58 ssize_t _bfr_surp; // surplus at start of current sweep |
59 ssize_t _prevSweep; // count from end of previous sweep | 59 ssize_t _prev_sweep; // count from end of previous sweep |
60 ssize_t _beforeSweep; // count from before current sweep | 60 ssize_t _before_sweep; // count from before current sweep |
61 ssize_t _coalBirths; // additional chunks from coalescing | 61 ssize_t _coal_births; // additional chunks from coalescing |
62 ssize_t _coalDeaths; // loss from coalescing | 62 ssize_t _coal_deaths; // loss from coalescing |
63 ssize_t _splitBirths; // additional chunks from splitting | 63 ssize_t _split_births; // additional chunks from splitting |
64 ssize_t _splitDeaths; // loss from splitting | 64 ssize_t _split_deaths; // loss from splitting |
65 size_t _returnedBytes; // number of bytes returned to list. | 65 size_t _returned_bytes; // number of bytes returned to list. |
66 public: | 66 public: |
67 void initialize(bool split_birth = false) { | 67 void initialize(bool split_birth = false) { |
68 AdaptivePaddedAverage* dummy = | 68 AdaptivePaddedAverage* dummy = |
69 new (&_demand_rate_estimate) AdaptivePaddedAverage(CMS_FLSWeight, | 69 new (&_demand_rate_estimate) AdaptivePaddedAverage(CMS_FLSWeight, |
70 CMS_FLSPadding); | 70 CMS_FLSPadding); |
71 _desired = 0; | 71 _desired = 0; |
72 _coalDesired = 0; | 72 _coal_desired = 0; |
73 _surplus = 0; | 73 _surplus = 0; |
74 _bfrSurp = 0; | 74 _bfr_surp = 0; |
75 _prevSweep = 0; | 75 _prev_sweep = 0; |
76 _beforeSweep = 0; | 76 _before_sweep = 0; |
77 _coalBirths = 0; | 77 _coal_births = 0; |
78 _coalDeaths = 0; | 78 _coal_deaths = 0; |
79 _splitBirths = (split_birth ? 1 : 0); | 79 _split_births = (split_birth ? 1 : 0); |
80 _splitDeaths = 0; | 80 _split_deaths = 0; |
81 _returnedBytes = 0; | 81 _returned_bytes = 0; |
82 } | 82 } |
83 | 83 |
84 AllocationStats() { | 84 AllocationStats() { |
85 initialize(); | 85 initialize(); |
86 } | 86 } |
97 // of accumulated data, since it has not been "integrated" | 97 // of accumulated data, since it has not been "integrated" |
98 // (read "low-pass-filtered") long enough, and would be | 98 // (read "low-pass-filtered") long enough, and would be |
99 // vulnerable to noisy glitches. In such cases, we | 99 // vulnerable to noisy glitches. In such cases, we |
100 // ignore the current sample and use currently available | 100 // ignore the current sample and use currently available |
101 // historical estimates. | 101 // historical estimates. |
102 assert(prevSweep() + splitBirths() + coalBirths() // "Total Production Stock" | 102 assert(prev_sweep() + split_births() + coal_births() // "Total Production Stock" |
103 >= splitDeaths() + coalDeaths() + (ssize_t)count, // "Current stock + depletion" | 103 >= split_deaths() + coal_deaths() + (ssize_t)count, // "Current stock + depletion" |
104 "Conservation Principle"); | 104 "Conservation Principle"); |
105 if (inter_sweep_current > _threshold) { | 105 if (inter_sweep_current > _threshold) { |
106 ssize_t demand = prevSweep() - (ssize_t)count + splitBirths() + coalBirths() | 106 ssize_t demand = prev_sweep() - (ssize_t)count + split_births() + coal_births() |
107 - splitDeaths() - coalDeaths(); | 107 - split_deaths() - coal_deaths(); |
108 assert(demand >= 0, | 108 assert(demand >= 0, |
109 err_msg("Demand (" SSIZE_FORMAT ") should be non-negative for " | 109 err_msg("Demand (" SSIZE_FORMAT ") should be non-negative for " |
110 PTR_FORMAT " (size=" SIZE_FORMAT ")", | 110 PTR_FORMAT " (size=" SIZE_FORMAT ")", |
111 demand, this, count)); | 111 demand, this, count)); |
112 // Defensive: adjust for imprecision in event counting | 112 // Defensive: adjust for imprecision in event counting |
128 } | 128 } |
129 | 129 |
130 ssize_t desired() const { return _desired; } | 130 ssize_t desired() const { return _desired; } |
131 void set_desired(ssize_t v) { _desired = v; } | 131 void set_desired(ssize_t v) { _desired = v; } |
132 | 132 |
133 ssize_t coalDesired() const { return _coalDesired; } | 133 ssize_t coal_desired() const { return _coal_desired; } |
134 void set_coalDesired(ssize_t v) { _coalDesired = v; } | 134 void set_coal_desired(ssize_t v) { _coal_desired = v; } |
135 | 135 |
136 ssize_t surplus() const { return _surplus; } | 136 ssize_t surplus() const { return _surplus; } |
137 void set_surplus(ssize_t v) { _surplus = v; } | 137 void set_surplus(ssize_t v) { _surplus = v; } |
138 void increment_surplus() { _surplus++; } | 138 void increment_surplus() { _surplus++; } |
139 void decrement_surplus() { _surplus--; } | 139 void decrement_surplus() { _surplus--; } |
140 | 140 |
141 ssize_t bfrSurp() const { return _bfrSurp; } | 141 ssize_t bfr_surp() const { return _bfr_surp; } |
142 void set_bfrSurp(ssize_t v) { _bfrSurp = v; } | 142 void set_bfr_surp(ssize_t v) { _bfr_surp = v; } |
143 ssize_t prevSweep() const { return _prevSweep; } | 143 ssize_t prev_sweep() const { return _prev_sweep; } |
144 void set_prevSweep(ssize_t v) { _prevSweep = v; } | 144 void set_prev_sweep(ssize_t v) { _prev_sweep = v; } |
145 ssize_t beforeSweep() const { return _beforeSweep; } | 145 ssize_t before_sweep() const { return _before_sweep; } |
146 void set_beforeSweep(ssize_t v) { _beforeSweep = v; } | 146 void set_before_sweep(ssize_t v) { _before_sweep = v; } |
147 | 147 |
148 ssize_t coalBirths() const { return _coalBirths; } | 148 ssize_t coal_births() const { return _coal_births; } |
149 void set_coalBirths(ssize_t v) { _coalBirths = v; } | 149 void set_coal_births(ssize_t v) { _coal_births = v; } |
150 void increment_coalBirths() { _coalBirths++; } | 150 void increment_coal_births() { _coal_births++; } |
151 | 151 |
152 ssize_t coalDeaths() const { return _coalDeaths; } | 152 ssize_t coal_deaths() const { return _coal_deaths; } |
153 void set_coalDeaths(ssize_t v) { _coalDeaths = v; } | 153 void set_coal_deaths(ssize_t v) { _coal_deaths = v; } |
154 void increment_coalDeaths() { _coalDeaths++; } | 154 void increment_coal_deaths() { _coal_deaths++; } |
155 | 155 |
156 ssize_t splitBirths() const { return _splitBirths; } | 156 ssize_t split_births() const { return _split_births; } |
157 void set_splitBirths(ssize_t v) { _splitBirths = v; } | 157 void set_split_births(ssize_t v) { _split_births = v; } |
158 void increment_splitBirths() { _splitBirths++; } | 158 void increment_split_births() { _split_births++; } |
159 | 159 |
160 ssize_t splitDeaths() const { return _splitDeaths; } | 160 ssize_t split_deaths() const { return _split_deaths; } |
161 void set_splitDeaths(ssize_t v) { _splitDeaths = v; } | 161 void set_split_deaths(ssize_t v) { _split_deaths = v; } |
162 void increment_splitDeaths() { _splitDeaths++; } | 162 void increment_split_deaths() { _split_deaths++; } |
163 | 163 |
164 NOT_PRODUCT( | 164 NOT_PRODUCT( |
165 size_t returnedBytes() const { return _returnedBytes; } | 165 size_t returned_bytes() const { return _returned_bytes; } |
166 void set_returnedBytes(size_t v) { _returnedBytes = v; } | 166 void set_returned_bytes(size_t v) { _returned_bytes = v; } |
167 ) | 167 ) |
168 }; | 168 }; |
169 | 169 |
170 #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_ALLOCATIONSTATS_HPP | 170 #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_ALLOCATIONSTATS_HPP |