PrintAssembly: Passing options to hsdis does not work anymore

Jean-Philippe BEMPEL jean-philippe at bempel.fr
Thu Nov 21 13:18:22 UTC 2019


Hello Vladimir,

Thanks for filing this issue.

PrintAssemblyOptions works for global hotspot settings like show-bytes,
show-offset, show-pc or help, but for hsdis plugin, options are not passed
to the plugin because the buffer is empty.

Thanks

On Thu, Nov 21, 2019 at 1:38 PM Vladimir Ivanov <
vladimir.x.ivanov at oracle.com> wrote:

> Anyway, filed JDK-8234583 to track it:
>
>    https://bugs.openjdk.java.net/browse/JDK-8234583
>
> Best regards,
> Vladimir Ivanov
>
> On 21.11.2019 15:26, Vladimir Ivanov wrote:
> > Thanks for the report, Jean-Philippe.
> >
> > My reading is -XX:PrintAssemblyOptions doesn't have any effect starting
> > 13. Is it what you observe?
> >
> > Best regards,
> > Vladimir Ivanov
> >
> > On 21.11.2019 15:19, Jean-Philippe BEMPEL wrote:
> >> Hello,
> >>
> >> I have just found an issue with PrintAssemblyOptions since openjdk 13
> >> (still works with openjdk 12)
> >> Before we could change the output of PrintAssembly thanks to
> >> PrintAssemblyOptions
> >> (for example switching to intel syntax instead of AT&T one)
> >> So doing
> >> java -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly
> >> -XX:PrintAssemblyOptions=intel -version
> >> with correct hsdis-*.[dll|so] should output assembly with intel syntax.
> >> I have investigated this issue and seems related to the addition of
> >> _optionParsed global flag:
> >>
> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/compiler/disassembler.cpp#L417
> >>
> >>
> >> Removing this line fix the issue.
> >>
> >> decode_env is created each time a call to Disassembler::decode() is made
> >> but parsing options is made only once.
> >> _option_buf is initialized each time decode_env is created but options
> >> are
> >> not parsed for subsequent calls and _option_bug is not filled.
> >>
> >> Downside of my fix: options are reparsed for each method disassembled,
> >> but
> >> this is what was done before from what I understood.
> >>
> >> Thanks
> >> Jean-Philippe Bempel
> >>
>


More information about the hotspot-dev mailing list