Skip to content

Commit 3c0b571

Browse files
author
duke
committedMar 24, 2022
Automatic merge of jdk:master into master
2 parents 6156d7c + c104802 commit 3c0b571

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎src/hotspot/share/compiler/compilerDefinitions.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,17 @@ intx CompilerConfig::scaled_freq_log(intx freq_log) {
124124
// Returns threshold scaled with the value of scale.
125125
// If scale < 0.0, threshold is returned without scaling.
126126
intx CompilerConfig::scaled_compile_threshold(intx threshold, double scale) {
127+
assert(threshold >= 0, "must be");
127128
if (scale == 1.0 || scale < 0.0) {
128129
return threshold;
129130
} else {
130-
return (intx)(threshold * scale);
131+
double v = threshold * scale;
132+
assert(v >= 0, "must be");
133+
if (v > max_intx) {
134+
return max_intx;
135+
} else {
136+
return (intx)(v);
137+
}
131138
}
132139
}
133140

0 commit comments

Comments
 (0)
Please sign in to comment.