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

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Aug 29 13:56:00 UTC 2025


On Fri, 29 Aug 2025 10:13:23 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> this is for cases when we have an argument that is for example of the same type as the current class so like:
>> 
>> class Test {
>>     String s;
>>     
>>     Test(Test t) {
>>         // the owner of s is Test not MTH so we need to check what is the qualifier for s which at the end is the argument
>>         // `t` so we ignore it
>>         String s1 = t.s;
>>         super();
>>     }
>> }
>
> yes, so isn't just checking owner.kind != TYP enough? (e.g. "not a field")

I tried to replace this with:

`if (!sym.isStatic() && sym.kind == VAR && sym.owner.kind == TYP) { ... }`

And no tests seem to fail.

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

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


More information about the valhalla-dev mailing list