[lworld] RFR: 8266466: [lworld] Enhance javac to consume unified primitive class files generated under the option -XDunifiedValRefClass [v3]

Srikanth Adayapalam sadayapalam at openjdk.java.net
Mon May 24 06:27:09 UTC 2021


On Fri, 21 May 2021 12:30:32 GMT, Srikanth Adayapalam <sadayapalam at openjdk.org> wrote:

>> src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java line 1033:
>> 
>>> 1031:          * viewed against the default nature of the associated class.
>>> 1032:          */
>>> 1033:         public enum Flavor {
>> 
>> Perhaps you could add a method which "upgrades" a flavor to a new one, given new info.
>> 
>> e.g.
>> 
>> 
>> L_TypeOf_X.update(sym.isPrimitiveClass()) ->  L_TypeOf_Q/L_TypeOf_L (depending on isPrimitiveClass)
>> 
>> 
>> This would allow you to rule out (e.g. throw) bad updates. E.g. X flavors can be updated, all the other "leaf" flavors can only be updated to self. 
>> 
>> I think a method such as this would remove a lot of conditional logic in the clients.
>
> I'll take a look ...

> Perhaps you could add a method which "upgrades" a flavor to a new one, given new info.
> 
> e.g.
> 
> ```
> L_TypeOf_X.update(sym.isPrimitiveClass()) ->  L_TypeOf_Q/L_TypeOf_L (depending on isPrimitiveClass)
> ```
> 
> This would allow you to rule out (e.g. throw) bad updates. E.g. X flavors can be updated, all the other "leaf" flavors can only be updated to self.
> 
> I think a method such as this would remove a lot of conditional logic in the clients.

Thanks, this turned out to be a nice suggestion and helped simplify the code at 3 or 4 places.

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

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



More information about the valhalla-dev mailing list