Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Issue 115918: Use uint in ProfLazyMode test when measuring time delta. (Closed)

Created:
11 years, 6 months ago by Mikhail Naganov
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Use uint in ProfLazyMode test when measuring time delta. While testing ProfLazyMode stability I encountered a situation when the cycle supposed to run for 200 ms started to run "infinitely" because delta between two int64_t values became negative. Committed: http://code.google.com/p/v8/source/detail?r=2078

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -3 lines) Patch
M test/cctest/test-log.cc View 1 chunk +5 lines, -3 lines 2 comments Download

Messages

Total messages: 5 (0 generated)
Mikhail Naganov
11 years, 6 months ago (2009-05-29 09:23:10 UTC) #1
Søren Thygesen Gjesse
LGTM
11 years, 6 months ago (2009-05-29 09:25:12 UTC) #2
William Hesse
http://codereview.chromium.org/115918/diff/1/2 File test/cctest/test-log.cc (right): http://codereview.chromium.org/115918/diff/1/2#newcode173 Line 173: while ((delta = i::OS::Ticks() - started_us) < 200 ...
11 years, 6 months ago (2009-05-29 12:19:49 UTC) #3
William Hesse
http://codereview.chromium.org/115918/diff/1/2 File test/cctest/test-log.cc (right): http://codereview.chromium.org/115918/diff/1/2#newcode173 Line 173: while ((delta = i::OS::Ticks() - started_us) < 200 ...
11 years, 6 months ago (2009-05-29 12:55:32 UTC) #4
Tobias Kaes
11 years, 6 months ago (2009-05-29 13:12:16 UTC) #5
I don't think either is really correct. The implementation of OS::Tick can wrap
around ways before reaching the int64 or uint64 limit because its implementation
eg. on windows has a max value of uint32*1000 and then starts over with zero

So when started_us is before and ended_us after an OS::Tick wrap-around you will
have problems. Using an uint64 at least avoids the infinite loop you get with
int64, but it can result in terminating too early (ie. before 200ms are over).

Powered by Google App Engine
This is Rietveld 408576698