Skip to content

Commit f6ff38a

Browse files
committed
8353815: [ubsan] compilationPolicy.cpp: division by zero related to tiered compilation flags
Reviewed-by: mbaesken, kvn
1 parent dbbfa76 commit f6ff38a

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/hotspot/share/compiler/compilationPolicy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ class CallPredicate : AllStatic {
385385

386386
double CompilationPolicy::threshold_scale(CompLevel level, int feedback_k) {
387387
int comp_count = compiler_count(level);
388-
if (comp_count > 0) {
388+
if (comp_count > 0 && feedback_k > 0) {
389389
double queue_size = CompileBroker::queue_size(level);
390390
double k = (double)queue_size / ((double)feedback_k * (double)comp_count) + 1;
391391

src/hotspot/share/compiler/compiler_globals.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,14 @@
234234
\
235235
product(intx, Tier3LoadFeedback, 5, \
236236
"Tier 3 thresholds will increase twofold when C1 queue size " \
237-
"reaches this amount per compiler thread") \
237+
"reaches this amount per compiler thread" \
238+
"Passing 0 disables the threshold scaling") \
238239
range(0, max_jint) \
239240
\
240241
product(intx, Tier4LoadFeedback, 3, \
241242
"Tier 4 thresholds will increase twofold when C2 queue size " \
242-
"reaches this amount per compiler thread") \
243+
"reaches this amount per compiler thread" \
244+
"Passing 0 disables the threshold scaling") \
243245
range(0, max_jint) \
244246
\
245247
product(intx, TieredCompileTaskTimeout, 50, \
@@ -263,11 +265,11 @@
263265
\
264266
product(intx, TieredRateUpdateMinTime, 1, \
265267
"Minimum rate sampling interval (in milliseconds)") \
266-
range(0, max_intx) \
268+
range(1, max_intx) \
267269
\
268270
product(intx, TieredRateUpdateMaxTime, 25, \
269271
"Maximum rate sampling interval (in milliseconds)") \
270-
range(0, max_intx) \
272+
range(1, max_intx) \
271273
\
272274
product(double, Tier0ProfileDelayFactor, 100.0, DIAGNOSTIC, \
273275
"Delay profiling/compiling of methods that were " \

0 commit comments

Comments
 (0)