Author: mikhail.naga...@gmail.com Date: Fri May 29 02:33:53 2009 New Revision: 2078
Modified: branches/bleeding_edge/test/cctest/test-log.cc Log: 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 Modified: branches/bleeding_edge/test/cctest/test-log.cc ============================================================================== --- branches/bleeding_edge/test/cctest/test-log.cc (original) +++ branches/bleeding_edge/test/cctest/test-log.cc Fri May 29 02:33:53 2009 @@ -166,9 +166,11 @@ "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()); } --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list v8-dev@googlegroups.com http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---