8353815: [ubsan] compilationPolicy.cpp: division by zero related to tiered compilation flags

Reviewed-by: mbaesken, kvn
This commit is contained in:
Manuel Hässig 2025-06-24 06:55:05 +00:00
parent dbbfa76b73
commit f6ff38ab42
2 changed files with 7 additions and 5 deletions

View File

@ -385,7 +385,7 @@ public:
double CompilationPolicy::threshold_scale(CompLevel level, int feedback_k) {
int comp_count = compiler_count(level);
if (comp_count > 0) {
if (comp_count > 0 && feedback_k > 0) {
double queue_size = CompileBroker::queue_size(level);
double k = (double)queue_size / ((double)feedback_k * (double)comp_count) + 1;

View File

@ -234,12 +234,14 @@
\
product(intx, Tier3LoadFeedback, 5, \
"Tier 3 thresholds will increase twofold when C1 queue size " \
"reaches this amount per compiler thread") \
"reaches this amount per compiler thread" \
"Passing 0 disables the threshold scaling") \
range(0, max_jint) \
\
product(intx, Tier4LoadFeedback, 3, \
"Tier 4 thresholds will increase twofold when C2 queue size " \
"reaches this amount per compiler thread") \
"reaches this amount per compiler thread" \
"Passing 0 disables the threshold scaling") \
range(0, max_jint) \
\
product(intx, TieredCompileTaskTimeout, 50, \
@ -263,11 +265,11 @@
\
product(intx, TieredRateUpdateMinTime, 1, \
"Minimum rate sampling interval (in milliseconds)") \
range(0, max_intx) \
range(1, max_intx) \
\
product(intx, TieredRateUpdateMaxTime, 25, \
"Maximum rate sampling interval (in milliseconds)") \
range(0, max_intx) \
range(1, max_intx) \
\
product(double, Tier0ProfileDelayFactor, 100.0, DIAGNOSTIC, \
"Delay profiling/compiling of methods that were " \