RFR: 8298099: [JVMCI] decouple libgraal from JVMCI module at runtime [v7]

David Holmes dholmes at openjdk.org
Thu Dec 8 02:45:59 UTC 2022


On Wed, 7 Dec 2022 19:49:47 GMT, Doug Simon <dnsimon at openjdk.org> wrote:

>> Libgraal is compiled ahead of time and should not need any JVMCI Java code to be dynamically loaded at runtime. Prior to this PR, this is not the case due to:
>> 
>> * Code to copy system properties from the HotSpot heap into the libgraal heap. This is in `jdk.vm.ci.services.Services.initializeSavedProperties(byte[])` and `jdk.vm.ci.services.Services.serializeSavedProperties()`. This code should be moved to `java.base/jdk.internal.vm.VMSupport`.
>> * Code to translate exceptions from the HotSpot heap into the libgraal heap and vice versa. This code should be moved from `jdk.internal.vm.ci//jdk.vm.ci.hotspot.TranslatedException` to `java.base/jdk.internal.vm.VMSupport`.
>> 
>> This PR makes the above changes. As a result, it's possible to build a JDK image that includes (and uses) libgraal but does not include `jdk.internal.vm.ci` or `jdk.internal.vm.compiler`. This both reduces footprint and better isolates the JAVMCI and the Graal compiler as accessing these components from Java code is now impossible.
>
> Doug Simon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 14 additional commits since the last revision:
> 
>  - Merge remote-tracking branch 'openjdk-jdk/master' into JDK-8298099
>  - formatting to avoid very long lines [skip ci]
>  - removed debug code [skip ci]
>  - clarify Properties filtering [skip ci]
>  - remove debug code [skip ci]
>  - incorporate review feedback [skip ci]
>  - removed hard-coded module name [skip ci]
>  - renamed is_module_resolvable to is_module_observable
>  - share code to create the exploded path for a module and avoid stack-based variable length array
>  - generalized ClassLoader::has_jvmci_module to is_module_resolvable
>  - ... and 4 more: https://git.openjdk.org/jdk/compare/5927a4d6...f5219b20

@dougxc Two reviews are needed for all non-trivial hotspot changes, and this also warranted a review from core-libs! Your discussions with Alan still seemed to be in-progress.

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

PR: https://git.openjdk.org/jdk/pull/11513


More information about the core-libs-dev mailing list