зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1141865 - Part 4: Remove LCallDirectEvalV in anticipation of register pressure with new.target in eval frames. (r=jandem)
This commit is contained in:
Родитель
428d5f13c7
Коммит
65208f2037
|
@ -465,22 +465,6 @@ js::DirectEvalStringFromIon(JSContext* cx,
|
|||
NullFramePtr() /* evalInFrame */, vp.address());
|
||||
}
|
||||
|
||||
bool
|
||||
js::DirectEvalValueFromIon(JSContext* cx,
|
||||
HandleObject scopeobj, HandleScript callerScript,
|
||||
HandleValue thisValue, HandleValue evalArg,
|
||||
jsbytecode* pc, MutableHandleValue vp)
|
||||
{
|
||||
// Act as identity on non-strings per ES5 15.1.2.1 step 1.
|
||||
if (!evalArg.isString()) {
|
||||
vp.set(evalArg);
|
||||
return true;
|
||||
}
|
||||
|
||||
RootedString string(cx, evalArg.toString());
|
||||
return DirectEvalStringFromIon(cx, scopeobj, callerScript, thisValue, string, pc, vp);
|
||||
}
|
||||
|
||||
bool
|
||||
js::IndirectEval(JSContext* cx, unsigned argc, Value* vp)
|
||||
{
|
||||
|
|
|
@ -32,11 +32,6 @@ DirectEvalStringFromIon(JSContext* cx,
|
|||
HandleObject scopeObj, HandleScript callerScript,
|
||||
HandleValue thisValue, HandleString str,
|
||||
jsbytecode * pc, MutableHandleValue vp);
|
||||
extern bool
|
||||
DirectEvalValueFromIon(JSContext* cx,
|
||||
HandleObject scopeObj, HandleScript callerScript,
|
||||
HandleValue thisValue, HandleValue evalArg,
|
||||
jsbytecode * pc, MutableHandleValue vp);
|
||||
|
||||
// True iff fun is a built-in eval function.
|
||||
extern bool
|
||||
|
|
|
@ -3490,38 +3490,20 @@ typedef bool (*DirectEvalSFn)(JSContext*, HandleObject, HandleScript, HandleValu
|
|||
static const VMFunction DirectEvalStringInfo = FunctionInfo<DirectEvalSFn>(DirectEvalStringFromIon);
|
||||
|
||||
void
|
||||
CodeGenerator::visitCallDirectEvalS(LCallDirectEvalS* lir)
|
||||
CodeGenerator::visitCallDirectEval(LCallDirectEval* lir)
|
||||
{
|
||||
Register scopeChain = ToRegister(lir->getScopeChain());
|
||||
Register string = ToRegister(lir->getString());
|
||||
|
||||
pushArg(ImmPtr(lir->mir()->pc()));
|
||||
pushArg(string);
|
||||
pushArg(ToValue(lir, LCallDirectEvalS::ThisValue));
|
||||
pushArg(ToValue(lir, LCallDirectEval::ThisValue));
|
||||
pushArg(ImmGCPtr(gen->info().script()));
|
||||
pushArg(scopeChain);
|
||||
|
||||
callVM(DirectEvalStringInfo, lir);
|
||||
}
|
||||
|
||||
typedef bool (*DirectEvalVFn)(JSContext*, HandleObject, HandleScript, HandleValue, HandleValue,
|
||||
jsbytecode*, MutableHandleValue);
|
||||
static const VMFunction DirectEvalValueInfo = FunctionInfo<DirectEvalVFn>(DirectEvalValueFromIon);
|
||||
|
||||
void
|
||||
CodeGenerator::visitCallDirectEvalV(LCallDirectEvalV* lir)
|
||||
{
|
||||
Register scopeChain = ToRegister(lir->getScopeChain());
|
||||
|
||||
pushArg(ImmPtr(lir->mir()->pc()));
|
||||
pushArg(ToValue(lir, LCallDirectEvalV::Argument));
|
||||
pushArg(ToValue(lir, LCallDirectEvalV::ThisValue));
|
||||
pushArg(ImmGCPtr(gen->info().script()));
|
||||
pushArg(scopeChain);
|
||||
|
||||
callVM(DirectEvalValueInfo, lir);
|
||||
}
|
||||
|
||||
void
|
||||
CodeGenerator::generateArgumentsChecks(bool bailout)
|
||||
{
|
||||
|
|
|
@ -148,8 +148,7 @@ class CodeGenerator : public CodeGeneratorSpecific
|
|||
void visitGetDynamicName(LGetDynamicName* lir);
|
||||
void visitFilterArgumentsOrEvalS(LFilterArgumentsOrEvalS* lir);
|
||||
void visitFilterArgumentsOrEvalV(LFilterArgumentsOrEvalV* lir);
|
||||
void visitCallDirectEvalS(LCallDirectEvalS* lir);
|
||||
void visitCallDirectEvalV(LCallDirectEvalV* lir);
|
||||
void visitCallDirectEval(LCallDirectEval* lir);
|
||||
void visitDoubleToInt32(LDoubleToInt32* lir);
|
||||
void visitFloat32ToInt32(LFloat32ToInt32* lir);
|
||||
void visitNewArrayCallVM(LNewArray* lir);
|
||||
|
|
|
@ -1927,12 +1927,12 @@ class LFilterArgumentsOrEvalV : public LCallInstructionHelper<0, BOX_PIECES, 3>
|
|||
}
|
||||
};
|
||||
|
||||
class LCallDirectEvalS : public LCallInstructionHelper<BOX_PIECES, 2 + BOX_PIECES, 0>
|
||||
class LCallDirectEval : public LCallInstructionHelper<BOX_PIECES, 2 + BOX_PIECES, 0>
|
||||
{
|
||||
public:
|
||||
LIR_HEADER(CallDirectEvalS)
|
||||
LIR_HEADER(CallDirectEval)
|
||||
|
||||
LCallDirectEvalS(const LAllocation& scopeChain, const LAllocation& string)
|
||||
LCallDirectEval(const LAllocation& scopeChain, const LAllocation& string)
|
||||
{
|
||||
setOperand(0, scopeChain);
|
||||
setOperand(1, string);
|
||||
|
@ -1952,28 +1952,6 @@ class LCallDirectEvalS : public LCallInstructionHelper<BOX_PIECES, 2 + BOX_PIECE
|
|||
}
|
||||
};
|
||||
|
||||
class LCallDirectEvalV : public LCallInstructionHelper<BOX_PIECES, 1 + (2 * BOX_PIECES), 0>
|
||||
{
|
||||
public:
|
||||
LIR_HEADER(CallDirectEvalV)
|
||||
|
||||
explicit LCallDirectEvalV(const LAllocation& scopeChain)
|
||||
{
|
||||
setOperand(0, scopeChain);
|
||||
}
|
||||
|
||||
static const size_t Argument = 1;
|
||||
static const size_t ThisValue = 1 + BOX_PIECES;
|
||||
|
||||
MCallDirectEval* mir() const {
|
||||
return mir_->toCallDirectEval();
|
||||
}
|
||||
|
||||
const LAllocation* getScopeChain() {
|
||||
return getOperand(0);
|
||||
}
|
||||
};
|
||||
|
||||
// Takes in either an integer or boolean input and tests it for truthiness.
|
||||
class LTestIAndBranch : public LControlInstructionHelper<2, 1, 0>
|
||||
{
|
||||
|
|
|
@ -76,8 +76,7 @@
|
|||
_(GetDynamicName) \
|
||||
_(FilterArgumentsOrEvalS) \
|
||||
_(FilterArgumentsOrEvalV) \
|
||||
_(CallDirectEvalS) \
|
||||
_(CallDirectEvalV) \
|
||||
_(CallDirectEval) \
|
||||
_(StackArgT) \
|
||||
_(StackArgV) \
|
||||
_(CreateThis) \
|
||||
|
|
|
@ -606,24 +606,13 @@ LIRGenerator::visitCallDirectEval(MCallDirectEval* ins)
|
|||
MOZ_ASSERT(scopeChain->type() == MIRType_Object);
|
||||
|
||||
MDefinition* string = ins->getString();
|
||||
MOZ_ASSERT(string->type() == MIRType_String || string->type() == MIRType_Value);
|
||||
MOZ_ASSERT(string->type() == MIRType_String);
|
||||
|
||||
MDefinition* thisValue = ins->getThisValue();
|
||||
|
||||
|
||||
LInstruction* lir;
|
||||
if (string->type() == MIRType_String) {
|
||||
lir = new(alloc()) LCallDirectEvalS(useRegisterAtStart(scopeChain),
|
||||
useRegisterAtStart(string));
|
||||
} else {
|
||||
lir = new(alloc()) LCallDirectEvalV(useRegisterAtStart(scopeChain));
|
||||
useBoxAtStart(lir, LCallDirectEvalV::Argument, string);
|
||||
}
|
||||
|
||||
if (string->type() == MIRType_String)
|
||||
useBoxAtStart(lir, LCallDirectEvalS::ThisValue, thisValue);
|
||||
else
|
||||
useBoxAtStart(lir, LCallDirectEvalV::ThisValue, thisValue);
|
||||
LInstruction* lir = new(alloc()) LCallDirectEval(useRegisterAtStart(scopeChain),
|
||||
useRegisterAtStart(string));
|
||||
useBoxAtStart(lir, LCallDirectEval::ThisValue, thisValue);
|
||||
|
||||
defineReturn(lir, ins);
|
||||
assignSafepoint(lir, ins);
|
||||
|
|
|
@ -4071,7 +4071,7 @@ class MFilterArgumentsOrEval
|
|||
class MCallDirectEval
|
||||
: public MAryInstruction<3>,
|
||||
public Mix3Policy<ObjectPolicy<0>,
|
||||
BoxExceptPolicy<1, MIRType_String>,
|
||||
StringPolicy<1>,
|
||||
BoxPolicy<2> >::Data
|
||||
{
|
||||
protected:
|
||||
|
|
|
@ -1143,7 +1143,7 @@ FilterTypeSetPolicy::adjustInputs(TempAllocator& alloc, MInstruction* ins)
|
|||
_(FloatingPointPolicy<0>) \
|
||||
_(IntPolicy<0>) \
|
||||
_(IntPolicy<1>) \
|
||||
_(Mix3Policy<ObjectPolicy<0>, BoxExceptPolicy<1, MIRType_String>, BoxPolicy<2> >) \
|
||||
_(Mix3Policy<ObjectPolicy<0>, StringPolicy<1>, BoxPolicy<2> >) \
|
||||
_(Mix3Policy<ObjectPolicy<0>, BoxPolicy<1>, BoxPolicy<2> >) \
|
||||
_(Mix3Policy<ObjectPolicy<0>, BoxPolicy<1>, ObjectPolicy<2> >) \
|
||||
_(Mix3Policy<ObjectPolicy<0>, IntPolicy<1>, BoxPolicy<2> >) \
|
||||
|
|
Загрузка…
Ссылка в новой задаче