[lworld] RFR: 8237072: [lworld] Add support for denoting and deriving the reference projection

Maurizio Cimadamore mcimadamore at openjdk.java.net
Fri May 1 11:24:04 UTC 2020

On Fri, 1 May 2020 10:53:14 GMT, Srikanth Adayapalam <sadayapalam at openjdk.org> wrote:

>> src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java line 2605:
>>> 2604:         readClassFileInternal(c);
>>> 2605:         if (c.isValue()) {
>>> 2606:             /* http://cr.openjdk.java.net/~briangoetz/valhalla/sov/04-translation.html
>> This approach leads to very compact code - but in javac-land it's a bit odd that we have to prune away members at this
>> late stage. I wonder if some of the pruning could happen earlier (e.g. in TransValues?)
> Actually, this code is trying to remove V$ref.class from its owner (the package symbol). The class finder would have
> from the class path found V.class and V$ref.class and added them to the known classes. When V.class is completed and we
> find that it is a value class, V.class has a "wrong" super type from javac pov. It needs to read V$ref.class and pick
> up the "real" super type from there. In that process it needs to remove V$ref.class from the package owner as it not a
> top level class at all (very similar to what happens for nested classes)

Actually I meant to comment on ClassWriter and clicked on the wrong thing!


PR: https://git.openjdk.java.net/valhalla/pull/32

More information about the valhalla-dev mailing list