[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 17:25:59 UTC 2025


On Thu, 28 Aug 2025 16:36:25 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 1420:
> 
>> 1418:             Symbol sym = TreeInfo.symbolFor(tree);
>> 1419:             if (sym != null) {
>> 1420:                 if (!sym.isStatic() && !isMethodArgument(tree)) {
> 
> if you have a `sym`, in order to understand if something is a method parameter (not argument?) don't you need to check if `sym.owner == MTH` ?

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();
    }
}

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

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


More information about the valhalla-dev mailing list