RFR: 8320276: Improve class initialization barrier in TemplateTable::_new [v4]
Vladimir Ivanov
vlivanov at openjdk.org
Thu Jan 4 23:50:29 UTC 2024
On Fri, 22 Dec 2023 05:08:19 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:
>> The class initialization barrier in TemplateTable::_new fast path check ensures that the class being instantiated is fully initialized. It can be improved by introducing additional fast path check when current thread is initializer thread as MacroAssembler::clinit_barrier() does. It avoids repeated calls into interpreter runtime for classes being initialized. This patch adds the optimization for x86 and aarch64. Verified with tier 1-5 tests.
>>
>> This change was tested with Spring Petclinic which reported the following startup times:
>>
>> Clean build: #### Booted and returned in 161941ms
>> Patched build: #### Booted and returned in 160657ms
>
> Matias Saavedra Silva has updated the pull request incrementally with one additional commit since the last revision:
>
> Added comment to remaining platforms
Thanks for taking care of the enhancement, Matias!
I'm late to the party, but have one suggestion for a future cleanup.
src/hotspot/cpu/aarch64/templateTable_aarch64.cpp line 3607:
> 3605:
> 3606: // make sure klass is initialized
> 3607: assert(VM_Version::supports_fast_class_init_checks(), "Optimization requires support for fast class initialization checks");
A better place to put the assert would be on callee side (in `MacroAssembler::clinit_barrier()`).
-------------
PR Review: https://git.openjdk.org/jdk/pull/17006#pullrequestreview-1805159391
PR Review Comment: https://git.openjdk.org/jdk/pull/17006#discussion_r1442372252
More information about the hotspot-dev
mailing list