[lworld] RFR: 8279672: [lworld] Implement semantic checks for value classes

Srikanth Adayapalam sadayapalam at openjdk.java.net
Tue Jan 11 12:30:17 UTC 2022


On Tue, 11 Jan 2022 12:20:38 GMT, Srikanth Adayapalam <sadayapalam at openjdk.org> wrote:

> Push down various sematic/behavioral restrictions/checks and the associated diagnostics from primitive to value classes.

Notes for reviewer:


This patch implements the semantic checks enumerated in JDK-8279672

    - These checks already exist the Valhalla code base, but were implemented
      at the level of B3 (primitive) classes. What this change set does therefore
      is to push these checks and diagnostics down to B2 (value) classes.

    - A primitive class automatically gets these checks by virtue of first of all
      being a value class.

    - For ease of review, I am pushing the changes in two sets, (a) the key changes and
      (b) incidental, routine, mostly boiler plate style changes to many tests

This patch also contains a cleanup:

    - We don't ANYMORE mark a value/primitive class as being final in the parser.
      This was not the best place for it and it actually requires some manueveres
      from us when we want to NOT expose (in diagnostics) those inserted implicit
      modifiers. Instead value classes are now marked final in the orthodox way in
      com.sun.tools.javac.comp.Check#checkFlags

Known issues deferred to later steps:

    - Some diagnostics/checks outside of the scope of JDK-8279672 that should 
      really operate at the level of value classes may be continuing to operate
      at the level of primitive classes. These will be fixed separately.

    - Javac incorrectly tolerates value records having synchronized methods.

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

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



More information about the valhalla-dev mailing list