--- a/js/src/jit/BaselineIC.cpp
+++ b/js/src/jit/BaselineIC.cpp
@@ -464,24 +464,23 @@ DoToBoolFallback(JSContext* cx, Baseline
if (stub->state().maybeTransition())
stub->discardStubs(cx);
if (stub->state().canAttachStub()) {
RootedScript script(cx, frame->script());
jsbytecode* pc = stub->icEntry()->pc(script);
- ICStubEngine engine = ICStubEngine::Baseline;
ToBoolIRGenerator gen(cx, script, pc, stub->state().mode(),
arg);
bool attached = false;
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
- engine, script, stub, &attached);
+ script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached ToBool CacheIR stub, attached is now %d", attached);
}
if (!attached)
stub->state().trackNotAttached();
}
bool cond = ToBoolean(arg);
@@ -604,25 +603,24 @@ DoGetElemFallback(JSContext* cx, Baselin
bool attached = false;
bool isTemporarilyUnoptimizable = false;
if (stub->state().maybeTransition())
stub->discardStubs(cx);
if (stub->state().canAttachStub()) {
- ICStubEngine engine = ICStubEngine::Baseline;
GetPropIRGenerator gen(cx, script, pc,
CacheKind::GetElem, stub->state().mode(),
&isTemporarilyUnoptimizable, lhs, rhs, lhs,
GetPropertyResultFlags::All);
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Monitored,
- engine, script, stub, &attached);
+ script, stub, &attached);
if (newStub) {
JitSpew(JitSpew_BaselineIC, " Attached GetElem CacheIR stub");
if (gen.shouldNotePreliminaryObjectStub())
newStub->toCacheIR_Monitored()->notePreliminaryObject();
else if (gen.shouldUnlinkPreliminaryObjectStubs())
StripPreliminaryObjectStubs(cx, stub);
}
}
@@ -678,24 +676,23 @@ DoGetElemSuperFallback(JSContext* cx, Ba
bool attached = false;
bool isTemporarilyUnoptimizable = false;
if (stub->state().maybeTransition())
stub->discardStubs(cx);
if (stub->state().canAttachStub()) {
- ICStubEngine engine = ICStubEngine::Baseline;
GetPropIRGenerator gen(cx, script, pc, CacheKind::GetElemSuper, stub->state().mode(),
&isTemporarilyUnoptimizable, lhs, rhs, receiver,
GetPropertyResultFlags::All);
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Monitored,
- engine, script, stub, &attached);
+ script, stub, &attached);
if (newStub) {
JitSpew(JitSpew_BaselineIC, " Attached GetElemSuper CacheIR stub");
if (gen.shouldNotePreliminaryObjectStub())
newStub->toCacheIR_Monitored()->notePreliminaryObject();
else if (gen.shouldUnlinkPreliminaryObjectStubs())
StripPreliminaryObjectStubs(cx, stub);
}
}
@@ -838,18 +835,17 @@ DoSetElemFallback(JSContext* cx, Baselin
stub->discardStubs(cx);
if (stub->state().canAttachStub()) {
SetPropIRGenerator gen(cx, script, pc, CacheKind::SetElem, stub->state().mode(),
&isTemporarilyUnoptimizable, objv, index, rhs);
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Updated,
- ICStubEngine::Baseline, frame->script(),
- stub, &attached);
+ frame->script(), stub, &attached);
if (newStub) {
JitSpew(JitSpew_BaselineIC, " Attached SetElem CacheIR stub");
SetUpdateStubData(newStub->toCacheIR_Updated(), gen.typeCheckInfo());
if (gen.shouldNotePreliminaryObjectStub())
newStub->toCacheIR_Updated()->notePreliminaryObject();
else if (gen.shouldUnlinkPreliminaryObjectStubs())
@@ -902,18 +898,17 @@ DoSetElemFallback(JSContext* cx, Baselin
stub->discardStubs(cx);
if (stub->state().canAttachStub()) {
SetPropIRGenerator gen(cx, script, pc, CacheKind::SetElem, stub->state().mode(),
&isTemporarilyUnoptimizable, objv, index, rhs);
if (gen.tryAttachAddSlotStub(oldGroup, oldShape)) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Updated,
- ICStubEngine::Baseline, frame->script(),
- stub, &attached);
+ frame->script(), stub, &attached);
if (newStub) {
if (gen.shouldNotePreliminaryObjectStub())
newStub->toCacheIR_Updated()->notePreliminaryObject();
else if (gen.shouldUnlinkPreliminaryObjectStubs())
StripPreliminaryObjectStubs(cx, stub);
JitSpew(JitSpew_BaselineIC, " Attached SetElem CacheIR stub");
SetUpdateStubData(newStub->toCacheIR_Updated(), gen.typeCheckInfo());
@@ -1094,23 +1089,22 @@ DoInFallback(JSContext* cx, BaselineFram
if (stub->state().maybeTransition())
stub->discardStubs(cx);
if (stub->state().canAttachStub()) {
RootedScript script(cx, frame->script());
jsbytecode* pc = stub->icEntry()->pc(script);
- ICStubEngine engine = ICStubEngine::Baseline;
HasPropIRGenerator gen(cx, script, pc, CacheKind::In, stub->state().mode(), key, objValue);
bool attached = false;
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
- engine, script, stub, &attached);
+ script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached In CacheIR stub");
}
if (!attached)
stub->state().trackNotAttached();
}
RootedObject obj(cx, &objValue.toObject());
@@ -1162,24 +1156,23 @@ DoHasOwnFallback(JSContext* cx, Baseline
if (stub->state().maybeTransition())
stub->discardStubs(cx);
if (stub->state().canAttachStub()) {
RootedScript script(cx, frame->script());
jsbytecode* pc = stub->icEntry()->pc(script);
- ICStubEngine engine = ICStubEngine::Baseline;
HasPropIRGenerator gen(cx, script, pc, CacheKind::HasOwn,
stub->state().mode(), keyValue, objValue);
bool attached = false;
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
- engine, script, stub, &attached);
+ script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached HasOwn CacheIR stub");
}
if (!attached)
stub->state().trackNotAttached();
}
bool found;
@@ -1236,22 +1229,21 @@ DoGetNameFallback(JSContext* cx, Baselin
RootedPropertyName name(cx, script->getName(pc));
bool attached = false;
if (stub->state().maybeTransition())
stub->discardStubs(cx);
if (stub->state().canAttachStub()) {
- ICStubEngine engine = ICStubEngine::Baseline;
GetNameIRGenerator gen(cx, script, pc, stub->state().mode(), envChain, name);
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Monitored,
- engine, script, stub, &attached);
+ script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached GetName CacheIR stub");
}
if (!attached)
stub->state().trackNotAttached();
}
static_assert(JSOP_GETGNAME_LENGTH == JSOP_GETNAME_LENGTH,
@@ -1321,18 +1313,17 @@ DoBindNameFallback(JSContext* cx, Baseli
if (stub->state().canAttachStub()) {
bool attached = false;
RootedScript script(cx, frame->script());
BindNameIRGenerator gen(cx, script, pc, stub->state().mode(), envChain, name);
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
- ICStubEngine::Baseline, script, stub,
- &attached);
+ script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached BindName CacheIR stub");
}
if (!attached)
stub->state().trackNotAttached();
}
RootedObject scope(cx);
@@ -1399,18 +1390,17 @@ DoGetIntrinsicFallback(JSContext* cx, Ba
if (stub->state().canAttachStub()) {
bool attached = false;
RootedScript script(cx, frame->script());
GetIntrinsicIRGenerator gen(cx, script, pc, stub->state().mode(), res);
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
- ICStubEngine::Baseline, script, stub,
- &attached);
+ script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached GetIntrinsic CacheIR stub");
}
if (!attached)
stub->state().trackNotAttached();
}
return true;
@@ -1501,18 +1491,17 @@ DoGetPropFallback(JSContext* cx, Baselin
if (stub->state().canAttachStub()) {
RootedValue idVal(cx, StringValue(name));
GetPropIRGenerator gen(cx, script, pc, CacheKind::GetProp, stub->state().mode(),
&isTemporarilyUnoptimizable, val, idVal, val,
GetPropertyResultFlags::All);
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Monitored,
- ICStubEngine::Baseline, script,
- stub, &attached);
+ script, stub, &attached);
if (newStub) {
JitSpew(JitSpew_BaselineIC, " Attached CacheIR stub");
if (gen.shouldNotePreliminaryObjectStub())
newStub->toCacheIR_Monitored()->notePreliminaryObject();
else if (gen.shouldUnlinkPreliminaryObjectStubs())
StripPreliminaryObjectStubs(cx, stub);
}
}
@@ -1572,18 +1561,17 @@ DoGetPropSuperFallback(JSContext* cx, Ba
if (stub->state().canAttachStub()) {
RootedValue idVal(cx, StringValue(name));
GetPropIRGenerator gen(cx, script, pc, CacheKind::GetPropSuper, stub->state().mode(),
&isTemporarilyUnoptimizable, val, idVal, receiver,
GetPropertyResultFlags::All);
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Monitored,
- ICStubEngine::Baseline, script,
- stub, &attached);
+ script, stub, &attached);
if (newStub) {
JitSpew(JitSpew_BaselineIC, " Attached CacheIR stub");
if (gen.shouldNotePreliminaryObjectStub())
newStub->toCacheIR_Monitored()->notePreliminaryObject();
else if (gen.shouldUnlinkPreliminaryObjectStubs())
StripPreliminaryObjectStubs(cx, stub);
}
}
@@ -1751,18 +1739,17 @@ DoSetPropFallback(JSContext* cx, Baselin
if (stub->state().canAttachStub()) {
RootedValue idVal(cx, StringValue(name));
SetPropIRGenerator gen(cx, script, pc, CacheKind::SetProp, stub->state().mode(),
&isTemporarilyUnoptimizable, lhs, idVal, rhs);
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Updated,
- ICStubEngine::Baseline, frame->script(),
- stub, &attached);
+ frame->script(), stub, &attached);
if (newStub) {
JitSpew(JitSpew_BaselineIC, " Attached SetProp CacheIR stub");
SetUpdateStubData(newStub->toCacheIR_Updated(), gen.typeCheckInfo());
if (gen.shouldNotePreliminaryObjectStub())
newStub->toCacheIR_Updated()->notePreliminaryObject();
else if (gen.shouldUnlinkPreliminaryObjectStubs())
@@ -1823,18 +1810,17 @@ DoSetPropFallback(JSContext* cx, Baselin
if (stub->state().canAttachStub()) {
RootedValue idVal(cx, StringValue(name));
SetPropIRGenerator gen(cx, script, pc, CacheKind::SetProp, stub->state().mode(),
&isTemporarilyUnoptimizable, lhs, idVal, rhs);
if (gen.tryAttachAddSlotStub(oldGroup, oldShape)) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Updated,
- ICStubEngine::Baseline, frame->script(),
- stub, &attached);
+ frame->script(), stub, &attached);
if (newStub) {
if (gen.shouldNotePreliminaryObjectStub())
newStub->toCacheIR_Updated()->notePreliminaryObject();
else if (gen.shouldUnlinkPreliminaryObjectStubs())
StripPreliminaryObjectStubs(cx, stub);
JitSpew(JitSpew_BaselineIC, " Attached SetProp CacheIR stub");
SetUpdateStubData(newStub->toCacheIR_Updated(), gen.typeCheckInfo());
@@ -2512,19 +2498,18 @@ DoCallFallback(JSContext* cx, BaselineFr
// Only bother to try optimizing JSOP_CALL with CacheIR if the chain is still
// allowed to attach stubs.
if (canAttachStub) {
CallIRGenerator gen(cx, script, pc, op, stub->state().mode(), argc,
callee, callArgs.thisv(),
HandleValueArray::fromMarkedLocation(argc, vp+2));
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
- gen.cacheIRStubKind(),
- ICStubEngine::Baseline,
- script, stub, &handled);
+ gen.cacheIRStubKind(), script,
+ stub, &handled);
if (newStub) {
JitSpew(JitSpew_BaselineIC, " Attached Call CacheIR stub");
// If it's an updated stub, initialize it.
if (gen.cacheIRStubKind() == BaselineCacheIRStubKind::Updated)
SetUpdateStubData(newStub->toCacheIR_Updated(), gen.typeCheckInfo());
}
@@ -4139,23 +4124,22 @@ DoGetIteratorFallback(JSContext* cx, Bas
if (stub->state().maybeTransition())
stub->discardStubs(cx);
if (stub->state().canAttachStub()) {
RootedScript script(cx, frame->script());
jsbytecode* pc = stub->icEntry()->pc(script);
- ICStubEngine engine = ICStubEngine::Baseline;
GetIteratorIRGenerator gen(cx, script, pc, stub->state().mode(), value);
bool attached = false;
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
- engine, script, stub, &attached);
+ script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached GetIterator CacheIR stub");
}
if (!attached)
stub->state().trackNotAttached();
}
JSObject* iterobj = ValueToIterator(cx, value);
@@ -4337,41 +4321,40 @@ TryAttachInstanceOfStub(JSContext* cx, B
if (stub->state().maybeTransition())
stub->discardStubs(cx);
if (stub->state().canAttachStub()) {
RootedScript script(cx, frame->script());
jsbytecode* pc = stub->icEntry()->pc(script);
- ICStubEngine engine = ICStubEngine::Baseline;
InstanceOfIRGenerator gen(cx, script, pc, stub->state().mode(),
lhs,
rhs);
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
- engine, script, stub, attached);
+ script, stub, attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached InstanceOf CacheIR stub, attached is now %d", *attached);
}
if (!attached)
stub->state().trackNotAttached();
}
return true;
}
static bool
DoInstanceOfFallback(JSContext* cx, BaselineFrame* frame, ICInstanceOf_Fallback* stub_,
HandleValue lhs, HandleValue rhs, MutableHandleValue res)
{
// This fallback stub may trigger debug mode toggling.
- DebugModeOSRVolatileStub<ICInstanceOf_Fallback*> stub(ICStubEngine::Baseline, frame, stub_);
+ DebugModeOSRVolatileStub<ICInstanceOf_Fallback*> stub(frame, stub_);
FallbackICSpew(cx, stub, "InstanceOf");
if (!rhs.isObject()) {
ReportValueError(cx, JSMSG_BAD_INSTANCEOF_RHS, -1, rhs, nullptr);
return false;
}
@@ -4440,23 +4423,22 @@ DoTypeOfFallback(JSContext* cx, Baseline
if (stub->state().maybeTransition())
stub->discardStubs(cx);
if (stub->state().canAttachStub()) {
RootedScript script(cx, frame->script());
jsbytecode* pc = stub->icEntry()->pc(script);
- ICStubEngine engine = ICStubEngine::Baseline;
TypeOfIRGenerator gen(cx, script, pc, stub->state().mode(), val);
bool attached = false;
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
- engine, script, stub, &attached);
+ script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached TypeOf CacheIR stub");
}
if (!attached)
stub->state().trackNotAttached();
}
JSType type = js::TypeOfValue(val);
@@ -4759,17 +4741,17 @@ ICRest_Fallback::Compiler::generateStubC
// UnaryArith_Fallback
//
static bool
DoUnaryArithFallback(JSContext* cx, BaselineFrame* frame, ICUnaryArith_Fallback* stub,
HandleValue val, MutableHandleValue res)
{
// This fallback stub may trigger debug mode toggling.
- DebugModeOSRVolatileStub<ICUnaryArith_Fallback*> debug_stub(ICStubEngine::Baseline, frame, stub);
+ DebugModeOSRVolatileStub<ICUnaryArith_Fallback*> debug_stub(frame, stub);
RootedScript script(cx, frame->script());
jsbytecode* pc = stub->icEntry()->pc(script);
JSOp op = JSOp(*pc);
FallbackICSpew(cx, stub, "UnaryArith(%s)", CodeName[op]);
switch (op) {
case JSOP_BITNOT: {
@@ -4802,17 +4784,17 @@ DoUnaryArithFallback(JSContext* cx, Base
if (stub->state().canAttachStub()) {
UnaryArithIRGenerator gen(cx, script, pc, stub->state().mode(),
op, val, res);
if (gen.tryAttachStub()) {
bool attached = false;
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
- ICStubEngine::Baseline, script, stub, &attached);
+ script, stub, &attached);
if (newStub) {
JitSpew(JitSpew_BaselineIC, " Attached UnaryArith CacheIR stub for %s", CodeName[op]);
}
}
}
return true;
}
@@ -4846,17 +4828,17 @@ ICUnaryArith_Fallback::Compiler::generat
// BinaryArith_Fallback
//
static bool
DoBinaryArithFallback(JSContext* cx, BaselineFrame* frame, ICBinaryArith_Fallback* stub_,
HandleValue lhs, HandleValue rhs, MutableHandleValue ret)
{
// This fallback stub may trigger debug mode toggling.
- DebugModeOSRVolatileStub<ICBinaryArith_Fallback*> stub(ICStubEngine::Baseline, frame, stub_);
+ DebugModeOSRVolatileStub<ICBinaryArith_Fallback*> stub(frame, stub_);
RootedScript script(cx, frame->script());
jsbytecode* pc = stub->icEntry()->pc(script);
JSOp op = JSOp(*pc);
FallbackICSpew(cx, stub, "CacheIRBinaryArith(%s,%d,%d)", CodeName[op],
int(lhs.isDouble() ? JSVAL_TYPE_DOUBLE : lhs.extractNonDoubleType()),
int(rhs.isDouble() ? JSVAL_TYPE_DOUBLE : rhs.extractNonDoubleType()));
@@ -4955,17 +4937,17 @@ DoBinaryArithFallback(JSContext* cx, Bas
if (stub->state().canAttachStub()) {
BinaryArithIRGenerator gen(cx, script, pc, stub->state().mode(),
op, lhs, rhs, ret);
if (gen.tryAttachStub()) {
bool attached = false;
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
- ICStubEngine::Baseline, script, stub, &attached);
+ script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached BinaryArith CacheIR stub for %s", CodeName[op]);
} else {
stub->noteUnoptimizableOperands();
}
}
return true;
@@ -5001,17 +4983,17 @@ ICBinaryArith_Fallback::Compiler::genera
//
// Compare_Fallback
//
static bool
DoCompareFallback(JSContext* cx, BaselineFrame* frame, ICCompare_Fallback* stub_, HandleValue lhs,
HandleValue rhs, MutableHandleValue ret)
{
// This fallback stub may trigger debug mode toggling.
- DebugModeOSRVolatileStub<ICCompare_Fallback*> stub(ICStubEngine::Baseline, frame, stub_);
+ DebugModeOSRVolatileStub<ICCompare_Fallback*> stub(frame, stub_);
RootedScript script(cx, frame->script());
jsbytecode* pc = stub->icEntry()->pc(script);
JSOp op = JSOp(*pc);
FallbackICSpew(cx, stub, "Compare(%s)", CodeName[op]);
// Case operations in a CONDSWITCH are performing strict equality.
@@ -5077,17 +5059,17 @@ DoCompareFallback(JSContext* cx, Baselin
}
if (stub->state().canAttachStub()) {
CompareIRGenerator gen(cx, script, pc, stub->state().mode(), op, lhs, rhs);
bool attached = false;
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
- ICStubEngine::Baseline, script, stub, &attached);
+ script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " Attached CacheIR stub");
return true;
}
}
stub->noteUnoptimizableAccess();
return true;
@@ -5199,17 +5181,17 @@ DoNewObject(JSContext* cx, BaselineFrame
return false;
if (!JitOptions.disableCacheIR) {
bool attached = false;
NewObjectIRGenerator gen(cx, script, pc, stub->state().mode(), JSOp(*pc), templateObject);
if (gen.tryAttachStub()) {
ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
BaselineCacheIRStubKind::Regular,
- ICStubEngine::Baseline , script, stub, &attached);
+ script, stub, &attached);
if (newStub)
JitSpew(JitSpew_BaselineIC, " NewObject Attached CacheIR stub");
}
}
stub->setTemplateObject(templateObject);
}
}