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

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

Issue 1314673008: Migrate logging infrastructure Isolate->Thread (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix test. Created 5 years, 3 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/timer.h" 10 #include "vm/timer.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // Traverse the heap and compute number of tokens in all 117 // Traverse the heap and compute number of tokens in all
118 // TokenStream objects. 118 // TokenStream objects.
119 num_tokens_total = 0; 119 num_tokens_total = 0;
120 num_literal_tokens_total = 0; 120 num_literal_tokens_total = 0;
121 num_ident_tokens_total = 0; 121 num_ident_tokens_total = 0;
122 TokenStreamVisitor visitor(isolate_, this); 122 TokenStreamVisitor visitor(isolate_, this);
123 isolate_->heap()->IterateObjects(&visitor); 123 isolate_->heap()->IterateObjects(&visitor);
124 Dart::vm_isolate()->heap()->IterateObjects(&visitor); 124 Dart::vm_isolate()->heap()->IterateObjects(&visitor);
125 125
126 Log log(PrintToStats); 126 Log log(PrintToStats);
127 LogBlock lb(isolate_, &log); 127 LogBlock lb(Thread::Current(), &log);
128 128
129 log.Print("==== Compiler Stats for isolate '%s' ====\n", 129 log.Print("==== Compiler Stats for isolate '%s' ====\n",
130 isolate_->debugger_name()); 130 isolate_->debugger_name());
131 log.Print("Number of tokens: %" Pd64 "\n", num_tokens_total); 131 log.Print("Number of tokens: %" Pd64 "\n", num_tokens_total);
132 log.Print(" Literal tokens: %" Pd64 "\n", num_literal_tokens_total); 132 log.Print(" Literal tokens: %" Pd64 "\n", num_literal_tokens_total);
133 log.Print(" Ident tokens: %" Pd64 "\n", num_ident_tokens_total); 133 log.Print(" Ident tokens: %" Pd64 "\n", num_ident_tokens_total);
134 log.Print("Source length: %" Pd64 " characters\n", src_length); 134 log.Print("Source length: %" Pd64 " characters\n", src_length);
135 135
136 log.Print("==== Parser stats:\n"); 136 log.Print("==== Parser stats:\n");
137 log.Print("Total tokens consumed: %" Pd64 "\n", num_tokens_consumed); 137 log.Print("Total tokens consumed: %" Pd64 "\n", num_tokens_consumed);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 total_instr_size / 1024); 206 total_instr_size / 1024);
207 log.Print(" Pc Desc size: %" Pd64 " KB\n", pc_desc_size / 1024); 207 log.Print(" Pc Desc size: %" Pd64 " KB\n", pc_desc_size / 1024);
208 log.Print(" VarDesc size: %" Pd64 " KB\n", vardesc_size / 1024); 208 log.Print(" VarDesc size: %" Pd64 " KB\n", vardesc_size / 1024);
209 log.Flush(); 209 log.Flush();
210 char* stats_text = text; 210 char* stats_text = text;
211 text = NULL; 211 text = NULL;
212 return stats_text; 212 return stats_text;
213 } 213 }
214 214
215 } // namespace dart 215 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/disassembler.h » ('j') | runtime/vm/thread.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698