public:
LIR_HEADER(WasmUint32ToDouble)
- LWasmUint32ToDouble(const LAllocation& input) {
+ LWasmUint32ToDouble(const LAllocation& input)
+ : LInstructionHelper(classOpcode)
+ {
setOperand(0, input);
}
};
public:
LIR_HEADER(WasmUint32ToFloat32)
- LWasmUint32ToFloat32(const LAllocation& input) {
+ LWasmUint32ToFloat32(const LAllocation& input)
+ : LInstructionHelper(classOpcode)
+ {
setOperand(0, input);
}
};
public:
LIR_HEADER(DivI);
- LDivI(const LAllocation& lhs, const LAllocation& rhs,
- const LDefinition& temp) {
+ LDivI(const LAllocation& lhs, const LAllocation& rhs, const LDefinition& temp)
+ : LBinaryMath(classOpcode)
+ {
setOperand(0, lhs);
setOperand(1, rhs);
setTemp(0, temp);
LIR_HEADER(DivPowTwoI)
LDivPowTwoI(const LAllocation& lhs, int32_t shift, const LDefinition& temp)
- : shift_(shift)
+ : LInstructionHelper(classOpcode),
+ shift_(shift)
{
setOperand(0, lhs);
setTemp(0, temp);
const LAllocation* numerator() {
return getOperand(0);
}
-
- int32_t shift() {
+ int32_t shift() const {
return shift_;
}
-
MDiv* mir() const {
return mir_->toDiv();
}
public:
LIR_HEADER(ModI);
- LModI(const LAllocation& lhs, const LAllocation& rhs,
- const LDefinition& callTemp)
+ LModI(const LAllocation& lhs, const LAllocation& rhs, const LDefinition& callTemp)
+ : LBinaryMath(classOpcode)
{
setOperand(0, lhs);
setOperand(1, rhs);
const LDefinition* callTemp() {
return getTemp(0);
}
-
MMod* mir() const {
return mir_->toMod();
}
public:
LIR_HEADER(ModPowTwoI);
- int32_t shift()
- {
- return shift_;
- }
LModPowTwoI(const LAllocation& lhs, int32_t shift)
- : shift_(shift)
+ : LInstructionHelper(classOpcode),
+ shift_(shift)
{
setOperand(0, lhs);
}
+ int32_t shift() const {
+ return shift_;
+ }
MMod* mir() const {
return mir_->toMod();
}
LModMaskI(const LAllocation& lhs, const LDefinition& temp0, const LDefinition& temp1,
int32_t shift)
- : shift_(shift)
+ : LInstructionHelper(classOpcode),
+ shift_(shift)
{
setOperand(0, lhs);
setTemp(0, temp0);
int32_t shift() const {
return shift_;
}
-
MMod* mir() const {
return mir_->toMod();
}
LIR_HEADER(TableSwitch);
LTableSwitch(const LAllocation& in, const LDefinition& inputCopy,
- const LDefinition& jumpTablePointer, MTableSwitch* ins) {
+ const LDefinition& jumpTablePointer, MTableSwitch* ins)
+ : LInstructionHelper(classOpcode)
+ {
setOperand(0, in);
setTemp(0, inputCopy);
setTemp(1, jumpTablePointer);
MTableSwitch* mir() const {
return mir_->toTableSwitch();
}
-
const LAllocation* index() {
return getOperand(0);
}
LTableSwitchV(const LBoxAllocation& input, const LDefinition& inputCopy,
const LDefinition& floatCopy, const LDefinition& jumpTablePointer,
MTableSwitch* ins)
+ : LInstructionHelper(classOpcode)
{
setBoxOperand(InputValue, input);
setTemp(0, inputCopy);
public:
LIR_HEADER(MulI);
+ LMulI()
+ : LBinaryMath(classOpcode)
+ {}
+
MMul* mir() {
return mir_->toMul();
}
public:
LIR_HEADER(UDivOrMod);
+ LUDivOrMod()
+ : LBinaryMath(classOpcode)
+ {}
+
MBinaryArithInstruction* mir() const {
MOZ_ASSERT(mir_->isDiv() || mir_->isMod());
return static_cast<MBinaryArithInstruction*>(mir_);
public:
typedef LWasmLoadBase<NumDefs, 2> Base;
- explicit LWasmUnalignedLoadBase(const LAllocation& ptr, const LDefinition& valueHelper)
- : Base(ptr, LAllocation())
+ explicit LWasmUnalignedLoadBase(LNode::Opcode opcode, const LAllocation& ptr,
+ const LDefinition& valueHelper)
+ : Base(opcode, ptr, LAllocation())
{
Base::setTemp(0, LDefinition::BogusTemp());
Base::setTemp(1, valueHelper);
}
+
const LAllocation* ptr() {
return Base::getOperand(0);
}
class LWasmUnalignedLoad : public details::LWasmUnalignedLoadBase<1>
{
public:
+ LIR_HEADER(WasmUnalignedLoad);
+
explicit LWasmUnalignedLoad(const LAllocation& ptr, const LDefinition& valueHelper)
- : LWasmUnalignedLoadBase(ptr, valueHelper)
+ : LWasmUnalignedLoadBase(classOpcode, ptr, valueHelper)
{}
- LIR_HEADER(WasmUnalignedLoad);
};
class LWasmUnalignedLoadI64 : public details::LWasmUnalignedLoadBase<INT64_PIECES>
{
public:
+ LIR_HEADER(WasmUnalignedLoadI64);
+
explicit LWasmUnalignedLoadI64(const LAllocation& ptr, const LDefinition& valueHelper)
- : LWasmUnalignedLoadBase(ptr, valueHelper)
+ : LWasmUnalignedLoadBase(classOpcode, ptr, valueHelper)
{}
- LIR_HEADER(WasmUnalignedLoadI64);
};
namespace details {
static const size_t PtrIndex = 0;
static const size_t ValueIndex = 1;
- LWasmUnalignedStoreBase(const LAllocation& ptr, const LDefinition& valueHelper)
+ LWasmUnalignedStoreBase(LNode::Opcode opcode, const LAllocation& ptr,
+ const LDefinition& valueHelper)
+ : Base(opcode)
{
Base::setOperand(0, ptr);
Base::setTemp(0, LDefinition::BogusTemp());
Base::setTemp(1, valueHelper);
}
+
MWasmStore* mir() const {
return Base::mir_->toWasmStore();
}
{
public:
LIR_HEADER(WasmUnalignedStore);
+
LWasmUnalignedStore(const LAllocation& ptr, const LAllocation& value,
const LDefinition& valueHelper)
- : LWasmUnalignedStoreBase(ptr, valueHelper)
+ : LWasmUnalignedStoreBase(classOpcode, ptr, valueHelper)
{
setOperand(1, value);
}
+
const LAllocation* value() {
return Base::getOperand(ValueIndex);
}
LIR_HEADER(WasmUnalignedStoreI64);
LWasmUnalignedStoreI64(const LAllocation& ptr, const LInt64Allocation& value,
const LDefinition& valueHelper)
- : LWasmUnalignedStoreBase(ptr, valueHelper)
+ : LWasmUnalignedStoreBase(classOpcode, ptr, valueHelper)
{
setInt64Operand(1, value);
}
+
const LInt64Allocation value() {
return getInt64Operand(ValueIndex);
}
public:
LIR_HEADER(WasmCompareExchangeI64);
- LWasmCompareExchangeI64(const LAllocation& ptr, const LInt64Allocation& oldValue, const LInt64Allocation& newValue)
+ LWasmCompareExchangeI64(const LAllocation& ptr, const LInt64Allocation& oldValue,
+ const LInt64Allocation& newValue)
+ : LInstructionHelper(classOpcode)
{
setOperand(0, ptr);
setInt64Operand(1, oldValue);
LIR_HEADER(WasmAtomicExchangeI64);
LWasmAtomicExchangeI64(const LAllocation& ptr, const LInt64Allocation& value)
+ : LInstructionHelper(classOpcode)
{
setOperand(0, ptr);
setInt64Operand(1, value);
LIR_HEADER(WasmAtomicBinopI64);
LWasmAtomicBinopI64(const LAllocation& ptr, const LInt64Allocation& value)
+ : LInstructionHelper(classOpcode)
{
setOperand(0, ptr);
setInt64Operand(1, value);
const LInt64Allocation value() {
return getInt64Operand(1);
}
-
const MWasmAtomicBinopHeap* mir() const {
return mir_->toWasmAtomicBinopHeap();
}
LIR_HEADER(BoxFloatingPoint);
LBoxFloatingPoint(const LAllocation& in, const LDefinition& temp, MIRType type)
- : type_(type)
+ : LInstructionHelper(classOpcode),
+ type_(type)
{
setOperand(0, in);
setTemp(0, temp);
public:
LIR_HEADER(Unbox);
+ LUnbox()
+ : LInstructionHelper(classOpcode)
+ {}
+
MUnbox* mir() const {
return mir_->toUnbox();
}
static const size_t Input = 0;
LUnboxFloatingPoint(const LBoxAllocation& input, MIRType type)
- : type_(type)
+ : LInstructionHelper(classOpcode),
+ type_(type)
{
setBoxOperand(Input, input);
}
MUnbox* mir() const {
return mir_->toUnbox();
}
-
MIRType type() const {
return type_;
}
static const size_t Rhs = INT64_PIECES;
LDivOrModI64(const LInt64Allocation& lhs, const LInt64Allocation& rhs)
+ : LCallInstructionHelper(classOpcode)
{
setInt64Operand(Lhs, lhs);
setInt64Operand(Rhs, rhs);
}
+
MBinaryArithInstruction* mir() const {
MOZ_ASSERT(mir_->isDiv() || mir_->isMod());
return static_cast<MBinaryArithInstruction*>(mir_);
}
+
bool canBeDivideByZero() const {
if (mir_->isMod())
return mir_->toMod()->canBeDivideByZero();
static const size_t Rhs = INT64_PIECES;
LUDivOrModI64(const LInt64Allocation& lhs, const LInt64Allocation& rhs)
+ : LCallInstructionHelper(classOpcode)
{
setInt64Operand(Lhs, lhs);
setInt64Operand(Rhs, rhs);
MOZ_ASSERT(mir_->isDiv() || mir_->isMod());
return static_cast<MBinaryArithInstruction*>(mir_);
}
+
bool canBeDivideByZero() const {
if (mir_->isMod())
return mir_->toMod()->canBeDivideByZero();
LIR_HEADER(WasmTruncateToInt64);
explicit LWasmTruncateToInt64(const LAllocation& in)
+ : LCallInstructionHelper(classOpcode)
{
setOperand(0, in);
}
public:
LIR_HEADER(Int64ToFloatingPoint);
- explicit LInt64ToFloatingPoint(const LInt64Allocation& in) {
+ explicit LInt64ToFloatingPoint(const LInt64Allocation& in)
+ : LCallInstructionHelper(classOpcode)
+ {
setInt64Operand(0, in);
}
LIR_HEADER(WasmAtomicLoadI64);
LWasmAtomicLoadI64(const LAllocation& ptr)
+ : LInstructionHelper(classOpcode)
{
setOperand(0, ptr);
}
public:
LIR_HEADER(WasmAtomicStoreI64);
- LWasmAtomicStoreI64(const LAllocation& ptr, const LInt64Allocation& value, const LDefinition& tmp)
+ LWasmAtomicStoreI64(const LAllocation& ptr, const LInt64Allocation& value,
+ const LDefinition& tmp)
+ : LInstructionHelper(classOpcode)
{
setOperand(0, ptr);
setInt64Operand(1, value);
class LUnbox : public LInstructionHelper<1, 1, 0>
{
+ protected:
+ LUnbox(LNode::Opcode opcode, const LAllocation& input)
+ : LInstructionHelper(opcode)
+ {
+ setOperand(0, input);
+ }
+
public:
LIR_HEADER(Unbox);
- explicit LUnbox(const LAllocation& input) {
+ explicit LUnbox(const LAllocation& input)
+ : LInstructionHelper(classOpcode)
+ {
setOperand(0, input);
}
LIR_HEADER(UnboxFloatingPoint);
LUnboxFloatingPoint(const LAllocation& input, MIRType type)
- : LUnbox(input),
+ : LUnbox(classOpcode, input),
type_(type)
{ }
public:
LIR_HEADER(DivOrModI64)
- LDivOrModI64(const LAllocation& lhs, const LAllocation& rhs, const LDefinition& temp) {
+ LDivOrModI64(const LAllocation& lhs, const LAllocation& rhs, const LDefinition& temp)
+ : LBinaryMath(classOpcode)
+ {
setOperand(0, lhs);
setOperand(1, rhs);
setTemp(0, temp);
const LDefinition* remainder() {
return getTemp(0);
}
-
MBinaryArithInstruction* mir() const {
MOZ_ASSERT(mir_->isDiv() || mir_->isMod());
return static_cast<MBinaryArithInstruction*>(mir_);
}
+
bool canBeDivideByZero() const {
if (mir_->isMod())
return mir_->toMod()->canBeDivideByZero();
public:
LIR_HEADER(UDivOrModI64);
- LUDivOrModI64(const LAllocation& lhs, const LAllocation& rhs, const LDefinition& temp) {
+ LUDivOrModI64(const LAllocation& lhs, const LAllocation& rhs, const LDefinition& temp)
+ : LBinaryMath(classOpcode)
+ {
setOperand(0, lhs);
setOperand(1, rhs);
setTemp(0, temp);
const LDefinition* remainder() {
return getTemp(0);
}
-
const char* extraName() const {
return mir()->isTruncated() ? "Truncated" : nullptr;
}
MOZ_ASSERT(mir_->isDiv() || mir_->isMod());
return static_cast<MBinaryArithInstruction*>(mir_);
}
-
bool canBeDivideByZero() const {
if (mir_->isMod())
return mir_->toMod()->canBeDivideByZero();
public:
LIR_HEADER(WasmTruncateToInt64);
- explicit LWasmTruncateToInt64(const LAllocation& in) {
+ explicit LWasmTruncateToInt64(const LAllocation& in)
+ : LInstructionHelper(classOpcode)
+ {
setOperand(0, in);
}
public:
LIR_HEADER(Int64ToFloatingPoint);
- explicit LInt64ToFloatingPoint(const LInt64Allocation& in) {
+ explicit LInt64ToFloatingPoint(const LInt64Allocation& in)
+ : LInstructionHelper(classOpcode)
+ {
setInt64Operand(0, in);
}