| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, |
| 70 "%28s %10.3f ms / %5.1f %%" | 70 "%28s %10.3f (%5.1f%%) " |
| 71 "%10u total / %5.1f %% " | 71 "%10u (%5.1f%%) %10u %10u", |
| 72 "%10u max %10u abs_max", | |
| 73 name, ms, percent, stats.total_allocated_bytes_, | 72 name, ms, percent, stats.total_allocated_bytes_, |
| 74 size_percent, stats.max_allocated_bytes_, | 73 size_percent, stats.max_allocated_bytes_, |
| 75 stats.absolute_max_allocated_bytes_); | 74 stats.absolute_max_allocated_bytes_); |
| 76 | 75 |
| 77 os << buffer; | 76 os << buffer; |
| 78 if (stats.function_name_.size() > 0) { | 77 if (stats.function_name_.size() > 0) { |
| 79 os << " : " << stats.function_name_.c_str(); | 78 os << " " << stats.function_name_.c_str(); |
| 80 } | 79 } |
| 81 os << std::endl; | 80 os << std::endl; |
| 82 } | 81 } |
| 83 | 82 |
| 84 | 83 |
| 85 static void WriteFullLine(std::ostream& os) { | 84 static void WriteFullLine(std::ostream& os) { |
| 86 os << "--------------------------------------------------------" | 85 os << "--------------------------------------------------------" |
| 87 "--------------------------------------------------------\n"; | 86 "--------------------------------------------------------\n"; |
| 88 } | 87 } |
| 89 | 88 |
| 90 | 89 |
| 91 static void WriteHeader(std::ostream& os) { | 90 static void WriteHeader(std::ostream& os) { |
| 92 WriteFullLine(os); | 91 WriteFullLine(os); |
| 93 os << " Turbofan timing results:\n"; | 92 os << " Turbonfan phase Time (ms) " |
| 93 << " Space (bytes) Function\n" |
| 94 << " " |
| 95 << " Total Max. Abs. max.\n"; |
| 94 WriteFullLine(os); | 96 WriteFullLine(os); |
| 95 } | 97 } |
| 96 | 98 |
| 97 | 99 |
| 98 static void WritePhaseKindBreak(std::ostream& os) { | 100 static void WritePhaseKindBreak(std::ostream& os) { |
| 99 os << " ---------------------------" | 101 os << " ---------------------------" |
| 100 "--------------------------------------------------------\n"; | 102 "--------------------------------------------------------\n"; |
| 101 } | 103 } |
| 102 | 104 |
| 103 | 105 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 os << std::endl; | 137 os << std::endl; |
| 136 } | 138 } |
| 137 WriteFullLine(os); | 139 WriteFullLine(os); |
| 138 WriteLine(os, "totals", s.total_stats_, s.total_stats_); | 140 WriteLine(os, "totals", s.total_stats_, s.total_stats_); |
| 139 | 141 |
| 140 return os; | 142 return os; |
| 141 } | 143 } |
| 142 | 144 |
| 143 } // namespace internal | 145 } // namespace internal |
| 144 } // namespace v8 | 146 } // namespace v8 |
| OLD | NEW |