mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34:38 +02:00
8000351: Tenuring threshold should be unsigned
Change the flags and variables related to tenuring threshold to be unsigned Reviewed-by: jmasa, johnc
This commit is contained in:
parent
88ab075a6d
commit
3506d44c57
22 changed files with 55 additions and 55 deletions
|
@ -642,7 +642,7 @@ bool AdaptiveSizePolicy::print_adaptive_size_policy_on(outputStream* st) const {
|
|||
|
||||
bool AdaptiveSizePolicy::print_adaptive_size_policy_on(
|
||||
outputStream* st,
|
||||
int tenuring_threshold_arg) const {
|
||||
uint tenuring_threshold_arg) const {
|
||||
if (!AdaptiveSizePolicy::print_adaptive_size_policy_on(st)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -663,7 +663,7 @@ bool AdaptiveSizePolicy::print_adaptive_size_policy_on(
|
|||
assert(!tenuring_threshold_change(), "(no change was attempted)");
|
||||
}
|
||||
if (tenuring_threshold_changed) {
|
||||
st->print_cr("%d", tenuring_threshold_arg);
|
||||
st->print_cr("%u", tenuring_threshold_arg);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -489,8 +489,8 @@ class AdaptiveSizePolicy : public CHeapObj<mtGC> {
|
|||
|
||||
// Printing support
|
||||
virtual bool print_adaptive_size_policy_on(outputStream* st) const;
|
||||
bool print_adaptive_size_policy_on(outputStream* st, int
|
||||
tenuring_threshold) const;
|
||||
bool print_adaptive_size_policy_on(outputStream* st,
|
||||
uint tenuring_threshold) const;
|
||||
};
|
||||
|
||||
// Class that can be used to print information about the
|
||||
|
|
|
@ -78,10 +78,10 @@ void ageTable::merge_par(ageTable* subTable) {
|
|||
}
|
||||
}
|
||||
|
||||
int ageTable::compute_tenuring_threshold(size_t survivor_capacity) {
|
||||
uint ageTable::compute_tenuring_threshold(size_t survivor_capacity) {
|
||||
size_t desired_survivor_size = (size_t)((((double) survivor_capacity)*TargetSurvivorRatio)/100);
|
||||
size_t total = 0;
|
||||
int age = 1;
|
||||
uint age = 1;
|
||||
assert(sizes[0] == 0, "no objects with age zero should be recorded");
|
||||
while (age < table_size) {
|
||||
total += sizes[age];
|
||||
|
@ -90,13 +90,13 @@ int ageTable::compute_tenuring_threshold(size_t survivor_capacity) {
|
|||
if (total > desired_survivor_size) break;
|
||||
age++;
|
||||
}
|
||||
int result = age < MaxTenuringThreshold ? age : MaxTenuringThreshold;
|
||||
uint result = age < MaxTenuringThreshold ? age : MaxTenuringThreshold;
|
||||
|
||||
if (PrintTenuringDistribution || UsePerfData) {
|
||||
|
||||
if (PrintTenuringDistribution) {
|
||||
gclog_or_tty->cr();
|
||||
gclog_or_tty->print_cr("Desired survivor size %ld bytes, new threshold %d (max %d)",
|
||||
gclog_or_tty->print_cr("Desired survivor size %ld bytes, new threshold %u (max %u)",
|
||||
desired_survivor_size*oopSize, result, MaxTenuringThreshold);
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ int ageTable::compute_tenuring_threshold(size_t survivor_capacity) {
|
|||
total += sizes[age];
|
||||
if (sizes[age] > 0) {
|
||||
if (PrintTenuringDistribution) {
|
||||
gclog_or_tty->print_cr("- age %3d: %10ld bytes, %10ld total",
|
||||
gclog_or_tty->print_cr("- age %3u: %10ld bytes, %10ld total",
|
||||
age, sizes[age]*oopSize, total*oopSize);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ class ageTable VALUE_OBJ_CLASS_SPEC {
|
|||
|
||||
// add entry
|
||||
void add(oop p, size_t oop_size) {
|
||||
int age = p->age();
|
||||
uint age = p->age();
|
||||
assert(age > 0 && age < table_size, "invalid age of object");
|
||||
sizes[age] += oop_size;
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ class ageTable VALUE_OBJ_CLASS_SPEC {
|
|||
void merge_par(ageTable* subTable);
|
||||
|
||||
// calculate new tenuring threshold based on age information
|
||||
int compute_tenuring_threshold(size_t survivor_capacity);
|
||||
uint compute_tenuring_threshold(size_t survivor_capacity);
|
||||
|
||||
private:
|
||||
PerfVariable* _perf_sizes[table_size];
|
||||
|
|
|
@ -188,7 +188,7 @@ class GCAdaptivePolicyCounters : public GCPolicyCounters {
|
|||
inline void update_survivor_overflowed(bool survivor_overflowed) {
|
||||
_survivor_overflowed_counter->set_value(survivor_overflowed);
|
||||
}
|
||||
inline void update_tenuring_threshold(int threshold) {
|
||||
inline void update_tenuring_threshold(uint threshold) {
|
||||
tenuring_threshold()->set_value(threshold);
|
||||
}
|
||||
inline void update_increment_tenuring_threshold_for_gc_cost() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue