<div dir="ltr">Thanks for the clarification!<div><br></div><div>I think that's what the patch is doing, then, aside from using String.valueOf instead of Object.toString.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Sep 18, 2021 at 6:12 PM Brian Goetz <<a href="mailto:brian.goetz@oracle.com" target="_blank">brian.goetz@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<br>
<br>
<div>On 9/18/2021 6:34 PM, Liam
Miller-Cushon wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">
<div>
<div dir="ltr" class="gmail_attr">On Wed, Sep 8, 2021 at
3:01 PM Brian Goetz <<a href="mailto:brian.goetz@oracle.com" target="_blank">brian.goetz@oracle.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>The natural way to do this is to have the various
arguments passed as real stack arguments, causing them
to all be evaluated before being pushed through the MH
nest</div>
</blockquote>
<br>
I'm not sure I understand this part. Aren't non-constant
arguments already being evaluated and passed as stack
arguments to the invokedynamic?<br>
</div>
</div>
</div>
</blockquote>
<br>
Yes, they are being evaluated, but not toString'ed. So the compiler
generates code to evaluate and push all the arguments, and then the
bootstrap does the toString'ing. That means that arg #2 is
evaluated before arg #1 is toString'ed. For non-string / primitive
arguments, the compiler would have to emit `invokevirtual
Object::toString` for each argument as it is pushed. <br>
</div>
</blockquote></div>