RFR: 8283641: Large value for CompileThresholdScaling causes assert

Ioi Lam iklam at openjdk.java.net
Thu Mar 24 17:28:04 UTC 2022


Please review this trivial fix that checks for overflow of `(intx)(threshold * scale)`

Before:

$ java -XX:CompileThresholdScaling=12345678901234567890.0 -version
...
# Internal Error (/jdk/open/src/hotspot/share/utilities/powerOfTwo.hpp:54), pid=4147940, tid=4147941
# assert(value > T(0)) failed: value must be > 0


After:


$ java -XX:CompileThresholdScaling=12345678901234567890.0 -version
intx Tier0InvokeNotifyFreqLog=32 is outside the allowed range [ 0 ... 30 ]
...
OnStackReplacePercentage cannot be validated because CompileThreshold value is invalid
CompileThreshold (9223372036854775807) must be between 0 and 1073741823
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.


Tested with tiers 1-2.

-------------

Commit messages:
 - 8283641: Large value for CompileThresholdScaling causes assert

Changes: https://git.openjdk.java.net/jdk/pull/7944/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7944&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8283641
  Stats: 8 lines in 1 file changed: 7 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7944.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7944/head:pull/7944

PR: https://git.openjdk.java.net/jdk/pull/7944


More information about the hotspot-compiler-dev mailing list