Integrated: 8286002: Add support for intel syntax to capstone hsdis
Jorn Vernee
jvernee at openjdk.java.net
Wed May 11 18:01:49 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
This pull request has now been integrated.
Changeset: 4ad8cfa2
Author: Jorn Vernee <jvernee at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/4ad8cfa26eb645f15a0aa77a58b2c333ded55c77
Stats: 37 lines in 1 file changed: 33 ins; 0 del; 4 mod
8286002: Add support for intel syntax to capstone hsdis
Reviewed-by: thartmann
-------------
PR: https://git.openjdk.java.net/jdk/pull/8502
More information about the hotspot-compiler-dev
mailing list