| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/compiler_stats.h" | 5 #include "vm/compiler_stats.h" |
| 6 | 6 |
| 7 #include "vm/flags.h" | 7 #include "vm/flags.h" |
| 8 #include "vm/log.h" | 8 #include "vm/log.h" |
| 9 #include "vm/object_graph.h" | 9 #include "vm/object_graph.h" |
| 10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 FLAG_compiler_stats = true; | 136 FLAG_compiler_stats = true; |
| 137 use_benchmark_output = true; | 137 use_benchmark_output = true; |
| 138 } | 138 } |
| 139 | 139 |
| 140 // Generate output for Golem benchmark harness. If the output format | 140 // Generate output for Golem benchmark harness. If the output format |
| 141 // changes, the parsing function in Golem must be updated. | 141 // changes, the parsing function in Golem must be updated. |
| 142 char* CompilerStats::BenchmarkOutput() { | 142 char* CompilerStats::BenchmarkOutput() { |
| 143 Update(); | 143 Update(); |
| 144 Log log(PrintToStats); | 144 Log log(PrintToStats); |
| 145 LogBlock lb(Thread::Current(), &log); | 145 LogBlock lb(Thread::Current(), &log); |
| 146 log.Print("==== Compiler Stats for isolate '%s' ====\n", | 146 log.Print("==== Compiler Stats for isolate (%" Pd64 ") '%s' ====\n", |
| 147 isolate_->debugger_name()); | 147 static_cast<int64_t>(isolate_->main_port()), isolate_->name()); |
| 148 | 148 |
| 149 log.Print("NumberOfTokens: %" Pd64 "\n", num_tokens_total); | 149 log.Print("NumberOfTokens: %" Pd64 "\n", num_tokens_total); |
| 150 log.Print("NumClassesParsed: %" Pd64 "\n", num_classes_parsed); | 150 log.Print("NumClassesParsed: %" Pd64 "\n", num_classes_parsed); |
| 151 log.Print("NumFunctionsCompiled: %" Pd64 "\n", num_functions_compiled); | 151 log.Print("NumFunctionsCompiled: %" Pd64 "\n", num_functions_compiled); |
| 152 log.Print("NumFunctionsOptimized: %" Pd64 "\n", num_functions_optimized); | 152 log.Print("NumFunctionsOptimized: %" Pd64 "\n", num_functions_optimized); |
| 153 log.Print("NumFunctionsParsed: %" Pd64 "\n", num_functions_parsed); | 153 log.Print("NumFunctionsParsed: %" Pd64 "\n", num_functions_parsed); |
| 154 | 154 |
| 155 // Scanner stats. | 155 // Scanner stats. |
| 156 int64_t scan_usecs = scanner_timer.TotalElapsedTime(); | 156 int64_t scan_usecs = scanner_timer.TotalElapsedTime(); |
| 157 int64_t scan_speed = | 157 int64_t scan_speed = |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 return NULL; | 196 return NULL; |
| 197 } else if (use_benchmark_output) { | 197 } else if (use_benchmark_output) { |
| 198 return BenchmarkOutput(); | 198 return BenchmarkOutput(); |
| 199 } | 199 } |
| 200 | 200 |
| 201 Update(); | 201 Update(); |
| 202 | 202 |
| 203 Log log(PrintToStats); | 203 Log log(PrintToStats); |
| 204 LogBlock lb(Thread::Current(), &log); | 204 LogBlock lb(Thread::Current(), &log); |
| 205 | 205 |
| 206 log.Print("==== Compiler Stats for isolate '%s' ====\n", | 206 log.Print("==== Compiler Stats for isolate (%" Pd64 ") '%s' ====\n", |
| 207 isolate_->debugger_name()); | 207 static_cast<int64_t>(isolate_->main_port()), isolate_->name()); |
| 208 log.Print("Number of tokens: %" Pd64 "\n", num_tokens_total); | 208 log.Print("Number of tokens: %" Pd64 "\n", num_tokens_total); |
| 209 log.Print("Source length: %" Pd64 " characters\n", src_length); | 209 log.Print("Source length: %" Pd64 " characters\n", src_length); |
| 210 log.Print("Number of source tokens: %" Pd64 "\n", num_tokens_scanned); | 210 log.Print("Number of source tokens: %" Pd64 "\n", num_tokens_scanned); |
| 211 | 211 |
| 212 int64_t num_local_functions = | 212 int64_t num_local_functions = |
| 213 GrowableObjectArray::Handle(isolate_->object_store()->closure_functions()) | 213 GrowableObjectArray::Handle(isolate_->object_store()->closure_functions()) |
| 214 .Length(); | 214 .Length(); |
| 215 | 215 |
| 216 log.Print("==== Parser stats:\n"); | 216 log.Print("==== Parser stats:\n"); |
| 217 log.Print("Total tokens consumed: %" Pd64 "\n", num_tokens_consumed); | 217 log.Print("Total tokens consumed: %" Pd64 "\n", num_tokens_consumed); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 log.Print(" VarDesc size: %" Pd64 " KB\n", vardesc_size / 1024); | 299 log.Print(" VarDesc size: %" Pd64 " KB\n", vardesc_size / 1024); |
| 300 log.Flush(); | 300 log.Flush(); |
| 301 char* stats_text = text; | 301 char* stats_text = text; |
| 302 text = NULL; | 302 text = NULL; |
| 303 return stats_text; | 303 return stats_text; |
| 304 } | 304 } |
| 305 | 305 |
| 306 #endif // !PRODUCT | 306 #endif // !PRODUCT |
| 307 | 307 |
| 308 } // namespace dart | 308 } // namespace dart |
| OLD | NEW |