Bug 1245112 - Part 3: Move MacroAssembler::branch32 into generic macro assembler. r=nbp

This commit is contained in:
Tooru Fujisawa 2016-02-15 23:01:48 +09:00
parent 76c6cf4c25
commit ba86a8bc78
21 changed files with 435 additions and 319 deletions

View File

@ -798,6 +798,26 @@ class MacroAssembler : public MacroAssemblerSpecific
// =============================================================== // ===============================================================
// Branch functions // Branch functions
inline void branch32(Condition cond, Register lhs, Register rhs, Label* label) PER_SHARED_ARCH;
inline void branch32(Condition cond, Register lhs, Imm32 rhs, Label* label) PER_SHARED_ARCH;
inline void branch32(Condition cond, const Address& lhs, Register rhs, Label* label) PER_SHARED_ARCH;
inline void branch32(Condition cond, const Address& lhs, Imm32 rhs, Label* label) PER_SHARED_ARCH;
inline void branch32(Condition cond, const AbsoluteAddress& lhs, Register rhs, Label* label)
DEFINED_ON(arm, arm64, mips_shared, x86, x64);
inline void branch32(Condition cond, const AbsoluteAddress& lhs, Imm32 rhs, Label* label)
DEFINED_ON(arm, arm64, mips_shared, x86, x64);
inline void branch32(Condition cond, const BaseIndex& lhs, Register rhs, Label* label)
DEFINED_ON(x86_shared);
inline void branch32(Condition cond, const BaseIndex& lhs, Imm32 rhs, Label* label) PER_SHARED_ARCH;
inline void branch32(Condition cond, const Operand& lhs, Register rhs, Label* label) PER_SHARED_ARCH;
inline void branch32(Condition cond, const Operand& lhs, Imm32 rhs, Label* label) PER_SHARED_ARCH;
inline void branch32(Condition cond, wasm::SymbolicAddress lhs, Imm32 rhs, Label* label)
DEFINED_ON(arm, arm64, mips_shared, x86, x64);
inline void branchPtr(Condition cond, Register lhs, Register rhs, Label* label) PER_SHARED_ARCH; inline void branchPtr(Condition cond, Register lhs, Register rhs, Label* label) PER_SHARED_ARCH;
inline void branchPtr(Condition cond, Register lhs, Imm32 rhs, Label* label) PER_SHARED_ARCH; inline void branchPtr(Condition cond, Register lhs, Imm32 rhs, Label* label) PER_SHARED_ARCH;
inline void branchPtr(Condition cond, Register lhs, ImmPtr rhs, Label* label) PER_SHARED_ARCH; inline void branchPtr(Condition cond, Register lhs, ImmPtr rhs, Label* label) PER_SHARED_ARCH;

View File

@ -393,6 +393,98 @@ MacroAssembler::rshift64(Imm32 imm, Register64 dest)
// =============================================================== // ===============================================================
// Branch functions // Branch functions
void
MacroAssembler::branch32(Condition cond, Register lhs, Register rhs, Label* label)
{
ma_cmp(lhs, rhs);
ma_b(label, cond);
}
void
MacroAssembler::branch32(Condition cond, Register lhs, Imm32 rhs, Label* label)
{
ma_cmp(lhs, rhs);
ma_b(label, cond);
}
void
MacroAssembler::branch32(Condition cond, const Address& lhs, Register rhs, Label* label)
{
ScratchRegisterScope scratch(*this);
load32(lhs, scratch);
branch32(cond, scratch, rhs, label);
}
void
MacroAssembler::branch32(Condition cond, const Address& lhs, Imm32 rhs, Label* label)
{
// branch32 will use ScratchRegister.
AutoRegisterScope scratch(*this, secondScratchReg_);
load32(lhs, scratch);
branch32(cond, scratch, rhs, label);
}
void
MacroAssembler::branch32(Condition cond, const AbsoluteAddress& lhs, Register rhs, Label* label)
{
AutoRegisterScope scratch2(*this, secondScratchReg_);
loadPtr(lhs, scratch2); // ma_cmp will use the scratch register.
ma_cmp(scratch2, rhs);
ma_b(label, cond);
}
void
MacroAssembler::branch32(Condition cond, const AbsoluteAddress& lhs, Imm32 rhs, Label* label)
{
AutoRegisterScope scratch2(*this, secondScratchReg_);
loadPtr(lhs, scratch2); // ma_cmp will use the scratch register.
ma_cmp(scratch2, rhs);
ma_b(label, cond);
}
void
MacroAssembler::branch32(Condition cond, const BaseIndex& lhs, Imm32 rhs, Label* label)
{
// branch32 will use ScratchRegister.
AutoRegisterScope scratch2(*this, secondScratchReg_);
load32(lhs, scratch2);
branch32(cond, scratch2, rhs, label);
}
void
MacroAssembler::branch32(Condition cond, const Operand& lhs, Register rhs, Label* label)
{
if (lhs.getTag() == Operand::OP2) {
branch32(cond, lhs.toReg(), rhs, label);
} else {
ScratchRegisterScope scratch(*this);
ma_ldr(lhs.toAddress(), scratch);
branch32(cond, scratch, rhs, label);
}
}
void
MacroAssembler::branch32(Condition cond, const Operand& lhs, Imm32 rhs, Label* label)
{
if (lhs.getTag() == Operand::OP2) {
branch32(cond, lhs.toReg(), rhs, label);
} else {
// branch32 will use ScratchRegister.
AutoRegisterScope scratch(*this, secondScratchReg_);
ma_ldr(lhs.toAddress(), scratch);
branch32(cond, scratch, rhs, label);
}
}
void
MacroAssembler::branch32(Condition cond, wasm::SymbolicAddress lhs, Imm32 rhs, Label* label)
{
ScratchRegisterScope scratch(*this);
loadPtr(lhs, scratch);
branch32(cond, scratch, rhs, label);
}
void void
MacroAssembler::branchPtr(Condition cond, Register lhs, Register rhs, Label* label) MacroAssembler::branchPtr(Condition cond, Register lhs, Register rhs, Label* label)
{ {

View File

@ -3589,11 +3589,13 @@ MacroAssemblerARMCompat::handleFailureWithHandlerTail(void* handler)
Label bailout; Label bailout;
ma_ldr(Address(sp, offsetof(ResumeFromException, kind)), r0); ma_ldr(Address(sp, offsetof(ResumeFromException, kind)), r0);
branch32(Assembler::Equal, r0, Imm32(ResumeFromException::RESUME_ENTRY_FRAME), &entryFrame); asMasm().branch32(Assembler::Equal, r0, Imm32(ResumeFromException::RESUME_ENTRY_FRAME),
branch32(Assembler::Equal, r0, Imm32(ResumeFromException::RESUME_CATCH), &catch_); &entryFrame);
branch32(Assembler::Equal, r0, Imm32(ResumeFromException::RESUME_FINALLY), &finally); asMasm().branch32(Assembler::Equal, r0, Imm32(ResumeFromException::RESUME_CATCH), &catch_);
branch32(Assembler::Equal, r0, Imm32(ResumeFromException::RESUME_FORCED_RETURN), &return_); asMasm().branch32(Assembler::Equal, r0, Imm32(ResumeFromException::RESUME_FINALLY), &finally);
branch32(Assembler::Equal, r0, Imm32(ResumeFromException::RESUME_BAILOUT), &bailout); asMasm().branch32(Assembler::Equal, r0, Imm32(ResumeFromException::RESUME_FORCED_RETURN),
&return_);
asMasm().branch32(Assembler::Equal, r0, Imm32(ResumeFromException::RESUME_BAILOUT), &bailout);
breakpoint(); // Invalid kind. breakpoint(); // Invalid kind.
@ -3644,7 +3646,8 @@ MacroAssemblerARMCompat::handleFailureWithHandlerTail(void* handler)
Label skipProfilingInstrumentation; Label skipProfilingInstrumentation;
// Test if profiler enabled. // Test if profiler enabled.
AbsoluteAddress addressOfEnabled(GetJitContext()->runtime->spsProfiler().addressOfEnabled()); AbsoluteAddress addressOfEnabled(GetJitContext()->runtime->spsProfiler().addressOfEnabled());
branch32(Assembler::Equal, addressOfEnabled, Imm32(0), &skipProfilingInstrumentation); asMasm().branch32(Assembler::Equal, addressOfEnabled, Imm32(0),
&skipProfilingInstrumentation);
profilerExitFrame(); profilerExitFrame();
bind(&skipProfilingInstrumentation); bind(&skipProfilingInstrumentation);
} }
@ -4119,8 +4122,8 @@ MacroAssemblerARMCompat::branchPtrInNurseryRange(Condition cond, Register ptr, R
ma_mov(Imm32(startChunk), scratch2); ma_mov(Imm32(startChunk), scratch2);
as_rsb(scratch2, scratch2, lsr(ptr, Nursery::ChunkShift)); as_rsb(scratch2, scratch2, lsr(ptr, Nursery::ChunkShift));
branch32(cond == Assembler::Equal ? Assembler::Below : Assembler::AboveOrEqual, asMasm().branch32(cond == Assembler::Equal ? Assembler::Below : Assembler::AboveOrEqual,
scratch2, Imm32(nursery.numChunks()), label); scratch2, Imm32(nursery.numChunks()), label);
} }
void void

