| 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 VM_COMPILER_STATS_H_ | 5 #ifndef VM_COMPILER_STATS_H_ |
| 6 #define VM_COMPILER_STATS_H_ | 6 #define VM_COMPILER_STATS_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/flags.h" | 9 #include "vm/flags.h" |
| 10 #include "vm/timer.h" | 10 #include "vm/timer.h" |
| 11 | 11 |
| 12 | 12 |
| 13 | 13 |
| 14 namespace dart { | 14 namespace dart { |
| 15 | 15 |
| 16 DECLARE_FLAG(bool, compiler_stats); | 16 DECLARE_FLAG(bool, compiler_stats); |
| 17 | 17 |
| 18 | 18 |
| 19 class CompilerStats : AllStatic { | 19 class CompilerStats : AllStatic { |
| 20 public: | 20 public: |
| 21 static intptr_t num_tokens_total; | 21 static intptr_t num_tokens_total; |
| 22 static intptr_t num_literal_tokens_total; |
| 23 static intptr_t num_ident_tokens_total; |
| 22 static intptr_t num_tokens_consumed; | 24 static intptr_t num_tokens_consumed; |
| 23 static intptr_t num_token_checks; | 25 static intptr_t num_token_checks; |
| 24 static intptr_t num_tokens_rewind; | 26 static intptr_t num_tokens_rewind; |
| 25 static intptr_t num_tokens_lookahead; | 27 static intptr_t num_tokens_lookahead; |
| 26 | 28 |
| 27 static intptr_t src_length; // Total number of characters in source. | 29 static intptr_t src_length; // Total number of characters in source. |
| 28 static intptr_t code_allocated; // Bytes allocated for generated code. | 30 static intptr_t code_allocated; // Bytes allocated for generated code. |
| 29 static Timer parser_timer; // Cumulative runtime of parser. | 31 static Timer parser_timer; // Cumulative runtime of parser. |
| 30 static Timer scanner_timer; // Cumulative runtime of scanner. | 32 static Timer scanner_timer; // Cumulative runtime of scanner. |
| 31 | 33 |
| 32 static void Print(); | 34 static void Print(); |
| 33 }; | 35 }; |
| 34 | 36 |
| 35 | 37 |
| 36 } // namespace dart | 38 } // namespace dart |
| 37 | 39 |
| 38 #endif // VM_COMPILER_STATS_H_ | 40 #endif // VM_COMPILER_STATS_H_ |
| OLD | NEW |