Backed out changeset 85e86b04035c (bug 1188616) for bustage.
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 03 Aug 2015 10:18:20 -0400
changeset 287544 1d20bd2d28d0c9450a04221a65646e2fd8f9f6fe
parent 287543 8859abb9b671280c00ddc4870954f6a008cd058c
child 287545 c890f043b794157c27ed78d959c01ae3a9bc5d16
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1188616
milestone42.0a1
backs out85e86b04035c76ec2f30d5c91c1f67ca0c222c79
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
Backed out changeset 85e86b04035c (bug 1188616) for bustage. CLOSED TREE
js/ipc/CPOWTimer.cpp
js/ipc/CPOWTimer.h
--- a/js/ipc/CPOWTimer.cpp
+++ b/js/ipc/CPOWTimer.cpp
@@ -4,43 +4,36 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "jsfriendapi.h"
 #include "nsContentUtils.h"
 #include "CPOWTimer.h"
 
-#include "jsapi.h"
-
 CPOWTimer::CPOWTimer(JSContext* cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
     : cx_(nullptr)
     , startInterval_(0)
 {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
     JSRuntime* runtime = JS_GetRuntime(cx);
     if (!js::GetStopwatchIsMonitoringCPOW(runtime))
         return;
     cx_ = cx;
-    startInterval_ = PR_Now();
+    startInterval_ = PR_IntervalNow();
 }
 CPOWTimer::~CPOWTimer()
 {
     if (!cx_) {
         // Monitoring was off when we started the timer.
         return;
     }
 
     JSRuntime* runtime = JS_GetRuntime(cx_);
     if (!js::GetStopwatchIsMonitoringCPOW(runtime)) {
         // Monitoring has been deactivated while we were in the timer.
         return;
     }
 
-    const int64_t endInterval = PR_Now();
-    if (endInterval <= startInterval_) {
-        // Do not assume monotonicity.
-        return;
-    }
-
     js::PerformanceData* performance = js::GetPerformanceData(runtime);
-    performance->totalCPOWTime += endInterval - startInterval_;
+    uint64_t duration = PR_IntervalToMicroseconds(PR_IntervalNow() - startInterval_);
+    performance->totalCPOWTime += duration;
 }
--- a/js/ipc/CPOWTimer.h
+++ b/js/ipc/CPOWTimer.h
@@ -33,12 +33,12 @@ class MOZ_STACK_CLASS CPOWTimer final {
      * CPOW monitoring was off when the timer was created.
      */
     JSContext* cx_;
 
     /**
      * The instant at which the stopwatch was started. Undefined
      * if CPOW monitoring was off when the timer was created.
      */
-    int64_t startInterval_;
+    PRIntervalTime startInterval_;
 };
 
 #endif