Navigation Menu

Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
8283641: Large value for CompileThresholdScaling causes assert
Browse files Browse the repository at this point in the history
Backport-of: c1048021fe57b78bb1f300b977588e1a93a284b6
  • Loading branch information
TobiHartmann committed Apr 4, 2022
1 parent 515a947 commit 43be343
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/hotspot/share/compiler/compilerDefinitions.cpp
Expand Up @@ -124,10 +124,17 @@ intx CompilerConfig::scaled_freq_log(intx freq_log) {
// Returns threshold scaled with the value of scale.
// If scale < 0.0, threshold is returned without scaling.
intx CompilerConfig::scaled_compile_threshold(intx threshold, double scale) {
assert(threshold >= 0, "must be");
if (scale == 1.0 || scale < 0.0) {
return threshold;
} else {
return (intx)(threshold * scale);
double v = threshold * scale;
assert(v >= 0, "must be");
if (v > max_intx) {
return max_intx;
} else {
return (intx)(v);
}
}
}

Expand Down

1 comment on commit 43be343

@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.