PrintAssembly: Passing options to hsdis does not work anymore
Jean-Philippe BEMPEL
jean-philippe at bempel.fr
Thu Nov 21 12:19:50 UTC 2019
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