From 80a51789e02fd3ebec6f3c697f6fc521f63beeea Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 28 Jun 2013 07:41:19 -0700 Subject: [PATCH] Bug 888276 - Use hasUses() instead of checking useCount() == 0. r=h4writer --- js/src/ion/IonBuilder.cpp | 6 +++--- js/src/ion/MIRGraph.cpp | 2 +- js/src/ion/ValueNumbering.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/src/ion/IonBuilder.cpp b/js/src/ion/IonBuilder.cpp index 6905af6c1b2b..788c02434602 100644 --- a/js/src/ion/IonBuilder.cpp +++ b/js/src/ion/IonBuilder.cpp @@ -3722,7 +3722,7 @@ IonBuilder::getInlineableGetPropertyCache(CallInfo &callInfo) // MGetPropertyCache with no uses may be optimized away. if (funcDef->isGetPropertyCache()) { MGetPropertyCache *cache = funcDef->toGetPropertyCache(); - if (cache->useCount() > 0) + if (cache->hasUses()) return NULL; if (!CanInlineGetPropertyCache(cache, thisDef)) return NULL; @@ -3735,7 +3735,7 @@ IonBuilder::getInlineableGetPropertyCache(CallInfo &callInfo) MUnbox *unbox = funcDef->toUnbox(); if (unbox->mode() != MUnbox::Infallible) return NULL; - if (unbox->useCount() > 0) + if (unbox->hasUses()) return NULL; if (!unbox->input()->isTypeBarrier()) return NULL; @@ -3978,7 +3978,7 @@ IonBuilder::inlineTypeObjectFallback(CallInfo &callInfo, MBasicBlock *dispatchBl // 3. The MGetPropertyCache (and, if applicable, MTypeBarrier and MUnbox) only // 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); // This means that no resume points yet capture the MGetPropertyCache, diff --git a/js/src/ion/MIRGraph.cpp b/js/src/ion/MIRGraph.cpp index a626e51f088a..9143849e7705 100644 --- a/js/src/ion/MIRGraph.cpp +++ b/js/src/ion/MIRGraph.cpp @@ -599,7 +599,7 @@ AssertSafelyDiscardable(MDefinition *def) #ifdef DEBUG // Instructions captured by resume points cannot be safely discarded, since // they are necessary for interpreter frame reconstruction in case of bailout. - JS_ASSERT(def->useCount() == 0); + JS_ASSERT(!def->hasUses()); #endif } diff --git a/js/src/ion/ValueNumbering.cpp b/js/src/ion/ValueNumbering.cpp index 5fb6a58bc582..f77ff3ab12d0 100644 --- a/js/src/ion/ValueNumbering.cpp +++ b/js/src/ion/ValueNumbering.cpp @@ -89,7 +89,7 @@ ValueNumberer::simplifyControlInstruction(MControlInstruction *def) // MControlInstructions should not have consumers. JS_ASSERT(repl->isControlInstruction()); - JS_ASSERT(def->useCount() == 0); + JS_ASSERT(!def->hasUses()); if (def->isInWorklist()) repl->setInWorklist();