[lworld] RFR: 8359370: [lworld] allow instance fields of identity classes to be readable in the prologue phase [v13]
Vicente Romero
vromero at openjdk.org
Thu Aug 28 20:35:51 UTC 2025
On Thu, 28 Aug 2025 16:21:43 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
>>
>> minor diff
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java line 1261:
>
>> 1259: for (JCTree stat : tree.body.stats) {
>> 1260: prologueCode.add(stat);
>> 1261: /* gather all the stats in the body until a `super` or `this` constructor invocation is found,
>
> I understand that you wanted to simplify the visitor -- but doing a linear pass on the constructor and creating a new list of statements is also kind of expensive -- maybe when we're done with this change we can see if there's a way to set a flag on the visitor to shortcircuit the analysis after the super call is found.
I think I like the trade-off, we could try to infer if a constructor invocation corresponds to the class we are interested in. Like for example analyzing the symbol associated to a `super` or `this` invocation. But for erroneous invocations the symbol could be null. So what to do when we find a null symbol? We would have no clues I think.
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1523#discussion_r2308478876
More information about the valhalla-dev
mailing list