From fdece9ac71e865371ef7e348c54bca21235efdb3 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 24 May 2022 16:31:10 +0000 Subject: [PATCH] 8287169: compiler/arguments/TestCompileThresholdScaling.java fails on x86_32 after JDK-8287052 Reviewed-by: kvn, dlong --- src/hotspot/share/compiler/compilerDefinitions.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/compiler/compilerDefinitions.cpp b/src/hotspot/share/compiler/compilerDefinitions.cpp index 94eb26d23ac..bc1eb0e4392 100644 --- a/src/hotspot/share/compiler/compilerDefinitions.cpp +++ b/src/hotspot/share/compiler/compilerDefinitions.cpp @@ -136,10 +136,13 @@ intx CompilerConfig::scaled_compile_threshold(intx threshold, double scale) { } int exp; (void) frexp(v, &exp); - if (exp > 63) { + int max_exp = sizeof(intx) * BitsPerByte - 1; + if (exp > max_exp) { return max_intx; } - return (intx)(v); + intx r = (intx)(v); + assert(r >= 0, "must be"); + return r; } }