Title: [228152] trunk/Source/WebKit
- Revision
- 228152
- Author
- cdu...@apple.com
- Date
- 2018-02-05 22:50:24 -0800 (Mon, 05 Feb 2018)
Log Message
Avoid unnecessarily constructing RunLoops for GC AutomaticThreads in Connection::sendMessage() after r228001
https://bugs.webkit.org/show_bug.cgi?id=182494
<rdar://problem/37147632>
Reviewed by Ryosuke Niwa.
Somebody fixed a GC crash in r228001 by allowing RunLoop::current() to be called from a
GC thread. However, this is still unnecessarily inefficient. Calling RunLoop::current()
will construct RunLoops for background GC threads (WTF::AutomaticThreads). This patches
updates the IPC code to call isMainThread() instead of RunLoop::isMain() in
Connection::sendMessage(). This should mean the same thing since this code runs in
WebKit2 and should be more efficient as it ends up simply calling pthread_main_np(),
without constructing a RunLoop.
* Platform/IPC/Connection.cpp:
(IPC::Connection::sendMessage):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (228151 => 228152)
--- trunk/Source/WebKit/ChangeLog 2018-02-06 05:00:07 UTC (rev 228151)
+++ trunk/Source/WebKit/ChangeLog 2018-02-06 06:50:24 UTC (rev 228152)
@@ -1,3 +1,22 @@
+2018-02-05 Chris Dumez <cdu...@apple.com>
+
+ Avoid unnecessarily constructing RunLoops for GC AutomaticThreads in Connection::sendMessage() after r228001
+ https://bugs.webkit.org/show_bug.cgi?id=182494
+ <rdar://problem/37147632>
+
+ Reviewed by Ryosuke Niwa.
+
+ Somebody fixed a GC crash in r228001 by allowing RunLoop::current() to be called from a
+ GC thread. However, this is still unnecessarily inefficient. Calling RunLoop::current()
+ will construct RunLoops for background GC threads (WTF::AutomaticThreads). This patches
+ updates the IPC code to call isMainThread() instead of RunLoop::isMain() in
+ Connection::sendMessage(). This should mean the same thing since this code runs in
+ WebKit2 and should be more efficient as it ends up simply calling pthread_main_np(),
+ without constructing a RunLoop.
+
+ * Platform/IPC/Connection.cpp:
+ (IPC::Connection::sendMessage):
+
2018-02-05 Ryosuke Niwa <rn...@webkit.org>
Release assertion in inlineVideoFrame
Modified: trunk/Source/WebKit/Platform/IPC/Connection.cpp (228151 => 228152)
--- trunk/Source/WebKit/Platform/IPC/Connection.cpp 2018-02-06 05:00:07 UTC (rev 228151)
+++ trunk/Source/WebKit/Platform/IPC/Connection.cpp 2018-02-06 06:50:24 UTC (rev 228152)
@@ -379,7 +379,7 @@
if (!isValid())
return false;
- if (RunLoop::isMain() && m_inDispatchMessageMarkedToUseFullySynchronousModeForTesting && !encoder->isSyncMessage() && !(encoder->messageReceiverName() == "IPC")) {
+ if (isMainThread() && m_inDispatchMessageMarkedToUseFullySynchronousModeForTesting && !encoder->isSyncMessage() && !(encoder->messageReceiverName() == "IPC")) {
uint64_t syncRequestID;
auto wrappedMessage = createSyncMessageEncoder("IPC", "WrappedAsyncMessageForTesting", encoder->destinationID(), syncRequestID);
wrappedMessage->setFullySynchronousModeForTesting();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes