Ignore:
Timestamp:
Aug 31, 2010, 5:02:10 AM (15 years ago)
Author:
[email protected]
Message:

2010-08-31 Benjamin Poulain <[email protected]>

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):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.