Bug 1020429 - IonMonkey: Make MAsmJSCall a subclass of MVariadicInstruction r=nbp

This commit is contained in:
Dan Gohman 2014-06-12 15:47:36 -07:00
parent e96dd3a631
commit 07c68191e4
2 changed files with 2 additions and 36 deletions

View File

@ -3040,7 +3040,7 @@ MAsmJSCall::New(TempAllocator &alloc, const CallSiteDesc &desc, Callee callee,
for (size_t i = 0; i < call->argRegs_.length(); i++) for (size_t i = 0; i < call->argRegs_.length(); i++)
call->argRegs_[i] = args[i].reg; call->argRegs_[i] = args[i].reg;
if (!call->operands_.init(alloc, call->argRegs_.length() + (callee.which() == Callee::Dynamic ? 1 : 0))) if (!call->init(alloc, call->argRegs_.length() + (callee.which() == Callee::Dynamic ? 1 : 0)))
return nullptr; return nullptr;
// FixedList doesn't initialize its elements, so do an unchecked init. // FixedList doesn't initialize its elements, so do an unchecked init.
for (size_t i = 0; i < call->argRegs_.length(); i++) for (size_t i = 0; i < call->argRegs_.length(); i++)

View File

@ -10417,7 +10417,7 @@ class MAsmJSPassStackArg : public MUnaryInstruction
} }
}; };
class MAsmJSCall MOZ_FINAL : public MInstruction class MAsmJSCall MOZ_FINAL : public MVariadicInstruction
{ {
public: public:
class Callee { class Callee {
@ -10442,34 +10442,15 @@ class MAsmJSCall MOZ_FINAL : public MInstruction
}; };
private: private:
struct Operand {
AnyRegister reg;
MUse use;
};
CallSiteDesc desc_; CallSiteDesc desc_;
Callee callee_; Callee callee_;
FixedList<MUse> operands_;
FixedList<AnyRegister> argRegs_; FixedList<AnyRegister> argRegs_;
size_t spIncrement_; size_t spIncrement_;
void initOperand(size_t index, MDefinition *operand) {
// FixedList doesn't initialize its elements, so do an unchecked init.
operands_[index].initUnchecked(operand, this);
}
MAsmJSCall(const CallSiteDesc &desc, Callee callee, size_t spIncrement) MAsmJSCall(const CallSiteDesc &desc, Callee callee, size_t spIncrement)
: desc_(desc), callee_(callee), spIncrement_(spIncrement) : desc_(desc), callee_(callee), spIncrement_(spIncrement)
{ } { }
protected:
MUse *getUseFor(size_t index) {
return &operands_[index];
}
const MUse *getUseFor(size_t index) const {
return &operands_[index];
}
public: public:
INSTRUCTION_HEADER(AsmJSCall); INSTRUCTION_HEADER(AsmJSCall);
@ -10483,21 +10464,6 @@ class MAsmJSCall MOZ_FINAL : public MInstruction
static MAsmJSCall *New(TempAllocator &alloc, const CallSiteDesc &desc, Callee callee, static MAsmJSCall *New(TempAllocator &alloc, const CallSiteDesc &desc, Callee callee,
const Args &args, MIRType resultType, size_t spIncrement); const Args &args, MIRType resultType, size_t spIncrement);
size_t numOperands() const {
return operands_.length();
}
size_t indexOf(const MUse *u) const MOZ_FINAL MOZ_OVERRIDE {
MOZ_ASSERT(u >= &operands_[0]);
MOZ_ASSERT(u <= &operands_[numOperands() - 1]);
return u - &operands_[0];
}
void replaceOperand(size_t index, MDefinition *operand) MOZ_FINAL MOZ_OVERRIDE {
operands_[index].replaceProducer(operand);
}
MDefinition *getOperand(size_t index) const {
JS_ASSERT(index < numOperands());
return operands_[index].producer();
}
size_t numArgs() const { size_t numArgs() const {
return argRegs_.length(); return argRegs_.length();
} }