@@ -80,14 +80,13 @@ G1Analytics::G1Analytics(const G1Predictions* predictor) :
8080 _card_scan_to_merge_ratio_seq(TruncatedSeqLength),
8181 _cost_per_card_scan_ms_seq(TruncatedSeqLength),
8282 _cost_per_card_merge_ms_seq(TruncatedSeqLength),
83+ _cost_per_byte_copied_ms_seq(TruncatedSeqLength),
8384 _pending_cards_seq(TruncatedSeqLength),
8485 _rs_length_seq(TruncatedSeqLength),
8586 _rs_length_diff_seq(TruncatedSeqLength),
86- _copy_cost_per_byte_ms_seq(TruncatedSeqLength),
8787 _constant_other_time_ms_seq(TruncatedSeqLength),
8888 _young_other_cost_per_region_ms_seq(TruncatedSeqLength),
8989 _non_young_other_cost_per_region_ms_seq(TruncatedSeqLength),
90- _cost_per_byte_ms_during_cm_seq(TruncatedSeqLength),
9190 _recent_prev_end_times_for_all_gcs_sec(NumPrevPausesForHeuristics),
9291 _long_term_pause_time_ratio(0.0 ),
9392 _short_term_pause_time_ratio(0.0 ) {
@@ -107,8 +106,8 @@ G1Analytics::G1Analytics(const G1Predictions* predictor) :
107106 _cost_per_card_scan_ms_seq.set_initial (young_only_cost_per_card_scan_ms_defaults[index]);
108107 _rs_length_seq.set_initial (0 );
109108 _rs_length_diff_seq.set_initial (0.0 );
109+ _cost_per_byte_copied_ms_seq.set_initial (cost_per_byte_ms_defaults[index]);
110110
111- _copy_cost_per_byte_ms_seq.add (cost_per_byte_ms_defaults[index]);
112111 _constant_other_time_ms_seq.add (constant_other_time_ms_defaults[index]);
113112 _young_other_cost_per_region_ms_seq.add (young_other_cost_per_region_ms_defaults[index]);
114113 _non_young_other_cost_per_region_ms_seq.add (non_young_other_cost_per_region_ms_defaults[index]);
@@ -197,12 +196,8 @@ void G1Analytics::report_rs_length_diff(double rs_length_diff, bool for_young_on
197196 _rs_length_diff_seq.add (rs_length_diff, for_young_only_phase);
198197}
199198
200- void G1Analytics::report_cost_per_byte_ms (double cost_per_byte_ms, bool mark_or_rebuild_in_progress) {
201- if (mark_or_rebuild_in_progress) {
202- _cost_per_byte_ms_during_cm_seq.add (cost_per_byte_ms);
203- } else {
204- _copy_cost_per_byte_ms_seq.add (cost_per_byte_ms);
205- }
199+ void G1Analytics::report_cost_per_byte_ms (double cost_per_byte_ms, bool for_young_only_phase) {
200+ _cost_per_byte_copied_ms_seq.add (cost_per_byte_ms, for_young_only_phase);
206201}
207202
208203void G1Analytics::report_young_other_cost_per_region_ms (double other_cost_per_region_ms) {
@@ -257,20 +252,8 @@ double G1Analytics::predict_card_scan_time_ms(size_t card_num, bool for_young_on
257252 return card_num * predict_zero_bounded (&_cost_per_card_scan_ms_seq, for_young_only_phase);
258253}
259254
260- double G1Analytics::predict_object_copy_time_ms_during_cm (size_t bytes_to_copy) const {
261- if (!enough_samples_available (&_cost_per_byte_ms_during_cm_seq)) {
262- return (1.1 * bytes_to_copy) * predict_zero_bounded (&_copy_cost_per_byte_ms_seq);
263- } else {
264- return bytes_to_copy * predict_zero_bounded (&_cost_per_byte_ms_during_cm_seq);
265- }
266- }
267-
268- double G1Analytics::predict_object_copy_time_ms (size_t bytes_to_copy, bool during_concurrent_mark) const {
269- if (during_concurrent_mark) {
270- return predict_object_copy_time_ms_during_cm (bytes_to_copy);
271- } else {
272- return bytes_to_copy * predict_zero_bounded (&_copy_cost_per_byte_ms_seq);
273- }
255+ double G1Analytics::predict_object_copy_time_ms (size_t bytes_to_copy, bool for_young_only_phase) const {
256+ return bytes_to_copy * predict_zero_bounded (&_cost_per_byte_copied_ms_seq, for_young_only_phase);
274257}
275258
276259double G1Analytics::predict_constant_other_time_ms () const {
0 commit comments