From 221305e98f15e24176138da5b58ad290c4cd5c9a Mon Sep 17 00:00:00 2001 From: Predrag Rudic Date: Wed, 17 Oct 2018 14:15:18 +0200 Subject: [PATCH] MIPS[64]: Fix failing several Liftoff tests Failing test are: cctest/cctest/test-run-wasm/RunWasmLiftoff*. Test started to fail after this commit: 56b8ab5d07a7f9300f20d06b68c34237b3be2d1b This patch also fixes MIPS big endian build failure. Change-Id: I333450f2a8f9c9a61db9aea18e5e973f48742d52 Reviewed-on: https://chromium-review.googlesource.com/c/1286348 Reviewed-by: Ivica Bogosavljevic Commit-Queue: Ivica Bogosavljevic Cr-Commit-Position: refs/heads/master@{#56742} --- src/wasm/baseline/mips/liftoff-assembler-mips.h | 5 ++++- src/wasm/baseline/mips64/liftoff-assembler-mips64.h | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wasm/baseline/mips/liftoff-assembler-mips.h b/src/wasm/baseline/mips/liftoff-assembler-mips.h index e4795e2ec1..85cbe76256 100644 --- a/src/wasm/baseline/mips/liftoff-assembler-mips.h +++ b/src/wasm/baseline/mips/liftoff-assembler-mips.h @@ -403,6 +403,9 @@ void LiftoffAssembler::Store(Register dst_addr, Register offset_reg, Register dst = no_reg; MemOperand dst_op = MemOperand(dst_addr, offset_imm); if (offset_reg != no_reg) { + if (is_store_mem) { + pinned.set(src); + } dst = GetUnusedRegister(kGpReg, pinned).gp(); emit_ptrsize_add(dst, dst_addr, offset_reg); dst_op = MemOperand(dst, offset_imm); @@ -410,7 +413,7 @@ void LiftoffAssembler::Store(Register dst_addr, Register offset_reg, #if defined(V8_TARGET_BIG_ENDIAN) if (is_store_mem) { - pinned |= LiftoffRegList::ForRegs(dst_op.rm(), src); + pinned = pinned | LiftoffRegList::ForRegs(dst_op.rm(), src); LiftoffRegister tmp = GetUnusedRegister(src.reg_class(), pinned); // Save original value. Move(tmp, src, type.value_type()); diff --git a/src/wasm/baseline/mips64/liftoff-assembler-mips64.h b/src/wasm/baseline/mips64/liftoff-assembler-mips64.h index 6faff7ecd6..ea6f547d94 100644 --- a/src/wasm/baseline/mips64/liftoff-assembler-mips64.h +++ b/src/wasm/baseline/mips64/liftoff-assembler-mips64.h @@ -340,6 +340,9 @@ void LiftoffAssembler::Store(Register dst_addr, Register offset_reg, Register dst = no_reg; MemOperand dst_op = MemOperand(dst_addr, offset_imm); if (offset_reg != no_reg) { + if (is_store_mem) { + pinned.set(src); + } dst = GetUnusedRegister(kGpReg, pinned).gp(); emit_ptrsize_add(dst, dst_addr, offset_reg); dst_op = MemOperand(dst, offset_imm);