RFR: 8321137: Relax ICStub alignment

Aleksey Shipilev shade at openjdk.org
Thu Nov 30 21:35:12 UTC 2023


WIP, submitting for others to poke holes in it.

Similarly to [JDK-8284578](https://bugs.openjdk.org/browse/JDK-8284578), we would like to handle `ICStub` alignment. Currently, the small stub that takes only 24 bytes of code is covered by 128 bytes on AArch64. This is due to the same thing fixed by [JDK-8284578](https://bugs.openjdk.org/browse/JDK-8284578) for interpreter codelets: aligning twice the `CodeEntryAlignment`.

128 bytes per `ICStub` means we deplete 10K `ICBuffer` with only 79 stubs. This actually happens multiple times even on a simple `HelloWorld.java` invocation that invokes some javac code, causing `ICBufferFull` safepoints. We can increase `ICBuffer` size, especially after [JDK-8314220](https://bugs.openjdk.org/browse/JDK-8314220), but we cannot do this without limits, since it eats up code cache.

But if we assume that we only need these stubs for IC transitions, and we don't need to actually over-align the stub to `CodeEntryAlignment`, we can significantly improve the `ICStub` footprint. Dropping alignment to `HeapWordSize` (similar to [JDK-8284578](https://bugs.openjdk.org/browse/JDK-8284578) for interpreter codelets) drops ICStub footprint from 128 bytes to 40 bytes on AArch64.

Is there something missing in this idea?

Additional testing:
 - [x] Linux x86_64 server fastdebug `tier1 tier2 tier3`
 - [x] Linux AArch64 server fastdebug `tier1 tier2 tier3`

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

Commit messages:
 - Work

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

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


More information about the hotspot-compiler-dev mailing list