Commit c16c682e authored by Lu Yahan's avatar Lu Yahan Committed by V8 LUCI CQ

[riscv64][builtins] Clear c_entry_fp when entering JS and at exception path

Port: 07b03b83

Bug: v8:10026
Change-Id: I4d7dc0fef98aa1754d3aea1d0f5d13b9bad9d645
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3118615
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Commit-Queue: Ji Qiu <qiuji@iscas.ac.cn>
Reviewed-by: 's avatarJi Qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#76498}
parent a936be57
......@@ -573,9 +573,14 @@ void Generate_JSEntryVariant(MacroAssembler* masm, StackFrame::Type type,
__ li(s3, Operand(StackFrame::TypeToMarker(type)));
ExternalReference c_entry_fp = ExternalReference::Create(
IsolateAddressId::kCEntryFPAddress, masm->isolate());
__ li(s4, c_entry_fp);
__ Ld(s4, MemOperand(s4));
__ li(s5, c_entry_fp);
__ Ld(s4, MemOperand(s5));
__ Push(s1, s2, s3, s4);
// Clear c_entry_fp, now we've pushed its previous value to the stack.
// If the c_entry_fp is not already zero and we don't clear it, the
// SafeStackFrameIterator will assume we are executing C++ and miss the JS
// frames on top.
__ Sd(zero_reg, MemOperand(s5));
// Set up frame pointer for the frame to be pushed.
__ Add64(fp, sp, -EntryFrameConstants::kCallerFPOffset);
// Registers:
......
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