[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
Doug Simon
doug.simon at oracle.com
Tue Jul 4 07:22:31 UTC 2017
> On 4 Jul 2017, at 00:57, Vladimir Kozlov <vladimir.kozlov at oracle.com> wrote:
>
> On 7/3/17 3:39 PM, Claes Redestad wrote:
>> Looks reasonable for 9 (assuming there is some compatibility story preventing you from using Runtime.version() and friends?).
>
> This is Graal code which work with JDK 8 too where this new API is not available. Even so JDK 9 has only copy of Oracle Lab's Graal we want to keep them similar.
>
>> 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
>
> Thanks,
> Vladimir
>
>> Thanks!
>> /Claes
>> On 2017-07-03 23:45, Vladimir Kozlov wrote:
>>> This is fix for P1 in JDK 9.
>>>
>>> https://bugs.openjdk.java.net/browse/JDK-8183401
>>> webrev:
>>> http://cr.openjdk.java.net/~kvn/8183401/webrev/
>>>
>>> Contribute by Doug Simon.
>>>
>>> After JDK 9 version string changed from "9-ea+174" to "9+176" Graal stop working because it does not recognize this version string. It looked for "9-ea". As result AOT does not work and all AOT [1] and JVMCI tests fail.
>>>
>>> The same problem also exists in JDK 10 but we did not hit it yet because we did not test AOT in *promoted* builds yet. Our current jdk 10 builds (from JPRT) have "internal" in version string and Graal's version check accepts it.
>>>
>>> The fix changed jdk 9 version check to "9+" and removed failure exit for other versions including 10:
>>>
>>> + } else {
>>> + // Graal will be compatible with all JDK versions as of 9 GA
>>> + // until a JVMCI API change is made in a 9u or later release.
>>>
>>>
>>> And the code is updated (added try{}) to match one in JDK 10 [2].
>>>
>>> Thanks,
>>> Vladimir
>>>
>>>
>>> [1] https://bugs.openjdk.java.net/browse/JDK-8183403
>>> [2] http://hg.openjdk.java.net/jdk10/hs/hotspot/file/7b76d42c6419/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java
More information about the hotspot-compiler-dev
mailing list