mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1245112 - Part 31: Move MacroAssembler::branchTestGCThing into generic macro assembler. r=jandem
This commit is contained in:
parent
15f8d8cefc
commit
dc44c3b83c
@ -980,6 +980,9 @@ class MacroAssembler : public MacroAssemblerSpecific
|
||||
inline void branchTestObject(Condition cond, const ValueOperand& value, Label* label)
|
||||
DEFINED_ON(arm, arm64, mips32, mips64, x86_shared);
|
||||
|
||||
inline void branchTestGCThing(Condition cond, const Address& address, Label* label) PER_SHARED_ARCH;
|
||||
inline void branchTestGCThing(Condition cond, const BaseIndex& address, Label* label) PER_SHARED_ARCH;
|
||||
|
||||
// Checks if given Value is evaluated to true or false in a condition.
|
||||
// The type of the value should match the type of the method.
|
||||
inline void branchTestInt32Truthy(bool truthy, const ValueOperand& value, Label* label)
|
||||
@ -1019,6 +1022,9 @@ class MacroAssembler : public MacroAssemblerSpecific
|
||||
template <typename T>
|
||||
inline void branchTestObjectImpl(Condition cond, const T& t, Label* label)
|
||||
DEFINED_ON(arm, arm64, x86_shared);
|
||||
template <typename T>
|
||||
inline void branchTestGCThingImpl(Condition cond, const T& t, Label* label)
|
||||
DEFINED_ON(arm, arm64, x86_shared);
|
||||
|
||||
//}}} check_macroassembler_style
|
||||
public:
|
||||
|
@ -1091,6 +1091,26 @@ MacroAssembler::branchTestObjectImpl(Condition cond, const T& t, Label* label)
|
||||
ma_b(label, c);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::branchTestGCThing(Condition cond, const Address& address, Label* label)
|
||||
{
|
||||
branchTestGCThingImpl(cond, address, label);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::branchTestGCThing(Condition cond, const BaseIndex& address, Label* label)
|
||||
{
|
||||
branchTestGCThingImpl(cond, address, label);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
MacroAssembler::branchTestGCThingImpl(Condition cond, const T& t, Label* label)
|
||||
{
|
||||
Condition c = testGCThing(cond, t);
|
||||
ma_b(label, c);
|
||||
}
|
||||
|
||||
//}}} check_macroassembler_style
|
||||
// ===============================================================
|
||||
|
||||
|
@ -684,11 +684,6 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM
|
||||
Condition testMagic(Condition cond, const BaseIndex& src);
|
||||
Condition testGCThing(Condition cond, const BaseIndex& src);
|
||||
|
||||
template <typename T>
|
||||
void branchTestGCThing(Condition cond, const T& t, Label* label) {
|
||||
Condition c = testGCThing(cond, t);
|
||||
ma_b(label, c);
|
||||
}
|
||||
template <typename T>
|
||||
void branchTestPrimitive(Condition cond, const T& t, Label* label) {
|
||||
Condition c = testPrimitive(cond, t);
|
||||
|
@ -1190,6 +1190,26 @@ MacroAssembler::branchTestObjectImpl(Condition cond, const T& t, Label* label)
|
||||
B(label, c);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::branchTestGCThing(Condition cond, const Address& address, Label* label)
|
||||
{
|
||||
branchTestGCThingImpl(cond, address, label);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::branchTestGCThing(Condition cond, const BaseIndex& address, Label* label)
|
||||
{
|
||||
branchTestGCThingImpl(cond, address, label);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
MacroAssembler::branchTestGCThingImpl(Condition cond, const T& src, Label* label)
|
||||
{
|
||||
Condition c = testGCThing(cond, src);
|
||||
B(label, c);
|
||||
}
|
||||
|
||||
//}}} check_macroassembler_style
|
||||
// ===============================================================
|
||||
|
||||
|
@ -1328,11 +1328,6 @@ class MacroAssemblerCompat : public vixl::MacroAssembler
|
||||
return jumpWithPatch(label, Always, documentation);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void branchTestGCThing(Condition cond, const T& src, Label* label) {
|
||||
Condition c = testGCThing(cond, src);
|
||||
B(label, c);
|
||||
}
|
||||
template <typename T>
|
||||
void branchTestPrimitive(Condition cond, const T& t, Label* label) {
|
||||
Condition c = testPrimitive(cond, t);
|
||||
|
@ -686,6 +686,25 @@ MacroAssembler::branchTestObject(Condition cond, const BaseIndex& address, Label
|
||||
branchTestObject(cond, scratch2, label);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::branchTestGCThing(Condition cond, const Address& address, Label* label)
|
||||
{
|
||||
MOZ_ASSERT(cond == Equal || cond == NotEqual);
|
||||
SecondScratchRegisterScope scratch2(*this);
|
||||
extractTag(address, scratch2);
|
||||
ma_b(scratch2, ImmTag(JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET), label,
|
||||
(cond == Equal) ? AboveOrEqual : Below);
|
||||
}
|
||||
void
|
||||
MacroAssembler::branchTestGCThing(Condition cond, const BaseIndex& address, Label* label)
|
||||
{
|
||||
MOZ_ASSERT(cond == Equal || cond == NotEqual);
|
||||
SecondScratchRegisterScope scratch2(*this);
|
||||
extractTag(address, scratch2);
|
||||
ma_b(scratch2, ImmTag(JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET), label,
|
||||
(cond == Equal) ? AboveOrEqual : Below);
|
||||
}
|
||||
|
||||
//}}} check_macroassembler_style
|
||||
// ===============================================================
|
||||
|
||||
|
@ -1095,23 +1095,6 @@ MacroAssemblerMIPSCompat::ToType(Operand base)
|
||||
return Operand(Register::FromCode(base.base()), base.disp() + TAG_OFFSET);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssemblerMIPSCompat::branchTestGCThing(Condition cond, const Address& address, Label* label)
|
||||
{
|
||||
MOZ_ASSERT(cond == Equal || cond == NotEqual);
|
||||
extractTag(address, SecondScratchReg);
|
||||
ma_b(SecondScratchReg, ImmTag(JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET), label,
|
||||
(cond == Equal) ? AboveOrEqual : Below);
|
||||
}
|
||||
void
|
||||
MacroAssemblerMIPSCompat::branchTestGCThing(Condition cond, const BaseIndex& src, Label* label)
|
||||
{
|
||||
MOZ_ASSERT(cond == Equal || cond == NotEqual);
|
||||
extractTag(src, SecondScratchReg);
|
||||
ma_b(SecondScratchReg, ImmTag(JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET), label,
|
||||
(cond == Equal) ? AboveOrEqual : Below);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssemblerMIPSCompat::branchTestPrimitive(Condition cond, const ValueOperand& value,
|
||||
Label* label)
|
||||
|
@ -309,9 +309,6 @@ class MacroAssemblerMIPSCompat : public MacroAssemblerMIPS
|
||||
return value.typeReg();
|
||||
}
|
||||
|
||||
void branchTestGCThing(Condition cond, const Address& address, Label* label);
|
||||
void branchTestGCThing(Condition cond, const BaseIndex& src, Label* label);
|
||||
|
||||
void branchTestPrimitive(Condition cond, const ValueOperand& value, Label* label);
|
||||
void branchTestPrimitive(Condition cond, Register tag, Label* label);
|
||||
|
||||
|
@ -1222,23 +1222,6 @@ MacroAssembler::clampDoubleToUint8(FloatRegister input, Register output)
|
||||
bind(&done);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssemblerMIPS64Compat::branchTestGCThing(Condition cond, const Address& address, Label* label)
|
||||
{
|
||||
MOZ_ASSERT(cond == Equal || cond == NotEqual);
|
||||
extractTag(address, SecondScratchReg);
|
||||
ma_b(SecondScratchReg, ImmTag(JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET), label,
|
||||
(cond == Equal) ? AboveOrEqual : Below);
|
||||
}
|
||||
void
|
||||
MacroAssemblerMIPS64Compat::branchTestGCThing(Condition cond, const BaseIndex& src, Label* label)
|
||||
{
|
||||
MOZ_ASSERT(cond == Equal || cond == NotEqual);
|
||||
extractTag(src, SecondScratchReg);
|
||||
ma_b(SecondScratchReg, ImmTag(JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET), label,
|
||||
(cond == Equal) ? AboveOrEqual : Below);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssemblerMIPS64Compat::branchTestPrimitive(Condition cond, const ValueOperand& value,
|
||||
Label* label)
|
||||
|
@ -337,9 +337,6 @@ class MacroAssemblerMIPS64Compat : public MacroAssemblerMIPS64
|
||||
return SecondScratchReg;
|
||||
}
|
||||
|
||||
void branchTestGCThing(Condition cond, const Address& address, Label* label);
|
||||
void branchTestGCThing(Condition cond, const BaseIndex& src, Label* label);
|
||||
|
||||
void branchTestPrimitive(Condition cond, const ValueOperand& value, Label* label);
|
||||
void branchTestPrimitive(Condition cond, Register tag, Label* label);
|
||||
|
||||
|
@ -345,7 +345,6 @@ class MacroAssemblerNone : public Assembler
|
||||
|
||||
Register splitTagForTest(ValueOperand) { MOZ_CRASH(); }
|
||||
|
||||
template <typename T> void branchTestGCThing(Condition, T, Label*) { MOZ_CRASH(); }
|
||||
template <typename T> void branchTestPrimitive(Condition, T, Label*) { MOZ_CRASH(); }
|
||||
template <typename T, typename L> void branchTestMagic(Condition, T, L) { MOZ_CRASH(); }
|
||||
template <typename T> void branchTestMagicValue(Condition, T, JSWhyMagic, Label*) { MOZ_CRASH(); }
|
||||
|
@ -683,11 +683,6 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared
|
||||
cmp32(reg, tag);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void branchTestGCThing(Condition cond, const T& src, Label* label) {
|
||||
cond = testGCThing(cond, src);
|
||||
j(cond, label);
|
||||
}
|
||||
template <typename T>
|
||||
void branchTestPrimitive(Condition cond, const T& t, Label* label) {
|
||||
cond = testPrimitive(cond, t);
|
||||
|
@ -713,6 +713,26 @@ MacroAssembler::branchTestObjectImpl(Condition cond, const T& t, Label* label)
|
||||
j(cond, label);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::branchTestGCThing(Condition cond, const Address& address, Label* label)
|
||||
{
|
||||
branchTestGCThingImpl(cond, address, label);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::branchTestGCThing(Condition cond, const BaseIndex& address, Label* label)
|
||||
{
|
||||
branchTestGCThingImpl(cond, address, label);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
MacroAssembler::branchTestGCThingImpl(Condition cond, const T& t, Label* label)
|
||||
{
|
||||
cond = testGCThing(cond, t);
|
||||
j(cond, label);
|
||||
}
|
||||
|
||||
//}}} check_macroassembler_style
|
||||
// ===============================================================
|
||||
|
||||
|
@ -660,11 +660,6 @@ class MacroAssemblerX86 : public MacroAssemblerX86Shared
|
||||
// Type testing instructions can take a tag in a register or a
|
||||
// ValueOperand.
|
||||
template <typename T>
|
||||
void branchTestGCThing(Condition cond, const T& t, Label* label) {
|
||||
cond = testGCThing(cond, t);
|
||||
j(cond, label);
|
||||
}
|
||||
template <typename T>
|
||||
void branchTestPrimitive(Condition cond, const T& t, Label* label) {
|
||||
cond = testPrimitive(cond, t);
|
||||
j(cond, label);
|
||||
|
Loading…
Reference in New Issue
Block a user