[arm64][arm] Only save clobbered registers when calling RecordWrite

RecordWrite uses callee saved registers, so only the clobbered registers
need to be saved by the caller.
This change gives us a 1% reduction in embedded blob size for arm64.
No change is seen for arm as the STM instruction can store and load
multiple registers.

Change-Id: I8e41da43851e96d3454a01c7093d76f2e0378214
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3406744
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Martyn Capewell <martyn.capewell@arm.com>
Cr-Commit-Position: refs/heads/main@{#78900}
This commit is contained in:
George Wort 2022-02-01 15:14:16 +00:00 committed by V8 LUCI CQ
parent 9f7cbe9b4e
commit b8b32f6b48

View File

@ -224,6 +224,10 @@ constexpr RegList WriteBarrierDescriptor::ComputeSavedRegisters(
if (slot_address != no_reg && slot_address != SlotAddressRegister()) {
saved_registers |= SlotAddressRegister().bit();
}
#elif V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_ARM
if (object != ObjectRegister()) saved_registers |= ObjectRegister().bit();
// The slot address is always clobbered.
saved_registers |= SlotAddressRegister().bit();
#else
// TODO(cbruni): Enable callee-saved registers for other platforms.
// This is a temporary workaround to prepare code for callee-saved registers.