Changeset 214936 in webkit


Ignore:
Timestamp:
Apr 5, 2017 12:58:02 AM (7 years ago)
Author:
Carlos Garcia Campos
Message:

Implement PromiseDeferredTimer for non CF based ports
https://bugs.webkit.org/show_bug.cgi?id=170391

Reviewed by Yusuke Suzuki.

RunLoop handling is only implemented for CF causing several wasm tests to fail for other ports.

  • jsc.cpp:

(runJSC): Remove CF ifdefs.

  • runtime/PromiseDeferredTimer.cpp:

(JSC::PromiseDeferredTimer::doWork): Add non CF implementation using WTF RunLoop.
(JSC::PromiseDeferredTimer::runRunLoop): Ditto.

  • runtime/PromiseDeferredTimer.h:
Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r214935 r214936  
     12017-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
    1172017-04-05  Carlos Garcia Campos  <cgarcia@igalia.com>
    218
  • trunk/Source/JavaScriptCore/jsc.cpp

    r214919 r214936  
    38133813        vm.drainMicrotasks();
    38143814    }
    3815 #if USE(CF)
    38163815    vm.promiseDeferredTimer->runRunLoop();
    3817 #endif
    38183816
    38193817    result = success && (asyncTestExpectedPasses == asyncTestPasses) ? 0 : 3;
  • trunk/Source/JavaScriptCore/runtime/PromiseDeferredTimer.cpp

    r214504 r214936  
    3030#include "StrongInlines.h"
    3131#include "VM.h"
    32 
    3332#include <wtf/Locker.h>
     33#include <wtf/RunLoop.h>
    3434
    3535namespace JSC {
     
    6969    }
    7070
     71    if (m_pendingPromises.isEmpty() && m_shouldStopRunLoopWhenAllPromisesFinish)
    7172#if USE(CF)
    72     if (m_pendingPromises.isEmpty() && m_shouldStopRunLoopWhenAllPromisesFinish)
    7373        CFRunLoopStop(m_runLoop.get());
     74#else
     75        RunLoop::current().stop();
    7476#endif
    7577}
    7678
    77 #if USE(CF)
    7879void PromiseDeferredTimer::runRunLoop()
    7980{
    8081    ASSERT(!m_vm->currentThreadIsHoldingAPILock());
     82#if USE(CF)
    8183    ASSERT(CFRunLoopGetCurrent() == m_runLoop.get());
     84#endif
    8285    m_shouldStopRunLoopWhenAllPromisesFinish = true;
    8386    if (m_pendingPromises.size())
     87#if USE(CF)
    8488        CFRunLoopRun();
     89#else
     90        RunLoop::run();
     91#endif
    8592}
    86 #endif
    8793
    8894void PromiseDeferredTimer::addPendingPromise(JSPromiseDeferred* ticket, Vector<Strong<JSCell>>&& dependencies)
  • trunk/Source/JavaScriptCore/runtime/PromiseDeferredTimer.h

    r214504 r214936  
    6262
    6363    void stopRunningTasks() { m_runTasks = false; }
    64 #if USE(CF)
     64
    6565    JS_EXPORT_PRIVATE void runRunLoop();
    66 #endif
    6766
    6867private:
     
    7069    Lock m_taskLock;
    7170    bool m_runTasks { true };
    72 #if USE(CF)
    7371    bool m_shouldStopRunLoopWhenAllPromisesFinish { false };
    74 #endif
    7572    Vector<std::tuple<JSPromiseDeferred*, Task>> m_tasks;
    7673    HashMap<JSPromiseDeferred*, Vector<Task>> m_blockedTasks;
Note: See TracChangeset for help on using the changeset viewer.