[lworld] RFR: 8242612: [lworld] Javac should not expressly encode the new super interface types in class files

Srikanth Adayapalam sadayapalam at openjdk.java.net
Mon May 18 13:22:12 UTC 2020

On Mon, 18 May 2020 12:44:53 GMT, Jim Laskey <jlaskey at openjdk.org> wrote:

>> Jim, Could you please review this change ? TIA.
>> Changes:
>>     - Withdraw the new top type InlineObject (per design)
>>     - Do not encode the new top types in class files as this is noisy and
>>       very disruptive and let the static compiler and the dynamic environments
>>       inject these types as needed. (since classes compiled with legacy compilers
>>       will not encode these top types anyway the VM has to resort to injection,
>>       why not resort to injection for everything is the motivation)
>>     - Adjust some code that is surprised by super interfaces being empty.
>> More background is available in https://bugs.openjdk.java.net/browse/JDK-8242612
> src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symtab.java line 276:
>> 275:                         Type it;
>> 276:                         if (ct.interfaces_field == null || ct.interfaces_field.isEmpty()) {
>> 277:                             it = objectType;
> I'm assuming that you are using this to indicate no top interfaces. Is this safe (non-hackish)?

Yes, it is safe. Basically earlier on all value classes had at least one interface (InlineObject) and possibly more.
Now the magic top type InlineObject going away, values may have no super interfaces at all and this would upset
makeIntersectionType which first asserts that it has not been called with an empty list of types.


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

More information about the valhalla-dev mailing list