RFR: 8323065: Unneccesary CodeBlob lookup in CompiledIC::internal_set_ic_destination

Aleksey Shipilev shade at openjdk.org
Fri Jan 5 14:43:41 UTC 2024


I was looking at hotpath for IC stub cleaning (happens at safepoint), and one obvious thing is that we look-up `CodeBlob` from `call->instruction_address()` only to assert that is compiled one. It used to be protected by `#ifdef ASSERT` before [JDK-8212681](https://bugs.openjdk.org/browse/JDK-8212681), and pulled from it to be used in Mutex:
 https://hg.openjdk.org/jdk/jdk/rev/d6dc479bcdd3#l15.62

...which is now gone after [JDK-8214257](https://bugs.openjdk.org/browse/JDK-8214257).

This fix reinstates the `ASSERT` block again. There are small improvements (~1..10us) for safepoint cleanup on small ad-hoc tests. But since this whole thing involves looking up things in code cache, it may cost quite a lot.

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

Commit messages:
 - Fix

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

PR: https://git.openjdk.org/jdk/pull/17281


More information about the hotspot-compiler-dev mailing list