<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p>Hi,</p>
    <p>The AArch64 CallArranger has several different subclasses (for
      different OSes). The arrangeDowncall/arrangeUpcall method calls
      (indirectly through getBindings) several overridden instance
      methods in these subclasses (see the `abstract` methods in the
      AArch64 CallArranger), so it has to be non-static.</p>
    <p>For the x64 implementations of CallArranger we don't have any
      subclasses of CallArranger, so there the method can be static.<br>
    </p>
    <p>Jorn<br>
    </p>
    <div class="moz-cite-prefix">On 02/02/2023 00:55, Cheng Jin wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:MN2PR15MB259213BA8353861DAE20DC8BF5D19@MN2PR15MB2592.namprd15.prod.outlook.com">
      
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style>@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}div.WordSection1
        {page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">Hi there, <o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Can anybody explain why the “static”
          keyword was removed from arrangeDowncall/arrangeUpcall on
          Aarch64 (since JDK18) in
src/java.base/share/classes/jdk/internal/foreign/abi/aarch64/CallArranger.java?<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">   public MethodHandle
          arrangeDowncall(MethodType mt, FunctionDescriptor cDesc,
          LinkerOptions options) {<o:p></o:p></p>
        <p class="MsoNormal">...<o:p></o:p></p>
        <p class="MsoNormal">    }<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">    public MemorySegment
          arrangeUpcall(MethodHandle target, MethodType mt,
          FunctionDescriptor cDesc, SegmentScope session) {<o:p></o:p></p>
        <p class="MsoNormal">...<o:p></o:p></p>
        <p class="MsoNormal">    }<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">It remains unchanged on x64 in
src/java.base/share/classes/jdk/internal/foreign/abi/x64/sysv/CallArranger.java
          &
src/java.base/share/classes/jdk/internal/foreign/abi/x64/windows/CallArranger.java<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">    public static MethodHandle
          arrangeDowncall(MethodType mt, FunctionDescriptor cDesc,
          LinkerOptions options) {<o:p></o:p></p>
        <p class="MsoNormal">...<o:p></o:p></p>
        <p class="MsoNormal">    }<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">    public static MemorySegment
          arrangeUpcall(MethodHandle target, MethodType mt,
          FunctionDescriptor cDesc, SegmentScope scope) {<o:p></o:p></p>
        <p class="MsoNormal">...<o:p></o:p></p>
        <p class="MsoNormal" style="text-indent:9.9pt">}<o:p></o:p></p>
        <p class="MsoNormal" style="text-indent:9.9pt"><o:p> </o:p></p>
        <p class="MsoNormal">I am wondering whether there was special
          reason for this or anything else I am unaware of.  Thanks.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Best Regards<o:p></o:p></p>
        <p class="MsoNormal">Cheng Jin<o:p></o:p></p>
      </div>
    </blockquote>
  </body>
</html>