| 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 #ifndef RUNTIME_VM_COMPILER_STATS_H_ | 5 #ifndef RUNTIME_VM_COMPILER_STATS_H_ |
| 6 #define RUNTIME_VM_COMPILER_STATS_H_ | 6 #define RUNTIME_VM_COMPILER_STATS_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/atomic.h" | 9 #include "vm/atomic.h" |
| 10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
| 11 #include "vm/isolate.h" | 11 #include "vm/isolate.h" |
| 12 #include "vm/timer.h" | 12 #include "vm/timer.h" |
| 13 | 13 |
| 14 | |
| 15 namespace dart { | 14 namespace dart { |
| 16 | 15 |
| 17 DECLARE_FLAG(bool, compiler_stats); | 16 DECLARE_FLAG(bool, compiler_stats); |
| 18 DECLARE_FLAG(bool, compiler_benchmark); | 17 DECLARE_FLAG(bool, compiler_benchmark); |
| 19 | 18 |
| 20 | |
| 21 #define STAT_TIMERS(V) \ | 19 #define STAT_TIMERS(V) \ |
| 22 V(parser_timer, "parser timer") \ | 20 V(parser_timer, "parser timer") \ |
| 23 V(scanner_timer, "scanner timer") \ | 21 V(scanner_timer, "scanner timer") \ |
| 24 V(codegen_timer, "codegen timer") \ | 22 V(codegen_timer, "codegen timer") \ |
| 25 V(graphbuilder_timer, "flow graph builder timer") \ | 23 V(graphbuilder_timer, "flow graph builder timer") \ |
| 26 V(ssa_timer, "flow graph SSA timer") \ | 24 V(ssa_timer, "flow graph SSA timer") \ |
| 27 V(graphinliner_timer, "flow graph inliner timer") \ | 25 V(graphinliner_timer, "flow graph inliner timer") \ |
| 28 V(graphinliner_parse_timer, "inliner parsing timer") \ | 26 V(graphinliner_parse_timer, "inliner parsing timer") \ |
| 29 V(graphinliner_build_timer, "inliner building timer") \ | 27 V(graphinliner_build_timer, "inliner building timer") \ |
| 30 V(graphinliner_ssa_timer, "inliner SSA timer") \ | 28 V(graphinliner_ssa_timer, "inliner SSA timer") \ |
| 31 V(graphinliner_opt_timer, "inliner optimization timer") \ | 29 V(graphinliner_opt_timer, "inliner optimization timer") \ |
| 32 V(graphinliner_subst_timer, "inliner substitution timer") \ | 30 V(graphinliner_subst_timer, "inliner substitution timer") \ |
| 33 V(graphoptimizer_timer, "flow graph optimizer timer") \ | 31 V(graphoptimizer_timer, "flow graph optimizer timer") \ |
| 34 V(graphcompiler_timer, "flow graph compiler timer") \ | 32 V(graphcompiler_timer, "flow graph compiler timer") \ |
| 35 V(codefinalizer_timer, "code finalization timer") | 33 V(codefinalizer_timer, "code finalization timer") |
| 36 | 34 |
| 37 | |
| 38 #define STAT_COUNTERS(V) \ | 35 #define STAT_COUNTERS(V) \ |
| 39 V(num_tokens_total) \ | 36 V(num_tokens_total) \ |
| 40 V(num_tokens_scanned) \ | 37 V(num_tokens_scanned) \ |
| 41 V(num_tokens_consumed) \ | 38 V(num_tokens_consumed) \ |
| 42 V(num_cached_consts) \ | 39 V(num_cached_consts) \ |
| 43 V(num_const_cache_hits) \ | 40 V(num_const_cache_hits) \ |
| 44 V(num_execute_const) \ | 41 V(num_execute_const) \ |
| 45 V(num_classes_parsed) \ | 42 V(num_classes_parsed) \ |
| 46 V(num_class_tokens) \ | 43 V(num_class_tokens) \ |
| 47 V(num_functions_parsed) \ | 44 V(num_functions_parsed) \ |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 int64_t num_method_extractors; | 95 int64_t num_method_extractors; |
| 99 | 96 |
| 100 int64_t src_length; // Total number of characters in source. | 97 int64_t src_length; // Total number of characters in source. |
| 101 int64_t total_code_size; // Bytes allocated for code and meta info. | 98 int64_t total_code_size; // Bytes allocated for code and meta info. |
| 102 int64_t total_instr_size; // Total size of generated code in bytes. | 99 int64_t total_instr_size; // Total size of generated code in bytes. |
| 103 int64_t pc_desc_size; | 100 int64_t pc_desc_size; |
| 104 int64_t vardesc_size; | 101 int64_t vardesc_size; |
| 105 char* text; | 102 char* text; |
| 106 bool use_benchmark_output; | 103 bool use_benchmark_output; |
| 107 | 104 |
| 108 | |
| 109 void EnableBenchmark(); | 105 void EnableBenchmark(); |
| 110 char* BenchmarkOutput(); | 106 char* BenchmarkOutput(); |
| 111 char* PrintToZone(); | 107 char* PrintToZone(); |
| 112 | 108 |
| 113 // Used to aggregate stats. | 109 // Used to aggregate stats. |
| 114 void Add(const CompilerStats& other); | 110 void Add(const CompilerStats& other); |
| 115 void Clear(); | 111 void Clear(); |
| 116 | 112 |
| 117 bool IsCleared() const; | 113 bool IsCleared() const; |
| 118 | 114 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 134 ? (thread)->compiler_stats()->counter \ | 130 ? (thread)->compiler_stats()->counter \ |
| 135 : 0) | 131 : 0) |
| 136 | 132 |
| 137 #define CSTAT_TIMER_SCOPE(thr, t) \ | 133 #define CSTAT_TIMER_SCOPE(thr, t) \ |
| 138 TimerScope timer(FLAG_support_compiler_stats&& FLAG_compiler_stats, \ | 134 TimerScope timer(FLAG_support_compiler_stats&& FLAG_compiler_stats, \ |
| 139 (FLAG_support_compiler_stats && FLAG_compiler_stats) \ | 135 (FLAG_support_compiler_stats && FLAG_compiler_stats) \ |
| 140 ? &((thr)->compiler_stats()->t) \ | 136 ? &((thr)->compiler_stats()->t) \ |
| 141 : NULL, \ | 137 : NULL, \ |
| 142 thr); | 138 thr); |
| 143 | 139 |
| 144 | |
| 145 } // namespace dart | 140 } // namespace dart |
| 146 | 141 |
| 147 #endif // RUNTIME_VM_COMPILER_STATS_H_ | 142 #endif // RUNTIME_VM_COMPILER_STATS_H_ |
| OLD | NEW |