Request for review (S): JDK-8011009: Use do-while(0) instead of while(0) in EC_TRACE and RC_TRACE* macros
John Rose
john.r.rose at oracle.com
Thu Mar 28 17:19:12 PDT 2013
On Mar 28, 2013, at 5:01 PM, Vitaly Davidovich <vitalyd at gmail.com> wrote:
> John, with lambdas that capture variables there's still the issue of allocating the holder class isn't there? So you remove the overhead of deriving the message but you still get GC churn (unless JIT inlines and escape analyzes out the alloc, but I don't think it's very reliable).
The "holder object" is stateless and can be adjusted by the runtime system, so we can play tricks like you point out. It is a prime candidate for escape analysis, for example. The JVM can delay allocation of certain objects by putting a "recipe" for the desired object in the debug info, and only executing it after an uncommon trap.
For making such transforms absolutely reliable we need macros or AOT or "assert 2.0" or something like that. But I hope users can get most of what they want from good-enough optimization of lambda.
— John
More information about the hotspot-dev
mailing list