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

8265423: [lworld] Provide experimental support for generating a single class file per primitive class #394

Closed
wants to merge 3 commits into from

Conversation

@sadayapalam
Copy link
Collaborator

@sadayapalam sadayapalam commented Apr 27, 2021

Use -XDunifiedValRefClass option to javac to get unified class file generation for primitive classes. Note: Javac will require some tweaks to consume such files, this is WIP.


Progress

  • Change must not contain extraneous whitespace

Issue

  • JDK-8265423: [lworld] Provide experimental support for generating a single class file per primitive class

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/valhalla pull/394/head:pull/394
$ git checkout pull/394

Update a local copy of the PR:
$ git checkout pull/394
$ git pull https://git.openjdk.java.net/valhalla pull/394/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 394

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/valhalla/pull/394.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Apr 27, 2021

👋 Welcome back sadayapalam! A progress list of the required criteria for merging this PR into lworld 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 openjdk bot commented Apr 27, 2021

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

8265423: [lworld] Provide experimental support for generating a single class file per primitive class

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 lworld branch:

  • a7ab3bb: 8266086: [lworld][lw3] C1 produces incorrect code when GlobalValueNumbering is used
  • 8dc4430: 8265726: [lworld] C2 compilation fails with assert "uses must be dominated by definitions"

Please see this link for an up-to-date comparison between the source branch of this pull request and the lworld 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 lworld branch, type /integrate in a new comment.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Apr 27, 2021

Webrevs

@@ -845,7 +845,7 @@ void writeInnerClasses() {
!inner.name.isEmpty() ? poolWriter.putName(inner.name) : 0);
databuf.appendChar(flags);
icCount++;
if (inner.isPrimitiveClass()) {
if (inner.isPrimitiveClass() && types.splitPrimitiveClass) {
Copy link
Collaborator

@mcimadamore mcimadamore Apr 27, 2021

Choose a reason for hiding this comment

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

the test sym.isPrimitiveClass() && types.splitPrimitiveClass is so common which I think would be better refactored into a separate predicate, to make the code clearer.

e.g. Symbol.isSplitPrimitiveClass(Types)

Copy link
Collaborator Author

@sadayapalam sadayapalam Apr 27, 2021

Choose a reason for hiding this comment

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

Thanks, I will take a look

@@ -2687,7 +2687,7 @@ public void readClassFile(ClassSymbol c) {
ClassSymbol referenceProjection = syms.getClass(currentModule, flatname);
if (referenceProjection != null) {
if (referenceProjection.name != names.ref && referenceProjection.owner.kind == PCK) {
readClassFileInternal(referenceProjection);
referenceProjection.complete();
Copy link
Collaborator

@mcimadamore mcimadamore Apr 27, 2021

Choose a reason for hiding this comment

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

This change seems sneaky - what caused it?

Copy link
Collaborator Author

@sadayapalam sadayapalam Apr 27, 2021

Choose a reason for hiding this comment

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

Indeed. I should push this as a separate change set. I discovered this bug while working on the now aborted attempt to evolve the code generation scheme to match SoV4. The right way to internalize the class is by calling complete() on the symbol and not by directly calling readClassFileInternal(). Doing the latter, could result in com.sun.tools.javac.code.ClassFinder#fillIn(com.sun.tools.javac.code.Symbol.ClassSymbol) from being re-entered resulting in an assertion failure.

This change is not required for the present feature, but is a crucial fix that should be made independently.

Copy link
Collaborator Author

@sadayapalam sadayapalam Apr 27, 2021

Choose a reason for hiding this comment

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

(As I was studying the code that merges the projections back to see what changes I should make for the unified class model, I remembered that bug fix from that aborted work)

Copy link
Collaborator

@mcimadamore mcimadamore Apr 27, 2021

Choose a reason for hiding this comment

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

I'm fine with keeping the change here if that's easier - I just wanted to make sure I understood where this was coming from as it looked an odd change given what of the rest of the code is doing. Thanks for the explanation.

@sadayapalam
Copy link
Collaborator Author

@sadayapalam sadayapalam commented May 3, 2021

/integrate

@openjdk openjdk bot closed this May 3, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels May 3, 2021
@openjdk
Copy link

@openjdk openjdk bot commented May 3, 2021

@sadayapalam Since your change was applied there have been 2 commits pushed to the lworld branch:

  • a7ab3bb: 8266086: [lworld][lw3] C1 produces incorrect code when GlobalValueNumbering is used
  • 8dc4430: 8265726: [lworld] C2 compilation fails with assert "uses must be dominated by definitions"

Your commit was automatically rebased without conflicts.

Pushed as commit 17b12ac.

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

@sadayapalam sadayapalam deleted the JDK-8265423 branch May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants