RFR: 8336491: Unnecessary boxing conversions in void-returning lambdas [v2]
Maurizio Cimadamore
mcimadamore at openjdk.org
Thu Jul 18 09:37:33 UTC 2024
On Thu, 18 Jul 2024 09:27:49 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> I'm a bit worried about the proposed fix having a potentially bigger impact than just the problem it's trying to address. What do you think?
I see what I suggested was your original fix - what is the reason you went the other way? I suppose the reason is that `void` can't really be a target type for regular expressions - as `void` is only used in lambdas and methods, and, for methods, the shape of the `return` statement tells you whether you are void-returning or not.
So I suppose you concluded that it would have been safe to generalize what `boxIfNeeded` is doing by skipping `void`, which can only really occur when lowering a lambda expression body. Correct?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20222#issuecomment-2236061100
More information about the compiler-dev
mailing list