View File

@ -774,50 +774,6 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM
Condition c = testBoolean(cond, t); Condition c = testBoolean(cond, t);
ma_b(label, c); ma_b(label, c);
} }
void branch32(Condition cond, Register lhs, Register rhs, Label* label) {
ma_cmp(lhs, rhs);
ma_b(label, cond);
}
void branch32(Condition cond, Register lhs, Imm32 imm, Label* label) {
ma_cmp(lhs, imm);
ma_b(label, cond);
}
void branch32(Condition cond, const Operand& lhs, Register rhs, Label* label) {
if (lhs.getTag() == Operand::OP2) {
branch32(cond, lhs.toReg(), rhs, label);
} else {
ScratchRegisterScope scratch(asMasm());
ma_ldr(lhs.toAddress(), scratch);
branch32(cond, scratch, rhs, label);
}
}
void branch32(Condition cond, const Operand& lhs, Imm32 rhs, Label* label) {
if (lhs.getTag() == Operand::OP2) {
branch32(cond, lhs.toReg(), rhs, label);
} else {
// branch32 will use ScratchRegister.
AutoRegisterScope scratch(asMasm(), secondScratchReg_);
ma_ldr(lhs.toAddress(), scratch);
branch32(cond, scratch, rhs, label);
}
}
void branch32(Condition cond, const Address& lhs, Register rhs, Label* label) {
ScratchRegisterScope scratch(asMasm());
load32(lhs, scratch);
branch32(cond, scratch, rhs, label);
}
void branch32(Condition cond, const Address& lhs, Imm32 rhs, Label* label) {
// branch32 will use ScratchRegister.
AutoRegisterScope scratch(asMasm(), secondScratchReg_);
load32(lhs, scratch);
branch32(cond, scratch, rhs, label);
}
void branch32(Condition cond, const BaseIndex& lhs, Imm32 rhs, Label* label) {
// branch32 will use ScratchRegister.
AutoRegisterScope scratch2(asMasm(), secondScratchReg_);
load32(lhs, scratch2);
branch32(cond, scratch2, rhs, label);
}
template<typename T> template<typename T>
void branchTestDouble(Condition cond, const T & t, Label* label) { void branchTestDouble(Condition cond, const T & t, Label* label) {
@ -942,24 +898,6 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM
ma_cmp(scratch2, ptr); ma_cmp(scratch2, ptr);
return jumpWithPatch(label, cond); return jumpWithPatch(label, cond);
} }
void branch32(Condition cond, AbsoluteAddress lhs, Imm32 rhs, Label* label) {
AutoRegisterScope scratch2(asMasm(), secondScratchReg_);
loadPtr(lhs, scratch2); // ma_cmp will use the scratch register.
ma_cmp(scratch2, rhs);
ma_b(label, cond);
}
void branch32(Condition cond, AbsoluteAddress lhs, Register rhs, Label* label) {
AutoRegisterScope scratch2(asMasm(), secondScratchReg_);
loadPtr(lhs, scratch2); // ma_cmp will use the scratch register.
ma_cmp(scratch2, rhs);
ma_b(label, cond);
}
void branch32(Condition cond, wasm::SymbolicAddress addr, Imm32 imm, Label* label) {
ScratchRegisterScope scratch(asMasm());
loadPtr(addr, scratch);
ma_cmp(scratch, imm);
ma_b(label, cond);
}
void loadUnboxedValue(Address address, MIRType type, AnyRegister dest) { void loadUnboxedValue(Address address, MIRType type, AnyRegister dest) {
if (dest.isFloat()) if (dest.isFloat())

View File

@ -438,6 +438,96 @@ MacroAssembler::rshift64(Imm32 imm, Register64 dest)
// =============================================================== // ===============================================================
// Branch functions // Branch functions
void
MacroAssembler::branch32(Condition cond, Register lhs, Register rhs, Label* label)
{
cmp32(lhs, rhs);
B(label, cond);
}
void
MacroAssembler::branch32(Condition cond, Register lhs, Imm32 imm, Label* label)
{
cmp32(lhs, imm);
B(label, cond);
}
void
MacroAssembler::branch32(Condition cond, const Address& lhs, Register rhs, Label* label)
{
vixl::UseScratchRegisterScope temps(this);
const Register scratch = temps.AcquireX().asUnsized();
MOZ_ASSERT(scratch != lhs.base);
MOZ_ASSERT(scratch != rhs);
load32(lhs, scratch);
branch32(cond, scratch, rhs, label);
}
void
MacroAssembler::branch32(Condition cond, const Address& lhs, Imm32 imm, Label* label)
{
vixl::UseScratchRegisterScope temps(this);
const Register scratch = temps.AcquireX().asUnsized();
MOZ_ASSERT(scratch != lhs.base);
load32(lhs, scratch);
branch32(cond, scratch, imm, label);
}
void
MacroAssembler::branch32(Condition cond, const AbsoluteAddress& lhs, Register rhs, Label* label)
{
vixl::UseScratchRegisterScope temps(this);
const Register scratch = temps.AcquireX().asUnsized();
movePtr(ImmPtr(lhs.addr), scratch);
branch32(cond, Address(scratch, 0), rhs, label);
}
void
MacroAssembler::branch32(Condition cond, const AbsoluteAddress& lhs, Imm32 rhs, Label* label)
{
vixl::UseScratchRegisterScope temps(this);
const Register scratch = temps.AcquireX().asUnsized();
movePtr(ImmPtr(lhs.addr), scratch);
branch32(cond, Address(scratch, 0), rhs, label);
}
void
MacroAssembler::branch32(Condition cond, const BaseIndex& lhs, Imm32 rhs, Label* label)
{
vixl::UseScratchRegisterScope temps(this);
const ARMRegister scratch32 = temps.AcquireW();
MOZ_ASSERT(scratch32.asUnsized() != lhs.base);
MOZ_ASSERT(scratch32.asUnsized() != lhs.index);
doBaseIndex(scratch32, lhs, vixl::LDR_w);
branch32(cond, scratch32.asUnsized(), rhs, label);
}
void
MacroAssembler::branch32(Condition cond, const Operand& lhs, Register rhs, Label* label)
{
// since rhs is an operand, do the compare backwards
Cmp(ARMRegister(rhs, 32), lhs);
B(label, Assembler::InvertCmpCondition(cond));
}
void
MacroAssembler::branch32(Condition cond, const Operand& lhs, Imm32 rhs, Label* label)
{
ARMRegister l = lhs.reg();
Cmp(l, Operand(rhs.value));
B(label, cond);
}
void
MacroAssembler::branch32(Condition cond, wasm::SymbolicAddress lhs, Imm32 rhs, Label* label)
{
vixl::UseScratchRegisterScope temps(this);
const Register scratch = temps.AcquireX().asUnsized();
movePtr(lhs, scratch);
branch32(cond, Address(scratch, 0), rhs, label);
}
void void
MacroAssembler::branchPtr(Condition cond, Register lhs, Register rhs, Label* label) MacroAssembler::branchPtr(Condition cond, Register lhs, Register rhs, Label* label)
{ {

View File

@ -156,11 +156,13 @@ MacroAssemblerCompat::handleFailureWithHandlerTail(void* handler)
MOZ_ASSERT(GetStackPointer64().Is(x28)); // Lets the code below be a little cleaner. MOZ_ASSERT(GetStackPointer64().Is(x28)); // Lets the code below be a little cleaner.
loadPtr(Address(r28, offsetof(ResumeFromException, kind)), r0); loadPtr(Address(r28, offsetof(ResumeFromException, kind)), r0);
branch32(Assembler::Equal, r0, Imm32(ResumeFromException::RESUME_ENTRY_FRAME), &entryFrame); asMasm().branch32(Assembler::Equal, r0, Imm32(ResumeFromException::RESUME_ENTRY_FRAME),
branch32(Assembler::Equal, r0, Imm32(ResumeFromException::RESUME_CATCH), &catch_); &entryFrame);
branch32(Assembler::Equal, r0, Imm32(ResumeFromException::RESUME_FINALLY), &finally); asMasm().branch32(Assembler::Equal, r0, Imm32(ResumeFromException::RESUME_CATCH), &catch_);
branch32(Assembler::Equal, r0, Imm32(ResumeFromException::RESUME_FORCED_RETURN), &return_); asMasm().branch32(Assembler::Equal, r0, Imm32(ResumeFromException::RESUME_FINALLY), &finally);
branch32(Assembler::Equal, r0, Imm32(ResumeFromException::RESUME_BAILOUT), &bailout); asMasm().branch32(Assembler::Equal, r0, Imm32(ResumeFromException::RESUME_FORCED_RETURN),
&return_);
asMasm().branch32(Assembler::Equal, r0, Imm32(ResumeFromException::RESUME_BAILOUT), &bailout);
breakpoint(); // Invalid kind. breakpoint(); // Invalid kind.

View File

@ -1357,66 +1357,6 @@ class MacroAssemblerCompat : public vixl::MacroAssembler
addPendingJump(loc, ImmPtr(target->raw()), Relocation::JITCODE); addPendingJump(loc, ImmPtr(target->raw()), Relocation::JITCODE);
} }
void branch32(Condition cond, const Operand& lhs, Register rhs, Label* label) {
// since rhs is an operand, do the compare backwards
Cmp(ARMRegister(rhs, 32), lhs);
B(label, Assembler::InvertCmpCondition(cond));
}
void branch32(Condition cond, const Operand& lhs, Imm32 rhs, Label* label) {
ARMRegister l = lhs.reg();
Cmp(l, Operand(rhs.value));
B(label, cond);
}
void branch32(Condition cond, Register lhs, Register rhs, Label* label) {
cmp32(lhs, rhs);
B(label, cond);
}
void branch32(Condition cond, Register lhs, Imm32 imm, Label* label) {
cmp32(lhs, imm);
B(label, cond);
}
void branch32(Condition cond, const Address& lhs, Register rhs, Label* label) {
vixl::UseScratchRegisterScope temps(this);
const Register scratch = temps.AcquireX().asUnsized();
MOZ_ASSERT(scratch != lhs.base);
MOZ_ASSERT(scratch != rhs);
load32(lhs, scratch);
branch32(cond, scratch, rhs, label);
}
void branch32(Condition cond, const Address& lhs, Imm32 imm, Label* label) {
vixl::UseScratchRegisterScope temps(this);
const Register scratch = temps.AcquireX().asUnsized();
MOZ_ASSERT(scratch != lhs.base);
load32(lhs, scratch);
branch32(cond, scratch, imm, label);
}
void branch32(Condition cond, AbsoluteAddress lhs, Register rhs, Label* label) {
vixl::UseScratchRegisterScope temps(this);
const Register scratch = temps.AcquireX().asUnsized();
movePtr(ImmPtr(lhs.addr), scratch);
branch32(cond, Address(scratch, 0), rhs, label);
}
void branch32(Condition cond, AbsoluteAddress lhs, Imm32 rhs, Label* label) {
vixl::UseScratchRegisterScope temps(this);
const Register scratch = temps.AcquireX().asUnsized();
movePtr(ImmPtr(lhs.addr), scratch);
branch32(cond, Address(scratch, 0), rhs, label);
}
void branch32(Condition cond, wasm::SymbolicAddress lhs, Imm32 rhs, Label* label) {
vixl::UseScratchRegisterScope temps(this);
const Register scratch = temps.AcquireX().asUnsized();
movePtr(lhs, scratch);
branch32(cond, Address(scratch, 0), rhs, label);
}
void branch32(Condition cond, BaseIndex lhs, Imm32 rhs, Label* label) {
vixl::UseScratchRegisterScope temps(this);
const ARMRegister scratch32 = temps.AcquireW();
MOZ_ASSERT(scratch32.asUnsized() != lhs.base);
MOZ_ASSERT(scratch32.asUnsized() != lhs.index);
doBaseIndex(scratch32, lhs, vixl::LDR_w);
branch32(cond, scratch32.asUnsized(), rhs, label);
}
template <class L> template <class L>
void branchTest32(Condition cond, Register lhs, Register rhs, L label) { void branchTest32(Condition cond, Register lhs, Register rhs, L label) {
MOZ_ASSERT(cond == Zero || cond == NonZero || cond == Signed || cond == NotSigned); MOZ_ASSERT(cond == Zero || cond == NonZero || cond == Signed || cond == NotSigned);

View File

@ -194,6 +194,78 @@ MacroAssembler::negateDouble(FloatRegister reg)
// =============================================================== // ===============================================================
// Branch functions // Branch functions
void
MacroAssembler::branch32(Condition cond, Register lhs, Register rhs, Label* label)
{
ma_b(lhs, rhs, label, cond);
}
void
MacroAssembler::branch32(Condition cond, Register lhs, Imm32 imm, Label* label)
{
ma_b(lhs, imm, label, cond);
}
void
MacroAssembler::branch32(Condition cond, const Address& lhs, Register rhs, Label* label)
{
load32(lhs, SecondScratchReg);
ma_b(SecondScratchReg, rhs, label, cond);
}
void
MacroAssembler::branch32(Condition cond, const Address& lhs, Imm32 rhs, Label* label)
{
load32(lhs, SecondScratchReg);
ma_b(SecondScratchReg, rhs, label, cond);
}
void
MacroAssembler::branch32(Condition cond, const AbsoluteAddress& lhs, Register rhs, Label* label)
{
load32(lhs, SecondScratchReg);
ma_b(SecondScratchReg, rhs, label, cond);
}
void
MacroAssembler::branch32(Condition cond, const AbsoluteAddress& lhs, Imm32 rhs, Label* label)
{
load32(lhs, SecondScratchReg);
ma_b(SecondScratchReg, rhs, label, cond);
}
void
MacroAssembler::branch32(Condition cond, const BaseIndex& lhs, Imm32 rhs, Label* label)
{
load32(lhs, SecondScratchReg);
ma_b(SecondScratchReg, rhs, label, cond);
}
void
MacroAssembler::branch32(Condition cond, const Operand& lhs, Register rhs, Label* label)
{
if (lhs.getTag() == Operand::REG)
ma_b(lhs.toReg(), rhs, label, cond);
else
branch32(cond, lhs.toAddress(), rhs, label);
}
void
MacroAssembler::branch32(Condition cond, const Operand& lhs, Imm32 rhs, Label* label)
{
if (lhs.getTag() == Operand::REG)
ma_b(lhs.toReg(), rhs, label, cond);
else
branch32(cond, lhs.toAddress(), rhs, label);
}
void
MacroAssembler::branch32(Condition cond, wasm::SymbolicAddress addr, Imm32 imm, Label* label)
{
load32(addr, SecondScratchReg);
ma_b(SecondScratchReg, imm, label, cond);
}
void void
MacroAssembler::branchPtr(Condition cond, Register lhs, Register rhs, Label* label) MacroAssembler::branchPtr(Condition cond, Register lhs, Register rhs, Label* label)
{ {

View File

@ -1088,7 +1088,7 @@ MacroAssembler::clampDoubleToUint8(FloatRegister input, Register output)
Label outOfRange; Label outOfRange;
branchTruncateDouble(input, output, &outOfRange); branchTruncateDouble(input, output, &outOfRange);
branch32(Assembler::Above, output, Imm32(255), &outOfRange); asMasm().branch32(Assembler::Above, output, Imm32(255), &outOfRange);
{ {
// Check if we had a tie. // Check if we had a tie.
convertInt32ToDouble(output, ScratchDoubleReg); convertInt32ToDouble(output, ScratchDoubleReg);
@ -2178,11 +2178,13 @@ MacroAssemblerMIPSCompat::handleFailureWithHandlerTail(void* handler)
// Already clobbered a0, so use it... // Already clobbered a0, so use it...
load32(Address(StackPointer, offsetof(ResumeFromException, kind)), a0); load32(Address(StackPointer, offsetof(ResumeFromException, kind)), a0);
branch32(Assembler::Equal, a0, Imm32(ResumeFromException::RESUME_ENTRY_FRAME), &entryFrame); asMasm().branch32(Assembler::Equal, a0, Imm32(ResumeFromException::RESUME_ENTRY_FRAME),
branch32(Assembler::Equal, a0, Imm32(ResumeFromException::RESUME_CATCH), &catch_); &entryFrame);
branch32(Assembler::Equal, a0, Imm32(ResumeFromException::RESUME_FINALLY), &finally); asMasm().branch32(Assembler::Equal, a0, Imm32(ResumeFromException::RESUME_CATCH), &catch_);
branch32(Assembler::Equal, a0, Imm32(ResumeFromException::RESUME_FORCED_RETURN), &return_); asMasm().branch32(Assembler::Equal, a0, Imm32(ResumeFromException::RESUME_FINALLY), &finally);
branch32(Assembler::Equal, a0, Imm32(ResumeFromException::RESUME_BAILOUT), &bailout); asMasm().branch32(Assembler::Equal, a0, Imm32(ResumeFromException::RESUME_FORCED_RETURN),
&return_);
asMasm().branch32(Assembler::Equal, a0, Imm32(ResumeFromException::RESUME_BAILOUT), &bailout);
breakpoint(); // Invalid kind. breakpoint(); // Invalid kind.
@ -2236,7 +2238,8 @@ MacroAssemblerMIPSCompat::handleFailureWithHandlerTail(void* handler)
Label skipProfilingInstrumentation; Label skipProfilingInstrumentation;
// Test if profiler enabled. // Test if profiler enabled.
AbsoluteAddress addressOfEnabled(GetJitContext()->runtime->spsProfiler().addressOfEnabled()); AbsoluteAddress addressOfEnabled(GetJitContext()->runtime->spsProfiler().addressOfEnabled());
branch32(Assembler::Equal, addressOfEnabled, Imm32(0), &skipProfilingInstrumentation); asMasm().branch32(Assembler::Equal, addressOfEnabled, Imm32(0),
&skipProfilingInstrumentation);
profilerExitFrame(); profilerExitFrame();
bind(&skipProfilingInstrumentation); bind(&skipProfilingInstrumentation);
} }

View File

@ -383,38 +383,6 @@ class MacroAssemblerMIPSCompat : public MacroAssemblerMIPS
void branchTestBoolean(Condition cond, const Address& address, Label* label); void branchTestBoolean(Condition cond, const Address& address, Label* label);
void branchTestBoolean(Condition cond, const BaseIndex& src, Label* label); void branchTestBoolean(Condition cond, const BaseIndex& src, Label* label);
void branch32(Condition cond, Register lhs, Register rhs, Label* label) {
ma_b(lhs, rhs, label, cond);
}
void branch32(Condition cond, Register lhs, Imm32 imm, Label* label) {
ma_b(lhs, imm, label, cond);
}
void branch32(Condition cond, const Operand& lhs, Register rhs, Label* label) {
if (lhs.getTag() == Operand::REG) {
ma_b(lhs.toReg(), rhs, label, cond);
} else {
branch32(cond, lhs.toAddress(), rhs, label);
}
}
void branch32(Condition cond, const Operand& lhs, Imm32 rhs, Label* label) {
if (lhs.getTag() == Operand::REG) {
ma_b(lhs.toReg(), rhs, label, cond);
} else {
branch32(cond, lhs.toAddress(), rhs, label);
}
}
void branch32(Condition cond, const Address& lhs, Register rhs, Label* label) {
load32(lhs, SecondScratchReg);
ma_b(SecondScratchReg, rhs, label, cond);
}
void branch32(Condition cond, const Address& lhs, Imm32 rhs, Label* label) {
load32(lhs, SecondScratchReg);
ma_b(SecondScratchReg, rhs, label, cond);
}
void branch32(Condition cond, const BaseIndex& lhs, Imm32 rhs, Label* label) {
load32(lhs, SecondScratchReg);
ma_b(SecondScratchReg, rhs, label, cond);
}
void branchTestDouble(Condition cond, const ValueOperand& value, Label* label); void branchTestDouble(Condition cond, const ValueOperand& value, Label* label);
void branchTestDouble(Condition cond, Register tag, Label* label); void branchTestDouble(Condition cond, Register tag, Label* label);
@ -551,18 +519,6 @@ class MacroAssemblerMIPSCompat : public MacroAssemblerMIPS
bind(&skipJump); bind(&skipJump);
return off; return off;
} }
void branch32(Condition cond, AbsoluteAddress lhs, Imm32 rhs, Label* label) {
load32(lhs, SecondScratchReg);
ma_b(SecondScratchReg, rhs, label, cond);
}
void branch32(Condition cond, AbsoluteAddress lhs, Register rhs, Label* label) {
load32(lhs, SecondScratchReg);
ma_b(SecondScratchReg, rhs, label, cond);
}
void branch32(Condition cond, wasm::SymbolicAddress addr, Imm32 imm, Label* label) {
load32(addr, SecondScratchReg);
ma_b(SecondScratchReg, imm, label, cond);
}
void loadUnboxedValue(Address address, MIRType type, AnyRegister dest) { void loadUnboxedValue(Address address, MIRType type, AnyRegister dest) {
if (dest.isFloat()) if (dest.isFloat())

View File

@ -1228,7 +1228,7 @@ MacroAssembler::clampDoubleToUint8(FloatRegister input, Register output)
Label outOfRange; Label outOfRange;
branchTruncateDouble(input, output, &outOfRange); branchTruncateDouble(input, output, &outOfRange);
branch32(Assembler::Above, output, Imm32(255), &outOfRange); asMasm().branch32(Assembler::Above, output, Imm32(255), &outOfRange);
{ {
// Check if we had a tie. // Check if we had a tie.
convertInt32ToDouble(output, ScratchDoubleReg); convertInt32ToDouble(output, ScratchDoubleReg);
@ -2335,11 +2335,13 @@ MacroAssemblerMIPS64Compat::handleFailureWithHandlerTail(void* handler)
// Already clobbered a0, so use it... // Already clobbered a0, so use it...
load32(Address(StackPointer, offsetof(ResumeFromException, kind)), a0); load32(Address(StackPointer, offsetof(ResumeFromException, kind)), a0);
branch32(Assembler::Equal, a0, Imm32(ResumeFromException::RESUME_ENTRY_FRAME), &entryFrame); asMasm().branch32(Assembler::Equal, a0, Imm32(ResumeFromException::RESUME_ENTRY_FRAME),
branch32(Assembler::Equal, a0, Imm32(ResumeFromException::RESUME_CATCH), &catch_); &entryFrame);
branch32(Assembler::Equal, a0, Imm32(ResumeFromException::RESUME_FINALLY), &finally); asMasm().branch32(Assembler::Equal, a0, Imm32(ResumeFromException::RESUME_CATCH), &catch_);
branch32(Assembler::Equal, a0, Imm32(ResumeFromException::RESUME_FORCED_RETURN), &return_); asMasm().branch32(Assembler::Equal, a0, Imm32(ResumeFromException::RESUME_FINALLY), &finally);
branch32(Assembler::Equal, a0, Imm32(ResumeFromException::RESUME_BAILOUT), &bailout); asMasm().branch32(Assembler::Equal, a0, Imm32(ResumeFromException::RESUME_FORCED_RETURN),
&return_);
asMasm().branch32(Assembler::Equal, a0, Imm32(ResumeFromException::RESUME_BAILOUT), &bailout);
breakpoint(); // Invalid kind. breakpoint(); // Invalid kind.
@ -2393,7 +2395,8 @@ MacroAssemblerMIPS64Compat::handleFailureWithHandlerTail(void* handler)
Label skipProfilingInstrumentation; Label skipProfilingInstrumentation;
// Test if profiler enabled. // Test if profiler enabled.
AbsoluteAddress addressOfEnabled(GetJitContext()->runtime->spsProfiler().addressOfEnabled()); AbsoluteAddress addressOfEnabled(GetJitContext()->runtime->spsProfiler().addressOfEnabled());
branch32(Assembler::Equal, addressOfEnabled, Imm32(0), &skipProfilingInstrumentation); asMasm().branch32(Assembler::Equal, addressOfEnabled, Imm32(0),
&skipProfilingInstrumentation);
profilerExitFrame(); profilerExitFrame();
bind(&skipProfilingInstrumentation); bind(&skipProfilingInstrumentation);
} }

View File

@ -424,38 +424,6 @@ class MacroAssemblerMIPS64Compat : public MacroAssemblerMIPS64
void branchTestBoolean(Condition cond, const Address& address, Label* label); void branchTestBoolean(Condition cond, const Address& address, Label* label);
void branchTestBoolean(Condition cond, const BaseIndex& src, Label* label); void branchTestBoolean(Condition cond, const BaseIndex& src, Label* label);
void branch32(Condition cond, Register lhs, Register rhs, Label* label) {
ma_b(lhs, rhs, label, cond);
}
void branch32(Condition cond, Register lhs, Imm32 imm, Label* label) {
ma_b(lhs, imm, label, cond);
}
void branch32(Condition cond, const Operand& lhs, Register rhs, Label* label) {
if (lhs.getTag() == Operand::REG) {
ma_b(lhs.toReg(), rhs, label, cond);
} else {
branch32(cond, lhs.toAddress(), rhs, label);
}
}
void branch32(Condition cond, const Operand& lhs, Imm32 rhs, Label* label) {
if (lhs.getTag() == Operand::REG) {
ma_b(lhs.toReg(), rhs, label, cond);
} else {
branch32(cond, lhs.toAddress(), rhs, label);
}
}
void branch32(Condition cond, const Address& lhs, Register rhs, Label* label) {
load32(lhs, SecondScratchReg);
ma_b(SecondScratchReg, rhs, label, cond);
}
void branch32(Condition cond, const Address& lhs, Imm32 rhs, Label* label) {
load32(lhs, SecondScratchReg);
ma_b(SecondScratchReg, rhs, label, cond);
}
void branch32(Condition cond, const BaseIndex& lhs, Imm32 rhs, Label* label) {
load32(lhs, SecondScratchReg);
ma_b(SecondScratchReg, rhs, label, cond);
}
void branchTestDouble(Condition cond, const ValueOperand& value, Label* label); void branchTestDouble(Condition cond, const ValueOperand& value, Label* label);
void branchTestDouble(Condition cond, Register tag, Label* label); void branchTestDouble(Condition cond, Register tag, Label* label);
@ -584,18 +552,6 @@ class MacroAssemblerMIPS64Compat : public MacroAssemblerMIPS64
bind(&skipJump); bind(&skipJump);
return off; return off;
} }
void branch32(Condition cond, AbsoluteAddress lhs, Imm32 rhs, Label* label) {
load32(lhs, SecondScratchReg);
ma_b(SecondScratchReg, rhs, label, cond);
}
void branch32(Condition cond, AbsoluteAddress lhs, Register rhs, Label* label) {
load32(lhs, SecondScratchReg);
ma_b(SecondScratchReg, rhs, label, cond);
}
void branch32(Condition cond, wasm::SymbolicAddress addr, Imm32 imm, Label* label) {
load32(addr, SecondScratchReg);
ma_b(SecondScratchReg, imm, label, cond);
}
template <typename T> template <typename T>
void loadUnboxedValue(const T& address, MIRType type, AnyRegister dest) { void loadUnboxedValue(const T& address, MIRType type, AnyRegister dest) {

View File

@ -244,7 +244,6 @@ class MacroAssemblerNone : public Assembler
template <typename T, typename S> void cmpPtrSet(Condition, T, S, Register) { MOZ_CRASH(); } template <typename T, typename S> void cmpPtrSet(Condition, T, S, Register) { MOZ_CRASH(); }
template <typename T, typename S> void cmp32Set(Condition, T, S, Register) { MOZ_CRASH(); } template <typename T, typename S> void cmp32Set(Condition, T, S, Register) { MOZ_CRASH(); }
template <typename T, typename S> void branch32(Condition, T, S, Label*) { MOZ_CRASH(); }
template <typename T, typename S, typename L> void branchTest32(Condition, T, S, L) { MOZ_CRASH(); } template <typename T, typename S, typename L> void branchTest32(Condition, T, S, L) { MOZ_CRASH(); }
template <typename T, typename S> void branchAdd32(Condition, T, S, Label*) { MOZ_CRASH(); } template <typename T, typename S> void branchAdd32(Condition, T, S, Label*) { MOZ_CRASH(); }
template <typename T, typename S> void branchSub32(Condition, T, S, Label*) { MOZ_CRASH(); } template <typename T, typename S> void branchSub32(Condition, T, S, Label*) { MOZ_CRASH(); }

View File

@ -222,6 +222,37 @@ MacroAssembler::rshift64(Imm32 imm, Register64 dest)
// =============================================================== // ===============================================================
// Branch functions // Branch functions
void
MacroAssembler::branch32(Condition cond, const AbsoluteAddress& lhs, Register rhs, Label* label)
{
if (X86Encoding::IsAddressImmediate(lhs.addr)) {
branch32(cond, Operand(lhs), rhs, label);
} else {
ScratchRegisterScope scratch(*this);
mov(ImmPtr(lhs.addr), scratch);
branch32(cond, Address(scratch, 0), rhs, label);
}
}
void
MacroAssembler::branch32(Condition cond, const AbsoluteAddress& lhs, Imm32 rhs, Label* label)
{
if (X86Encoding::IsAddressImmediate(lhs.addr)) {
branch32(cond, Operand(lhs), rhs, label);
} else {
ScratchRegisterScope scratch(*this);
mov(ImmPtr(lhs.addr), scratch);
branch32(cond, Address(scratch, 0), rhs, label);
}
}
void
MacroAssembler::branch32(Condition cond, wasm::SymbolicAddress lhs, Imm32 rhs, Label* label)
{
ScratchRegisterScope scratch(*this);
mov(lhs, scratch);
branch32(cond, Address(scratch, 0), rhs, label);
}
void void
MacroAssembler::branchPtr(Condition cond, const AbsoluteAddress& lhs, Register rhs, Label* label) MacroAssembler::branchPtr(Condition cond, const AbsoluteAddress& lhs, Register rhs, Label* label)
{ {

View File

@ -159,11 +159,11 @@ MacroAssemblerX64::handleFailureWithHandlerTail(void* handler)
Label bailout; Label bailout;
loadPtr(Address(rsp, offsetof(ResumeFromException, kind)), rax); loadPtr(Address(rsp, offsetof(ResumeFromException, kind)), rax);
branch32(Assembler::Equal, rax, Imm32(ResumeFromException::RESUME_ENTRY_FRAME), &entryFrame); asMasm().branch32(Assembler::Equal, rax, Imm32(ResumeFromException::RESUME_ENTRY_FRAME), &entryFrame);
branch32(Assembler::Equal, rax, Imm32(ResumeFromException::RESUME_CATCH), &catch_); asMasm().branch32(Assembler::Equal, rax, Imm32(ResumeFromException::RESUME_CATCH), &catch_);
branch32(Assembler::Equal, rax, Imm32(ResumeFromException::RESUME_FINALLY), &finally); asMasm().branch32(Assembler::Equal, rax, Imm32(ResumeFromException::RESUME_FINALLY), &finally);
branch32(Assembler::Equal, rax, Imm32(ResumeFromException::RESUME_FORCED_RETURN), &return_); asMasm().branch32(Assembler::Equal, rax, Imm32(ResumeFromException::RESUME_FORCED_RETURN), &return_);
branch32(Assembler::Equal, rax, Imm32(ResumeFromException::RESUME_BAILOUT), &bailout); asMasm().branch32(Assembler::Equal, rax, Imm32(ResumeFromException::RESUME_BAILOUT), &bailout);
breakpoint(); // Invalid kind. breakpoint(); // Invalid kind.
@ -210,7 +210,7 @@ MacroAssemblerX64::handleFailureWithHandlerTail(void* handler)
{ {
Label skipProfilingInstrumentation; Label skipProfilingInstrumentation;
AbsoluteAddress addressOfEnabled(GetJitContext()->runtime->spsProfiler().addressOfEnabled()); AbsoluteAddress addressOfEnabled(GetJitContext()->runtime->spsProfiler().addressOfEnabled());
branch32(Assembler::Equal, addressOfEnabled, Imm32(0), &skipProfilingInstrumentation); asMasm().branch32(Assembler::Equal, addressOfEnabled, Imm32(0), &skipProfilingInstrumentation);
profilerExitFrame(); profilerExitFrame();
bind(&skipProfilingInstrumentation); bind(&skipProfilingInstrumentation);
} }

View File

@ -42,7 +42,6 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared
void bindOffsets(const MacroAssemblerX86Shared::UsesVector&); void bindOffsets(const MacroAssemblerX86Shared::UsesVector&);
public: public:
using MacroAssemblerX86Shared::branch32;
using MacroAssemblerX86Shared::branchTest32; using MacroAssemblerX86Shared::branchTest32;
using MacroAssemblerX86Shared::load32; using MacroAssemblerX86Shared::load32;
using MacroAssemblerX86Shared::store32; using MacroAssemblerX86Shared::store32;
@ -528,29 +527,6 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared
// Common interface. // Common interface.
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
void branch32(Condition cond, AbsoluteAddress lhs, Imm32 rhs, Label* label) {
if (X86Encoding::IsAddressImmediate(lhs.addr)) {
branch32(cond, Operand(lhs), rhs, label);
} else {
ScratchRegisterScope scratch(asMasm());
mov(ImmPtr(lhs.addr), scratch);
branch32(cond, Address(scratch, 0), rhs, label);
}
}
void branch32(Condition cond, wasm::SymbolicAddress lhs, Imm32 rhs, Label* label) {
ScratchRegisterScope scratch(asMasm());
mov(lhs, scratch);
branch32(cond, Address(scratch, 0), rhs, label);
}
void branch32(Condition cond, AbsoluteAddress lhs, Register rhs, Label* label) {
if (X86Encoding::IsAddressImmediate(lhs.addr)) {
branch32(cond, Operand(lhs), rhs, label);
} else {
ScratchRegisterScope scratch(asMasm());
mov(ImmPtr(lhs.addr), scratch);
branch32(cond, Address(scratch, 0), rhs, label);
}
}
void branchTest32(Condition cond, AbsoluteAddress address, Imm32 imm, Label* label) { void branchTest32(Condition cond, AbsoluteAddress address, Imm32 imm, Label* label) {
if (X86Encoding::IsAddressImmediate(address.addr)) { if (X86Encoding::IsAddressImmediate(address.addr)) {
test32(Operand(address), imm); test32(Operand(address), imm);

View File

@ -183,6 +183,62 @@ MacroAssembler::negateDouble(FloatRegister reg)
// =============================================================== // ===============================================================
// Branch instructions // Branch instructions
void
MacroAssembler::branch32(Condition cond, Register lhs, Register rhs, Label* label)
{
cmp32(lhs, rhs);
j(cond, label);
}
void
MacroAssembler::branch32(Condition cond, Register lhs, Imm32 rhs, Label* label)
{
cmp32(lhs, rhs);
j(cond, label);
}
void
MacroAssembler::branch32(Condition cond, const Address& lhs, Register rhs, Label* label)
{
cmp32(Operand(lhs), rhs);
j(cond, label);
}
void
MacroAssembler::branch32(Condition cond, const Address& lhs, Imm32 rhs, Label* label)
{
cmp32(Operand(lhs), rhs);
j(cond, label);
}
void
MacroAssembler::branch32(Condition cond, const BaseIndex& lhs, Register rhs, Label* label)
{
cmp32(Operand(lhs), rhs);
j(cond, label);
}
void
MacroAssembler::branch32(Condition cond, const BaseIndex& lhs, Imm32 rhs, Label* label)
{
cmp32(Operand(lhs), rhs);
j(cond, label);
}
void
MacroAssembler::branch32(Condition cond, const Operand& lhs, Register rhs, Label* label)
{
cmp32(lhs, rhs);
j(cond, label);
}
void
MacroAssembler::branch32(Condition cond, const Operand& lhs, Imm32 rhs, Label* label)
{
cmp32(lhs, rhs);
j(cond, label);
}
void void
MacroAssembler::branchPtr(Condition cond, Register lhs, Register rhs, Label* label) MacroAssembler::branchPtr(Condition cond, Register lhs, Register rhs, Label* label)
{ {

View File

@ -568,38 +568,6 @@ class MacroAssemblerX86Shared : public Assembler
cmpw(rhs, lhs); cmpw(rhs, lhs);
j(cond, label); j(cond, label);
} }
void branch32(Condition cond, const Operand& lhs, Register rhs, Label* label) {
cmp32(lhs, rhs);
j(cond, label);
}
void branch32(Condition cond, const Operand& lhs, Imm32 rhs, Label* label) {
cmp32(lhs, rhs);
j(cond, label);
}
void branch32(Condition cond, const Address& lhs, Register rhs, Label* label) {
cmp32(Operand(lhs), rhs);
j(cond, label);
}
void branch32(Condition cond, const Address& lhs, Imm32 imm, Label* label) {
cmp32(Operand(lhs), imm);
j(cond, label);
}
void branch32(Condition cond, const BaseIndex& lhs, Register rhs, Label* label) {
cmp32(Operand(lhs), rhs);
j(cond, label);
}
void branch32(Condition cond, const BaseIndex& lhs, Imm32 imm, Label* label) {
cmp32(Operand(lhs), imm);
j(cond, label);
}
void branch32(Condition cond, Register lhs, Imm32 imm, Label* label) {
cmp32(lhs, imm);
j(cond, label);
}
void branch32(Condition cond, Register lhs, Register rhs, Label* label) {
cmp32(lhs, rhs);
j(cond, label);
}
void branchTest16(Condition cond, Register lhs, Register rhs, Label* label) { void branchTest16(Condition cond, Register lhs, Register rhs, Label* label) {
testw(rhs, lhs); testw(rhs, lhs);
j(cond, label); j(cond, label);

View File

@ -258,6 +258,27 @@ MacroAssembler::rshift64(Imm32 imm, Register64 dest)
// =============================================================== // ===============================================================
// Branch functions // Branch functions
void
MacroAssembler::branch32(Condition cond, const AbsoluteAddress& lhs, Register rhs, Label* label)
{
cmp32(Operand(lhs), rhs);
j(cond, label);
}
void
MacroAssembler::branch32(Condition cond, const AbsoluteAddress& lhs, Imm32 rhs, Label* label)
{
cmp32(Operand(lhs), rhs);
j(cond, label);
}
void
MacroAssembler::branch32(Condition cond, wasm::SymbolicAddress lhs, Imm32 rhs, Label* label)
{
cmpl(rhs, lhs);
j(cond, label);
}
void void
MacroAssembler::branchPtr(Condition cond, const AbsoluteAddress& lhs, Register rhs, Label* label) MacroAssembler::branchPtr(Condition cond, const AbsoluteAddress& lhs, Register rhs, Label* label)
{ {

View File

@ -203,11 +203,13 @@ MacroAssemblerX86::handleFailureWithHandlerTail(void* handler)
Label bailout; Label bailout;
loadPtr(Address(esp, offsetof(ResumeFromException, kind)), eax); loadPtr(Address(esp, offsetof(ResumeFromException, kind)), eax);
branch32(Assembler::Equal, eax, Imm32(ResumeFromException::RESUME_ENTRY_FRAME), &entryFrame); asMasm().branch32(Assembler::Equal, eax, Imm32(ResumeFromException::RESUME_ENTRY_FRAME),
branch32(Assembler::Equal, eax, Imm32(ResumeFromException::RESUME_CATCH), &catch_); &entryFrame);
branch32(Assembler::Equal, eax, Imm32(ResumeFromException::RESUME_FINALLY), &finally); asMasm().branch32(Assembler::Equal, eax, Imm32(ResumeFromException::RESUME_CATCH), &catch_);
branch32(Assembler::Equal, eax, Imm32(ResumeFromException::RESUME_FORCED_RETURN), &return_); asMasm().branch32(Assembler::Equal, eax, Imm32(ResumeFromException::RESUME_FINALLY), &finally);
branch32(Assembler::Equal, eax, Imm32(ResumeFromException::RESUME_BAILOUT), &bailout); asMasm().branch32(Assembler::Equal, eax, Imm32(ResumeFromException::RESUME_FORCED_RETURN),
&return_);
asMasm().branch32(Assembler::Equal, eax, Imm32(ResumeFromException::RESUME_BAILOUT), &bailout);
breakpoint(); // Invalid kind. breakpoint(); // Invalid kind.
@ -255,7 +257,8 @@ MacroAssemblerX86::handleFailureWithHandlerTail(void* handler)
Label skipProfilingInstrumentation; Label skipProfilingInstrumentation;
// Test if profiler enabled. // Test if profiler enabled.
AbsoluteAddress addressOfEnabled(GetJitContext()->runtime->spsProfiler().addressOfEnabled()); AbsoluteAddress addressOfEnabled(GetJitContext()->runtime->spsProfiler().addressOfEnabled());
branch32(Assembler::Equal, addressOfEnabled, Imm32(0), &skipProfilingInstrumentation); asMasm().branch32(Assembler::Equal, addressOfEnabled, Imm32(0),
&skipProfilingInstrumentation);
profilerExitFrame(); profilerExitFrame();
bind(&skipProfilingInstrumentation); bind(&skipProfilingInstrumentation);
} }

View File

@ -50,7 +50,6 @@ class MacroAssemblerX86 : public MacroAssemblerX86Shared
void setupABICall(uint32_t args); void setupABICall(uint32_t args);
public: public:
using MacroAssemblerX86Shared::branch32;
using MacroAssemblerX86Shared::branchTest32; using MacroAssemblerX86Shared::branchTest32;
using MacroAssemblerX86Shared::load32; using MacroAssemblerX86Shared::load32;
using MacroAssemblerX86Shared::store32; using MacroAssemblerX86Shared::store32;
@ -552,18 +551,6 @@ class MacroAssemblerX86 : public MacroAssemblerX86Shared
// Common interface. // Common interface.
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
void branch32(Condition cond, AbsoluteAddress lhs, Imm32 rhs, Label* label) {
cmp32(Operand(lhs), rhs);
j(cond, label);
}
void branch32(Condition cond, wasm::SymbolicAddress lhs, Imm32 rhs, Label* label) {
cmpl(rhs, lhs);
j(cond, label);
}
void branch32(Condition cond, AbsoluteAddress lhs, Register rhs, Label* label) {
cmp32(Operand(lhs), rhs);
j(cond, label);
}
void branchTest32(Condition cond, AbsoluteAddress address, Imm32 imm, Label* label) { void branchTest32(Condition cond, AbsoluteAddress address, Imm32 imm, Label* label) {
test32(Operand(address), imm); test32(Operand(address), imm);
j(cond, label); j(cond, label);