Updated JEP: nestmates

John Rose john.r.rose at oracle.com
Fri Apr 14 20:34:42 UTC 2017

On Apr 13, 2017, at 3:12 PM, Brian Goetz <brian.goetz at oracle.com> wrote:
> We can't rely on javac (or other compilers) to always generate "nest of one" attributes, so the VM would have to, on seeing a class with no nest attributes, set "nestTop = me".  But I think that would be the only change in the implementation?  And then nestTop(C) becomes a total function, which simplifies things.


Regarding javac:  It would be polite if javac were to agree that if the output classfile
has an InnerClasses attribute, and the current class either records an outer-class
or the current class *is* an outer-class, then the classfile will also have one of the
nestmate attributes.

But the system has to be robust if javac drops the ball once in a while.
And it certainly has to read down-rev class files correctly.

On Apr 13, 2017, at 2:57 PM, David Holmes <david.holmes at oracle.com> wrote:
> Do you want javac to generate a self-referential MemberOfNest attribute? If you want this then the definitions need a rewrite. This is not where we are today.

FTR, the form of a degenerate nest is not a self-referential MON attribute, but an empty NMs attribute.  That's allowed by the spec.

— John

More information about the valhalla-dev mailing list