RFR: 8365991: AArch64: Ignore BlockZeroingLowLimit when UseBlockZeroing is false [v7]

Patrick Zhang qpzhang at openjdk.org
Mon Dec 15 11:20:43 UTC 2025


On Fri, 5 Dec 2025 12:06:16 GMT, Patrick Zhang <qpzhang at openjdk.org> wrote:

>>> I wondered why `MacroAssembler::zero_words` uses 16 words to do `stp` unrolling, while `generate_zero_blocks()` 8 words (`const int MacroAssembler::zero_words_block_size = 8;`), so defined this variable to compare `8 vs 16` but did not find obvious performance difference.
>>> 
>>> Regarding the var name `block_size`, could `unroll` or `unroll_words` be better?
>> 
>> What's wrong with 16? I'm asking not from a "my teachers said always name constants" point of view, but from a reader's understanding point of view. Named constants are all well and good if the constant has some meaning, but this one is just two words. Perhaps `2 * WordSize` would do.
>
> [PR 4919](https://github.com/openjdk/jdk/pull/4919/files#diff-0f4150a9c607ccd590bf256daa800c0276144682a92bc6bdced5e8bc1bb81f3aL4737) for [8270947: AArch64: C1: use zero_words to initialize all objects](https://bugs.openjdk.org/browse/JDK-8270947) changed the loop unroll length from 4 STPs (clearing 8 words) to 8 STPs (clearing 16 words) within the loop. In fact, before that PR, it seems the value 16 was from the `SmallArraySize` (`18 * BytesPerLong`).
> 
> For the current code snippet, I think, using `2 * WordSize` to the constant is not ideal, as it suggests the size of the unroll length and can be confusing. A better choice might be `2 * MacroAssembler::zero_words_block_size`, which more accurately reflects the intended meaning. Is this acceptable?

Please see the latest commit. I renamed the var name to `unroll_words` in `address MacroAssembler::zero_words(Register base, uint64_t cnt)` and `address generate_zero_blocks()` and have them aligned, one for 16 words and the other for 8 words to do unrolling for block clearing.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26917#discussion_r2618990845


More information about the hotspot-dev mailing list