<div dir="ltr">Got it, thanks!<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 12, 2023 at 3:40 PM Tobias Hartmann <<a href="mailto:tobias.hartmann@oracle.com">tobias.hartmann@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">Hi Andrii,<br>
<br>
Ideally, hot methods are C2 compiled and therefore heap allocation / copying is only required when<br>
storing into containers.<br>
<br>
Stack allocation support for C2 has been proposed before [1] and is out of scope of this project.<br>
<br>
Best regards,<br>
Tobias<br>
<br>
[1] <a href="https://github.com/microsoft/openjdk-proposals/blob/main/stack_allocation/Stack_Allocation_JEP.md" rel="noreferrer" target="_blank">https://github.com/microsoft/openjdk-proposals/blob/main/stack_allocation/Stack_Allocation_JEP.md</a><br>
<br>
<br>
On 24.05.23 08:54, Andrey Lomakin wrote:<br>
> Hi guys.<br>
> <br>
> I don't know whether it is the correct mailing list to ask, but I will try it.<br>
> <br>
> If I got JEP correctly, value objects are inlined in case of usage of the C2 compiler if they are<br>
> passed as function arguments. It means that we will have an overhead of copying data. So likely,<br>
> this optimization will depend on the size of the value object. But what about passing the stack<br>
> pointer with the ability to convert stack-based value objects into heap objects if the passed<br>
> references leak the called method? <br>
> <br>
> Are such optimizations considered or possible?<br>
> <br>
> -- <br>
> Best regards,<br>
> Andrii Lomakin.<br>
> <br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Best regards,<br>Andrii Lomakin.<br><br></div></div></div></div>