Commit 8dbd200c authored by LiuYu's avatar LiuYu Committed by Commit Bot

[mips][wasm][liftoff] Record correct offset in StoreTaggedPointer

Besides, change kSpeculationPoisonRegister from t3 to a7.

Port: a1616e6f

Bug: v8:7581
Change-Id: Id25850ddebce7250997e3b042ef094afd5d37d36
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2651699Reviewed-by: 's avatarZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Auto-Submit: Liu yu <liuyu@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#72388}
parent 3965dcd5
......@@ -368,7 +368,7 @@ constexpr Register kReturnRegister2 = a0;
constexpr Register kJSFunctionRegister = a1;
constexpr Register kContextRegister = s7;
constexpr Register kAllocateSizeRegister = a0;
constexpr Register kSpeculationPoisonRegister = t3;
constexpr Register kSpeculationPoisonRegister = a7;
constexpr Register kInterpreterAccumulatorRegister = v0;
constexpr Register kInterpreterBytecodeOffsetRegister = t0;
constexpr Register kInterpreterBytecodeArrayRegister = t1;
......
......@@ -140,6 +140,9 @@ inline void Store(LiftoffAssembler* assm, Register base, int32_t offset,
inline void push(LiftoffAssembler* assm, LiftoffRegister reg, ValueType type) {
switch (type.kind()) {
case ValueType::kI32:
case ValueType::kOptRef:
case ValueType::kRef:
case ValueType::kRtt:
assm->push(reg.gp());
break;
case ValueType::kI64:
......@@ -153,9 +156,6 @@ inline void push(LiftoffAssembler* assm, LiftoffRegister reg, ValueType type) {
assm->addiu(sp, sp, -sizeof(double));
assm->Sdc1(reg.fp(), MemOperand(sp, 0));
break;
case ValueType::kOptRef:
assm->push(reg.gp());
break;
default:
UNREACHABLE();
}
......@@ -452,12 +452,12 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
CheckPageFlag(dst_addr, scratch,
MemoryChunk::kPointersFromHereAreInterestingMask, ne,
&write_barrier);
Branch(USE_DELAY_SLOT, &exit);
Branch(&exit);
bind(&write_barrier);
JumpIfSmi(src.gp(), &exit);
CheckPageFlag(src.gp(), scratch,
MemoryChunk::kPointersToHereAreInterestingMask, eq, &exit);
Addu(scratch, dst_addr, offset_imm);
Addu(scratch, dst_op.rm(), dst_op.offset());
CallRecordWriteStub(dst_addr, scratch, EMIT_REMEMBERED_SET, kSaveFPRegs,
wasm::WasmCode::kRecordWrite);
bind(&exit);
......@@ -743,7 +743,9 @@ void LiftoffAssembler::Spill(int offset, WasmValue value) {
RecordUsedSpillOffset(offset);
MemOperand dst = liftoff::GetStackSlot(offset);
switch (value.type().kind()) {
case ValueType::kI32: {
case ValueType::kI32:
case ValueType::kRef:
case ValueType::kOptRef: {
LiftoffRegister tmp = GetUnusedRegister(kGpReg, {});
TurboAssembler::li(tmp.gp(), Operand(value.to_i32()));
sw(tmp.gp(), dst);
......
......@@ -152,6 +152,9 @@ inline void push(LiftoffAssembler* assm, LiftoffRegister reg, ValueType type) {
assm->sw(reg.gp(), MemOperand(sp, 0));
break;
case ValueType::kI64:
case ValueType::kOptRef:
case ValueType::kRef:
case ValueType::kRtt:
assm->push(reg.gp());
break;
case ValueType::kF32:
......@@ -429,13 +432,13 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
CheckPageFlag(dst_addr, scratch,
MemoryChunk::kPointersFromHereAreInterestingMask, ne,
&write_barrier);
Branch(USE_DELAY_SLOT, &exit);
Branch(&exit);
bind(&write_barrier);
JumpIfSmi(src.gp(), &exit);
CheckPageFlag(src.gp(), scratch,
MemoryChunk::kPointersToHereAreInterestingMask, eq,
&exit);
Daddu(scratch, dst_addr, offset_imm);
Daddu(scratch, dst_op.rm(), dst_op.offset());
CallRecordWriteStub(dst_addr, scratch, EMIT_REMEMBERED_SET, kSaveFPRegs,
wasm::WasmCode::kRecordWrite);
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