Title: [105982] trunk/Source/_javascript_Core
Revision
105982
Author
commit-qu...@webkit.org
Date
2012-01-26 02:22:25 -0800 (Thu, 26 Jan 2012)

Log Message

[Qt] GC should be parallel on Qt platform
https://bugs.webkit.org/show_bug.cgi?id=73309

Patch by Roland Takacs <takacs.rol...@stud.u-szeged.hu> on 2012-01-26
Reviewed by Zoltan Herczeg.

These changes made the parallel gc feature available for Qt port.
The implementation of "registerGCThread" and "isMainThreadOrGCThread"
is moved from MainThreadMac.mm to the common MainThread.cpp to make
them available for other platforms.

Measurement results:
V8           speed-up:  1.071x as fast  [From: 746.1ms  To: 696.4ms ]
WindScorpion speed-up:  1.082x as fast  [From: 3490.4ms To: 3226.7ms]
V8 Splay     speed-up:  1.158x as fast  [From: 145.8ms  To: 125.9ms ]

Tested on Intel(R) Core(TM) i5-2320 CPU @ 3.00GHz with 4-core.

* wtf/MainThread.cpp:
(WTF):
(WTF::registerGCThread):
(WTF::isMainThreadOrGCThread):
* wtf/Platform.h:
* wtf/mac/MainThreadMac.mm:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (105981 => 105982)


--- trunk/Source/_javascript_Core/ChangeLog	2012-01-26 10:10:22 UTC (rev 105981)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-01-26 10:22:25 UTC (rev 105982)
@@ -1,3 +1,29 @@
+2012-01-26  Roland Takacs  <takacs.rol...@stud.u-szeged.hu>
+
+        [Qt] GC should be parallel on Qt platform
+        https://bugs.webkit.org/show_bug.cgi?id=73309
+
+        Reviewed by Zoltan Herczeg.
+
+        These changes made the parallel gc feature available for Qt port.
+        The implementation of "registerGCThread" and "isMainThreadOrGCThread"
+        is moved from MainThreadMac.mm to the common MainThread.cpp to make
+        them available for other platforms.
+
+        Measurement results:
+        V8           speed-up:  1.071x as fast  [From: 746.1ms  To: 696.4ms ]
+        WindScorpion speed-up:  1.082x as fast  [From: 3490.4ms To: 3226.7ms]
+        V8 Splay     speed-up:  1.158x as fast  [From: 145.8ms  To: 125.9ms ]
+
+        Tested on Intel(R) Core(TM) i5-2320 CPU @ 3.00GHz with 4-core.
+
+        * wtf/MainThread.cpp:
+        (WTF):
+        (WTF::registerGCThread):
+        (WTF::isMainThreadOrGCThread):
+        * wtf/Platform.h:
+        * wtf/mac/MainThreadMac.mm:
+
 2012-01-26  Andy Estes  <aes...@apple.com>
 
         REGRESSION (r105555): Incorrect use of OS() macro breaks OwnPtr when used with Win32 data types

Modified: trunk/Source/_javascript_Core/wtf/MainThread.cpp (105981 => 105982)


--- trunk/Source/_javascript_Core/wtf/MainThread.cpp	2012-01-26 10:10:22 UTC (rev 105981)
+++ trunk/Source/_javascript_Core/wtf/MainThread.cpp	2012-01-26 10:22:25 UTC (rev 105982)
@@ -34,6 +34,7 @@
 #include "Functional.h"
 #include "StdLibExtras.h"
 #include "Threading.h"
+#include <wtf/ThreadSpecific.h>
 
 #if PLATFORM(CHROMIUM)
 #error Chromium uses a different main thread implementation
@@ -249,4 +250,33 @@
 }
 #endif
 
+#if ENABLE(PARALLEL_GC)
+static ThreadSpecific<bool>* isGCThread;
+
+void registerGCThread()
+{
+    if (!isGCThread) {
+        // This happens if we're running in a process that doesn't care about
+        // MainThread.
+        return;
+    }
+
+    **isGCThread = true;
+}
+
+bool isMainThreadOrGCThread()
+{
+    if (isGCThread->isSet() && **isGCThread)
+        return true;
+
+    return isMainThread();
+}
+#elif PLATFORM(MAC)
+// This is necessary because _javascript_Core.exp doesn't support preprocessor macros.
+bool isMainThreadOrGCThread()
+{
+    return isMainThread();
+}
+#endif
+
 } // namespace WTF

Modified: trunk/Source/_javascript_Core/wtf/Platform.h (105981 => 105982)


--- trunk/Source/_javascript_Core/wtf/Platform.h	2012-01-26 10:10:22 UTC (rev 105981)
+++ trunk/Source/_javascript_Core/wtf/Platform.h	2012-01-26 10:22:25 UTC (rev 105982)
@@ -1120,7 +1120,7 @@
 #define ENABLE_COMPARE_AND_SWAP 1
 #endif
 
-#if !defined(ENABLE_PARALLEL_GC) && (PLATFORM(MAC) || PLATFORM(IOS)) && ENABLE(COMPARE_AND_SWAP)
+#if !defined(ENABLE_PARALLEL_GC) && (PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(QT)) && ENABLE(COMPARE_AND_SWAP)
 #define ENABLE_PARALLEL_GC 1
 #endif
 

Modified: trunk/Source/_javascript_Core/wtf/mac/MainThreadMac.mm (105981 => 105982)


--- trunk/Source/_javascript_Core/wtf/mac/MainThreadMac.mm	2012-01-26 10:10:22 UTC (rev 105981)
+++ trunk/Source/_javascript_Core/wtf/mac/MainThreadMac.mm	2012-01-26 10:22:25 UTC (rev 105982)
@@ -145,31 +145,4 @@
     return pthread_equal(pthread_self(), mainThreadPthread);
 }
 
-#if ENABLE(PARALLEL_GC)
-void registerGCThread()
-{
-    if (!isGCThread) {
-        // This happens if we're running in a process that doesn't care about
-        // MainThread.
-        return;
-    }
-
-    **isGCThread = true;
-}
-
-bool isMainThreadOrGCThread()
-{
-    if (isGCThread->isSet() && **isGCThread)
-        return true;
-    
-    return isMainThread();
-}
-#else
-// This is necessary because _javascript_Core.exp doesn't support preprocessor macros.
-bool isMainThreadOrGCThread()
-{
-    return isMainThread();
-}
-#endif
-
 } // namespace WTF
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to