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/runtime/SamplingProfiler.h

    r219653 r226295  
    163163    void visit(SlotVisitor&);
    164164    Lock& getLock() { return m_lock; }
    165     void setTimingInterval(std::chrono::microseconds interval) { m_timingInterval = interval; }
     165    void setTimingInterval(Seconds interval) { m_timingInterval = interval; }
    166166    JS_EXPORT_PRIVATE void start();
    167167    void start(const AbstractLocker&);
     
    186186    void createThreadIfNecessary(const AbstractLocker&);
    187187    void timerLoop();
    188     void takeSample(const AbstractLocker&, std::chrono::microseconds& stackTraceProcessingTime);
     188    void takeSample(const AbstractLocker&, Seconds& stackTraceProcessingTime);
    189189
    190190    VM& m_vm;
     
    193193    Vector<StackTrace> m_stackTraces;
    194194    Vector<UnprocessedStackTrace> m_unprocessedStackTraces;
    195     std::chrono::microseconds m_timingInterval;
     195    Seconds m_timingInterval;
    196196    double m_lastTime;
    197197    Lock m_lock;
Note: See TracChangeset for help on using the changeset viewer.