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...) You mean `reinit_heapbase` can be removed? I'm not sure whether the caller expects it to be preserved. Note that `r12` is used in this case to save and restore `rsp`. This is needed since we access data in the frame relative to `rsp`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16201#discussion_r1374300821