Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8292818: replace 96-bit representation for field metadata with variable-sized streams #12855

Closed
wants to merge 9 commits into from

Conversation

fparain
Copy link
Contributor

@fparain fparain commented Mar 3, 2023

Please review this change re-implementing the FieldInfo data structure.

The FieldInfo array is an old data structure storing fields metadata. It has poor extension capabilities, a complex management code because of lack of strong typing and semantic overloading, and a poor memory efficiency.

The new implementation uses a compressed stream to store those metadata, achieving better memory density and providing flexible extensibility, while exposing a strongly typed set of data when uncompressed. The stream is compressed using the unsigned5 encoding, which alreay present in the JDK (because of pack200) and the JVM (because JIT compulers use it to comrpess debugging information).

More technical details are available in the CR: https://bugs.openjdk.org/browse/JDK-8292818

Those changes include a re-organisation of fields' flags, splitting the previous heterogeneous AccessFlags field into three distincts flag categories: immutable flags from the class file, immutable fields defined by the JVM, and finally mutable flags defined by the JVM.

The SA, CI, and JVMCI, which all used to access the old FieldInfo array, have been updated too to deal with the new FieldInfo format.

Tested with mach5, tier 1 to 7.

Thank you.


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-8292818: replace 96-bit representation for field metadata with variable-sized streams

Reviewers

Contributors

  • John R Rose <jrose@openjdk.org>
  • Chris Plummer <cjplummer@openjdk.org>

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 12855

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 3, 2023

👋 Welcome back fparain! 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 Mar 3, 2023

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

  • 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 serviceability serviceability-dev@openjdk.org hotspot hotspot-dev@openjdk.org labels Mar 3, 2023
@fparain
Copy link
Contributor Author

fparain commented Mar 3, 2023

/contributor add jrose

@openjdk
Copy link

openjdk bot commented Mar 3, 2023

@fparain
Contributor John R Rose <jrose@openjdk.org> successfully added.

@fparain fparain marked this pull request as ready for review March 6, 2023 16:39
@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 6, 2023
@mlbridge
Copy link

mlbridge bot commented Mar 6, 2023

Webrevs

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

HI Fred,

I've taken one pass through this but it is a huge set of changes to try and digest. At this stage just a bunch of style nits.

Thanks.

src/hotspot/share/classfile/classFileParser.cpp Outdated Show resolved Hide resolved
src/hotspot/share/classfile/classFileParser.cpp Outdated Show resolved Hide resolved
src/hotspot/share/oops/fieldInfo.cpp Outdated Show resolved Hide resolved
src/hotspot/share/oops/fieldInfo.cpp Outdated Show resolved Hide resolved
src/hotspot/share/oops/fieldInfo.cpp Outdated Show resolved Hide resolved
src/hotspot/share/oops/fieldInfo.cpp Outdated Show resolved Hide resolved
src/hotspot/share/oops/fieldInfo.inline.hpp Outdated Show resolved Hide resolved
src/hotspot/share/oops/fieldInfo.inline.hpp Outdated Show resolved Hide resolved
src/hotspot/share/oops/fieldStreams.hpp Outdated Show resolved Hide resolved
@fparain
Copy link
Contributor Author

fparain commented Mar 7, 2023

/label hotspot-runtime

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Mar 7, 2023
@openjdk
Copy link

openjdk bot commented Mar 7, 2023

@fparain
The hotspot-runtime label was successfully added.

Copy link
Contributor

@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.

I was able to do a first pass through the vm code except for jvmci. I didn't look at tests or SA in this pass.

src/hotspot/share/ci/ciFlags.hpp Outdated Show resolved Hide resolved
src/hotspot/share/classfile/classFileParser.cpp Outdated Show resolved Hide resolved
src/hotspot/share/oops/fieldStreams.hpp Show resolved Hide resolved
src/hotspot/share/oops/fieldStreams.inline.hpp Outdated Show resolved Hide resolved
src/hotspot/share/oops/instanceKlass.hpp Show resolved Hide resolved
src/hotspot/share/prims/jvmtiRedefineClasses.cpp Outdated Show resolved Hide resolved
src/hotspot/share/runtime/reflectionUtils.hpp Outdated Show resolved Hide resolved
@fparain
Copy link
Contributor Author

