Ignore:
Timestamp:
Dec 26, 2017, 4:33:11 PM (7 years ago)
Author:
Yusuke Suzuki
Message:

[JSC] Remove std::chrono completely
https://bugs.webkit.org/show_bug.cgi?id=181165

Reviewed by Konstantin Tokarev.

Source/JavaScriptCore:

This patch removes std::chrono use completely from JSC.

  • API/JSContextRef.cpp:

(JSContextGroupSetExecutionTimeLimit):

  • API/tests/ExecutionTimeLimitTest.cpp:

(currentCPUTimeAsJSFunctionCallback):
(testExecutionTimeLimit):

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::CodeBlock):
(JSC::timeToLive):

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::timeSinceCreation):

  • runtime/SamplingProfiler.cpp:

(JSC::SamplingProfiler::SamplingProfiler):
(JSC::SamplingProfiler::timerLoop):
(JSC::SamplingProfiler::takeSample):
(JSC::SamplingProfiler::reportTopFunctions):
(JSC::SamplingProfiler::reportTopBytecodes):

  • runtime/SamplingProfiler.h:

(JSC::SamplingProfiler::setTimingInterval):

  • runtime/VM.cpp:

(JSC::VM::VM):

  • runtime/Watchdog.cpp:

(JSC::Watchdog::Watchdog):
(JSC::Watchdog::setTimeLimit):
(JSC::Watchdog::shouldTerminate):
(JSC::Watchdog::startTimer):
(JSC::currentWallClockTime): Deleted.

  • runtime/Watchdog.h:

Source/WTF:

WTF::currentCPUTime now returns WTF::Seconds.
We also add the implementaiton for Linux and FreeBSD.

  • wtf/CurrentTime.cpp:

(WTF::currentCPUTime):

  • wtf/CurrentTime.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSContextRef.cpp

    r221822 r226295  
    100100    if (callback) {
    101101        void* callbackPtr = reinterpret_cast<void*>(callback);
    102         watchdog.setTimeLimit(std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::duration<double>(limit)), internalScriptTimeoutCallback, callbackPtr, callbackData);
     102        watchdog.setTimeLimit(Seconds { limit }, internalScriptTimeoutCallback, callbackPtr, callbackData);
    103103    } else
    104         watchdog.setTimeLimit(std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::duration<double>(limit)));
     104        watchdog.setTimeLimit(Seconds { limit });
    105105}
    106106
Note: See TracChangeset for help on using the changeset viewer.