Changeset 214936 in webkit
- Timestamp:
- Apr 5, 2017 12:58:02 AM (7 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r214935 r214936 1 2017-04-05 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Implement PromiseDeferredTimer for non CF based ports 4 https://bugs.webkit.org/show_bug.cgi?id=170391 5 6 Reviewed by Yusuke Suzuki. 7 8 RunLoop handling is only implemented for CF causing several wasm tests to fail for other ports. 9 10 * jsc.cpp: 11 (runJSC): Remove CF ifdefs. 12 * runtime/PromiseDeferredTimer.cpp: 13 (JSC::PromiseDeferredTimer::doWork): Add non CF implementation using WTF RunLoop. 14 (JSC::PromiseDeferredTimer::runRunLoop): Ditto. 15 * runtime/PromiseDeferredTimer.h: 16 1 17 2017-04-05 Carlos Garcia Campos <cgarcia@igalia.com> 2 18 -
trunk/Source/JavaScriptCore/jsc.cpp
r214919 r214936 3813 3813 vm.drainMicrotasks(); 3814 3814 } 3815 #if USE(CF)3816 3815 vm.promiseDeferredTimer->runRunLoop(); 3817 #endif3818 3816 3819 3817 result = success && (asyncTestExpectedPasses == asyncTestPasses) ? 0 : 3; -
trunk/Source/JavaScriptCore/runtime/PromiseDeferredTimer.cpp
r214504 r214936 30 30 #include "StrongInlines.h" 31 31 #include "VM.h" 32 33 32 #include <wtf/Locker.h> 33 #include <wtf/RunLoop.h> 34 34 35 35 namespace JSC { … … 69 69 } 70 70 71 if (m_pendingPromises.isEmpty() && m_shouldStopRunLoopWhenAllPromisesFinish) 71 72 #if USE(CF) 72 if (m_pendingPromises.isEmpty() && m_shouldStopRunLoopWhenAllPromisesFinish)73 73 CFRunLoopStop(m_runLoop.get()); 74 #else 75 RunLoop::current().stop(); 74 76 #endif 75 77 } 76 78 77 #if USE(CF)78 79 void PromiseDeferredTimer::runRunLoop() 79 80 { 80 81 ASSERT(!m_vm->currentThreadIsHoldingAPILock()); 82 #if USE(CF) 81 83 ASSERT(CFRunLoopGetCurrent() == m_runLoop.get()); 84 #endif 82 85 m_shouldStopRunLoopWhenAllPromisesFinish = true; 83 86 if (m_pendingPromises.size()) 87 #if USE(CF) 84 88 CFRunLoopRun(); 89 #else 90 RunLoop::run(); 91 #endif 85 92 } 86 #endif87 93 88 94 void PromiseDeferredTimer::addPendingPromise(JSPromiseDeferred* ticket, Vector<Strong<JSCell>>&& dependencies) -
trunk/Source/JavaScriptCore/runtime/PromiseDeferredTimer.h
r214504 r214936 62 62 63 63 void stopRunningTasks() { m_runTasks = false; } 64 #if USE(CF) 64 65 65 JS_EXPORT_PRIVATE void runRunLoop(); 66 #endif67 66 68 67 private: … … 70 69 Lock m_taskLock; 71 70 bool m_runTasks { true }; 72 #if USE(CF)73 71 bool m_shouldStopRunLoopWhenAllPromisesFinish { false }; 74 #endif75 72 Vector<std::tuple<JSPromiseDeferred*, Task>> m_tasks; 76 73 HashMap<JSPromiseDeferred*, Vector<Task>> m_blockedTasks;
Note: See TracChangeset
for help on using the changeset viewer.