[WTF] [JSC] Replace currentTime() with monotonicallyIncreasingTime() in all possible...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Aug 2013 00:51:25 +0000 (00:51 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Aug 2013 00:51:25 +0000 (00:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=119762

Patch by Arunprasad Rajkumar <arurajku@cisco.com> on 2013-08-13
Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::markRoots):
(JSC::Heap::collect):
* jsc.cpp:
(StopWatch::start):
(StopWatch::stop):
* testRegExp.cpp:
(StopWatch::start):
(StopWatch::stop):

Source/WTF:

* wtf/MainThread.cpp:
(WTF::dispatchFunctionsFromMainThread):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154032 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/heap/Heap.cpp
Source/JavaScriptCore/jsc.cpp
Source/JavaScriptCore/testRegExp.cpp
Source/WTF/ChangeLog
Source/WTF/wtf/MainThread.cpp

index 2e5f944f5c6a79006ea9f467670882bc7fb01c9b..92f72eed82950def7bff8c3b79918b786c226b61 100644 (file)
@@ -1,3 +1,21 @@
+2013-08-13  Arunprasad Rajkumar  <arurajku@cisco.com>
+
+        [WTF] [JSC] Replace currentTime() with monotonicallyIncreasingTime() in all possible places
+        https://bugs.webkit.org/show_bug.cgi?id=119762
+
+        Reviewed by Geoffrey Garen.
+
+        * heap/Heap.cpp:
+        (JSC::Heap::Heap):
+        (JSC::Heap::markRoots):
+        (JSC::Heap::collect):
+        * jsc.cpp:
+        (StopWatch::start):
+        (StopWatch::stop):
+        * testRegExp.cpp:
+        (StopWatch::start):
+        (StopWatch::stop):
+
 2013-08-13  Julien Brianceau  <jbrianceau@nds.com>
 
         [sh4] Prepare LLINT for DFG_JIT implementation.
index 5a89fdb81a31f6d6e28d72289424bec79bf847de..604e7884f1e57e0fb2be64e4c6227b350e7b0876 100644 (file)
@@ -90,12 +90,12 @@ struct GCTimer {
 struct GCTimerScope {
     GCTimerScope(GCTimer* timer)
         : m_timer(timer)
-        , m_start(WTF::currentTime())
+        , m_start(WTF::monotonicallyIncreasingTime())
     {
     }
     ~GCTimerScope()
     {
-        double delta = WTF::currentTime() - m_start;
+        double delta = WTF::monotonicallyIncreasingTime() - m_start;
         if (delta < m_timer->m_min)
             m_timer->m_min = delta;
         if (delta > m_timer->m_max)
@@ -263,7 +263,7 @@ Heap::Heap(VM* vm, HeapType heapType)
     , m_isSafeToCollect(false)
     , m_vm(vm)
     , m_lastGCLength(0)
-    , m_lastCodeDiscardTime(WTF::currentTime())
+    , m_lastCodeDiscardTime(WTF::monotonicallyIncreasingTime())
     , m_activityCallback(DefaultGCActivityCallback::create(this))
     , m_sweeper(IncrementalSweeper::create(this))
     , m_deferralDepth(0)
@@ -433,7 +433,7 @@ void Heap::markRoots()
     ASSERT(isValidThreadState(m_vm));
 
 #if ENABLE(OBJECT_MARK_LOGGING)
-    double gcStartTime = WTF::currentTime();
+    double gcStartTime = WTF::monotonicallyIncreasingTime();
 #endif
 
     void* dummy;
@@ -590,7 +590,7 @@ void Heap::markRoots()
 #if ENABLE(PARALLEL_GC)
     visitCount += m_sharedData.childVisitCount();
 #endif
-    MARK_LOG_MESSAGE2("\nNumber of live Objects after full GC %lu, took %.6f secs\n", visitCount, WTF::currentTime() - gcStartTime);
+    MARK_LOG_MESSAGE2("\nNumber of live Objects after full GC %lu, took %.6f secs\n", visitCount, WTF::monotonicallyIncreasingTime() - gcStartTime);
 #endif
 
     visitor.reset();
@@ -726,10 +726,10 @@ void Heap::collect(SweepToggle sweepToggle)
 
     m_activityCallback->willCollect();
 
-    double lastGCStartTime = WTF::currentTime();
+    double lastGCStartTime = WTF::monotonicallyIncreasingTime();
     if (lastGCStartTime - m_lastCodeDiscardTime > minute) {
         deleteAllCompiledCode();
-        m_lastCodeDiscardTime = WTF::currentTime();
+        m_lastCodeDiscardTime = WTF::monotonicallyIncreasingTime();
     }
 
     {
@@ -797,7 +797,7 @@ void Heap::collect(SweepToggle sweepToggle)
     m_bytesAllocatedLimit = maxHeapSize - currentHeapSize;
 
     m_bytesAllocated = 0;
-    double lastGCEndTime = WTF::currentTime();
+    double lastGCEndTime = WTF::monotonicallyIncreasingTime();
     m_lastGCLength = lastGCEndTime - lastGCStartTime;
 
     if (Options::recordGCPauseTimes())
index 3e6d4aba969be0769f64077f9e0c1dba0d978145..ae2995467e582d246f639b5d005a93f262c53131 100644 (file)
@@ -171,12 +171,12 @@ private:
 
 void StopWatch::start()
 {
-    m_startTime = currentTime();
+    m_startTime = monotonicallyIncreasingTime();
 }
 
 void StopWatch::stop()
 {
-    m_stopTime = currentTime();
+    m_stopTime = monotonicallyIncreasingTime();
 }
 
 long StopWatch::getElapsedMS()
index 9185d72810f311c2a0031d1020ba06f644db4aba..6f68d32a37b729d3f8c49093e059f5ee16eb70e4 100644 (file)
@@ -82,12 +82,12 @@ private:
 
 void StopWatch::start()
 {
-    m_startTime = currentTime();
+    m_startTime = monotonicallyIncreasingTime();
 }
 
 void StopWatch::stop()
 {
-    m_stopTime = currentTime();
+    m_stopTime = monotonicallyIncreasingTime();
 }
 
 long StopWatch::getElapsedMS()
index d8e5c9b2bca3f7a3cf535dce48814ee5f0e8b5c1..d38735838624c1928219b67f360bb7195629ad49 100644 (file)
@@ -1,3 +1,13 @@
+2013-08-13  Arunprasad Rajkumar  <arurajku@cisco.com>
+
+        [WTF] [JSC] Replace currentTime() with monotonicallyIncreasingTime() in all possible places
+        https://bugs.webkit.org/show_bug.cgi?id=119762
+
+        Reviewed by Geoffrey Garen.
+
+        * wtf/MainThread.cpp:
+        (WTF::dispatchFunctionsFromMainThread):
+
 2013-08-12  Ragner Magalhaes  <ranger.n@samsung.com>
 
         Broken build with build-webkit --no-webgl
index aea8c366e31a36ec26b69df134c3b49ed92f444a..e77b15f873472b0e8f7a047a6482b441ea1386af 100644 (file)
@@ -141,7 +141,7 @@ void dispatchFunctionsFromMainThread()
     if (callbacksPaused)
         return;
 
-    double startTime = currentTime();
+    double startTime = monotonicallyIncreasingTime();
 
     FunctionWithContext invocation;
     while (true) {
@@ -162,7 +162,7 @@ void dispatchFunctionsFromMainThread()
         // yield so the user input can be processed. Otherwise user may not be able to even close the window.
         // This code has effect only in case the scheduleDispatchFunctionsOnMainThread() is implemented in a way that
         // allows input events to be processed before we are back here.
-        if (currentTime() - startTime > maxRunLoopSuspensionTime) {
+        if (monotonicallyIncreasingTime() - startTime > maxRunLoopSuspensionTime) {
             scheduleDispatchFunctionsOnMainThread();
             break;
         }