-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
As per #71044 (comment), we currently have "method local constants" emitted as part of the method body block on Arm64. This is unlike x64 where we allocate a distinct area separate from the method.
We do this to ensure that these constants can be cheaply accessed via ldr. However, much like on x86/x64, placing "data" in the same page as your "code" can be problematic as it can negatively impact the instruction decoder, instruction cache, lead to poor speculative execution, etc.
We should look at a better approach to handling this to ensure that this data can be placed in a distinct page from the code. One recommendation was to create an "anchor" to the data section and then offset from that anchor to access the constants. It can be assumed that re-materializing the constant is "cheap" to avoid spilling.
category:implementation
theme:memory-usage