RFR: 8322630: Remove ICStubs and related safepoints [v4]

Doug Simon dnsimon at openjdk.org
Mon Jan 29 13:50:50 UTC 2024


On Mon, 29 Jan 2024 13:10:50 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:

>> ICStubs solve an atomicity problem when setting both the destination and data of an inline cache. Unfortunately, it also leads to occasional safepoint carpets when multiple threads need to ICRefill the stubs at the same time, and spurious GuaranteedSafepointInterval "Cleanup" safepoints every second. This patch changes inline caches to not change the data part at all during the nmethod life cycle, hence removing the need for ICStubs.
>> 
>> The new scheme is less stateful. Instead of adding and removing callsite metadata back and forth when transitioning inline cache states, it installs all state any shape of call will ever need at resolution time in a struct that I call CompiledICData. This reduces inline cache state changes to simply changing the destination of the call, and it doesn't really matter what state transitions to what other state.
>> 
>> With this patch, we get rid of ICStub and ICBuffer classes and the related ICRefill and almost all Cleanup safepoints in practice. It also makes the inline cache code much simpler.
>> 
>> I have tested the changes from tier1-7, and run through full aurora performance tests.
>
> Erik Österlund has updated the pull request incrementally with eight additional commits since the last revision:
> 
>  - Batch allocate and free CompiledICData
>  - JVMCI support
>  - Cleanup from FYang
>  - Axel suggestions
>  - Suggestion from Axel
>  - Use relevant global register aliases for clarity
>  - Rename register aliases: holder -> data
>  - Platform Comment Cleanup

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 1004:

> 1002: 
> 1003: int MacroAssembler::ic_check_size() {
> 1004:   return NativeInstruction::instruction_size * 7;

This can be 5 or 7 depending on `MacroAssembler::far_jump` right? If it's 5, then who inserts the extra alignment at the end of the IC check?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17495#discussion_r1469616471


More information about the shenandoah-dev mailing list