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

Tobias Hartmann thartmann at openjdk.org
Mon Jan 8 10:11:21 UTC 2024


On Fri, 5 Jan 2024 14:37:16 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> 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 in JDK 12: https://hg.openjdk.org/jdk/jdk/rev/d6dc479bcdd3#l15.62 And the Mutex was shortly gone after [JDK-8214257](https://bugs.openjdk.org/browse/JDK-8214257). So we are exposing this code to product binaries since JDK 12. 
> 
> This fix reinstates the `ASSERT` block again. There are small improvements (~1..10us) for safepoint cleanup on small ad-hoc tests in release builds on my Mac. But since this whole thing involves looking up things in code cache, it may cost quite a lot.

Looks good to me too.

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

Marked as reviewed by thartmann (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/17281#pullrequestreview-1808611926


More information about the hotspot-compiler-dev mailing list