[9] RFR(S) 8183401: compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java fails with The VM does not support the minimum JVMCI API version requ

Claes Redestad claes.redestad at oracle.com
Tue Jul 4 09:15:34 UTC 2017



On 2017-07-04 09:22, Doug Simon wrote:
>>> Nit: no need for Objects.equals() for int comparisons.
>> Doug, any reason why Objects.equals() is used?
> At periods of development, there was no JDK9 EA build compatible with Graal. During these periods we set JVMCI9_MIN_EA_BUILD to Integer.MAX_VALUE:
>
>      // MAX_VALUE indicates that no current EA version is compatible with Graal.
>      // Note: Keep README.md in sync with the EA version support checked here.
>      private static final int JVMCI9_MIN_EA_BUILD = 174;
>
> The code that tests JVMCI9_MIN_EA_BUILD against Integer.MAX_VALUE is effectively constant and Eclipse issues a "Dead code" warning for the "then" branch. Using Object.equals  suppresses this warning. To avoid the boxing, one could refactor the test to an intsEqual helper method.
>
> -Doug
>

Ok, maybe could've used a @SuppressWarnings("unused") to satisfy 
Eclipse, but either way it's a branch that we shouldn't ever take. I was 
just curious about the why, since it seemed a bit off.

Thanks!

/Claes


More information about the hotspot-compiler-dev mailing list