Ignore:
Timestamp:
Feb 15, 2018, 2:34:16 PM (7 years ago)
Author:
Yusuke Suzuki
Message:

[JSC] Remove monotonicallyIncreasingTime and currentTime
https://bugs.webkit.org/show_bug.cgi?id=182793

Reviewed by Saam Barati.

We would like to drop monotonicallyIncreasingTime and currentTime from our tree by
replacing them with MonotonicTime and WallTime, which are well-typed alternatives,
compared to double.
This patch removes monotonicallyIncreasingTime and currentTime in JSC.

  • b3/testb3.cpp:

(JSC::B3::testComplex):

  • dfg/DFGPhase.h:

(JSC::DFG::runAndLog):

  • dfg/DFGPlan.cpp:

(JSC::DFG::Plan::compileInThread):
(JSC::DFG::Plan::compileInThreadImpl):

  • dfg/DFGPlan.h:
  • dynbench.cpp:

(JSC::benchmarkImpl):

  • heap/BlockDirectory.cpp:

(JSC::BlockDirectory::isPagedOut):

  • heap/BlockDirectory.h:
  • heap/FullGCActivityCallback.cpp:

(JSC::FullGCActivityCallback::doCollection):

  • heap/Heap.cpp:

(JSC::Heap::isPagedOut):
(JSC::Heap::sweepSynchronously):

  • heap/Heap.h:
  • heap/MarkedSpace.cpp:

(JSC::MarkedSpace::isPagedOut):

  • heap/MarkedSpace.h:
  • inspector/agents/InspectorConsoleAgent.cpp:

(Inspector::InspectorConsoleAgent::startTiming):
(Inspector::InspectorConsoleAgent::stopTiming):

  • inspector/agents/InspectorConsoleAgent.h:
  • inspector/agents/InspectorRuntimeAgent.cpp:

(Inspector::InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets):

  • jit/JIT.cpp:

(JSC::JIT::compileWithoutLinking):
(JSC::JIT::compileTimeStats):

  • jit/JIT.h:
  • jsc.cpp:

(StopWatch::start):
(StopWatch::stop):
(StopWatch::getElapsedMS):
(functionPreciseTime):
(runJSC):

  • profiler/ProfilerDatabase.cpp:

(JSC::Profiler::Database::logEvent):

  • profiler/ProfilerEvent.cpp:

(JSC::Profiler::Event::toJS const):

  • profiler/ProfilerEvent.h:

(JSC::Profiler::Event::Event):
(JSC::Profiler::Event::time const):

  • runtime/CodeCache.cpp:

(JSC::CodeCacheMap::pruneSlowCase):

  • runtime/CodeCache.h:

(JSC::CodeCacheMap::CodeCacheMap):
(JSC::CodeCacheMap::prune):

  • runtime/DateConstructor.cpp:

(JSC::callDate):

  • runtime/TypeProfilerLog.cpp:

(JSC::TypeProfilerLog::processLogEntries):

  • testRegExp.cpp:

(StopWatch::start):
(StopWatch::stop):
(StopWatch::getElapsedMS):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jsc.cpp

    r228488 r228533  
    8181#include <type_traits>
    8282#include <wtf/CommaPrinter.h>
    83 #include <wtf/CurrentTime.h>
    8483#include <wtf/MainThread.h>
    8584#include <wtf/NeverDestroyed.h>
    8685#include <wtf/StringPrintStream.h>
     86#include <wtf/WallTime.h>
    8787#include <wtf/text/StringBuilder.h>
    8888
     
    410410
    411411private:
    412     double m_startTime;
    413     double m_stopTime;
     412    MonotonicTime m_startTime;
     413    MonotonicTime m_stopTime;
    414414};
    415415
    416416void StopWatch::start()
    417417{
    418     m_startTime = monotonicallyIncreasingTime();
     418    m_startTime = MonotonicTime::now();
    419419}
    420420
    421421void StopWatch::stop()
    422422{
    423     m_stopTime = monotonicallyIncreasingTime();
     423    m_stopTime = MonotonicTime::now();
    424424}
    425425
    426426long StopWatch::getElapsedMS()
    427427{
    428     return static_cast<long>((m_stopTime - m_startTime) * 1000);
     428    return (m_stopTime - m_startTime).millisecondsAs<long>();
    429429}
    430430
     
    13781378EncodedJSValue JSC_HOST_CALL functionPreciseTime(ExecState*)
    13791379{
    1380     return JSValue::encode(jsNumber(currentTime()));
     1380    return JSValue::encode(jsNumber(WallTime::now().secondsSinceEpoch().value()));
    13811381}
    13821382
     
    26502650        std::sort(compileTimeKeys.begin(), compileTimeKeys.end());
    26512651        for (CString key : compileTimeKeys)
    2652             printf("%40s: %.3lf ms\n", key.data(), compileTimeStats.get(key));
     2652            printf("%40s: %.3lf ms\n", key.data(), compileTimeStats.get(key).milliseconds());
    26532653    }
    26542654#endif
Note: See TracChangeset for help on using the changeset viewer.