Skip to content

Commit f40dcdd

Browse files
committed
[JSC] LLInt prologue should zero the new frame 16 bytes per iteration
https://bugs.webkit.org/show_bug.cgi?id=320799 Reviewed by Yusuke Suzuki. The LLInt prologue's frame-clearing loop from 199147@main zeroes the frame 8 bytes per top-tested iteration, and on ARM64 the immediate store re-materializes zero every iteration: 12 instructions per 16 bytes. Both bounds are stack-aligned (numCalleeLocals is always rounded to stackAlignmentRegisters and sp is aligned before the loop), so hoist the zero register and store 16 bytes per bottom-tested iteration (stp on ARM64, two storeq on X86_64): 4 instructions per 16 bytes on ARM64, 5 on X86_64. * Source/JavaScriptCore/llint/LowLevelInterpreter.asm: Canonical link: https://commits.webkit.org/318432@main
1 parent 5d6747e commit f40dcdd

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

‎Source/JavaScriptCore/llint/LowLevelInterpreter.asm‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,11 +1569,20 @@ end
15691569
# We need to start zeroing from sp as it has been adjusted after saving callee saves.
15701570
move sp, t2
15711571
move t0, sp
1572-
.zeroStackLoop:
1573-
bpeq sp, t2, .zeroStackDone
1574-
subp PtrSize, t2
1575-
storep 0, [t2]
1576-
jmp .zeroStackLoop
1572+
bpeq t0, t2, .zeroStackDone
1573+
if ARM64 or ARM64E
1574+
.zeroStackLoop:
1575+
subp 2 * PtrSize, t2
1576+
storepairq zr, zr, [t2]
1577+
bpa t2, t0, .zeroStackLoop
1578+
else
1579+
move 0, t3
1580+
.zeroStackLoop:
1581+
subp 2 * PtrSize, t2
1582+
storeq t3, [t2]
1583+
storeq t3, PtrSize[t2]
1584+
bpa t2, t0, .zeroStackLoop
1585+
end
15771586
.zeroStackDone:
15781587
else
15791588
move t0, sp

0 commit comments

Comments
 (0)