diff --git a/src/hotspot/share/compiler/compilerDefinitions.cpp b/src/hotspot/share/compiler/compilerDefinitions.cpp index bdd9a50c7fd..94eb26d23ac 100644 --- a/src/hotspot/share/compiler/compilerDefinitions.cpp +++ b/src/hotspot/share/compiler/compilerDefinitions.cpp @@ -131,11 +131,15 @@ intx CompilerConfig::scaled_compile_threshold(intx threshold, double scale) { } else { double v = threshold * scale; assert(v >= 0, "must be"); - if (v > max_intx) { + if (g_isnan(v) || !g_isfinite(v)) { return max_intx; - } else { - return (intx)(v); } + int exp; + (void) frexp(v, &exp); + if (exp > 63) { + return max_intx; + } + return (intx)(v); } }