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

Besides, change kSpeculationPoisonRegister from t3 to a7.

Port: a1616e6f7f

Bug: v8:7581
Change-Id: Id25850ddebce7250997e3b042ef094afd5d37d36
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2651699
Reviewed-by: Zhao 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}
This commit is contained in:
LiuYu 2021-01-27 18:31:07 +08:00 committed by Commit Bot
parent 3965dcd5cb
commit 8dbd200c6b
3 changed files with 14 additions and 9 deletions

View File

@ -368,7 +368,7 @@ constexpr Register kReturnRegister2 = a0;
constexpr Register kJSFunctionRegister = a1; constexpr Register kJSFunctionRegister = a1;
constexpr Register kContextRegister = s7; constexpr Register kContextRegister = s7;
constexpr Register kAllocateSizeRegister = a0; constexpr Register kAllocateSizeRegister = a0;
constexpr Register kSpeculationPoisonRegister = t3; constexpr Register kSpeculationPoisonRegister = a7;
constexpr Register kInterpreterAccumulatorRegister = v0; constexpr Register kInterpreterAccumulatorRegister = v0;
constexpr Register kInterpreterBytecodeOffsetRegister = t0; constexpr Register kInterpreterBytecodeOffsetRegister = t0;
constexpr Register kInterpreterBytecodeArrayRegister = t1; constexpr Register kInterpreterBytecodeArrayRegister = t1;

View File

@ -140,6 +140,9 @@ inline void Store(LiftoffAssembler* assm, Register base, int32_t offset,
inline void push(LiftoffAssembler* assm, LiftoffRegister reg, ValueType type) { inline void push(LiftoffAssembler* assm, LiftoffRegister reg, ValueType type) {
switch (type.kind()) { switch (type.kind()) {
case ValueType::kI32: case ValueType::kI32:
case ValueType::kOptRef:
case ValueType::kRef:
case ValueType::kRtt:
assm->push(reg.gp()); assm->push(reg.gp());
break; break;
case ValueType::kI64: case ValueType::kI64:
@ -153,9 +156,6 @@ inline void push(LiftoffAssembler* assm, LiftoffRegister reg, ValueType type) {
assm->addiu(sp, sp, -sizeof(double)); assm->addiu(sp, sp, -sizeof(double));
assm->Sdc1(reg.fp(), MemOperand(sp, 0)); assm->Sdc1(reg.fp(), MemOperand(sp, 0));
break; break;
case ValueType::kOptRef:
assm->push(reg.gp());
break;
default: default:
UNREACHABLE(); UNREACHABLE();
} }
@ -452,12 +452,12 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
CheckPageFlag(dst_addr, scratch, CheckPageFlag(dst_addr, scratch,
MemoryChunk::kPointersFromHereAreInterestingMask, ne, MemoryChunk::kPointersFromHereAreInterestingMask, ne,
&write_barrier); &write_barrier);
Branch(USE_DELAY_SLOT, &exit); Branch(&exit);
bind(&write_barrier); bind(&write_barrier);
JumpIfSmi(src.gp(), &exit); JumpIfSmi(src.gp(), &exit);
CheckPageFlag(src.gp(), scratch, CheckPageFlag(src.gp(), scratch,
MemoryChunk::kPointersToHereAreInterestingMask, eq, &exit); 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, CallRecordWriteStub(dst_addr, scratch, EMIT_REMEMBERED_SET, kSaveFPRegs,
wasm::WasmCode::kRecordWrite); wasm::WasmCode::kRecordWrite);
bind(&exit); bind(&exit);
@ -743,7 +743,9 @@ void LiftoffAssembler::Spill(int offset, WasmValue value) {
RecordUsedSpillOffset(offset); RecordUsedSpillOffset(offset);
MemOperand dst = liftoff::GetStackSlot(offset); MemOperand dst = liftoff::GetStackSlot(offset);
switch (value.type().kind()) { switch (value.type().kind()) {
case ValueType::kI32: { case ValueType::kI32:
case ValueType::kRef:
case ValueType::kOptRef: {
LiftoffRegister tmp = GetUnusedRegister(kGpReg, {}); LiftoffRegister tmp = GetUnusedRegister(kGpReg, {});
TurboAssembler::li(tmp.gp(), Operand(value.to_i32())); TurboAssembler::li(tmp.gp(), Operand(value.to_i32()));
sw(tmp.gp(), dst); sw(tmp.gp(), dst);

View File

@ -152,6 +152,9 @@ inline void push(LiftoffAssembler* assm, LiftoffRegister reg, ValueType type) {
assm->sw(reg.gp(), MemOperand(sp, 0)); assm->sw(reg.gp(), MemOperand(sp, 0));
break; break;
case ValueType::kI64: case ValueType::kI64:
case ValueType::kOptRef:
case ValueType::kRef:
case ValueType::kRtt:
assm->push(reg.gp()); assm->push(reg.gp());
break; break;
case ValueType::kF32: case ValueType::kF32:
@ -429,13 +432,13 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
CheckPageFlag(dst_addr, scratch, CheckPageFlag(dst_addr, scratch,
MemoryChunk::kPointersFromHereAreInterestingMask, ne, MemoryChunk::kPointersFromHereAreInterestingMask, ne,
&write_barrier); &write_barrier);
Branch(USE_DELAY_SLOT, &exit); Branch(&exit);
bind(&write_barrier); bind(&write_barrier);
JumpIfSmi(src.gp(), &exit); JumpIfSmi(src.gp(), &exit);
CheckPageFlag(src.gp(), scratch, CheckPageFlag(src.gp(), scratch,
MemoryChunk::kPointersToHereAreInterestingMask, eq, MemoryChunk::kPointersToHereAreInterestingMask, eq,
&exit); &exit);
Daddu(scratch, dst_addr, offset_imm); Daddu(scratch, dst_op.rm(), dst_op.offset());
CallRecordWriteStub(dst_addr, scratch, EMIT_REMEMBERED_SET, kSaveFPRegs, CallRecordWriteStub(dst_addr, scratch, EMIT_REMEMBERED_SET, kSaveFPRegs,
wasm::WasmCode::kRecordWrite); wasm::WasmCode::kRecordWrite);
bind(&exit); bind(&exit);