Title: [270311] trunk
Revision
270311
Author
[email protected]
Date
2020-12-01 10:00:27 -0800 (Tue, 01 Dec 2020)

Log Message

Unreviewed, reverting r270132.

Caused at least one regression test failure
(webkit.org/b/219401)

Reverted changeset:

"Use a Version 1 CFRunLoopSource for faster task dispatch"
https://bugs.webkit.org/show_bug.cgi?id=202874
https://trac.webkit.org/changeset/270132

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (270310 => 270311)


--- trunk/Source/WTF/ChangeLog	2020-12-01 17:59:18 UTC (rev 270310)
+++ trunk/Source/WTF/ChangeLog	2020-12-01 18:00:27 UTC (rev 270311)
@@ -1,3 +1,16 @@
+2020-12-01  Ryan Haddad  <[email protected]>
+
+        Unreviewed, reverting r270132.
+
+        Caused at least one regression test failure
+        (webkit.org/b/219401)
+
+        Reverted changeset:
+
+        "Use a Version 1 CFRunLoopSource for faster task dispatch"
+        https://bugs.webkit.org/show_bug.cgi?id=202874
+        https://trac.webkit.org/changeset/270132
+
 2020-11-30  Youenn Fablet  <[email protected]>
 
         Introduce an experimental flag specific to VP9 profile 2

Modified: trunk/Source/WTF/wtf/RunLoop.h (270310 => 270311)


--- trunk/Source/WTF/wtf/RunLoop.h	2020-12-01 17:59:18 UTC (rev 270310)
+++ trunk/Source/WTF/wtf/RunLoop.h	2020-12-01 18:00:27 UTC (rev 270311)
@@ -225,10 +225,9 @@
 
     Lock m_loopLock;
 #elif USE(COCOA_EVENT_LOOP)
-    static void performWork(CFMachPortRef, void* msg, CFIndex size, void* info);
+    static void performWork(void*);
     RetainPtr<CFRunLoopRef> m_runLoop;
     RetainPtr<CFRunLoopSourceRef> m_runLoopSource;
-    RetainPtr<CFMachPortRef> m_port;
 #elif USE(GLIB_EVENT_LOOP)
     void notify(Event, const char*);
 

Modified: trunk/Source/WTF/wtf/cf/RunLoopCF.cpp (270310 => 270311)


--- trunk/Source/WTF/wtf/cf/RunLoopCF.cpp	2020-12-01 17:59:18 UTC (rev 270310)
+++ trunk/Source/WTF/wtf/cf/RunLoopCF.cpp	2020-12-01 18:00:27 UTC (rev 270311)
@@ -28,7 +28,6 @@
 
 #include <CoreFoundation/CoreFoundation.h>
 #include <dispatch/dispatch.h>
-#include <mach/mach.h>
 #include <wtf/AutodrainedPool.h>
 #include <wtf/SchedulePair.h>
 
@@ -41,39 +40,29 @@
     return adoptCF(CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent() + interval.seconds(), repeatInterval.seconds(), 0, 0, timerFired, &context));
 }
 
-void RunLoop::performWork(CFMachPortRef, void*, CFIndex, void* info)
+void RunLoop::performWork(void* context)
 {
     AutodrainedPool pool;
-    static_cast<RunLoop*>(info)->performWork();
+    static_cast<RunLoop*>(context)->performWork();
 }
 
 RunLoop::RunLoop()
     : m_runLoop(CFRunLoopGetCurrent())
 {
-    CFMachPortContext context = { 0, this, nullptr, nullptr, nullptr };
-    m_port = adoptCF(CFMachPortCreate(kCFAllocatorDefault, performWork, &context, nullptr));
-    m_runLoopSource = adoptCF(CFMachPortCreateRunLoopSource(kCFAllocatorDefault, m_port.get(), 0));
+    CFRunLoopSourceContext context = { 0, this, 0, 0, 0, 0, 0, 0, 0, performWork };
+    m_runLoopSource = adoptCF(CFRunLoopSourceCreate(kCFAllocatorDefault, 0, &context));
     CFRunLoopAddSource(m_runLoop.get(), m_runLoopSource.get(), kCFRunLoopCommonModes);
 }
 
 RunLoop::~RunLoop()
 {
-    CFMachPortInvalidate(m_port.get());
     CFRunLoopSourceInvalidate(m_runLoopSource.get());
 }
 
 void RunLoop::wakeUp()
 {
-    mach_msg_header_t header;
-    header.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, 0);
-    header.msgh_size = sizeof(mach_msg_header_t);
-    header.msgh_remote_port = CFMachPortGetPort(m_port.get());
-    header.msgh_local_port = MACH_PORT_NULL;
-    header.msgh_id = 0;
-    mach_msg_return_t result = mach_msg(&header, MACH_SEND_MSG | MACH_SEND_TIMEOUT, header.msgh_size, 0, MACH_PORT_NULL, 0, MACH_PORT_NULL);
-    RELEASE_ASSERT(result == MACH_MSG_SUCCESS || result == MACH_SEND_TIMED_OUT);
-    if (result == MACH_SEND_TIMED_OUT)
-        mach_msg_destroy(&header);
+    CFRunLoopSourceSignal(m_runLoopSource.get());
+    CFRunLoopWakeUp(m_runLoop.get());
 }
 
 RunLoop::CycleResult RunLoop::cycle(RunLoopMode mode)

Modified: trunk/Tools/ChangeLog (270310 => 270311)


--- trunk/Tools/ChangeLog	2020-12-01 17:59:18 UTC (rev 270310)
+++ trunk/Tools/ChangeLog	2020-12-01 18:00:27 UTC (rev 270311)
@@ -1,3 +1,16 @@
+2020-12-01  Ryan Haddad  <[email protected]>
+
+        Unreviewed, reverting r270132.
+
+        Caused at least one regression test failure
+        (webkit.org/b/219401)
+
+        Reverted changeset:
+
+        "Use a Version 1 CFRunLoopSource for faster task dispatch"
+        https://bugs.webkit.org/show_bug.cgi?id=202874
+        https://trac.webkit.org/changeset/270132
+
 2020-12-01  Aakash Jain  <[email protected]>
 
         Share runUnittests.py for ews-build and build.webkit.org unit-tests

Modified: trunk/Tools/TestWebKitAPI/cocoa/UtilitiesCocoa.mm (270310 => 270311)


--- trunk/Tools/TestWebKitAPI/cocoa/UtilitiesCocoa.mm	2020-12-01 17:59:18 UTC (rev 270310)
+++ trunk/Tools/TestWebKitAPI/cocoa/UtilitiesCocoa.mm	2020-12-01 18:00:27 UTC (rev 270311)
@@ -38,7 +38,7 @@
 void spinRunLoop(uint64_t count)
 {
     for (uint64_t i = 0; i < count; ++i)
-        while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true) == kCFRunLoopRunHandledSource) { }
+        [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]];
 }
 
 void sleep(double seconds)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to