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.

Review URL: http://codereview.chromium.org/115918


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2078 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6ad05a9e
......@@ -166,9 +166,11 @@ static int CheckThatProfilerWorks(int log_pos) {
"for (var i = 0; i < 1000; ++i) { "
"(function(x) { return %d * x; })(i); }",
log_pos);
// Run code for 200 msecs to get some ticks.
const int64_t started_us = i::OS::Ticks();
while (i::OS::Ticks() - started_us < 200 * 1000) {
// Run code for 200 msecs to get some ticks. Use uint to always have
// non-negative delta.
const uint64_t started_us = i::OS::Ticks();
uint64_t delta;
while ((delta = i::OS::Ticks() - started_us) < 200 * 1000) {
CompileAndRunScript(script_src.start());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment