RFR: 8286002: Add support for intel syntax to capstone hsdis

Tobias Hartmann thartmann at openjdk.java.net
Tue May 10 08:22:54 UTC 2022


On Mon, 2 May 2022 14:01:53 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

> This patch adds support for outputting assembly in intel syntax to capstone hsdis, through the `-XX:PrintAssemblyOptions=intel` flag.
> 
> Snippet of example output:
> 
> 
> [Verified Entry Point]
>   # {method} {0x0000021c8a4002d8} 'add' '(II)I' in 'Main'
>   # parm0:    rdx       = int
>   # parm1:    r8        = int
>   #           [sp+0x20]  (sp of caller)
>   0x0000021cfa713780:   sub             rsp, 0x18
>   0x0000021cfa713787:   mov             qword ptr [rsp + 0x10], rbp
>   0x0000021cfa71378c:   mov             eax, edx
>   0x0000021cfa71378e:   add             eax, r8d
>   0x0000021cfa713791:   add             rsp, 0x10
>   0x0000021cfa713795:   pop             rbp
>   0x0000021cfa713796:   cmp             rsp, qword ptr [r15 + 0x338]
>                                                             ;   {poll_return}
>   0x0000021cfa71379d:   ja              0x21cfa7137a4
>   0x0000021cfa7137a3:   ret
>   0x0000021cfa7137a4:   movabs          r10, 0x21cfa713796  ;   {internal_word}
>   0x0000021cfa7137ae:   mov             qword ptr [r15 + 0x350], r10
>   0x0000021cfa7137b5:   jmp             0x21cfa6f3400       ;   {runtime_call SafepointBlob}
>   ```
>   
>   Testing: 
>   - Manual testing with and without `-XX:PrintAssemblyOptions=intel`, to make sure that both syntaxes work.
>   - Manual testing with several different invalid options such as `-XX:PrintAssemblyOptions=asdf,,` to make sure that invalid options are handled correctly.
>   
>   Thanks,
>   Jorn

Looks reasonable.

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

Marked as reviewed by thartmann (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/8502


More information about the hotspot-compiler-dev mailing list