JDK 14 record type representation in classfile format?
Luke Hutchison
luke.hutch at gmail.com
Sat Mar 28 00:06:12 UTC 2020
>
> There is a good reason to duplicate the metadata declared at declaration
> site at callsite, it means that you can avoid to load the class containing
> the metadata. Here the compiler can find the classfile of the inner class
> without finding/loading the outer class.
>
But as I mentioned, this information is present as an attribute in Lookup
(the inner class), not just in MethodHandle (the outer class). Therefore
you can determine the outer class without loading the outer class. In fact
it has to be that way, because you can't load the outer class before you
know what the outer class is.
Furthermore if you don't need to load the inner class, there's no reason
why you would need to determine the outer class. So if the inner class is
actually being used, you already have the outer class information, because
the inner class has already been loaded.
More information about the amber-dev
mailing list