[lworld] RFR: 8359370: [lworld] allow instance fields of identity classes to be readable in the prologue phase [v18]
Vicente Romero
vromero at openjdk.org
Fri Aug 29 19:48:53 UTC 2025
On Fri, 29 Aug 2025 19:45:36 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 incrementally with one additional commit since the last revision:
>
> moving isEarlyReference to Attr
src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java line 323:
> 321:
> 322: // Check instance field assignments that appear in constructor prologues
> 323: if (isEarlyReference(env, base, v)) {
this method, isEarlyReference, is only used in Attr, I moved it here
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1523#discussion_r2311016772
More information about the valhalla-dev
mailing list