Source/JavaScriptCore/ChangeLog

 12012-01-20 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 NOBODY (OOPS!).
 7
 8 These changes made the parallel gc feature available for Qt port.
 9 I inserted the "isMainThreadOrGCThread" function's symbol to the .order
 10 and .def files to build correctly on Windows platform.
 11 Furthermore I moved "registerGCThread" and "isMainThreadOrGCThread"
 12 implementations from the MainThreadMac.mm to MainThread.cpp to make
 13 parallel GC available not only on MAC platform.
 14
 15 Measurement results:
 16 V8 speed-up: 1.071x as fast [From: 746.1ms To: 696.4ms ]
 17 WindScorpion speed-up: 1.082x as fast [From: 3490.4ms To: 3226.7ms]
 18 V8 Splay speed-up: 1.158x as fast [From: 145.8ms To: 125.9ms ]
 19
 20 Tested on Intel(R) Core(TM) i5-2320 CPU @ 3.00GHz with 4-core.
 21
 22 * JavaScriptCore.order:
 23 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
 24 * wtf/MainThread.cpp:
 25 (WTF::registerGCThread):
 26 (WTF::isMainThreadOrGCThread):
 27 * wtf/MainThread.h:
 28 * wtf/Platform.h:
 29 * wtf/mac/MainThreadMac.mm:
 30
1312012-01-20 ChangSeok Oh <shivamidow@gmail.com>
232
333 undefined reference to symbol eina_module_free

Source/JavaScriptCore/JavaScriptCore.order

@@__ZN3WTF10StringImpl19createUninitializedEjRPt
4040__ZN3WTF5equalEPKNS_10StringImplES2_
4141__ZN3WTF10StringImpl6createEPKtj
4242__ZN3WTF12isMainThreadEv
 43__ZN3WTF22isMainThreadOrGCThreadEv
4344__ZN3WTF10StringImplD1Ev
4445__ZN3WTF10StringImplD2Ev
4546__ZN3WTF6String6numberEy

Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def

@@EXPORTS
232232 ?isDataDescriptor@PropertyDescriptor@JSC@@QBE_NXZ
233233 ?isHostFunctionNonInline@JSFunction@JSC@@ABE_NXZ
234234 ?isMainThread@WTF@@YA_NXZ
 235 ?isMainThreadOrGCThread@WTF@@YA_NXZ
235236 ?isReachableFromOpaqueRoots@WeakHandleOwner@JSC@@UAE_NV?$Handle@W4Unknown@JSC@@@2@PAXAAVSlotVisitor@2@@Z
236237 ?isTerminatedExecutionException@JSC@@YA_NVJSValue@1@@Z
237238 ?isValidAllocation@Heap@JSC@@AAE_NI@Z

Source/JavaScriptCore/wtf/MainThread.cpp

@@bool isMainThread()
249249}
250250#endif
251251
 252#if ENABLE(PARALLEL_GC)
 253static ThreadSpecific<bool>* isGCThread;
 254
 255void registerGCThread()
 256{
 257 if (!isGCThread) {
 258 // This happens if we're running in a process that doesn't care about
 259 // MainThread.
 260 return;
 261 }
 262
 263 **isGCThread = true;
 264}
 265
 266bool isMainThreadOrGCThread()
 267{
 268 if (isGCThread->isSet() && **isGCThread)
 269 return true;
 270
 271 return isMainThread();
 272}
 273#endif
 274
252275} // namespace WTF

Source/JavaScriptCore/wtf/MainThread.h

@@WTF_EXPORT_PRIVATE bool isMainThread();
5555#if ENABLE(PARALLEL_GC)
5656void registerGCThread();
5757WTF_EXPORT_PRIVATE bool isMainThreadOrGCThread();
58 #elif PLATFORM(MAC)
59 bool isMainThreadOrGCThread();
6058#else
6159inline bool isMainThreadOrGCThread() { return isMainThread(); }
6260#endif

Source/JavaScriptCore/wtf/Platform.h

11181118#define ENABLE_COMPARE_AND_SWAP 1
11191119#endif
11201120
1121 #if !defined(ENABLE_PARALLEL_GC) && (PLATFORM(MAC) || PLATFORM(IOS)) && ENABLE(COMPARE_AND_SWAP)
 1121#if !defined(ENABLE_PARALLEL_GC) && (PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(QT)) && ENABLE(COMPARE_AND_SWAP)
11221122#define ENABLE_PARALLEL_GC 1
11231123#endif
11241124

Source/JavaScriptCore/wtf/mac/MainThreadMac.mm

@@bool isMainThread()
145145 return pthread_equal(pthread_self(), mainThreadPthread);
146146}
147147
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 about
153  // 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 #else
168 // This is necessary because JavaScriptCore.exp doesn't support preprocessor macros.
169 bool isMainThreadOrGCThread()
170 {
171  return isMainThread();
172 }
173 #endif
174 
175148} // namespace WTF