RFR: 8287052: comparing double to max_intx gives unexpected results

Dean Long dlong at openjdk.java.net
Fri May 20 20:24:56 UTC 2022


On Fri, 20 May 2022 02:49:15 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

> I think it is **insane** to allow DBL_MAX as upper limit for CompileThresholdScaling:
> 
> ```
> range(0.0, DBL_MAX)
> ```
> 
> It should be `(double)max_intx` since we can't have compilation threshold (which is integer) more than that.
> 
> If limited to that, your checks for NAN and INF double values will not be needed because you will only can get max_intx^2 value. You can convert them to assert to catch case if `scale` is something different from `CompileThresholdScaling`. But I don't see such path in code.

It looks like we can still get large (or infinite?) values because we don't seem to do a range check when using -XX:CompileCommand=CompileThresholdScaling,....

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

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


More information about the hotspot-compiler-dev mailing list