RFR: 8336491: Unnecessary boxing conversions in void-returning lambdas [v2]

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Jul 19 21:50:48 UTC 2024


On Thu, 18 Jul 2024 17:28:10 GMT, Liam Miller-Cushon <cushon at openjdk.org> wrote:

> Your alternative of setting `currentRestype` to `Type.noType` should handle that case as well, I'm happy to make that switch if you'd prefer it over handling `VOID` in `boxIfNeeded`.

I have a very very slight preference for adding an assert in boxIfNeeded to check against VOID (since the method doesn't really seem to be thought for that), and dealing with void in `visitLambda`, by setting `Type.noType`. But, as said, the preference is only slight, given that, in either case some special casing would be required. I suppose the reason for my preference is that I like to put the special casing close to where it belong (so that we can comment it clearly too).

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

PR Comment: https://git.openjdk.org/jdk/pull/20222#issuecomment-2240257146


More information about the compiler-dev mailing list