Bug 1597157. Remove unused mNextIdleDeadline bits. r=smaug
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 18 Nov 2019 17:05:30 +0000
changeset 502441 65d5310bd0be5f1865f3d33fd363ded4d150a361
parent 502440 c0b01b965387f871cea0a5fd9eebad0e848d7162
child 502442 5ebe15b529320ffc221ba354b30f526cb1a84a75
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1597157
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1597157. Remove unused mNextIdleDeadline bits. r=smaug Differential Revision: https://phabricator.services.mozilla.com/D53626
xpcom/threads/MainThreadQueue.h
xpcom/threads/PrioritizedEventQueue.cpp
xpcom/threads/PrioritizedEventQueue.h
xpcom/threads/nsThread.h
--- a/xpcom/threads/MainThreadQueue.h
+++ b/xpcom/threads/MainThreadQueue.h
@@ -30,20 +30,16 @@ inline already_AddRefed<nsThread> Create
       new SynchronizedQueueT(std::move(queue));
 
   prioritized->SetMutexRef(synchronizedQueue->MutexRef());
 
   // Setup "main" thread
   RefPtr<nsThread> mainThread =
       new nsThread(WrapNotNull(synchronizedQueue), nsThread::MAIN_THREAD, 0);
 
-#ifndef RELEASE_OR_BETA
-  prioritized->SetNextIdleDeadlineRef(mainThread->NextIdleDeadlineRef());
-#endif
-
   if (aSynchronizedQueue) {
     synchronizedQueue.forget(aSynchronizedQueue);
   }
   return mainThread.forget();
 }
 
 }  // namespace mozilla
 
--- a/xpcom/threads/PrioritizedEventQueue.cpp
+++ b/xpcom/threads/PrioritizedEventQueue.cpp
@@ -150,22 +150,16 @@ EventQueuePriority PrioritizedEventQueue
 // The delay returned is the queuing delay a hypothetical Input event would
 // see due to the current running event if it had arrived while the current
 // event was queued.  This means that any event running at  priority below
 // Input doesn't cause queuing delay for Input events, and we return
 // TimeDuration() for those cases.
 already_AddRefed<nsIRunnable> PrioritizedEventQueue::GetEvent(
     EventQueuePriority* aPriority, const MutexAutoLock& aProofOfLock,
     mozilla::TimeDuration* aHypotheticalInputEventDelay) {
-#ifndef RELEASE_OR_BETA
-  // Clear mNextIdleDeadline so that it is possible to determine that
-  // we're running an idle runnable in ProcessNextEvent.
-  *mNextIdleDeadline = TimeStamp();
-#endif
-
   EventQueuePriority queue = SelectQueue(true, aProofOfLock);
   auto guard = MakeScopeExit([&] {
     mIdlePeriodState.ForgetPendingTaskGuarantee();
     if (queue != EventQueuePriority::Idle &&
         queue != EventQueuePriority::DeferredTimers) {
       mIdlePeriodState.FlagNotIdle(*mMutex);
     }
   });
@@ -236,22 +230,16 @@ already_AddRefed<nsIRunnable> Prioritize
       if (!event) {
         event = mIdleQueue->GetEvent(aPriority, aProofOfLock);
       }
       if (event) {
         nsCOMPtr<nsIIdleRunnable> idleEvent = do_QueryInterface(event);
         if (idleEvent) {
           idleEvent->SetDeadline(idleDeadline);
         }
-
-#ifndef RELEASE_OR_BETA
-        // Store the next idle deadline to be able to determine budget use
-        // in ProcessNextEvent.
-        *mNextIdleDeadline = idleDeadline;
-#endif
       }
       break;
   }  // switch (queue)
 
   if (!event) {
     *aHypotheticalInputEventDelay = TimeDuration();
   }
 
