Usage of stack pointers

Tobias Hartmann tobias.hartmann at oracle.com
Mon Jun 12 13:40:18 UTC 2023


Hi Andrii,

Ideally, hot methods are C2 compiled and therefore heap allocation / copying is only required when
storing into containers.

Stack allocation support for C2 has been proposed before [1] and is out of scope of this project.

Best regards,
Tobias

[1] https://github.com/microsoft/openjdk-proposals/blob/main/stack_allocation/Stack_Allocation_JEP.md


On 24.05.23 08:54, Andrey Lomakin wrote:
> Hi guys.
> 
> I don't know whether it is the correct mailing list to ask, but I will try it.
> 
> If I got JEP correctly, value objects are inlined in case of usage of the C2 compiler if they are
> passed as function arguments. It means that we will have an overhead of copying data. So likely,
> this optimization will depend on the size of the value object. But what about passing the stack
> pointer with the ability to convert stack-based value objects into heap objects if the passed
> references leak the called method? 
> 
> Are such optimizations considered or possible?
> 
> -- 
> Best regards,
> Andrii Lomakin.
> 



More information about the valhalla-dev mailing list