Skip to content

Commit 8f4fa3f

Browse files
committed
8257232: CompileThresholdScaling fails to work on 32-bit platforms
Reviewed-by: kvn, redestad
1 parent cfd070e commit 8f4fa3f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/hotspot/share/compiler/compilerDefinitions.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,17 @@ intx CompilerConfig::scaled_freq_log(intx freq_log, double scale) {
119119
// max_freq_bits accordingly.
120120
intx max_freq_bits = InvocationCounter::number_of_count_bits + 1;
121121
intx scaled_freq = scaled_compile_threshold((intx)1 << freq_log, scale);
122+
122123
if (scaled_freq == 0) {
123124
// Return 0 right away to avoid calculating log2 of 0.
124125
return 0;
125-
} else if (scaled_freq > nth_bit(max_freq_bits)) {
126-
return max_freq_bits;
127126
} else {
128-
return log2_intptr(scaled_freq);
127+
intx res = log2_intptr(scaled_freq);
128+
if (res > max_freq_bits) {
129+
return max_freq_bits;
130+
} else {
131+
return res;
132+
}
129133
}
130134
}
131135

0 commit comments

Comments
 (0)