[lworld] RFR: 8244231: [lworld] Add support for ref-default and val-default inline classes.

Srikanth Adayapalam sadayapalam at openjdk.java.net
Thu Jul 22 07:54:59 UTC 2021


On Wed, 21 Jul 2021 12:02:13 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Code changes and tests
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java line 1340:
> 
>> 1338: 
>> 1339:         @Override
>> 1340:         public boolean isPrimitiveClass() {
> 
> I'm not too convinced by the name of this method. The use of the word `Class` makes me think of the symbol - but here you are essentially checking if it's a value projection (regardless of whether the primitive symbol is reference-favoring or not). So the name of the method should be updated and some clarifying javadoc added too. I think this should be called `isValueType` which would then connect to `asValueType` - e.g.
> 
> 
> assert type.asValueType().isValueType() // ok

Agreed, per earlier comment, I will take up this in JDK-8268734. 

(I am a bit unsettled on using "value type" at all, since the JEP introduces the name primitive class type and we are moving away value/inline nomenclature. But I see that java.lang.Class defines a method by name asValueType)

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

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



More information about the valhalla-dev mailing list