Bug 1640829 part 1 - Add some missing branchTestSymbol and unboxInt32/unboxBoolean overloads. r=iain

Differential Revision: https://phabricator.services.mozilla.com/D76827
This commit is contained in:
Jan de Mooij 2020-05-27 05:10:18 +00:00
parent 5fa2c88aaa
commit 319bac0dc9
8 changed files with 42 additions and 0 deletions

View File

@ -1567,6 +1567,8 @@ class MacroAssembler : public MacroAssemblerSpecific {
Label* label)
DEFINED_ON(arm, arm64, mips32, mips64, x86_shared);
inline void branchTestSymbol(Condition cond, const Address& address,
Label* label) PER_SHARED_ARCH;
inline void branchTestSymbol(Condition cond, const BaseIndex& address,
Label* label) PER_SHARED_ARCH;
inline void branchTestSymbol(Condition cond, const ValueOperand& value,

View File

@ -1728,6 +1728,11 @@ void MacroAssembler::branchTestSymbol(Condition cond, Register tag,
branchTestSymbolImpl(cond, tag, label);
}
void MacroAssembler::branchTestSymbol(Condition cond, const Address& address,
Label* label) {
branchTestSymbolImpl(cond, address, label);
}
void MacroAssembler::branchTestSymbol(Condition cond, const BaseIndex& address,
Label* label) {
branchTestSymbolImpl(cond, address, label);

View File

@ -827,12 +827,18 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM {
void unboxInt32(const Address& src, Register dest) {
unboxNonDouble(src, dest, JSVAL_TYPE_INT32);
}
void unboxInt32(const BaseIndex& src, Register dest) {
unboxNonDouble(src, dest, JSVAL_TYPE_INT32);
}
void unboxBoolean(const ValueOperand& src, Register dest) {
unboxNonDouble(src, dest, JSVAL_TYPE_BOOLEAN);
}
void unboxBoolean(const Address& src, Register dest) {
unboxNonDouble(src, dest, JSVAL_TYPE_BOOLEAN);
}
void unboxBoolean(const BaseIndex& src, Register dest) {
unboxNonDouble(src, dest, JSVAL_TYPE_BOOLEAN);
}
void unboxString(const ValueOperand& src, Register dest) {
unboxNonDouble(src, dest, JSVAL_TYPE_STRING);
}

View File

@ -1441,6 +1441,11 @@ void MacroAssembler::branchTestSymbol(Condition cond, Register tag,
branchTestSymbolImpl(cond, tag, label);
}
void MacroAssembler::branchTestSymbol(Condition cond, const Address& address,
Label* label) {
branchTestSymbolImpl(cond, address, label);
}
void MacroAssembler::branchTestSymbol(Condition cond, const BaseIndex& address,
Label* label) {
branchTestSymbolImpl(cond, address, label);

View File

@ -1343,6 +1343,7 @@ class MacroAssemblerCompat : public vixl::MacroAssembler {
move32(src.valueReg(), dest);
}
void unboxInt32(const Address& src, Register dest) { load32(src, dest); }
void unboxInt32(const BaseIndex& src, Register dest) { load32(src, dest); }
template <typename T>
void unboxDouble(const T& src, FloatRegister dest) {
@ -1363,6 +1364,7 @@ class MacroAssemblerCompat : public vixl::MacroAssembler {
move32(src.valueReg(), dest);
}
void unboxBoolean(const Address& src, Register dest) { load32(src, dest); }
void unboxBoolean(const BaseIndex& src, Register dest) { load32(src, dest); }
void unboxMagic(const ValueOperand& src, Register dest) {
move32(src.valueReg(), dest);

View File

@ -725,6 +725,9 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared {
void unboxInt32(const Address& src, Register dest) {
unboxInt32(Operand(src), dest);
}
void unboxInt32(const BaseIndex& src, Register dest) {
unboxInt32(Operand(src), dest);
}
template <typename T>
void unboxDouble(const T& src, FloatRegister dest) {
loadDouble(Operand(src), dest);
@ -747,6 +750,9 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared {
void unboxBoolean(const Address& src, Register dest) {
unboxBoolean(Operand(src), dest);
}
void unboxBoolean(const BaseIndex& src, Register dest) {
unboxBoolean(Operand(src), dest);
}
void unboxMagic(const ValueOperand& src, Register dest) {
movl(src.valueReg(), dest);

View File

@ -814,6 +814,11 @@ void MacroAssembler::branchTestSymbol(Condition cond, Register tag,
branchTestSymbolImpl(cond, tag, label);
}
void MacroAssembler::branchTestSymbol(Condition cond, const Address& address,
Label* label) {
branchTestSymbolImpl(cond, address, label);
}
void MacroAssembler::branchTestSymbol(Condition cond, const BaseIndex& address,
Label* label) {
branchTestSymbolImpl(cond, address, label);

View File

@ -480,6 +480,11 @@ class MacroAssemblerX86 : public MacroAssemblerX86Shared {
cmp32(tagOf(address), ImmTag(JSVAL_TAG_STRING));
return cond;
}
Condition testSymbol(Condition cond, const Address& address) {
MOZ_ASSERT(cond == Equal || cond == NotEqual);
cmp32(tagOf(address), ImmTag(JSVAL_TAG_SYMBOL));
return cond;
}
Condition testSymbol(Condition cond, const BaseIndex& address) {
MOZ_ASSERT(cond == Equal || cond == NotEqual);
cmp32(tagOf(address), ImmTag(JSVAL_TAG_SYMBOL));
@ -742,12 +747,18 @@ class MacroAssemblerX86 : public MacroAssemblerX86Shared {
void unboxInt32(const Address& src, Register dest) {
unboxNonDouble(src, dest, JSVAL_TYPE_INT32);
}
void unboxInt32(const BaseIndex& src, Register dest) {
unboxNonDouble(src, dest, JSVAL_TYPE_INT32);
}
void unboxBoolean(const ValueOperand& src, Register dest) {
unboxNonDouble(src, dest, JSVAL_TYPE_BOOLEAN);
}
void unboxBoolean(const Address& src, Register dest) {
unboxNonDouble(src, dest, JSVAL_TYPE_BOOLEAN);
}
void unboxBoolean(const BaseIndex& src, Register dest) {
unboxNonDouble(src, dest, JSVAL_TYPE_BOOLEAN);
}
void unboxString(const ValueOperand& src, Register dest) {
unboxNonDouble(src, dest, JSVAL_TYPE_STRING);
}