VarHandle optimization
Brian S O'Neill
bronee at gmail.com
Fri Nov 1 14:08:53 UTC 2024
On 2024-10-31 12:07 PM, Maurizio Cimadamore wrote:
>
>
> The target MH that is used for the var handle operation is inlined into
> the caller, pretty much from scratch. I believe method handles
> (internally) supports "customization" , which allows a method handle to
> be "recompiled" into its own (possibly simpler) lambda form. Method
> handle specialization is avoided, where possible, to limit the number of
> classfiles being generated dynamically. It's a delicate balance (and one
> I'm not entirely familiar with, so I'll leave others to comment on this).
>
> (that said, I agree with the general point that var handle warmup is
> quite bad -- and I do believe this will be tackled in some shape or form
> by Leyden).
>
> Maurizio
>
>
Even if a VarHandle could forcibly be compiled into a class early, would
this still present the same problem if the generated code has so many
steps that the inliner gives up too soon? Or is the expectation that the
class representation would generally be smaller and more likely to be
inlined? Could the generated class apply a "force inline" annotation?
More information about the panama-dev
mailing list