RFR: 8285246: AArch64: remove overflow check from InterpreterMacroAssembler::increment_mdp_data_at

Nick Gasson ngasson at openjdk.java.net
Fri Apr 22 14:42:52 UTC 2022


Several reasons to do this:

- A 64-bit counter is realistically never going to overflow in the interpreter.  The PPC64 port also doesn't check for overflow for this reason.

- It's inconsistent with C1 which does not check for overflow.  (See e.g. `LIRGenerator::profile_branch()` which does `__ leal(...)` to add and explicitly doesn't set the flags.)

- We're checking for 64-bit overflow as the MDO cells are word-sized but accessors like `BranchData::taken()` silently truncate to uint which is 32 bit.  So I don't think this check is doing anything useful.

- I'd like to experiment with using LSE far atomics to update the MDO counters here, but the overflow check prevents that.

Tested jtreg tier1-3 and also verified that the counters for a particular test method were the same before and after when run with -Xbatch.

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

Commit messages:
 - 8285246: AArch64: remove overflow check from InterpreterMacroAssembler::increment_mdp_data_at

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

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


More information about the hotspot-compiler-dev mailing list