Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8257232: CompileThresholdScaling fails to work on 32-bit platforms
Reviewed-by: kvn, redestad
  • Loading branch information
DamonFool committed Dec 2, 2020
1 parent cfd070e commit 8f4fa3f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/hotspot/share/compiler/compilerDefinitions.cpp
Expand Up @@ -119,13 +119,17 @@ intx CompilerConfig::scaled_freq_log(intx freq_log, double scale) {
// max_freq_bits accordingly.
intx max_freq_bits = InvocationCounter::number_of_count_bits + 1;
intx scaled_freq = scaled_compile_threshold((intx)1 << freq_log, scale);

if (scaled_freq == 0) {
// Return 0 right away to avoid calculating log2 of 0.
return 0;
} else if (scaled_freq > nth_bit(max_freq_bits)) {
return max_freq_bits;
} else {
return log2_intptr(scaled_freq);
intx res = log2_intptr(scaled_freq);
if (res > max_freq_bits) {
return max_freq_bits;
} else {
return res;
}
}
}

Expand Down

1 comment on commit 8f4fa3f

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.