зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1542740: Convert GetIteratorIRGenerator to use AttachDecision r=mgaudet
Differential Revision: https://phabricator.services.mozilla.com/D27304 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
097c764d09
Коммит
c897ea5db7
|
@ -5416,7 +5416,7 @@ bool DoGetIteratorFallback(JSContext* cx, BaselineFrame* frame,
|
|||
stub->incrementEnteredCount();
|
||||
FallbackICSpew(cx, stub, "GetIterator");
|
||||
|
||||
TryAttachStubOld<GetIteratorIRGenerator>(
|
||||
TryAttachStub<GetIteratorIRGenerator>(
|
||||
"GetIterator", cx, frame, stub, BaselineCacheIRStubKind::Regular, value);
|
||||
|
||||
JSObject* iterobj = ValueToIterator(cx, value);
|
||||
|
|
|
@ -4540,39 +4540,36 @@ GetIteratorIRGenerator::GetIteratorIRGenerator(JSContext* cx,
|
|||
HandleValue value)
|
||||
: IRGenerator(cx, script, pc, CacheKind::GetIterator, mode), val_(value) {}
|
||||
|
||||
bool GetIteratorIRGenerator::tryAttachStub() {
|
||||
AttachDecision GetIteratorIRGenerator::tryAttachStub() {
|
||||
MOZ_ASSERT(cacheKind_ == CacheKind::GetIterator);
|
||||
|
||||
AutoAssertNoPendingException aanpe(cx_);
|
||||
|
||||
if (mode_ == ICState::Mode::Megamorphic) {
|
||||
return false;
|
||||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
||||
ValOperandId valId(writer.setInputOperandId(0));
|
||||
if (!val_.isObject()) {
|
||||
return false;
|
||||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
||||
RootedObject obj(cx_, &val_.toObject());
|
||||
|
||||
ObjOperandId objId = writer.guardIsObject(valId);
|
||||
if (tryAttachNativeIterator(objId, obj)) {
|
||||
trackAttached("GetIterator");
|
||||
return true;
|
||||
}
|
||||
TRY_ATTACH(tryAttachNativeIterator(objId, obj));
|
||||
|
||||
trackAttached(IRGenerator::NotAttached);
|
||||
return false;
|
||||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
||||
bool GetIteratorIRGenerator::tryAttachNativeIterator(ObjOperandId objId,
|
||||
HandleObject obj) {
|
||||
AttachDecision GetIteratorIRGenerator::tryAttachNativeIterator(
|
||||
ObjOperandId objId, HandleObject obj) {
|
||||
MOZ_ASSERT(JSOp(*pc_) == JSOP_ITER);
|
||||
|
||||
PropertyIteratorObject* iterobj = LookupInIteratorCache(cx_, obj);
|
||||
if (!iterobj) {
|
||||
return false;
|
||||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(obj->isNative());
|
||||
|
@ -4592,7 +4589,8 @@ bool GetIteratorIRGenerator::tryAttachNativeIterator(ObjOperandId objId,
|
|||
writer.loadObjectResult(iterId);
|
||||
writer.returnFromIC();
|
||||
|
||||
return true;
|
||||
trackAttached("GetIterator");
|
||||
return AttachDecision::Attach;
|
||||
}
|
||||
|
||||
void GetIteratorIRGenerator::trackAttached(const char* name) {
|
||||
|
|
|
@ -2329,13 +2329,13 @@ class MOZ_RAII TypeOfIRGenerator : public IRGenerator {
|
|||
class MOZ_RAII GetIteratorIRGenerator : public IRGenerator {
|
||||
HandleValue val_;
|
||||
|
||||
bool tryAttachNativeIterator(ObjOperandId objId, HandleObject obj);
|
||||
AttachDecision tryAttachNativeIterator(ObjOperandId objId, HandleObject obj);
|
||||
|
||||
public:
|
||||
GetIteratorIRGenerator(JSContext* cx, HandleScript, jsbytecode* pc,
|
||||
ICState::Mode mode, HandleValue value);
|
||||
|
||||
bool tryAttachStub();
|
||||
AttachDecision tryAttachStub();
|
||||
|
||||
void trackAttached(const char* name);
|
||||
};
|
||||
|
|
|
@ -458,8 +458,8 @@ JSObject* IonGetIteratorIC::update(JSContext* cx, HandleScript outerScript,
|
|||
IonGetIteratorIC* ic, HandleValue value) {
|
||||
IonScript* ionScript = outerScript->ionScript();
|
||||
|
||||
TryAttachIonStubOld<GetIteratorIRGenerator, IonGetIteratorIC>(
|
||||
cx, ic, ionScript, value);
|
||||
TryAttachIonStub<GetIteratorIRGenerator, IonGetIteratorIC>(cx, ic, ionScript,
|
||||
value);
|
||||
|
||||
return ValueToIterator(cx, value);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче