Skip to content

Conversation

@coleenp
Copy link
Contributor

@coleenp coleenp commented Aug 26, 2024

Move JVM implementation access flags that are not specified by the classfile format into Klass so we can shrink AccessFlags to u2 in a future change.

Tested with tier1-7.

NOTE: there are arm, ppc and s390 changes to this that are just a guess. Also, graal changes.


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-8339112: Move JVM Klass flags out of AccessFlags (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 20719

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 26, 2024

👋 Welcome back coleenp! 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 Aug 26, 2024

@coleenp 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:

8339112: Move JVM Klass flags out of AccessFlags

Reviewed-by: matsaave, cjplummer, dlong, thartmann, yzheng

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 133 new commits pushed to the master branch:

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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk
Copy link

openjdk bot commented Aug 26, 2024

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

  • graal
  • hotspot
  • serviceability

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 serviceability serviceability-dev@openjdk.org hotspot hotspot-dev@openjdk.org labels Aug 26, 2024
@coleenp coleenp changed the title Flags 8339112: Move JVM Klass flags out of AccessFlags Aug 27, 2024
@coleenp coleenp marked this pull request as ready for review August 29, 2024 15:53
@openjdk openjdk bot added the rfr Pull request is ready for review label Aug 29, 2024
@mlbridge
Copy link

mlbridge bot commented Aug 29, 2024

Webrevs

Copy link
Contributor

@matias9927 matias9927 left a comment

Choose a reason for hiding this comment

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

x86 and ARM interpreter code looks good, just one potential nit.

Copy link
Contributor Author

@coleenp coleenp left a comment

Choose a reason for hiding this comment

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

Dean and Matias, thank you for the improvements to the assembly code. Dean I took your suggestions, including refactoring C2 code. Thanks for the thorough look at this change.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Aug 30, 2024
Copy link
Contributor

@matias9927 matias9927 left a comment

Choose a reason for hiding this comment

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

Interpreter changes look good, thanks!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Aug 30, 2024
@coleenp
Copy link
Contributor Author

coleenp commented Aug 30, 2024

Thanks Chris and Matias for reviewing parts of this.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Aug 30, 2024
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Aug 30, 2024
@offamitkumar
Copy link
Member

Hi @coleenp,

I got this error while build on my Mac-M1, did you see something like this ? :

ERROR: Failed to generate link optimization data. This is likely a problem with the newly built JVM/JDK.
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/Users/amitkumar/jdk/src/hotspot/share/oops/klassFlags.hpp:72), pid=57968, tid=10499
#  assert(!is_value_based_class()) failed: set once
#
# JRE version:  (24.0) (fastdebug build )
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 24-internal-adhoc.amitkumar.jdk, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/amitkumar/jdk/make/hs_err_pid57968.log
#
#

These are the changes with which I am build the JVM. I can reproduce it on my s390x-machine as well.

diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp
index d442894798b..fbd1a2b3281 100644
--- a/src/hotspot/share/runtime/globals.hpp
+++ b/src/hotspot/share/runtime/globals.hpp
@@ -170,7 +170,7 @@ const int ObjectAlignmentInBytes = 8;
   product(bool, AlwaysSafeConstructors, false, EXPERIMENTAL,                \
           "Force safe construction, as if all fields are final.")           \
                                                                             \
-  product(bool, UnlockDiagnosticVMOptions, trueInDebug, DIAGNOSTIC,         \
+  product(bool, UnlockDiagnosticVMOptions, true, DIAGNOSTIC,         \
           "Enable normal processing of flags relating to field diagnostics")\
                                                                             \
   product(bool, UnlockExperimentalVMOptions, false, EXPERIMENTAL,           \
@@ -819,7 +819,7 @@ const int ObjectAlignmentInBytes = 8;
   product(bool, RestrictContended, true,                                    \
           "Restrict @Contended to trusted classes")                         \
                                                                             \
-  product(int, DiagnoseSyncOnValueBasedClasses, 0, DIAGNOSTIC,              \
+  product(int, DiagnoseSyncOnValueBasedClasses, 1, DIAGNOSTIC,              \
              "Detect and take action upon identifying synchronization on "  \
              "value based classes. Modes: "                                 \
              "0: off; "                                                     \

Copy link
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

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

The JIT changes look good to me.

Copy link
Contributor

@mur47x111 mur47x111 left a comment

Choose a reason for hiding this comment

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

JVMCI changes look good to me!

@coleenp
Copy link
Contributor Author

coleenp commented Sep 3, 2024

@offamitkumar Thank you for finding this bug. These flags have asserts that they're only set once, but CDS restores sets the value for this flag. Since it was set when dumping the archive, it resets it, which is okay in this case. I have a fix for this.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Sep 3, 2024
Copy link
Contributor

@matias9927 matias9927 left a comment

Choose a reason for hiding this comment

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

Updates look good!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 4, 2024
@coleenp
Copy link
Contributor Author

coleenp commented Sep 4, 2024

Thank you for reviewing, Dean, Tobias, Amit, Exe-Boss and reviewing the updates also Matias.
/integrate

@openjdk
Copy link

openjdk bot commented Sep 4, 2024

Going to push as commit 0cfd08f.
Since your change was applied there have been 133 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Sep 4, 2024

@coleenp Pushed as commit 0cfd08f.

💡 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 hotspot-dev@openjdk.org integrated Pull request has been integrated serviceability serviceability-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.