mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-06 00:55:37 +00:00
Bug 1020429 - IonMonkey: Make MAsmJSCall a subclass of MVariadicInstruction r=nbp
This commit is contained in:
parent
e96dd3a631
commit
07c68191e4
@ -3040,7 +3040,7 @@ MAsmJSCall::New(TempAllocator &alloc, const CallSiteDesc &desc, Callee callee,
|
||||
for (size_t i = 0; i < call->argRegs_.length(); i++)
|
||||
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;
|
||||
// FixedList doesn't initialize its elements, so do an unchecked init.
|
||||
for (size_t i = 0; i < call->argRegs_.length(); i++)
|
||||
|
@ -10417,7 +10417,7 @@ class MAsmJSPassStackArg : public MUnaryInstruction
|
||||
}
|
||||
};
|
||||
|
||||
class MAsmJSCall MOZ_FINAL : public MInstruction
|
||||
class MAsmJSCall MOZ_FINAL : public MVariadicInstruction
|
||||
{
|
||||
public:
|
||||
class Callee {
|
||||
@ -10442,34 +10442,15 @@ class MAsmJSCall MOZ_FINAL : public MInstruction
|
||||
};
|
||||
|
||||
private:
|
||||
struct Operand {
|
||||
AnyRegister reg;
|
||||
MUse use;
|
||||
};
|
||||
|
||||
CallSiteDesc desc_;
|
||||
Callee callee_;
|
||||
FixedList<MUse> operands_;
|
||||
FixedList<AnyRegister> argRegs_;
|
||||
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)
|
||||
: 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:
|
||||
INSTRUCTION_HEADER(AsmJSCall);
|
||||
|
||||
@ -10483,21 +10464,6 @@ class MAsmJSCall MOZ_FINAL : public MInstruction
|
||||
static MAsmJSCall *New(TempAllocator &alloc, const CallSiteDesc &desc, Callee callee,
|
||||
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 {
|
||||
return argRegs_.length();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user