[External] : Re: String concatenation order of operations

John Rose john.r.rose at oracle.com
Fri Sep 17 06:51:07 UTC 2021

On Sep 8, 2021, at 3:01 PM, Brian Goetz <brian.goetz at oracle.com<mailto:brian.goetz at oracle.com>> wrote:

We'd essentially have to write a new bootstrap (but leave the old one in place), and have the compiler generate bytecode to do the string conversion as the values are being pushed on the stack.  This requires a different bootstrap and a different calling convention.  So old bytecode will stay around, and the old bootstrap would have to be kept around ... pretty disruptive.

Wouldn’t be enough for javac to run toString() on arguments that need it, and pass those (to the *old* indy mechanism) as strings?

If javac can determine that toString() can be safely delayed (for String and primitive boxes, for example) then it doesn’t need to call toString() eagerly.

But in order to fix this issue, it may be necessary to run toString() calls while arguments are being computed for the indy.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20210917/7c431590/attachment.htm>

More information about the compiler-dev mailing list