Skip to content

Commit 22e72f4

Browse files
committed
Reset BlockZeroingLowLimit to 4 * _zva_length
Signed-off-by: Patrick Zhang <[email protected]>
1 parent 14c18f7 commit 22e72f4

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6261,7 +6261,12 @@ address MacroAssembler::zero_words(Register base, uint64_t cnt)
62616261
{
62626262
assert(wordSize <= BlockZeroingLowLimit, "increase BlockZeroingLowLimit");
62636263
address result = nullptr;
6264-
if (UseBlockZeroing && cnt > (uint64_t)BlockZeroingLowLimit / BytesPerWord) {
6264+
// We do not check UseBlockZeroing here because this is delegated to the
6265+
// zero_blocks stub function that wraps the core logic of zero_words
6266+
// and necessary unrolled str/stp expanding when the condition is not met.
6267+
// This approach also helps prevent sudden increases in code cache size
6268+
// when zeroing large memory areas in many places.
6269+
if (cnt > (uint64_t)BlockZeroingLowLimit / BytesPerWord) {
62656270
mov(r10, base); mov(r11, cnt);
62666271
result = zero_words(r10, r11);
62676272
} else {

src/hotspot/cpu/aarch64/vm_version_aarch64.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,8 @@ void VM_Version::initialize() {
454454
FLAG_SET_DEFAULT(UseBlockZeroing, false);
455455
}
456456
if (!UseBlockZeroing && !FLAG_IS_DEFAULT(BlockZeroingLowLimit)) {
457-
warning("BlockZeroingLowLimit will not work when UseBlockZeroing is false");
457+
warning("BlockZeroingLowLimit has been ignored because UseBlockZeroing is disabled");
458+
FLAG_SET_DEFAULT(BlockZeroingLowLimit, 4 * VM_Version::zva_length());
458459
}
459460

460461
if (VM_Version::supports_sve2()) {

0 commit comments

Comments
 (0)