Commit 7eceb02f authored by Steve Fink's avatar Steve Fink
Browse files

Bug 1672121 - Don't bother resetting the budget that is going to be recreated...

Bug 1672121 - Don't bother resetting the budget that is going to be recreated for every slice anyway r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D131399
parent c2449f6f
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -98,14 +98,6 @@ class JS_PUBLIC_API SliceBudget {
    }
  }

  [[nodiscard]] bool checkAndResetOverBudget() {
    if (isOverBudget()) {
      resetOverBudget();
      return true;
    }
    return false;
  }

  bool isWorkBudget() const { return budget.is<WorkBudget>(); }
  bool isTimeBudget() const { return budget.is<TimeBudget>(); }
  bool isUnlimited() const { return budget.is<UnlimitedBudget>(); }
+0 −1
Original line number Diff line number Diff line
@@ -1464,7 +1464,6 @@ bool CycleCollectedJSRuntime::TraceJSHolders(JSTracer* aTracer,
    aBudget.step();
  }

  aBudget.resetOverBudget();
  return aIter.Done();
}

+3 −6
Original line number Diff line number Diff line
@@ -2060,8 +2060,6 @@ MOZ_NEVER_INLINE bool CCGraphBuilder::BuildGraph(SliceBudget& aBudget) {
    aBudget.step(mNoteChildCount + 1);
  }

  aBudget.resetOverBudget();

  if (!mCurrNode->IsDone()) {
    return false;
  }
@@ -2425,7 +2423,7 @@ class SnowWhiteKiller : public TraceCallbacks {
 public:
  bool Visit(nsPurpleBuffer& aBuffer, nsPurpleBufferEntry* aEntry) {
    if (mBudget) {
      if (mBudget->checkAndResetOverBudget()) {
      if (mBudget->isOverBudget()) {
        return false;
      }
      mBudget->step();
@@ -2529,7 +2527,7 @@ class RemoveSkippableVisitor : public SnowWhiteKiller {
  }

  bool Visit(nsPurpleBuffer& aBuffer, nsPurpleBufferEntry* aEntry) {
    if (mBudget.checkAndResetOverBudget()) {
    if (mBudget.isOverBudget()) {
      return false;
    }

@@ -3444,8 +3442,6 @@ bool nsCycleCollector::Collect(CCReason aReason, ccIsManual aIsManual,
    }
  } while (continueSlice);

  aBudget.resetOverBudget();

  // Clear mActivelyCollecting here to ensure that a recursive call to
  // Collect() does something.
  mActivelyCollecting = false;
@@ -3455,6 +3451,7 @@ bool nsCycleCollector::Collect(CCReason aReason, ccIsManual aIsManual,
    // Somebody has forced a CC, so after having finished out the current CC,
    // run the CC again using the new listener.
    MOZ_ASSERT(IsIdle());
    aBudget.resetOverBudget();
    if (Collect(aReason, ccIsManual::CCIsManual, aBudget, aManualListener)) {
      collectedAny = true;
    }