OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <ostream> // NOLINT(readability/streams) | 5 #include <ostream> // NOLINT(readability/streams) |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "src/base/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
9 #include "src/compilation-statistics.h" | 9 #include "src/compilation-statistics.h" |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 const CompilationStatistics::BasicStats& stats, | 59 const CompilationStatistics::BasicStats& stats, |
60 const CompilationStatistics::BasicStats& total_stats) { | 60 const CompilationStatistics::BasicStats& total_stats) { |
61 const size_t kBufferSize = 128; | 61 const size_t kBufferSize = 128; |
62 char buffer[kBufferSize]; | 62 char buffer[kBufferSize]; |
63 | 63 |
64 double ms = stats.delta_.InMillisecondsF(); | 64 double ms = stats.delta_.InMillisecondsF(); |
65 double percent = stats.delta_.PercentOf(total_stats.delta_); | 65 double percent = stats.delta_.PercentOf(total_stats.delta_); |
66 double size_percent = | 66 double size_percent = |
67 static_cast<double>(stats.total_allocated_bytes_ * 100) / | 67 static_cast<double>(stats.total_allocated_bytes_ * 100) / |
68 static_cast<double>(total_stats.total_allocated_bytes_); | 68 static_cast<double>(total_stats.total_allocated_bytes_); |
69 base::OS::SNPrintF(buffer, kBufferSize, "%28s %10.3f (%5.1f%%) %10" PRIuS | 69 base::OS::SNPrintF(buffer, kBufferSize, |
70 " (%5.1f%%) %10" PRIuS " %10" PRIuS, | 70 "%28s %10.3f (%5.1f%%) " |
| 71 "%10u (%5.1f%%) %10u %10u", |
71 name, ms, percent, stats.total_allocated_bytes_, | 72 name, ms, percent, stats.total_allocated_bytes_, |
72 size_percent, stats.max_allocated_bytes_, | 73 size_percent, stats.max_allocated_bytes_, |
73 stats.absolute_max_allocated_bytes_); | 74 stats.absolute_max_allocated_bytes_); |
74 | 75 |
75 os << buffer; | 76 os << buffer; |
76 if (stats.function_name_.size() > 0) { | 77 if (stats.function_name_.size() > 0) { |
77 os << " " << stats.function_name_.c_str(); | 78 os << " " << stats.function_name_.c_str(); |
78 } | 79 } |
79 os << std::endl; | 80 os << std::endl; |
80 } | 81 } |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 os << std::endl; | 137 os << std::endl; |
137 } | 138 } |
138 WriteFullLine(os); | 139 WriteFullLine(os); |
139 WriteLine(os, "totals", s.total_stats_, s.total_stats_); | 140 WriteLine(os, "totals", s.total_stats_, s.total_stats_); |
140 | 141 |
141 return os; | 142 return os; |
142 } | 143 } |
143 | 144 |
144 } // namespace internal | 145 } // namespace internal |
145 } // namespace v8 | 146 } // namespace v8 |
OLD | NEW |