RFR: 8281744: x86: Use short jumps in TIG::set_vtos_entry_points

Aleksey Shipilev shade at openjdk.java.net
Mon Feb 14 17:08:36 UTC 2022


Performance in `-Xint` mode seems to be bottlenecked on the code size, rather than particular instruction hotspots, which means code density is important.

There are forward branches in `TemplateInterpreterGenerator::set_vtos_entry_points`, which cannot be shortened by `MacroAssembler`, unless we tell it specifically that the upcoming branch target would be within the 8-bit offset. Which it apparently is in this particular case, because there are just a handful of `push`-es between the jump and its target. If a jump offset is more than 8 bits, the interpreter would catch fire just about everywhere, since `set_vtos_entry_points` is used at every bytecode entry. `fastdebug` builds assert the offset sanity directly.

Current patch improves `SPECjvm2008:serial` performance in `-Xint` mode for about 7% on Ryzen 7 5700G. (More perf runs pending).

There are other places in template interpreter where forward jumps can be short, I'll do them separately, since they are riskier and also less important.

Additional testing:
 - [x] Linux x86_64 fastdebug, `tier1`
 - [x] Linux x86_32 fastdebug, `tier1`

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

Commit messages:
 - Fix

Changes: https://git.openjdk.java.net/jdk/pull/7463/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7463&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8281744
  Stats: 5 lines in 1 file changed: 0 ins; 0 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7463.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7463/head:pull/7463

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


More information about the hotspot-dev mailing list