Skip to content

Conversation

vicente-romero-oracle
Copy link
Contributor

@vicente-romero-oracle vicente-romero-oracle commented Jun 20, 2025

Before this fix only strict fields were readable in the prologue phase. The proposed fix should allow any instance fields of identity classes to be readable in the prologue phase. This implies changes in flow analysis as before we were only tracking final and strict fields. There is also some "cooperation" needed in the code to detect cases when reading a field is not allowed in the prologue phase. For example some methods in Resolve don't have all the needed information at the moment they are dealing with some ASTs and part of the processing needs to be done in Attr

TIA


Progress

  • Change must not contain extraneous whitespace

Issue

  • JDK-8359370: [lworld] allow instance fields of identity classes to be readable in the prologue phase (Bug - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1490

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/1490.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 20, 2025

👋 Welcome back vromero! 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 bot commented Jun 20, 2025

@vicente-romero-oracle 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:

8359370: [lworld] allow instance fields of identity classes to be readable in the prologue phase

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 147 new commits pushed to 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.

@liach
Copy link
Member

liach commented Jun 21, 2025

Just curious, why is field proxies so late in the stages? Is it because strict fields cannot be used by lowered structures, etc.?

y = Inner1.this.x; // FAIL - early 'this' reference
super();
}

public class Inner1a extends Inner1 {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved the code above to new file EarlyAssignments2.java as now if fails in Flow not in Resolve, so it was not being reported by javac

this.x++; // this should FAIL
super();
}

public SuperInitFails(float[] x) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved to EarlyAssignments2, too

@vicente-romero-oracle
Copy link
Contributor Author

vicente-romero-oracle commented Jul 2, 2025

Just curious, why is field proxies so late in the stages? Is it because strict fields cannot be used by lowered structures, etc.?

sorry I missed your question, well what this phase is doing is kind of similar to what we do in Lower, actually I don't discard folding the code into lower in the future, this is probably one of the reasons it is so close to Lower. We certainly need it after Flow

@openjdk
Copy link

openjdk bot commented Jul 2, 2025

⚠️ @vicente-romero-oracle This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@vicente-romero-oracle vicente-romero-oracle marked this pull request as ready for review July 2, 2025 21:58
@openjdk openjdk bot added ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 2, 2025
@mlbridge
Copy link

mlbridge bot commented Jul 2, 2025

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 31, 2025

@vicente-romero-oracle This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed ready Pull request is ready to be integrated labels Aug 6, 2025
@bridgekeeper
Copy link

bridgekeeper bot commented Aug 28, 2025

@vicente-romero-oracle This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

@bridgekeeper bridgekeeper bot closed this Aug 28, 2025
@vicente-romero-oracle vicente-romero-oracle deleted the JDK-8359370 branch August 28, 2025 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Pull request is ready to be integrated rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

2 participants