mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8143215: gcc 4.1.2: fix three issues breaking the build
Also fix some more recent introduced missing casts. Reviewed-by: stuefe, simonis, kbarrett, tschatzl
This commit is contained in:
parent
8c13cfe16c
commit
0410c05b22
5 changed files with 23 additions and 13 deletions
|
@ -2730,7 +2730,7 @@ class CMSPhaseAccounting: public StackObj {
|
|||
public:
|
||||
// Not MT-safe; so do not pass around these StackObj's
|
||||
// where they may be accessed by other threads.
|
||||
jlong wallclock_millis() {
|
||||
double wallclock_millis() {
|
||||
return TimeHelper::counter_to_millis(os::elapsed_counter() - _trace_time.start_time());
|
||||
}
|
||||
};
|
||||
|
|
|
@ -291,6 +291,10 @@ double G1CollectorPolicy::get_new_prediction(TruncatedSeq const* seq) const {
|
|||
return _predictor.get_new_prediction(seq);
|
||||
}
|
||||
|
||||
size_t G1CollectorPolicy::get_new_size_prediction(TruncatedSeq const* seq) const {
|
||||
return (size_t)get_new_prediction(seq);
|
||||
}
|
||||
|
||||
void G1CollectorPolicy::initialize_alignments() {
|
||||
_space_alignment = HeapRegion::GrainBytes;
|
||||
size_t card_table_alignment = CardTableRS::ct_max_alignment_constraint();
|
||||
|
@ -477,7 +481,7 @@ bool G1CollectorPolicy::predict_will_fit(uint young_length,
|
|||
// (100 + TargetPLABWastePct) represents the increase in expected bytes during
|
||||
// copying due to anticipated waste in the PLABs.
|
||||
double safety_factor = (100.0 / G1ConfidencePercent) * (100 + TargetPLABWastePct) / 100.0;
|
||||
size_t expected_bytes_to_copy = safety_factor * bytes_to_copy;
|
||||
size_t expected_bytes_to_copy = (size_t)(safety_factor * bytes_to_copy);
|
||||
|
||||
if (expected_bytes_to_copy > free_bytes) {
|
||||
// end condition 3: out-of-space
|
||||
|
@ -524,7 +528,7 @@ uint G1CollectorPolicy::calculate_young_list_desired_max_length() const {
|
|||
}
|
||||
|
||||
uint G1CollectorPolicy::update_young_list_max_and_target_length() {
|
||||
return update_young_list_max_and_target_length(get_new_prediction(_rs_lengths_seq));
|
||||
return update_young_list_max_and_target_length(get_new_size_prediction(_rs_lengths_seq));
|
||||
}
|
||||
|
||||
uint G1CollectorPolicy::update_young_list_max_and_target_length(size_t rs_lengths) {
|
||||
|
@ -629,7 +633,7 @@ G1CollectorPolicy::calculate_young_list_target_length(size_t rs_lengths,
|
|||
|
||||
double target_pause_time_ms = _mmu_tracker->max_gc_time() * 1000.0;
|
||||
double survivor_regions_evac_time = predict_survivor_regions_evac_time();
|
||||
size_t pending_cards = (size_t) get_new_prediction(_pending_cards_seq);
|
||||
size_t pending_cards = get_new_size_prediction(_pending_cards_seq);
|
||||
size_t adj_rs_lengths = rs_lengths + predict_rs_length_diff();
|
||||
size_t scanned_cards = predict_young_card_num(adj_rs_lengths);
|
||||
double base_time_ms =
|
||||
|
@ -732,7 +736,7 @@ void G1CollectorPolicy::revise_young_list_target_length_if_necessary() {
|
|||
}
|
||||
|
||||
void G1CollectorPolicy::update_rs_lengths_prediction() {
|
||||
update_rs_lengths_prediction(get_new_prediction(_rs_lengths_seq));
|
||||
update_rs_lengths_prediction(get_new_size_prediction(_rs_lengths_seq));
|
||||
}
|
||||
|
||||
void G1CollectorPolicy::update_rs_lengths_prediction(size_t prediction) {
|
||||
|
@ -1345,7 +1349,7 @@ void G1CollectorPolicy::adjust_concurrent_refinement(double update_rs_time,
|
|||
}
|
||||
|
||||
size_t G1CollectorPolicy::predict_rs_length_diff() const {
|
||||
return (size_t) get_new_prediction(_rs_length_diff_seq);
|
||||
return get_new_size_prediction(_rs_length_diff_seq);
|
||||
}
|
||||
|
||||
double G1CollectorPolicy::predict_alloc_rate_ms() const {
|
||||
|
|
|
@ -179,6 +179,7 @@ class G1CollectorPolicy: public CollectorPolicy {
|
|||
G1Predictions _predictor;
|
||||
|
||||
double get_new_prediction(TruncatedSeq const* seq) const;
|
||||
size_t get_new_size_prediction(TruncatedSeq const* seq) const;
|
||||
|
||||
// either equal to the number of parallel threads, if ParallelGCThreads
|
||||
// has been set, or 1 otherwise
|
||||
|
|
|
@ -138,7 +138,7 @@ size_t G1AdaptiveIHOPControl::actual_target_threshold() const {
|
|||
|
||||
double safe_total_heap_percentage = MIN2((double)(_heap_reserve_percent + _heap_waste_percent), 100.0);
|
||||
|
||||
return MIN2(
|
||||
return (size_t)MIN2(
|
||||
G1CollectedHeap::heap()->max_capacity() * (100.0 - safe_total_heap_percentage) / 100.0,
|
||||
_target_occupancy * (100.0 - _heap_waste_percent) / 100.0
|
||||
);
|
||||
|
@ -153,10 +153,13 @@ size_t G1AdaptiveIHOPControl::get_conc_mark_start_threshold() {
|
|||
if (have_enough_data_for_prediction()) {
|
||||
double pred_marking_time = _predictor->get_new_prediction(&_marking_times_s);
|
||||
double pred_promotion_rate = _predictor->get_new_prediction(&_allocation_rate_s);
|
||||
size_t pred_promotion_size = (size_t)(pred_marking_time * pred_promotion_rate);
|
||||
|
||||
size_t predicted_needed_bytes_during_marking =
|
||||
(pred_marking_time * pred_promotion_rate +
|
||||
_last_unrestrained_young_size); // In reality we would need the maximum size of the young gen during marking. This is a conservative estimate.
|
||||
pred_promotion_size +
|
||||
// In reality we would need the maximum size of the young gen during
|
||||
// marking. This is a conservative estimate.
|
||||
_last_unrestrained_young_size;
|
||||
|
||||
size_t internal_threshold = actual_target_threshold();
|
||||
size_t predicted_initiating_threshold = predicted_needed_bytes_during_marking < internal_threshold ?
|
||||
|
@ -165,11 +168,13 @@ size_t G1AdaptiveIHOPControl::get_conc_mark_start_threshold() {
|
|||
return predicted_initiating_threshold;
|
||||
} else {
|
||||
// Use the initial value.
|
||||
return _initial_ihop_percent * _target_occupancy / 100.0;
|
||||
return (size_t)(_initial_ihop_percent * _target_occupancy / 100.0);
|
||||
}
|
||||
}
|
||||
|
||||
void G1AdaptiveIHOPControl::update_allocation_info(double allocation_time_s, size_t allocated_bytes, size_t additional_buffer_size) {
|
||||
void G1AdaptiveIHOPControl::update_allocation_info(double allocation_time_s,
|
||||
size_t allocated_bytes,
|
||||
size_t additional_buffer_size) {
|
||||
G1IHOPControl::update_allocation_info(allocation_time_s, allocated_bytes, additional_buffer_size);
|
||||
|
||||
double allocation_rate = (double) allocated_bytes / allocation_time_s;
|
||||
|
|
|
@ -278,7 +278,7 @@ void G1NewTracer::send_basic_ihop_statistics(size_t threshold,
|
|||
evt.set_gcId(GCId::current());
|
||||
evt.set_threshold(threshold);
|
||||
evt.set_targetOccupancy(target_occupancy);
|
||||
evt.set_thresholdPercentage(target_occupancy > 0 ? threshold * 100.0 / target_occupancy : 0.0);
|
||||
evt.set_thresholdPercentage(target_occupancy > 0 ? (threshold * 100 / target_occupancy) : 0);
|
||||
evt.set_currentOccupancy(current_occupancy);
|
||||
evt.set_lastAllocationSize(last_allocation_size);
|
||||
evt.set_lastAllocationDuration(last_allocation_duration);
|
||||
|
@ -299,7 +299,7 @@ void G1NewTracer::send_adaptive_ihop_statistics(size_t threshold,
|
|||
if (evt.should_commit()) {
|
||||
evt.set_gcId(GCId::current());
|
||||
evt.set_threshold(threshold);
|
||||
evt.set_thresholdPercentage(internal_target_occupancy > 0 ? threshold * 100.0 / internal_target_occupancy : 0.0);
|
||||
evt.set_thresholdPercentage(internal_target_occupancy > 0 ? (threshold * 100 / internal_target_occupancy) : 0);
|
||||
evt.set_internalTargetOccupancy(internal_target_occupancy);
|
||||
evt.set_currentOccupancy(current_occupancy);
|
||||
evt.set_additionalBufferSize(additional_buffer_size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue