Changeset 66475 in webkit


Ignore:
Timestamp:
Aug 31, 2010 5:02:10 AM (14 years ago)
Author:
benjamin.poulain@nokia.com
Message:

2010-08-31 Benjamin Poulain <benjamin.poulain@nokia.com>

Reviewed by Kenneth Rohde Christiansen.

JSC TimeoutChecker::didTimeOut overflows on ARM
https://bugs.webkit.org/show_bug.cgi?id=38538

Make getCPUTime() return values relative to the first call.
The previous implementation relied on simply on currentTime(), which
return a time since epoch and not a time since the thread started. This
made the return value of getCPUTime() overflow on 32 bits.

  • runtime/TimeoutChecker.cpp: (JSC::getCPUTime):
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r66458 r66475  
     12010-08-31  Benjamin Poulain  <benjamin.poulain@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        JSC TimeoutChecker::didTimeOut overflows on ARM
     6        https://bugs.webkit.org/show_bug.cgi?id=38538
     7
     8        Make getCPUTime() return values relative to the first call.
     9        The previous implementation relied on simply on currentTime(), which
     10        return a time since epoch and not a time since the thread started. This
     11        made the return value of getCPUTime() overflow on 32 bits.
     12
     13        * runtime/TimeoutChecker.cpp:
     14        (JSC::getCPUTime):
     15
    1162010-08-30  Mihai Parparita  <mihaip@chromium.org>
    217
  • trunk/JavaScriptCore/runtime/TimeoutChecker.cpp

    r55296 r66475  
    9999#else
    100100    // FIXME: We should return the time the current thread has spent executing.
    101     return currentTime() * 1000;
     101
     102    // use a relative time from first call in order to avoid an overflow
     103    static double firstTime = currentTime();
     104    return (currentTime() - firstTime) * 1000;
    102105#endif
    103106}
Note: See TracChangeset for help on using the changeset viewer.