[lworld] RFR: 8244227: [lworld] Explore an implementation where the reference projection and value projection types are backed by a single class symbol [v3]
Srikanth Adayapalam
sadayapalam at openjdk.java.net
Thu Apr 8 08:12:42 UTC 2021
On Thu, 1 Apr 2021 15:52:40 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Srikanth Adayapalam has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR.
>
> This seems like a good cleanup overall. IMHO the issues can be bucketized as follows:
>
> * some more experiment is required to see if we can avoid changing asSuper too much
> * there is code which will be simplified if we come to a point where javac can let go of generating two classes instead of one.
> * there is a bigger issue (which we'll have to confront with, sooner or later, because of specialization) regarding type erasure kicking in too early, and subsequent pipeline steps only dealing with symbol (not type) info
>
> Since the approach moves things in the way generic types are modeled, I'm not surprised to see some of the issues I had to face when writing a backend for the specializer compiler pop back here. I'd say, for now, let's try to deal with the first bullet (which is localized with these changes), and let's come back (in a separate PR) with some workaround for the last bullet (perhaps borrowing some old valhalla code?).
Hello Maurzio, Please take another look. I have reverted all the earlier changes to asSuper per suggestion and transformed calls to asSuper into isSubtype calls where possible (This is not always possible - see the elaborate javadoc comment attached to Types.asSuper - in fact starting the review there would be a good thing)
There are still a few calls to asSuper that are not studied through the lens of the twin hazards - these are calls from Types itself and Infer.java - outside of these two files I have studied all call sites of asSuper and suitably amended them and added tests to guard against any regressions and prove the need for and correctness of the transformation. I decided to defer the study of these remaining call sites to the pre-existing ticket JDK-8244712 - Javac should switch to reference projection before walking type hierarchy. (This ticket would include analysis of not only the remaining asSuper calls, but also isSubtype calls)
Of the two commits (ignoring the merge related ones), one of them is simply a revert of earlier change for asSuper and can be ignored.
Let me know if you see any further issues that block integration. Thanks!
-------------
PR: https://git.openjdk.java.net/valhalla/pull/375
More information about the valhalla-dev
mailing list