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, | 69 base::OS::SNPrintF(buffer, kBufferSize, "%28s %10.3f (%5.1f%%) %10" PRIuS |
70 "%28s %10.3f (%5.1f%%) " | 70 " (%5.1f%%) %10" PRIuS " %10" PRIuS, |
71 "%10u (%5.1f%%) %10u %10u", | |
72 name, ms, percent, stats.total_allocated_bytes_, | 71 name, ms, percent, stats.total_allocated_bytes_, |
73 size_percent, stats.max_allocated_bytes_, | 72 size_percent, stats.max_allocated_bytes_, |
74 stats.absolute_max_allocated_bytes_); | 73 stats.absolute_max_allocated_bytes_); |
75 | 74 |
76 os << buffer; | 75 os << buffer; |
77 if (stats.function_name_.size() > 0) { | 76 if (stats.function_name_.size() > 0) { |
78 os << " " << stats.function_name_.c_str(); | 77 os << " " << stats.function_name_.c_str(); |
79 } | 78 } |
80 os << std::endl; | 79 os << std::endl; |
81 } | 80 } |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 os << std::endl; | 136 os << std::endl; |
138 } | 137 } |
139 WriteFullLine(os); | 138 WriteFullLine(os); |
140 WriteLine(os, "totals", s.total_stats_, s.total_stats_); | 139 WriteLine(os, "totals", s.total_stats_, s.total_stats_); |
141 | 140 |
142 return os; | 141 return os; |
143 } | 142 } |
144 | 143 |
145 } // namespace internal | 144 } // namespace internal |
146 } // namespace v8 | 145 } // namespace v8 |
OLD | NEW |