RFR: 8339067: Convert Threshold flags (like Tier4MinInvocationThreshold and Tier3MinInvocationThreshold) to double [v2]

Vladimir Kozlov kvn at openjdk.org
Fri Oct 18 18:12:07 UTC 2024


On Wed, 16 Oct 2024 07:14:03 GMT, Amit Kumar <amitkumar at openjdk.org> wrote:

> > you could also just cast to double at every use site. Would that also work?
> 
> is that required ? Aren't integers, by default, will be treated as double if they are multiplied by a double data type value ?

Yes, you are right. This RFE could be NOP.  My suggestion in [JDK-8333098 PR](https://github.com/openjdk/jdk/pull/20615) was based on assumption that these flags may cause rounding issue if they are used in integer expressions. Or result of double expression is converted into integer.
But you show that they used with double value `scale` which cast these flags values into double and only in compare expressions.
The only other place I found is:

compilationPolicy.hpp:  static int min_invocations() { return Tier4MinInvocationThreshold; }

But it is used only double expression again:

bytecodeInfo.cpp:      double min_freq = MAX2(MinInlineFrequencyRatio, 1.0 / CompilationPolicy::min_invocations());

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

PR Comment: https://git.openjdk.org/jdk/pull/21354#issuecomment-2422988943


More information about the hotspot-compiler-dev mailing list