Ignore:
Timestamp:
Jun 1, 2017, 10:42:23 AM (8 years ago)
Author:
[email protected]
Message:

[JSC][MIPS] SamplingProfiler::timerLoop() sleeps for 4000+ seconds
https://bugs.webkit.org/show_bug.cgi?id=172800

Patch by Guillaume Emont <[email protected]> on 2017-06-01
Reviewed by Saam Barati.

This fixes a static_cast<uint64_t> by making it a cast to int64_t
instead, which looks like the original intent. This fixes the
sampling-profiler tests in JSTests/stress.

  • runtime/SamplingProfiler.cpp:

(JSC::SamplingProfiler::timerLoop):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/SamplingProfiler.cpp

    r216428 r217663  
    326326        // http://plv.colorado.edu/papers/mytkowicz-pldi10.pdf
    327327        double randomSignedNumber = (m_weakRandom.get() * 2.0) - 1.0; // A random number between [-1, 1).
    328         std::chrono::microseconds randomFluctuation = std::chrono::microseconds(static_cast<uint64_t>(randomSignedNumber * static_cast<double>(m_timingInterval.count()) * 0.20l));
     328        std::chrono::microseconds randomFluctuation = std::chrono::microseconds(static_cast<int64_t>(randomSignedNumber * static_cast<double>(m_timingInterval.count()) * 0.20l));
    329329        std::this_thread::sleep_for(m_timingInterval - std::min(m_timingInterval, stackTraceProcessingTime) + randomFluctuation);
    330330    }
Note: See TracChangeset for help on using the changeset viewer.