Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: runtime/vm/compiler_stats.cc

Issue 1952023002: Minor cleanup based on profiler output of CompileParseFunction. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 13 matching lines...) Expand all
24 : obj_(Object::Handle()), 24 : obj_(Object::Handle()),
25 stats_(compiler_stats) { 25 stats_(compiler_stats) {
26 } 26 }
27 27
28 void VisitObject(RawObject* raw_obj) { 28 void VisitObject(RawObject* raw_obj) {
29 if (raw_obj->IsFreeListElement()) { 29 if (raw_obj->IsFreeListElement()) {
30 return; 30 return;
31 } 31 }
32 obj_ = raw_obj; 32 obj_ = raw_obj;
33 if (obj_.GetClassId() == TokenStream::kClassId) { 33 if (obj_.GetClassId() == TokenStream::kClassId) {
34 TokenStream::Iterator tkit(TokenStream::Cast(obj_), 34 TokenStream::Iterator tkit(Thread::Current()->zone(),
35 TokenStream::Cast(obj_),
35 TokenPosition::kMinSource, 36 TokenPosition::kMinSource,
36 TokenStream::Iterator::kNoNewlines); 37 TokenStream::Iterator::kNoNewlines);
37 Token::Kind kind = tkit.CurrentTokenKind(); 38 Token::Kind kind = tkit.CurrentTokenKind();
38 while (kind != Token::kEOS) { 39 while (kind != Token::kEOS) {
39 ++stats_->num_tokens_total; 40 ++stats_->num_tokens_total;
40 tkit.Advance(); 41 tkit.Advance();
41 kind = tkit.CurrentTokenKind(); 42 kind = tkit.CurrentTokenKind();
42 } 43 }
43 } 44 }
44 } 45 }
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 log.Print(" VarDesc size: %" Pd64 " KB\n", vardesc_size / 1024); 309 log.Print(" VarDesc size: %" Pd64 " KB\n", vardesc_size / 1024);
309 log.Flush(); 310 log.Flush();
310 char* stats_text = text; 311 char* stats_text = text;
311 text = NULL; 312 text = NULL;
312 return stats_text; 313 return stats_text;
313 } 314 }
314 315
315 #endif // !PRODUCT 316 #endif // !PRODUCT
316 317
317 } // namespace dart 318 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/debugger.cc » ('j') | runtime/vm/raw_object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698