> From: "Maurizio Cimadamore" <maurizio.cimadam...@oracle.com>
> To: "Brian Goetz" <brian.go...@oracle.com>, "Remi Forax" <fo...@univ-mlv.fr>
> Cc: "daniel smith" <daniel.sm...@oracle.com>, "valhalla-spec-experts"
> <valhalla-spec-experts@openjdk.java.net>
> Sent: Friday, June 3, 2022 8:18:44 PM
> Subject: Re: Anonymous value classes

> And `var` ?

> (but I agree this feels a niche)
in conjunction of anything like a VarHandle, a MethodHandle, a lambda, string 
concatenation, etc. 

Anyway, Brian spins it as we do not get full-flattening and that may be 
correct, but half-flattening (flattening on stack) is as important, 
there is a lot of libraries that have APIs using interfaces that are 
implemented by anonymous classes, the collection API is one of them, fluent 
loggers (anything fluent in fact) is another, and those will benefit to have 
better than escape analysis performance. 

For half-flattening, being monomorphic and a value-based class at a callsite is 
enough for the JITs, you do not have to have the precise concrete class name 
mentioned. 

> Maurizio
Rémi 

> On 03/06/2022 18:59, Brian Goetz wrote:

>> On 6/3/2022 1:39 PM, Remi Forax wrote:

>>>> From: "Brian Goetz" [ mailto:brian.go...@oracle.com | 
>>>> <brian.go...@oracle.com> ]
>>>> To: "daniel smith" [ mailto:daniel.sm...@oracle.com | 
>>>> <daniel.sm...@oracle.com>
>>>> ] , "valhalla-spec-experts" [ 
>>>> mailto:valhalla-spec-experts@openjdk.java.net |
>>>> <valhalla-spec-experts@openjdk.java.net> ]
>>>> Sent: Friday, June 3, 2022 6:21:26 PM
>>>> Subject: Re: Anonymous value classes

>>>> There is no chance to get any calling-convention optimization here, since 
>>>> the
>>>> concrete class name will not show up in any method descriptor (or preload
>>>> attribute). There is no chance to get any heap flattening here, since the
>>>> concrete class name will not show up in any field descriptor or `newarray`
>>>> operand.
>>> Nope, anonymous classes are anonymous only for Java not in the bytecode, by
>>> example

>> OK, correction: such a vanishingly microscopic chance as to be completely
>> ignorable :)

Reply via email to