RFR: 8280901: MethodHandle::linkToNative stub is missing w/ -Xint
Vladimir Ivanov
vlivanov at openjdk.java.net
Tue Feb 22 11:49:27 UTC 2022
On Mon, 14 Feb 2022 13:40:32 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
> MethodHandle::linkToNative linker doesn't have a dedicated stub for interpreter. A stub for compiled code is shared and it is invoked through i2c stub when accessed from interpreter. In interpreter-only mode, stubs for compiled code are not generated and linkToNative ends up in a broken state where `Method::_from_interpreted_entry` points to `i2c` stub while `Method::_from_compiled_entry` points to `c2i` stub.
>
> Proposed fix unconditionally generates a stub for `MethodHandle::linkToNative` case irrespective whether it is a interpreter-only mode or not.
>
> Testing: test/jdk/java/foreign/ w/ -Xint
Thanks for the reviews, Maurizio, Aleksey, and Vladimir.
> maybe consider adding some extra test combinations in TestMatrix
I decided to extend `test/jdk/java/foreign/TestDowncall.java` to run a single test in `-Xint` mode:
----------messages:(5/559)----------
command: testng -Xint ... -Dgenerator.sample.factor=100000 TestDowncall
...
elapsed time (seconds): 1.031
...
----------System.out:(7/249)----------
test TestDowncall.testDowncall(0, "f0_V__", VOID, [], []): success
===============================================
java/foreign/TestDowncall.java
Total tests run: 1, Passes: 1, Failures: 0, Skips: 0
===============================================
-------------
PR: https://git.openjdk.java.net/jdk/pull/7459
More information about the hotspot-dev
mailing list