--- a/xpcom/threads/PrioritizedEventQueue.h
+++ b/xpcom/threads/PrioritizedEventQueue.h
@@ -64,25 +64,16 @@ class PrioritizedEventQueue final : publ
   bool HasPendingHighPriorityEvents(const MutexAutoLock& aProofOfLock) final;
 
   // When checking the idle deadline, we need to drop whatever mutex protects
   // this queue. This method allows that mutex to be stored so that we can drop
   // it and reacquire it when checking the idle deadline. The mutex must live at
   // least as long as the queue.
   void SetMutexRef(Mutex& aMutex) { mMutex = &aMutex; }
 
-#ifndef RELEASE_OR_BETA
-  // nsThread.cpp sends telemetry containing the most recently computed idle
-  // deadline. We store a reference to a field in nsThread where this deadline
-  // will be stored so that it can be fetched quickly for telemetry.
-  void SetNextIdleDeadlineRef(TimeStamp& aDeadline) {
-    mNextIdleDeadline = &aDeadline;
-  }
-#endif
-
   void EnableInputEventPrioritization(const MutexAutoLock& aProofOfLock) final;
   void FlushInputEventPrioritization(const MutexAutoLock& aProofOfLock) final;
   void SuspendInputEventPrioritization(const MutexAutoLock& aProofOfLock) final;
   void ResumeInputEventPrioritization(const MutexAutoLock& aProofOfLock) final;
 
   size_t SizeOfExcludingThis(
       mozilla::MallocSizeOf aMallocSizeOf) const override {
     size_t n = 0;
@@ -112,22 +103,16 @@ class PrioritizedEventQueue final : publ
 
   // We need to drop the queue mutex when checking the idle deadline, so we keep
   // a pointer to it here.
   Mutex* mMutex = nullptr;
 
   TimeDuration mLastEventDelay;
   TimeStamp mLastEventStart;
 
-#ifndef RELEASE_OR_BETA
-  // Pointer to a place where the most recently computed idle deadline is
-  // stored.
-  TimeStamp* mNextIdleDeadline = nullptr;
-#endif
-
   // Try to process one high priority runnable after each normal
   // priority runnable. This gives the processing model HTML spec has for
   // 'Update the rendering' in the case only vsync messages are in the
   // secondary queue and prevents starving the normal queue.
   bool mProcessHighPriorityQueue = false;
 
   TimeStamp mInputHandlingStartTime;
 
--- a/xpcom/threads/nsThread.h
+++ b/xpcom/threads/nsThread.h
@@ -118,20 +118,16 @@ class nsThread : public nsIThreadInterna
   void SuspendInputEventPrioritization() {
     EventQueue()->SuspendInputEventPrioritization();
   }
 
   void ResumeInputEventPrioritization() {
     EventQueue()->ResumeInputEventPrioritization();
   }
 
-#ifndef RELEASE_OR_BETA
-  mozilla::TimeStamp& NextIdleDeadlineRef() { return mNextIdleDeadline; }
-#endif
-
   mozilla::SynchronizedEventQueue* EventQueue() { return mEvents.get(); }
 
   bool ShuttingDown() { return mShutdownContext != nullptr; }
 
   virtual mozilla::PerformanceCounter* GetPerformanceCounter(
       nsIRunnable* aEvent);
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
@@ -244,17 +240,16 @@ class nsThread : public nsIThreadInterna
 
   // Used to track which event is being executed by ProcessNextEvent
   nsCOMPtr<nsIRunnable> mCurrentEvent;
 
   // When the current event started.  Note: recursive events use the time
   // the outmost event started, so the entire recursion chain is considered
   // one event.
   mozilla::TimeStamp mCurrentEventStart;
-  mozilla::TimeStamp mNextIdleDeadline;
 
   // The time the currently running event spent in event queues, and
   // when it started running.  If no event is running, they are
   // TimeDuration() & TimeStamp().
   mozilla::TimeDuration mLastEventDelay;
   mozilla::TimeStamp mLastEventStart;
 
 #ifdef EARLY_BETA_OR_EARLIER