Changeset 190324 in webkit
- Timestamp:
- Sep 29, 2015 1:25:42 PM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r190310 r190324 1 2015-09-29 Filip Pizlo <fpizlo@apple.com> 2 3 ParallelHelperPool::runFunctionInParallel() shouldn't allocate, and ParallelHelperPool.h shouldn't be included everywhere 4 https://bugs.webkit.org/show_bug.cgi?id=149635 5 6 Reviewed by Saam Barati. 7 8 It bugged me that this change caused a whole-world recompile. So, I changed the code so 9 that ParallelHelperPool.h is only included by Heap.cpp and not by Heap.h. 10 11 * heap/Heap.cpp: 12 (JSC::Heap::Heap): 13 (JSC::Heap::markRoots): 14 (JSC::Heap::copyBackingStores): 15 * heap/Heap.h: 16 1 17 2015-09-29 Filip Pizlo <fpizlo@apple.com> 2 18 -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r190310 r190324 54 54 #include <wtf/RAMSize.h> 55 55 #include <wtf/CurrentTime.h> 56 #include <wtf/ParallelHelperPool.h> 56 57 #include <wtf/ParallelVectorIterator.h> 57 58 #include <wtf/ProcessID.h> … … 358 359 , m_delayedReleaseRecursionCount(0) 359 360 #endif 360 , m_helperClient( &heapHelperPool())361 , m_helperClient(std::make_unique<ParallelHelperClient>(&heapHelperPool())) 361 362 { 362 363 m_storageSpace.init(); … … 548 549 m_parallelMarkersShouldExit = false; 549 550 550 m_helperClient .setFunction(551 m_helperClient->setFunction( 551 552 [this] () { 552 553 SlotVisitor* slotVisitor; … … 605 606 m_markingConditionVariable.notifyAll(); 606 607 } 607 m_helperClient .finish();608 m_helperClient->finish(); 608 609 updateObjectCounts(gcStartTime); 609 610 resetVisitors(); … … 638 639 // we have created is not going to be running anymore. Hence, everything on the stack here 639 640 // outlives the task. 640 m_helperClient .runFunctionInParallel(641 m_helperClient->runFunctionInParallel( 641 642 [&] () { 642 643 CopyVisitor copyVisitor(*this); -
trunk/Source/JavaScriptCore/heap/Heap.h
r190310 r190324 46 46 #include <wtf/HashCountedSet.h> 47 47 #include <wtf/HashSet.h> 48 #include <wtf/ParallelHelperPool.h> 48 49 namespace WTF { 50 class ParallelHelperClient; 51 } 52 using WTF::ParallelHelperClient; 49 53 50 54 namespace JSC { … … 442 446 ListableHandler<UnconditionalFinalizer>::List m_unconditionalFinalizers; 443 447 444 ParallelHelperClientm_helperClient;448 std::unique_ptr<ParallelHelperClient> m_helperClient; 445 449 }; 446 450 -
trunk/Source/WTF/ChangeLog
r190310 r190324 1 2015-09-29 Filip Pizlo <fpizlo@apple.com> 2 3 ParallelHelperPool::runFunctionInParallel() shouldn't allocate, and ParallelHelperPool.h shouldn't be included everywhere 4 https://bugs.webkit.org/show_bug.cgi?id=149635 5 6 Reviewed by Saam Barati. 7 8 * wtf/ParallelHelperPool.h: 9 (WTF::ParallelHelperClient::runFunctionInParallel): Stack-allocate the task instead of heap-allocating it. 10 1 11 2015-09-29 Filip Pizlo <fpizlo@apple.com> 2 12 -
trunk/Source/WTF/wtf/ParallelHelperPool.h
r190268 r190324 149 149 WTF_EXPORT_PRIVATE void runTaskInParallel(RefPtr<SharedTask>); 150 150 151 // Equivalent to:151 // Semantically equivalent to: 152 152 // client->setFunction(functor); 153 153 // client->doSomeHelping(); 154 154 // client->finish(); 155 // 156 // Except, unlike the above sequence, this won't allocate the task in the heap. This allocates 157 // the task on the stack because it knows that the task is not reachable after this method is 158 // done. 155 159 template<typename Functor> 156 160 void runFunctionInParallel(const Functor& functor) 157 161 { 158 runTaskInParallel(createSharedTask(functor)); 162 SharedTaskFunctor<Functor> sharedTask(functor); 163 runTaskInParallel(&sharedTask); 159 164 } 160 165
Note: See TracChangeset
for help on using the changeset viewer.