[jdk11u-dev] RFR: 8204267: Generate comments in -XX:+PrintInterpreter to link to source code

SendaoYan syan at openjdk.org
Sat Oct 19 12:03:48 UTC 2024


Hi all,
HotSpot's interpreter is dynamically generated (by C++ sources such as src/hotspot/cpu/x86/templateTable_x86.cpp).

The command `java -XX:+PrintInterpreter` can be used to print a disassembly of the HotSpot interpreter. However, the output has very little comment, and it's very hard to associate the assembler instructions with the C++ code that generates them.

To make it easier to understand the -XX:+PrintInterpreter, we should generate comments to link the instructions back to the C++ source code that generates them. This is doable because much of the interpreter code generation is done via a macro "__". We can redefine this macro to generate comments.

The file `src/hotspot/share/compiler/disassembler.cpp` has different context cause this PR can't backport cleanly, all other files are backport cleanly.

Only change the behavior of `PrintInterpreter`, risk is low.

Additional testing:

- [x] linux x64 build with fastdebug and slowdebug configure
- [ ] linux x64 jtreg tests(include tier1/2/3 etc.) with release build
- [ ] linux aarch64 jtreg tests(include tier1/2/3 etc.) with release build


Thanks.

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

Commit messages:
 - Backport b5f0945a726722dc92b0a10cc30723faa05ee475

Changes: https://git.openjdk.org/jdk11u-dev/pull/2957/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk11u-dev&pr=2957&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8204267
  Stats: 191 lines in 8 files changed: 173 ins; 0 del; 18 mod
  Patch: https://git.openjdk.org/jdk11u-dev/pull/2957.diff
  Fetch: git fetch https://git.openjdk.org/jdk11u-dev.git pull/2957/head:pull/2957

PR: https://git.openjdk.org/jdk11u-dev/pull/2957


More information about the jdk-updates-dev mailing list