Bug 888276 - Use hasUses() instead of checking useCount() == 0. r=h4writer

This commit is contained in:
Dan Gohman 2013-06-28 07:41:19 -07:00
Родитель 0a90666fc8
Коммит 80a51789e0
3 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -3722,7 +3722,7 @@ IonBuilder::getInlineableGetPropertyCache(CallInfo &callInfo)
// MGetPropertyCache with no uses may be optimized away. // MGetPropertyCache with no uses may be optimized away.
if (funcDef->isGetPropertyCache()) { if (funcDef->isGetPropertyCache()) {
MGetPropertyCache *cache = funcDef->toGetPropertyCache(); MGetPropertyCache *cache = funcDef->toGetPropertyCache();
if (cache->useCount() > 0) if (cache->hasUses())
return NULL; return NULL;
if (!CanInlineGetPropertyCache(cache, thisDef)) if (!CanInlineGetPropertyCache(cache, thisDef))
return NULL; return NULL;
@ -3735,7 +3735,7 @@ IonBuilder::getInlineableGetPropertyCache(CallInfo &callInfo)
MUnbox *unbox = funcDef->toUnbox(); MUnbox *unbox = funcDef->toUnbox();
if (unbox->mode() != MUnbox::Infallible) if (unbox->mode() != MUnbox::Infallible)
return NULL; return NULL;
if (unbox->useCount() > 0) if (unbox->hasUses())
return NULL; return NULL;
if (!unbox->input()->isTypeBarrier()) if (!unbox->input()->isTypeBarrier())
return NULL; return NULL;
@ -3978,7 +3978,7 @@ IonBuilder::inlineTypeObjectFallback(CallInfo &callInfo, MBasicBlock *dispatchBl
// 3. The MGetPropertyCache (and, if applicable, MTypeBarrier and MUnbox) only // 3. The MGetPropertyCache (and, if applicable, MTypeBarrier and MUnbox) only
// have at most a single use. // have at most a single use.
JS_ASSERT_IF(callInfo.fun()->isGetPropertyCache(), cache->useCount() == 0); JS_ASSERT_IF(callInfo.fun()->isGetPropertyCache(), !cache->hasUses());
JS_ASSERT_IF(callInfo.fun()->isUnbox(), cache->useCount() == 1); JS_ASSERT_IF(callInfo.fun()->isUnbox(), cache->useCount() == 1);
// This means that no resume points yet capture the MGetPropertyCache, // This means that no resume points yet capture the MGetPropertyCache,

Просмотреть файл

@ -599,7 +599,7 @@ AssertSafelyDiscardable(MDefinition *def)
#ifdef DEBUG #ifdef DEBUG
// Instructions captured by resume points cannot be safely discarded, since // Instructions captured by resume points cannot be safely discarded, since
// they are necessary for interpreter frame reconstruction in case of bailout. // they are necessary for interpreter frame reconstruction in case of bailout.
JS_ASSERT(def->useCount() == 0); JS_ASSERT(!def->hasUses());
#endif #endif
} }

Просмотреть файл

@ -89,7 +89,7 @@ ValueNumberer::simplifyControlInstruction(MControlInstruction *def)
// MControlInstructions should not have consumers. // MControlInstructions should not have consumers.
JS_ASSERT(repl->isControlInstruction()); JS_ASSERT(repl->isControlInstruction());
JS_ASSERT(def->useCount() == 0); JS_ASSERT(!def->hasUses());
if (def->isInWorklist()) if (def->isInWorklist())
repl->setInWorklist(); repl->setInWorklist();