[lworld] RFR: 8244227: [lworld] Explore an implementation where the reference projection and value projection types are backed by a single class symbol

Srikanth Adayapalam sadayapalam at openjdk.java.net
Wed Mar 31 12:55:24 UTC 2021


On Wed, 31 Mar 2021 12:32:04 GMT, Srikanth Adayapalam <sadayapalam at openjdk.org> wrote:

> This PR overhauls the existing implementation/representation of reference projection types  and the inline types so that both share the same underlying symbol, much like how an infinite family of parameterized types that originate from the same generic type are modelled using the same underlying symbol.

Here are some notes that should help in the review process. I have broken down the changes involved into six logical units each forming a separate commit. Of these, the very first ("In diagnostics and debug strings while mentioning projection types, use .ref/.val rather than $ref/$val") and perhaps even the second commit ("Get out of the business of having to maintain the doppleganger symbol in sync with original") can be skipped or cursorily glanced through.

Real action starts at the third commit ("Genesis, construction, preservation and propagation of reference projection type") and proceeds through the next three commits.

src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java line 2208:

> 2206:                 asSuper(t, s.tsym) : null;
> 2207:     }
> 2208: 

Not all calls to the original method asSuper(Type, Symbol) have been rerouted to here. A few calls it appears should not be. I will add more analysis on why that is so later tomorrow.

I haven't also fully studied whether asSub, asEnclosingSuper, asOuterSuper etc need similar variant, it seems not. This is to be studied and addressed in a follow up task.

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

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


More information about the valhalla-dev mailing list