Handling invokedynamic in jaotc of OpenJDK 11
Yifei Zhang
yifei.zhang1992 at outlook.com
Tue Aug 11 06:10:13 UTC 2020
Dear all,
jaotc in OpenJDK 11 does not handle the invokedynamic bytecode due to the issue [1]. It generates a DeoptimizeNode to fall back to the interpreter, which causes performance degradation.
After looking into the JVMCI Java-side code of OpenJDK 11 and 14, I find that it is possible to turn on invokedynamic in OpenJDK 11 (but 14 still not).
In OpenJDK 14, If the commit [2] is reverted, jaotc complains in [3] when compiling the java.base module, since HotSpotConstantPoolObject introduced in [4] is not a subtype of neither HotSpotObjectConstant nor HotSpotMetaspaceConstant. However, those subtyping relations still hold in OpenJDK 11, so that no error reported when compiling the java.base with OpenJDK 11.
According to this, I was wondering if it is possible to turn on inovkedynamic in OpenJDK 11 so that unnecessary performance penalty caused by deoptimization can be avoided.
Please feel free to give any suggestions.
Cheers,
Yifei
[1] https://bugs.openjdk.java.net/browse/JDK-8223533
[2] http://hg.openjdk.java.net/jdk/jdk/rev/80dd2b549354
[3] https://hg.openjdk.java.net/jdk-updates/jdk14u/file/680a974138a1/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyNode.java#l91
[4] https://hg.openjdk.java.net/jdk-updates/jdk14u/file/680a974138a1/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTDynamicTypeStore.java#l140
More information about the jdk-updates-dev
mailing list