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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 va_list args; | 116 va_list args; |
117 va_start(args, format); | 117 va_start(args, format); |
118 stats->text = zone->VPrint(format, args); | 118 stats->text = zone->VPrint(format, args); |
119 va_end(args); | 119 va_end(args); |
120 } | 120 } |
121 | 121 |
122 void CompilerStats::Update() { | 122 void CompilerStats::Update() { |
123 // Traverse the heap and compute number of tokens in all | 123 // Traverse the heap and compute number of tokens in all |
124 // TokenStream objects. | 124 // TokenStream objects. |
125 num_tokens_total = 0; | 125 num_tokens_total = 0; |
126 TokenStreamVisitor visitor(this); | 126 |
127 isolate_->heap()->IterateObjects(&visitor); | 127 { |
128 Dart::vm_isolate()->heap()->IterateObjects(&visitor); | 128 HeapIterationScope iteration(Thread::Current()); |
| 129 TokenStreamVisitor visitor(this); |
| 130 iteration.IterateObjects(&visitor); |
| 131 iteration.IterateVMIsolateObjects(&visitor); |
| 132 } |
129 } | 133 } |
130 | 134 |
131 void CompilerStats::EnableBenchmark() { | 135 void CompilerStats::EnableBenchmark() { |
132 FLAG_compiler_stats = true; | 136 FLAG_compiler_stats = true; |
133 use_benchmark_output = true; | 137 use_benchmark_output = true; |
134 } | 138 } |
135 | 139 |
136 // Generate output for Golem benchmark harness. If the output format | 140 // Generate output for Golem benchmark harness. If the output format |
137 // changes, the parsing function in Golem must be updated. | 141 // changes, the parsing function in Golem must be updated. |
138 char* CompilerStats::BenchmarkOutput() { | 142 char* CompilerStats::BenchmarkOutput() { |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 log.Print(" VarDesc size: %" Pd64 " KB\n", vardesc_size / 1024); | 299 log.Print(" VarDesc size: %" Pd64 " KB\n", vardesc_size / 1024); |
296 log.Flush(); | 300 log.Flush(); |
297 char* stats_text = text; | 301 char* stats_text = text; |
298 text = NULL; | 302 text = NULL; |
299 return stats_text; | 303 return stats_text; |
300 } | 304 } |
301 | 305 |
302 #endif // !PRODUCT | 306 #endif // !PRODUCT |
303 | 307 |
304 } // namespace dart | 308 } // namespace dart |
OLD | NEW |