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
This commit is contained in:
fschneider@chromium.org 2011-03-25 10:02:42 +00:00
parent 3a1c4d9b78
commit 6fadb5257f

View File

@ -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",