Changeset 107390 in webkit
- Timestamp:
- Feb 10, 2012 2:48:50 AM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r107348 r107390 1 2012-02-10 Roland Takacs <takacs.roland@stud.u-szeged.hu> 2 3 [Qt] GC should be parallel on Qt platform 4 https://bugs.webkit.org/show_bug.cgi?id=73309 5 6 Reviewed by Zoltan Herczeg. 7 8 These changes made the parallel gc feature available for Qt port. 9 The implementation of "registerGCThread" and "isMainThreadOrGCThread", 10 and a local static function [initializeGCThreads] is moved from 11 MainThreadMac.mm to the common MainThread.cpp to make them available 12 for other platforms. 13 14 Measurement results: 15 V8 speed-up: 1.025x as fast [From: 663.4ms To: 647.0ms ] 16 V8 Splay speed-up: 1.185x as fast [From: 138.4ms To: 116.8ms ] 17 18 Tested on Intel(R) Core(TM) i5-2320 CPU @ 3.00GHz with 4-core. 19 20 * JavaScriptCore.order: 21 * wtf/MainThread.cpp: 22 (WTF::initializeMainThread): 23 (WTF): 24 (WTF::initializeGCThreads): 25 (WTF::registerGCThread): 26 (WTF::isMainThreadOrGCThread): 27 * wtf/MainThread.h: 28 (WTF): 29 * wtf/Platform.h: 30 * wtf/mac/MainThreadMac.mm: 31 (WTF): 32 1 33 2012-02-09 Andy Wingo <wingo@igalia.com> 2 34 -
trunk/Source/JavaScriptCore/JavaScriptCore.order
r105635 r107390 1145 1145 __ZN3JSCL19jsStrDecimalLiteralERPKtS1_ 1146 1146 __ZN3WTF22cancelCallOnMainThreadEPFvPvES0_ 1147 __ZN3WTF22isMainThreadOrGCThreadEv 1147 1148 __ZNK3JSC8JSString9toBooleanEPNS_9ExecStateE 1148 1149 __ZN3WTF10StringImpl4findEPFbtEj -
trunk/Source/JavaScriptCore/wtf/MainThread.cpp
r105987 r107390 35 35 #include "StdLibExtras.h" 36 36 #include "Threading.h" 37 #include <wtf/ThreadSpecific.h> 37 38 38 39 #if PLATFORM(CHROMIUM) … … 102 103 mainThreadFunctionQueueMutex(); 103 104 initializeMainThreadPlatform(); 105 initializeGCThreads(); 104 106 } 105 107 … … 250 252 #endif 251 253 254 #if ENABLE(PARALLEL_GC) 255 static ThreadSpecific<bool>* isGCThread; 256 #endif 257 258 void initializeGCThreads() 259 { 260 #if ENABLE(PARALLEL_GC) 261 isGCThread = new ThreadSpecific<bool>(); 262 #endif 263 } 264 265 #if ENABLE(PARALLEL_GC) 266 void registerGCThread() 267 { 268 if (!isGCThread) { 269 // This happens if we're running in a process that doesn't care about 270 // MainThread. 271 return; 272 } 273 274 **isGCThread = true; 275 } 276 277 bool isMainThreadOrGCThread() 278 { 279 if (isGCThread->isSet() && **isGCThread) 280 return true; 281 282 return isMainThread(); 283 } 284 #elif PLATFORM(MAC) || PLATFORM(WINDOWS) 285 // This is necessary because JavaScriptCore.exp doesn't support preprocessor macros. 286 bool isMainThreadOrGCThread() 287 { 288 return isMainThread(); 289 } 290 #endif 291 252 292 } // namespace WTF -
trunk/Source/JavaScriptCore/wtf/MainThread.h
r104900 r107390 53 53 54 54 WTF_EXPORT_PRIVATE bool isMainThread(); 55 56 void initializeGCThreads(); 57 55 58 #if ENABLE(PARALLEL_GC) 56 59 void registerGCThread(); 57 60 WTF_EXPORT_PRIVATE bool isMainThreadOrGCThread(); 58 #elif PLATFORM(MAC) 59 bool isMainThreadOrGCThread();61 #elif PLATFORM(MAC) || PLATFORM(WINDOWS) 62 WTF_EXPORT_PRIVATE bool isMainThreadOrGCThread(); 60 63 #else 61 64 inline bool isMainThreadOrGCThread() { return isMainThread(); } -
trunk/Source/JavaScriptCore/wtf/Platform.h
r107036 r107390 1124 1124 #endif 1125 1125 1126 #if !defined(ENABLE_PARALLEL_GC) && (PLATFORM(MAC) || PLATFORM(IOS) ) && ENABLE(COMPARE_AND_SWAP)1126 #if !defined(ENABLE_PARALLEL_GC) && (PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(QT)) && ENABLE(COMPARE_AND_SWAP) 1127 1127 #define ENABLE_PARALLEL_GC 1 1128 1128 #endif -
trunk/Source/JavaScriptCore/wtf/mac/MainThreadMac.mm
r105987 r107390 36 36 #import <wtf/HashSet.h> 37 37 #import <wtf/Threading.h> 38 #import <wtf/ThreadSpecific.h>39 38 40 39 @interface JSWTFMainThreadCaller : NSObject { … … 59 58 static pthread_t mainThreadPthread; 60 59 static NSThread* mainThreadNSThread; 61 62 #if ENABLE(PARALLEL_GC)63 static ThreadSpecific<bool>* isGCThread;64 65 static void initializeGCThreads()66 {67 isGCThread = new ThreadSpecific<bool>();68 }69 #else70 static void initializeGCThreads() { }71 #endif72 60 73 61 void initializeMainThreadPlatform() … … 146 134 } 147 135 148 #if ENABLE(PARALLEL_GC)149 void registerGCThread()150 {151 if (!isGCThread) {152 // This happens if we're running in a process that doesn't care about153 // MainThread.154 return;155 }156 157 **isGCThread = true;158 }159 160 bool isMainThreadOrGCThread()161 {162 if (isGCThread->isSet() && **isGCThread)163 return true;164 165 return isMainThread();166 }167 #else168 // This is necessary because JavaScriptCore.exp doesn't support preprocessor macros.169 bool isMainThreadOrGCThread()170 {171 return isMainThread();172 }173 #endif174 175 136 } // namespace WTF
Note: See TracChangeset
for help on using the changeset viewer.