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

Liam Miller-Cushon cushon at openjdk.org
Fri Jul 19 22:18:05 UTC 2024


On Fri, 19 Jul 2024 21:47:45 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> 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).

Sounds good, I'm happy to make that change. I went ahead and did that, although it turns out that the current logic in `boxIfNeeded` emits a boxing conversion if the target is `Type.noType`, so it still requires a new case there to avoid that. Let me know if I missed anything, or if that changes your preference at all.

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

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


More information about the compiler-dev mailing list