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

Vicente Romero vromero at openjdk.org
Fri Aug 22 16:23:48 UTC 2025


On Fri, 22 Aug 2025 16:20:29 GMT, Vicente Romero <vromero at openjdk.org> wrote:

>> 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
>> 
>> This PR is a remake of https://github.com/openjdk/valhalla/pull/1490
>
> Vicente Romero has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits:
> 
>  - fixing bugs: new test cases brought in with latest merge are not accepted
>  - merge with lworld
>  - refactorings
>  - another bug fix
>  - bug fix
>  - merge with lworld
>  - renaming methods in LocalProxyVarGen
>  - more changes
>  - refactoring
>  - test changes
>  - ... and 7 more: https://git.openjdk.org/valhalla/compare/62e90b5d...0eb81681

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LocalProxyVarsGen.java line 91:

> 89:     private final UnsetFieldsInfo unsetFieldsInfo;
> 90:     private ClassSymbol currentClass = null;
> 91:     private java.util.List<JCVariableDecl> finalOrStrictInstanceFields;

most changes in this one are due to renaming as now we will be tracking non-strict fields too

-------------

PR Review Comment: https://git.openjdk.org/valhalla/pull/1523#discussion_r2294156402


More information about the valhalla-dev mailing list