On Fri, 27 Oct 2023 03:49:17 GMT, Yasumasa Suenaga <ysuen...@openjdk.org> wrote:

>> src/hotspot/cpu/x86/downcallLinker_x86_64.cpp line 110:
>> 
>>> 108:   __ mov(rsp, r12); // restore sp
>>> 109:   __ reinit_heapbase();
>>> 110: }
>> 
>> This is a minor cleanup to share this code for the three use sites below.
>
> Question: `r12` does not need to remember?
> 
> According to [CallingSequences in OpenJDK 
> Wiki](https://wiki.openjdk.org/display/HotSpot/CallingSequences), `r12` may 
> be reserved for HeapBase if COOP is enabled.  
> (`r12` is also used in another places in downcallLinker_x86_64.cpp without 
> restoring...)

@YaSuenag `r12` is restored in `reinit_heapbase()` if needed and no, `r12` does 
not need remembering because it is a constant and can be restored from 
somewhere else.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16201#discussion_r1374370475

Reply via email to