On Fri, 29 Aug 2025 19:48:52 GMT, Vicente Romero <[email protected]> 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/Resolve.java line 3945: > 3943: return result.toList(); > 3944: } > 3945: private boolean isReceiverParameter(Env<AttrContext> env, > JCFieldAccess tree) { this method, `isReceiverParameter`, is not used any more, I removed it src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java line 3968: > 3966: * To catch those cases, we rely on similar logic in > Attr.checkAssignable(). > 3967: */ > 3968: private boolean isAllowedEarlyReference(DiagnosticPosition pos, > Env<AttrContext> env, VarSymbol v) { moved this one to Attr ------------- PR Review Comment: https://git.openjdk.org/valhalla/pull/1523#discussion_r2311022818 PR Review Comment: https://git.openjdk.org/valhalla/pull/1523#discussion_r2311023458