fparain commented Mar 13, 2023

/contributor add cjplummer

@openjdk
Copy link

openjdk bot commented Mar 13, 2023

@fparain
Contributor Chris Plummer <cjplummer@openjdk.org> successfully added.

Copy link
Contributor

@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.

Most minor comments but one .inline.hpp still in an hpp file.

src/hotspot/share/jvmci/jvmciCompilerToVM.cpp Outdated Show resolved Hide resolved
src/hotspot/share/oops/fieldInfo.cpp Outdated Show resolved Hide resolved
src/hotspot/share/oops/fieldStreams.hpp Show resolved Hide resolved
src/hotspot/share/oops/instanceKlass.hpp Outdated Show resolved Hide resolved
src/hotspot/share/runtime/vmStructs.cpp Show resolved Hide resolved
@coleenp
Copy link
Contributor

coleenp commented Mar 13, 2023

I should point out that I only skimmed the SA and JVMCI changes.

Copy link
Contributor

@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.

All my comments are addressed. Thank you! This is significant work.

@openjdk
Copy link

openjdk bot commented Mar 13, 2023

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

8292818: replace 96-bit representation for field metadata with variable-sized streams

Co-authored-by: John R Rose <jrose@openjdk.org>
Co-authored-by: Chris Plummer <cjplummer@openjdk.org>
Reviewed-by: dholmes, coleenp, cjplummer, 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 2 new commits pushed to the master branch:

  • 4486f1b: 8304367: jlink --include-locales=* attempts to parse non .class resource files with classfile reader
  • 8d2ebf2: 8303697: ProcessTools doesn't print last line of process output

Please see this link for an up-to-date comparison between the source branch of this pull request and 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 openjdk bot added the ready Pull request is ready to be integrated label Mar 13, 2023
Copy link
Contributor

@plummercj plummercj left a comment

Choose a reason for hiding this comment

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

SA changes looks good. Thanks for taking care of this!

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Nice piece of work Fred - I won't pretend to follow every detail.

A few nits on unnecessary alignment (which may match pre-existing style not evident in the diff).

Thanks.

src/hotspot/share/oops/fieldInfo.inline.hpp Outdated Show resolved Hide resolved
src/hotspot/share/oops/fieldInfo.inline.hpp Outdated Show resolved Hide resolved
src/hotspot/share/oops/fieldInfo.inline.hpp Outdated Show resolved Hide resolved
src/hotspot/share/oops/instanceKlass.inline.hpp Outdated Show resolved Hide resolved
@openjdk
Copy link

openjdk bot commented Mar 17, 2023

@fparain this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout fieldinfo_unsigned5
git fetch https://git.openjdk.org/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added merge-conflict Pull request has merge conflict with target branch and removed ready Pull request is ready to be integrated labels Mar 17, 2023
@openjdk openjdk bot added ready Pull request is ready to be integrated and removed merge-conflict Pull request has merge conflict with target branch labels Mar 17, 2023
@fparain
Copy link
Contributor Author

fparain commented Mar 17, 2023

Chris, Doug, thank you for your reviews and your help.
Coleen, David, Andrey, thank you for your reviews.

@fparain
Copy link
Contributor Author

fparain commented Mar 17, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Mar 17, 2023

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

  • 932be35: 8298469: Obsolete legacy parallel class loading workaround for non-parallel-capable class loaders
  • 02a4ee2: 8303921: serviceability/sa/UniqueVtableTest.java timed out
  • 4486f1b: 8304367: jlink --include-locales=* attempts to parse non .class resource files with classfile reader
  • 8d2ebf2: 8303697: ProcessTools doesn't print last line of process output

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Mar 17, 2023

@fparain Pushed as commit bfb812a.

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