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 15 matching lines...) Expand all Loading... |
26 stats_(compiler_stats) { | 26 stats_(compiler_stats) { |
27 } | 27 } |
28 | 28 |
29 void VisitObject(RawObject* raw_obj) { | 29 void VisitObject(RawObject* raw_obj) { |
30 if (raw_obj->IsFreeListElement()) { | 30 if (raw_obj->IsFreeListElement()) { |
31 return; | 31 return; |
32 } | 32 } |
33 obj_ = raw_obj; | 33 obj_ = raw_obj; |
34 if (obj_.GetClassId() == TokenStream::kClassId) { | 34 if (obj_.GetClassId() == TokenStream::kClassId) { |
35 TokenStream::Iterator tkit(TokenStream::Cast(obj_), | 35 TokenStream::Iterator tkit(TokenStream::Cast(obj_), |
36 0, | 36 TokenPosition::kMinSource, |
37 TokenStream::Iterator::kNoNewlines); | 37 TokenStream::Iterator::kNoNewlines); |
38 Token::Kind kind = tkit.CurrentTokenKind(); | 38 Token::Kind kind = tkit.CurrentTokenKind(); |
39 while (kind != Token::kEOS) { | 39 while (kind != Token::kEOS) { |
40 ++stats_->num_tokens_total; | 40 ++stats_->num_tokens_total; |
41 tkit.Advance(); | 41 tkit.Advance(); |
42 kind = tkit.CurrentTokenKind(); | 42 kind = tkit.CurrentTokenKind(); |
43 } | 43 } |
44 } | 44 } |
45 } | 45 } |
46 | 46 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 total_instr_size / 1024); | 280 total_instr_size / 1024); |
281 log.Print(" Pc Desc size: %" Pd64 " KB\n", pc_desc_size / 1024); | 281 log.Print(" Pc Desc size: %" Pd64 " KB\n", pc_desc_size / 1024); |
282 log.Print(" VarDesc size: %" Pd64 " KB\n", vardesc_size / 1024); | 282 log.Print(" VarDesc size: %" Pd64 " KB\n", vardesc_size / 1024); |
283 log.Flush(); | 283 log.Flush(); |
284 char* stats_text = text; | 284 char* stats_text = text; |
285 text = NULL; | 285 text = NULL; |
286 return stats_text; | 286 return stats_text; |
287 } | 287 } |
288 | 288 |
289 } // namespace dart | 289 } // namespace dart |
OLD | NEW |