summaryrefslogtreecommitdiffstats
path: root/js/src/jit/mips64
diff options
context:
space:
mode:
authorJiaxun Yang <jiaxun.yang@flygoat.com>2020-05-12 12:40:12 +0800
committerMoonchild <moonchild@palemoon.org>2020-05-20 14:02:42 +0000
commitc40bda67bbed2faae019a67d339cf0f0042abc3a (patch)
tree9162edf5668460ae25b70f3fbdf2ca459241a8cb /js/src/jit/mips64
parent0c2de12ffdb44e5d35fcef752e762824fcd14ef3 (diff)
downloadUXP-c40bda67bbed2faae019a67d339cf0f0042abc3a.tar
UXP-c40bda67bbed2faae019a67d339cf0f0042abc3a.tar.gz
UXP-c40bda67bbed2faae019a67d339cf0f0042abc3a.tar.lz
UXP-c40bda67bbed2faae019a67d339cf0f0042abc3a.tar.xz
UXP-c40bda67bbed2faae019a67d339cf0f0042abc3a.zip
Bug 1424978 - IonMonkey: MIPS64: Fix unboxNonDouble for Int32
Tag: #1542
Diffstat (limited to 'js/src/jit/mips64')
-rw-r--r--js/src/jit/mips64/MacroAssembler-mips64.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/js/src/jit/mips64/MacroAssembler-mips64.cpp b/js/src/jit/mips64/MacroAssembler-mips64.cpp
index e16e5d03f..d283d0b4c 100644
--- a/js/src/jit/mips64/MacroAssembler-mips64.cpp
+++ b/js/src/jit/mips64/MacroAssembler-mips64.cpp
@@ -1366,22 +1366,52 @@ MacroAssemblerMIPS64Compat::testUndefinedSet(Condition cond, const ValueOperand&
void
MacroAssemblerMIPS64Compat::unboxNonDouble(const ValueOperand& operand, Register dest)
{
+ Label isInt32, done;
+ Register tag = splitTagForTest(operand);
+ asMasm().branchTestInt32(Assembler::Equal, tag, &isInt32);
+
ma_dext(dest, operand.valueReg(), Imm32(0), Imm32(JSVAL_TAG_SHIFT));
+ jump(&done);
+
+ bind(&isInt32);
+ ma_sll(dest, operand.valueReg(), Imm32(0));
+
+ bind(&done);
}
void
MacroAssemblerMIPS64Compat::unboxNonDouble(const Address& src, Register dest)
{
+ Label isInt32, done;
loadPtr(Address(src.base, src.offset), dest);
+ splitTag(dest, SecondScratchReg);
+ asMasm().branchTestInt32(Assembler::Equal, SecondScratchReg, &isInt32);
+
ma_dext(dest, dest, Imm32(0), Imm32(JSVAL_TAG_SHIFT));
+ jump(&done);
+
+ bind(&isInt32);
+ ma_sll(dest, dest, Imm32(0));
+
+ bind(&done);
}
void
MacroAssemblerMIPS64Compat::unboxNonDouble(const BaseIndex& src, Register dest)
{
+ Label isInt32, done;
computeScaledAddress(src, SecondScratchReg);
loadPtr(Address(SecondScratchReg, src.offset), dest);
+ splitTag(dest, SecondScratchReg);
+ asMasm().branchTestInt32(Assembler::Equal, SecondScratchReg, &isInt32);
+
ma_dext(dest, dest, Imm32(0), Imm32(JSVAL_TAG_SHIFT));
+ jump(&done);
+
+ bind(&isInt32);
+ ma_sll(dest, dest, Imm32(0));
+
+ bind(&done);
}
void