Commit 61cc0cc5 authored by George Wort's avatar George Wort Committed by V8 LUCI CQ

[builtins] Always build the stack frame when callee saved registers used

The frame construction code in AssembleConstructFrame saves the registers on the
stack, if this does not occur for every code path then the values restored to
the registers in AssembleReturn will be incorrect.

The relevant DCHECK had been removed here:
https://chromium-review.googlesource.com/c/v8/v8/+/2922604/5/src/compiler/pipeline.cc.

This was not previously an issue as no builtins used callee saved registers,
this changed in the following patches:
https://chromium-review.googlesource.com/c/v8/v8/+/2922604/
https://chromium-review.googlesource.com/c/v8/v8/+/2944844

Bug was found using PGO for the RecordWriteOmitRememberedSetSaveFP builtin on
AArch64.

Change-Id: I23fbea9f39c9b61ef0d0b28b73ebe6063e478fef
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3401589Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Martyn Capewell <martyn.capewell@arm.com>
Cr-Commit-Position: refs/heads/main@{#78725}
parent 71118b24
......@@ -310,6 +310,7 @@ class V8_EXPORT_PRIVATE CallDescriptor final
#if V8_ENABLE_WEBASSEMBLY
if (IsWasmFunctionCall()) return true;
#endif // V8_ENABLE_WEBASSEMBLY
if (CalleeSavedRegisters() != kNoCalleeSaved) return true;
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment