Ignore:
Timestamp:
Oct 16, 2014, 6:29:55 AM (11 years ago)
Author:
[email protected]
Message:

Use isnan from std namespace in ProfileGenerator.cpp
https://bugs.webkit.org/show_bug.cgi?id=137653

Patch by Adrien Destugues <[email protected]> on 2014-10-16
Reviewed by Darin Adler.

The C++ isnan() function is in the std namespace. The unprefixed isnan
may be available because of C99 headers leakage in C++, but should not
be used.

No new tests: no functional change, build fix on platforms which don't
export C99 functions in C++.

  • profiler/ProfileGenerator.cpp:

(JSC::ProfileGenerator::beginCallEntry):
(JSC::ProfileGenerator::endCallEntry):
(JSC::ProfileGenerator::didPause):
(JSC::ProfileGenerator::didContinue):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/profiler/ProfileGenerator.cpp

    r174322 r174762  
    118118    ASSERT_ARG(node, node);
    119119
    120     if (isnan(startTime))
     120    if (std::isnan(startTime))
    121121        startTime = currentTime();
    122122
    123123    // If the debugger is paused when beginning, then don't set the start time. It
    124124    // will be fixed up when the debugger unpauses or the call entry ends.
    125     if (!isnan(m_debuggerPausedTimestamp))
     125    if (!std::isnan(m_debuggerPausedTimestamp))
    126126        startTime = NAN;
    127127
     
    136136
    137137    // If the debugger is paused, ignore the interval that ends now.
    138     if (!isnan(m_debuggerPausedTimestamp) && !isnan(last.elapsedTime()))
     138    if (!std::isnan(m_debuggerPausedTimestamp) && !std::isnan(last.elapsedTime()))
    139139        return;
    140140
    141141    // If paused and no time was accrued then the debugger was never unpaused. The call will
    142142    // have no time accrued and appear to have started when the debugger was paused.
    143     if (!isnan(m_debuggerPausedTimestamp)) {
     143    if (!std::isnan(m_debuggerPausedTimestamp)) {
    144144        last.setStartTime(m_debuggerPausedTimestamp);
    145145        last.setElapsedTime(0.0);
     
    148148
    149149    // Otherwise, add the interval ending now to elapsed time.
    150     double previousElapsedTime = isnan(last.elapsedTime()) ? 0.0 : last.elapsedTime();
     150    double previousElapsedTime = std::isnan(last.elapsedTime()) ? 0.0 : last.elapsedTime();
    151151    double newlyElapsedTime = currentTime() - last.startTime();
    152152    last.setElapsedTime(previousElapsedTime + newlyElapsedTime);
     
    226226void ProfileGenerator::didPause(PassRefPtr<DebuggerCallFrame>, const CallIdentifier&)
    227227{
    228     ASSERT(isnan(m_debuggerPausedTimestamp));
     228    ASSERT(std::isnan(m_debuggerPausedTimestamp));
    229229
    230230    m_debuggerPausedTimestamp = currentTime();
     
    232232    for (ProfileNode* node = m_currentNode.get(); node != m_profile->rootNode(); node = node->parent()) {
    233233        ProfileNode::Call& last = node->lastCall();
    234         ASSERT(!isnan(last.startTime()));
    235 
    236         double previousElapsedTime = isnan(last.elapsedTime()) ? 0.0 : last.elapsedTime();
     234        ASSERT(!std::isnan(last.startTime()));
     235
     236        double previousElapsedTime = std::isnan(last.elapsedTime()) ? 0.0 : last.elapsedTime();
    237237        double additionalElapsedTime = m_debuggerPausedTimestamp - last.startTime();
    238238        last.setStartTime(NAN);
     
    243243void ProfileGenerator::didContinue(PassRefPtr<DebuggerCallFrame>, const CallIdentifier&)
    244244{
    245     ASSERT(!isnan(m_debuggerPausedTimestamp));
     245    ASSERT(!std::isnan(m_debuggerPausedTimestamp));
    246246
    247247    for (ProfileNode* node = m_currentNode.get(); node != m_profile->rootNode(); node = node->parent())
Note: See TracChangeset for help on using the changeset viewer.