Skip to content

Conversation

@tzezula
Copy link
Contributor

@tzezula tzezula commented Sep 18, 2024

Disabling the JVMCI compiler with -XX:-UseJVMCICompiler not only deactivates JVMCI-based CompileBroker compilations but also prevents the loading of the libjvmci compiler. While this works as expected for CompileBroker compilations, it poses issues for the Truffle compiler. When -XX:-UseJVMCICompiler is used, Truffle falls back to the jargraal compiler, if available. This behavior may be confusing for Truffle users.

Expected behavior:

With -XX:+UseGraalJIT, both CompileBroker compilations and Truffle compilations should utilize the libjvmci compiler, if available.
With -XX:+EnableJVMCI, CompileBroker compilations should use the C2 compiler, while only Truffle compilations should leverage the libjvmci compiler, if available.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8340398: [JVMCI] Unintuitive behavior of UseJVMCICompiler option (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/21069/head:pull/21069
$ git checkout pull/21069

Update a local copy of the PR:
$ git checkout pull/21069
$ git pull https://git.openjdk.org/jdk.git pull/21069/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 21069

View PR using the GUI difftool:
$ git pr show -t 21069

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/21069.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 18, 2024

👋 Welcome back tzezula! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Sep 18, 2024

@tzezula This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8340398: [JVMCI] Unintuitive behavior of UseJVMCICompiler option

Reviewed-by: dnsimon

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 78 new commits pushed to the master branch:

  • 4402482: 8340585: [JVMCI] compiler/unsafe/UnsafeGetStableArrayElement.java fails with -XX:-UseCompressedClassPointers
  • e60e882: 8335167: Test runtime/Thread/TestAlwaysPreTouchStacks.java failed with Expected a higher ratio between stack committed and reserved
  • 9176f68: 8340623: Remove outdated PROCESSOR_ARCHITECTURE_IA64 from Windows coding
  • 88801ca: 8340590: RISC-V: C2: Small improvement to vector gather load and scatter store
  • 1dd60b6: 8323688: C2: Fix UB of jlong overflow in PhaseIdealLoop::is_counted_loop()
  • 4098acc: 8340146: ZGC: TestAllocateHeapAt.java should not run with UseLargePages
  • 6c91a16: 8340367: Opensource few AWT image tests
  • 865d99f: 8340596: Remove dead code from RequiresSetenv function in java.base/unix/native/libjli/java_md.c
  • 3411f9d: 8339995: Open source several AWT focus tests - series 6
  • 40cde00: 8340114: Remove outdated SelectVersion() function from the launcher and update the code comments explaining the code flow
  • ... and 68 more: https://git.openjdk.org/jdk/compare/6ff287ad9aa45d8a37aafb4dd7bd9170280f5bbb...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@dougxc) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot changed the title JDK-8340398: [JVMCI] Unintuitive behavior of UseJVMCICompiler option 8340398: [JVMCI] Unintuitive behavior of UseJVMCICompiler option Sep 18, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 18, 2024
@openjdk
Copy link

openjdk bot commented Sep 18, 2024

@tzezula The following labels will be automatically applied to this pull request:

  • graal
  • hotspot-compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added graal graal-dev@openjdk.org hotspot-compiler hotspot-compiler-dev@openjdk.org labels Sep 18, 2024
@mlbridge
Copy link

mlbridge bot commented Sep 18, 2024

Webrevs

if (UseJVMCICompiler) {
if (EnableJVMCI) {
if (FLAG_IS_DEFAULT(UseJVMCINativeLibrary) && !UseJVMCINativeLibrary) {
char path[JVM_MAXPATHLEN];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check for enabling UseJVMCINativeLibrary should really be:

   if (UseJVMCICompiler) {
     if (FLAG_IS_DEFAULT(UseJVMCINativeLibrary) && !UseJVMCINativeLibrary) {
-      char path[JVM_MAXPATHLEN];
-      if (os::dll_locate_lib(path, sizeof(path), Arguments::get_dll_dir(), JVMCI_SHARED_LIBRARY_NAME)) {
+      if (JVMCI::shared_library_exists()) {
         // If a JVMCI native library is present,

but I will address that as part of JDK-8340576.

@openjdk
Copy link

openjdk bot commented Sep 23, 2024

⚠️ @tzezula the full name on your profile does not match the author name in this pull requests' HEAD commit. If this pull request gets integrated then the author name from this pull requests' HEAD commit will be used for the resulting commit. If you wish to push a new commit with a different author name, then please run the following commands in a local repository of your personal fork:

$ git checkout JDK-8340398
$ git commit --author='Preferred Full Name <you@example.com>' --allow-empty -m 'Update full name'
$ git push

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 23, 2024
@toddjonker
Copy link
Contributor

If I'm reading things correctly, the doc-string for UseJVMCINativeLibrary in jvmci_globals.hpp needs updating. That currently states "Defaults to true if EnableJVMCIProduct is true and a JVMCI native library is available" but looks like it default to true if EnableJVMCI is true, regardless of the EnableJVMCIProduct setting.

@dougxc
Copy link
Member

dougxc commented Sep 24, 2024

If I'm reading things correctly, the doc-string for UseJVMCINativeLibrary in jvmci_globals.hpp needs updating. That currently states "Defaults to true if EnableJVMCIProduct is true and a JVMCI native library is available" but looks like it default to true if EnableJVMCI is true, regardless of the EnableJVMCIProduct setting.

That is correct and I'm making that fix here. However, it wouldn't hurt to also fix it here.

@tzezula
Copy link
Contributor Author

tzezula commented Sep 24, 2024

If I'm reading things correctly, the doc-string for UseJVMCINativeLibrary in jvmci_globals.hpp needs updating.

Fixed in 28dbd93

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Sep 24, 2024
@tzezula tzezula requested a review from dougxc September 24, 2024 07:13
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 24, 2024
@tzezula
Copy link
Contributor Author

tzezula commented Sep 24, 2024

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Sep 24, 2024
@openjdk
Copy link

openjdk bot commented Sep 24, 2024

@tzezula
Your change (at version 28dbd93) is now ready to be sponsored by a Committer.

@dougxc
Copy link
Member

dougxc commented Sep 24, 2024

/sponsor

@openjdk
Copy link

openjdk bot commented Sep 24, 2024

Going to push as commit 4cd8c75.
Since your change was applied there have been 78 commits pushed to the master branch:

  • 4402482: 8340585: [JVMCI] compiler/unsafe/UnsafeGetStableArrayElement.java fails with -XX:-UseCompressedClassPointers
  • e60e882: 8335167: Test runtime/Thread/TestAlwaysPreTouchStacks.java failed with Expected a higher ratio between stack committed and reserved
  • 9176f68: 8340623: Remove outdated PROCESSOR_ARCHITECTURE_IA64 from Windows coding
  • 88801ca: 8340590: RISC-V: C2: Small improvement to vector gather load and scatter store
  • 1dd60b6: 8323688: C2: Fix UB of jlong overflow in PhaseIdealLoop::is_counted_loop()
  • 4098acc: 8340146: ZGC: TestAllocateHeapAt.java should not run with UseLargePages
  • 6c91a16: 8340367: Opensource few AWT image tests
  • 865d99f: 8340596: Remove dead code from RequiresSetenv function in java.base/unix/native/libjli/java_md.c
  • 3411f9d: 8339995: Open source several AWT focus tests - series 6
  • 40cde00: 8340114: Remove outdated SelectVersion() function from the launcher and update the code comments explaining the code flow
  • ... and 68 more: https://git.openjdk.org/jdk/compare/6ff287ad9aa45d8a37aafb4dd7bd9170280f5bbb...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 24, 2024
@openjdk openjdk bot closed this Sep 24, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Sep 24, 2024
@openjdk
Copy link

openjdk bot commented Sep 24, 2024

@dougxc @tzezula Pushed as commit 4cd8c75.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

graal graal-dev@openjdk.org hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants