Fix hydrogen statistics output when no code gets optimized.

In that case print 0 instead of NaN for normalized time and bytes allocated.

R=kmillikin@chromium.org
Review URL: http://codereview.chromium.org/6696070

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7359 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 3a1c4d9b
......@@ -5817,9 +5817,14 @@ void HStatistics::Print() {
PrintF(" %8u bytes / %4.1f %%\n", size, size_percent);
}
double source_size_in_kb = static_cast<double>(source_size_) / 1024;
double normalized_time = source_size_in_kb > 0
? (static_cast<double>(sum) / 1000) / source_size_in_kb
: 0;
double normalized_bytes = source_size_in_kb > 0
? total_size_ / source_size_in_kb
: 0;
PrintF("%30s - %7.3f ms %7.3f bytes\n", "Sum",
(static_cast<double>(sum) / 1000) / source_size_in_kb,
total_size_ / source_size_in_kb);
normalized_time, normalized_bytes);
PrintF("---------------------------------------------------------------\n");
PrintF("%30s - %7.3f ms (%.1f times slower than full code gen)\n",
"Total",
......
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