mirror of
https://github.com/classilla/tenfourfox.git
synced 2024-05-28 20:41:33 +00:00
Bug 1071646 - Support JSOP_BINDVAR in Ion. (r=jandem)
This commit is contained in:
parent
c283022810
commit
d05f77998c
|
@ -158,6 +158,7 @@ BytecodeAnalysis::init(TempAllocator& alloc, GSNCache& gsn)
|
|||
|
||||
case JSOP_GETNAME:
|
||||
case JSOP_BINDNAME:
|
||||
case JSOP_BINDVAR:
|
||||
case JSOP_SETNAME:
|
||||
case JSOP_STRICTSETNAME:
|
||||
case JSOP_DELNAME:
|
||||
|
|
|
@ -9050,6 +9050,16 @@ CodeGenerator::visitOutOfLineUnboxFloatingPoint(OutOfLineUnboxFloatingPoint* ool
|
|||
masm.jump(ool->rejoin());
|
||||
}
|
||||
|
||||
typedef JSObject* (*BindVarFn)(JSContext*, HandleObject);
|
||||
static const VMFunction BindVarInfo = FunctionInfo<BindVarFn>(jit::BindVar);
|
||||
|
||||
void
|
||||
CodeGenerator::visitCallBindVar(LCallBindVar* lir)
|
||||
{
|
||||
pushArg(ToRegister(lir->scopeChain()));
|
||||
callVM(BindVarInfo, lir);
|
||||
}
|
||||
|
||||
typedef bool (*GetPropertyFn)(JSContext*, HandleValue, HandlePropertyName, MutableHandleValue);
|
||||
static const VMFunction GetPropertyInfo = FunctionInfo<GetPropertyFn>(GetProperty);
|
||||
|
||||
|
|
|
@ -331,6 +331,7 @@ class CodeGenerator : public CodeGeneratorSpecific
|
|||
void visitSetDOMProperty(LSetDOMProperty* lir);
|
||||
void visitCallDOMNative(LCallDOMNative* lir);
|
||||
void visitCallGetIntrinsicValue(LCallGetIntrinsicValue* lir);
|
||||
void visitCallBindVar(LCallBindVar* lir);
|
||||
void visitIsCallable(LIsCallable* lir);
|
||||
void visitOutOfLineIsCallable(OutOfLineIsCallable* ool);
|
||||
void visitIsObject(LIsObject* lir);
|
||||
|
|
|
@ -1947,6 +1947,9 @@ IonBuilder::inspectOpcode(JSOp op)
|
|||
case JSOP_BINDNAME:
|
||||
return jsop_bindname(info().getName(pc));
|
||||
|
||||
case JSOP_BINDVAR:
|
||||
return jsop_bindvar();
|
||||
|
||||
case JSOP_DUP:
|
||||
current->pushSlot(current->stackDepth() - 1);
|
||||
return true;
|
||||
|
@ -8425,6 +8428,16 @@ IonBuilder::jsop_bindname(PropertyName* name)
|
|||
return resumeAfter(ins);
|
||||
}
|
||||
|
||||
bool
|
||||
IonBuilder::jsop_bindvar()
|
||||
{
|
||||
MOZ_ASSERT(analysis().usesScopeChain());
|
||||
MCallBindVar* ins = MCallBindVar::New(alloc(), current->scopeChain());
|
||||
current->add(ins);
|
||||
current->push(ins);
|
||||
return true;
|
||||
}
|
||||
|
||||
static MIRType
|
||||
GetElemKnownType(bool needsHoleCheck, TemporaryTypeSet* types)
|
||||
{
|
||||
|
|
|
@ -3368,6 +3368,16 @@ LIRGenerator::visitBindNameCache(MBindNameCache* ins)
|
|||
assignSafepoint(lir, ins);
|
||||
}
|
||||
|
||||
void
|
||||
LIRGenerator::visitCallBindVar(MCallBindVar* ins)
|
||||
{
|
||||
MOZ_ASSERT(ins->scopeChain()->type() == MIRType_Object);
|
||||
MOZ_ASSERT(ins->type() == MIRType_Object);
|
||||
|
||||
LCallBindVar* lir = new(alloc()) LCallBindVar(useRegister(ins->scopeChain()));
|
||||
define(lir, ins);
|
||||
}
|
||||
|
||||
void
|
||||
LIRGenerator::visitGuardObjectIdentity(MGuardObjectIdentity* ins)
|
||||
{
|
||||
|
|
|
@ -232,6 +232,7 @@ class LIRGenerator : public LIRGeneratorSpecific
|
|||
void visitGetPropertyPolymorphic(MGetPropertyPolymorphic* ins);
|
||||
void visitSetPropertyPolymorphic(MSetPropertyPolymorphic* ins);
|
||||
void visitBindNameCache(MBindNameCache* ins);
|
||||
void visitCallBindVar(MCallBindVar* ins);
|
||||
void visitGuardObjectIdentity(MGuardObjectIdentity* ins);
|
||||
void visitGuardClass(MGuardClass* ins);
|
||||
void visitGuardObject(MGuardObject* ins);
|
||||
|
|
|
@ -10819,6 +10819,39 @@ class MBindNameCache
|
|||
}
|
||||
};
|
||||
|
||||
class MCallBindVar
|
||||
: public MUnaryInstruction,
|
||||
public SingleObjectPolicy::Data
|
||||
{
|
||||
explicit MCallBindVar(MDefinition* scopeChain)
|
||||
: MUnaryInstruction(scopeChain)
|
||||
{
|
||||
setResultType(MIRType_Object);
|
||||
setMovable();
|
||||
}
|
||||
|
||||
public:
|
||||
INSTRUCTION_HEADER(CallBindVar)
|
||||
|
||||
static MCallBindVar* New(TempAllocator& alloc, MDefinition* scopeChain) {
|
||||
return new(alloc) MCallBindVar(scopeChain);
|
||||
}
|
||||
|
||||
MDefinition* scopeChain() const {
|
||||
return getOperand(0);
|
||||
}
|
||||
|
||||
bool congruentTo(const MDefinition* ins) const override {
|
||||
if (!ins->isCallBindVar())
|
||||
return false;
|
||||
return congruentIfOperandsEqual(ins);
|
||||
}
|
||||
|
||||
AliasSet getAliasSet() const override {
|
||||
return AliasSet::None();
|
||||
}
|
||||
};
|
||||
|
||||
// Guard on an object's shape.
|
||||
class MGuardShape
|
||||
: public MUnaryInstruction,
|
||||
|
|
|
@ -162,6 +162,7 @@ namespace jit {
|
|||
_(GetPropertyPolymorphic) \
|
||||
_(SetPropertyPolymorphic) \
|
||||
_(BindNameCache) \
|
||||
_(CallBindVar) \
|
||||
_(GuardShape) \
|
||||
_(GuardReceiverPolymorphic) \
|
||||
_(GuardObjectGroup) \
|
||||
|
|
|
@ -173,6 +173,7 @@ BindVar(JSContext* cx, HandleObject scopeChain)
|
|||
JSObject* obj = scopeChain;
|
||||
while (!obj->isQualifiedVarObj())
|
||||
obj = obj->enclosingScope();
|
||||
MOZ_ASSERT(obj);
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
|
|
@ -5774,6 +5774,22 @@ class LBindNameCache : public LInstructionHelper<1, 1, 0>
|
|||
}
|
||||
};
|
||||
|
||||
class LCallBindVar : public LInstructionHelper<1, 1, 0>
|
||||
{
|
||||
public:
|
||||
LIR_HEADER(CallBindVar)
|
||||
|
||||
explicit LCallBindVar(const LAllocation& scopeChain) {
|
||||
setOperand(0, scopeChain);
|
||||
}
|
||||
const LAllocation* scopeChain() {
|
||||
return getOperand(0);
|
||||
}
|
||||
const MCallBindVar* mir() const {
|
||||
return mir_->toCallBindVar();
|
||||
}
|
||||
};
|
||||
|
||||
// Load a value from an object's dslots or a slots vector.
|
||||
class LLoadSlotV : public LInstructionHelper<BOX_PIECES, 1, 0>
|
||||
{
|
||||
|
|
|
@ -277,6 +277,7 @@
|
|||
_(GetPropertyPolymorphicV) \
|
||||
_(GetPropertyPolymorphicT) \
|
||||
_(BindNameCache) \
|
||||
_(CallBindVar) \
|
||||
_(CallGetProperty) \
|
||||
_(GetNameCache) \
|
||||
_(CallGetIntrinsicValue) \
|
||||
|
|
Loading…
Reference in New Issue
Block a user