Commit cedb1121 authored by Yu Yin's avatar Yu Yin Committed by V8 LUCI CQ

[loong64] Fix target address in StoreTaggedPointer

TEST: externref-globals-liftoff
wasm-gc-breakpoints
with --stress-incremental-marking

Change-Id: Ia5956588a008155f199bad98b1aff6e593fcd7ee
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3106785
Auto-Submit: Yu Yin <xwafish@gmail.com>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Reviewed-by: 's avatarZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#76390}
parent 7255e1f8
......@@ -388,9 +388,22 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
LiftoffRegister src,
LiftoffRegList pinned,
SkipWriteBarrier skip_write_barrier) {
STATIC_ASSERT(kTaggedSize == kInt64Size);
MemOperand dst_op = liftoff::GetMemOp(this, dst_addr, offset_reg, offset_imm);
St_d(src.gp(), dst_op);
UseScratchRegisterScope temps(this);
Operand offset_op =
offset_reg.is_valid() ? Operand(offset_reg) : Operand(offset_imm);
// For the write barrier (below), we cannot have both an offset register and
// an immediate offset. Add them to a 32-bit offset initially, but in a 64-bit
// register, because that's needed in the MemOperand below.
if (offset_reg.is_valid() && offset_imm) {
Register effective_offset = temps.Acquire();
Add_d(effective_offset, offset_reg, Operand(offset_imm));
offset_op = Operand(effective_offset);
}
if (offset_op.is_reg()) {
St_d(src.gp(), MemOperand(dst_addr, offset_op.rm()));
} else {
St_d(src.gp(), MemOperand(dst_addr, offset_imm));
}
if (skip_write_barrier || FLAG_disable_write_barriers) return;
......@@ -404,9 +417,7 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
CheckPageFlag(src.gp(), MemoryChunk::kPointersToHereAreInterestingMask, eq,
&exit);
CallRecordWriteStubSaveRegisters(
dst_addr,
dst_op.hasIndexReg() ? Operand(dst_op.index()) : Operand(dst_op.offset()),
RememberedSetAction::kEmit, SaveFPRegsMode::kSave,
dst_addr, offset_op, RememberedSetAction::kEmit, SaveFPRegsMode::kSave,
StubCallMode::kCallWasmRuntimeStub);
bind(&exit);
}
......
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