Title: [148704] trunk/Source/_javascript_Core
Revision
148704
Author
gga...@apple.com
Date
2013-04-18 14:55:22 -0700 (Thu, 18 Apr 2013)

Log Message

Removed HeapTimer::synchronize
https://bugs.webkit.org/show_bug.cgi?id=114832

Reviewed by Mark Hahnenberg.

HeapTimer::synchronize was a flawed attempt to make HeapTimer thread-safe.
Instead, we use proper locking now.

This is a slight API change, since the GC timer will now only fire in the
run loop that created the JS VM, even if another run loop later executes
some JS.

* API/APIShims.h:
(JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
* heap/HeapTimer.cpp:
(JSC):
* heap/HeapTimer.h:
(HeapTimer):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/API/APIShims.h (148703 => 148704)


--- trunk/Source/_javascript_Core/API/APIShims.h	2013-04-18 21:48:36 UTC (rev 148703)
+++ trunk/Source/_javascript_Core/API/APIShims.h	2013-04-18 21:55:22 UTC (rev 148704)
@@ -42,8 +42,6 @@
     {
         if (registerThread)
             vm->heap.machineThreads().addCurrentThread();
-        m_vm->heap.activityCallback()->synchronize();
-        m_vm->heap.sweeper()->synchronize();
     }
 
     ~APIEntryShimWithoutLock()

Modified: trunk/Source/_javascript_Core/ChangeLog (148703 => 148704)


--- trunk/Source/_javascript_Core/ChangeLog	2013-04-18 21:48:36 UTC (rev 148703)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-04-18 21:55:22 UTC (rev 148704)
@@ -1,3 +1,24 @@
+2013-04-18  Geoffrey Garen  <gga...@apple.com>
+
+        Removed HeapTimer::synchronize
+        https://bugs.webkit.org/show_bug.cgi?id=114832
+
+        Reviewed by Mark Hahnenberg.
+
+        HeapTimer::synchronize was a flawed attempt to make HeapTimer thread-safe.
+        Instead, we use proper locking now.
+
+        This is a slight API change, since the GC timer will now only fire in the
+        run loop that created the JS VM, even if another run loop later executes
+        some JS.
+
+        * API/APIShims.h:
+        (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
+        * heap/HeapTimer.cpp:
+        (JSC):
+        * heap/HeapTimer.h:
+        (HeapTimer):
+
 2013-04-17  Geoffrey Garen  <gga...@apple.com>
 
         Renamed JSGlobalData to VM

Modified: trunk/Source/_javascript_Core/heap/HeapTimer.cpp (148703 => 148704)


--- trunk/Source/_javascript_Core/heap/HeapTimer.cpp	2013-04-18 21:48:36 UTC (rev 148703)
+++ trunk/Source/_javascript_Core/heap/HeapTimer.cpp	2013-04-18 21:55:22 UTC (rev 148704)
@@ -75,15 +75,6 @@
     CFRunLoopTimerInvalidate(m_timer.get());
 }
 
-void HeapTimer::synchronize()
-{
-    if (CFRunLoopGetCurrent() == m_runLoop.get())
-        return;
-    CFRunLoopRemoveTimer(m_runLoop.get(), m_timer.get(), kCFRunLoopCommonModes);
-    m_runLoop = CFRunLoopGetCurrent();
-    CFRunLoopAddTimer(m_runLoop.get(), m_timer.get(), kCFRunLoopCommonModes);
-}
-
 void HeapTimer::timerDidFire(CFRunLoopTimerRef timer, void* context)
 {
     JSLock* apiLock = static_cast<JSLock*>(context);
@@ -132,10 +123,6 @@
     doWork();
 }
 
-void HeapTimer::synchronize()
-{
-}
-
 void HeapTimer::invalidate()
 {
 }
@@ -178,18 +165,6 @@
     m_newThread = 0;
 }
 
-void HeapTimer::synchronize()
-{
-    if (thread() != QThread::currentThread()) {
-        // We can only move from the objects own thread to another, so we fire an
-        // event into the owning thread to trigger the move.
-        // This must be processed before any timerEvents so giving it high priority.
-        QMutexLocker lock(&m_mutex);
-        m_newThread = QThread::currentThread();
-        QCoreApplication::postEvent(this, new QEvent(QEvent::User), Qt::HighEventPriority);
-    }
-}
-
 #else
 HeapTimer::HeapTimer(VM* vm)
     : m_vm(vm)
@@ -200,10 +175,6 @@
 {
 }
 
-void HeapTimer::synchronize()
-{
-}
-
 void HeapTimer::invalidate()
 {
 }

Modified: trunk/Source/_javascript_Core/heap/HeapTimer.h (148703 => 148704)


--- trunk/Source/_javascript_Core/heap/HeapTimer.h	2013-04-18 21:48:36 UTC (rev 148703)
+++ trunk/Source/_javascript_Core/heap/HeapTimer.h	2013-04-18 21:55:22 UTC (rev 148704)
@@ -58,8 +58,6 @@
 #endif
     
     virtual ~HeapTimer();
-
-    virtual void synchronize();
     virtual void doWork() = 0;
     
 protected:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to