OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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/precompiler.h" | 5 #include "vm/precompiler.h" |
6 | 6 |
7 #include "vm/aot_optimizer.h" | 7 #include "vm/aot_optimizer.h" |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
10 #include "vm/branch_optimizer.h" | 10 #include "vm/branch_optimizer.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 DedupStackmapLists(); | 222 DedupStackmapLists(); |
223 | 223 |
224 if (FLAG_dedup_instructions) { | 224 if (FLAG_dedup_instructions) { |
225 // Reduces binary size but obfuscates profiler results. | 225 // Reduces binary size but obfuscates profiler results. |
226 DedupInstructions(); | 226 DedupInstructions(); |
227 } | 227 } |
228 | 228 |
229 zone_ = NULL; | 229 zone_ = NULL; |
230 } | 230 } |
231 | 231 |
232 intptr_t dropped_symbols_count = Symbols::Compact(I); | 232 intptr_t symbols_before = -1; |
| 233 intptr_t symbols_after = -1; |
| 234 intptr_t capacity = -1; |
233 if (FLAG_trace_precompiler) { | 235 if (FLAG_trace_precompiler) { |
| 236 Symbols::GetStats(I, &symbols_before, &capacity); |
| 237 } |
| 238 |
| 239 Symbols::Compact(I); |
| 240 |
| 241 if (FLAG_trace_precompiler) { |
| 242 Symbols::GetStats(I, &symbols_after, &capacity); |
234 THR_Print("Precompiled %" Pd " functions,", function_count_); | 243 THR_Print("Precompiled %" Pd " functions,", function_count_); |
235 THR_Print(" %" Pd " dynamic types,", class_count_); | 244 THR_Print(" %" Pd " dynamic types,", class_count_); |
236 THR_Print(" %" Pd " dynamic selectors.\n", selector_count_); | 245 THR_Print(" %" Pd " dynamic selectors.\n", selector_count_); |
237 | 246 |
238 THR_Print("Dropped %" Pd " functions,", dropped_function_count_); | 247 THR_Print("Dropped %" Pd " functions,", dropped_function_count_); |
239 THR_Print(" %" Pd " fields,", dropped_field_count_); | 248 THR_Print(" %" Pd " fields,", dropped_field_count_); |
240 THR_Print(" %" Pd " symbols,", dropped_symbols_count); | 249 THR_Print(" %" Pd " symbols,", symbols_before - symbols_after); |
241 THR_Print(" %" Pd " types,", dropped_type_count_); | 250 THR_Print(" %" Pd " types,", dropped_type_count_); |
242 THR_Print(" %" Pd " type arguments,", dropped_typearg_count_); | 251 THR_Print(" %" Pd " type arguments,", dropped_typearg_count_); |
243 THR_Print(" %" Pd " classes,", dropped_class_count_); | 252 THR_Print(" %" Pd " classes,", dropped_class_count_); |
244 THR_Print(" %" Pd " libraries.\n", dropped_library_count_); | 253 THR_Print(" %" Pd " libraries.\n", dropped_library_count_); |
245 } | 254 } |
246 } | 255 } |
247 | 256 |
248 | 257 |
249 void Precompiler::ClearAllCode() { | 258 void Precompiler::ClearAllCode() { |
250 class ClearCodeFunctionVisitor : public FunctionVisitor { | 259 class ClearCodeFunctionVisitor : public FunctionVisitor { |
(...skipping 2499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2750 CompilationPipeline::New(thread->zone(), function); | 2759 CompilationPipeline::New(thread->zone(), function); |
2751 | 2760 |
2752 ASSERT(FLAG_precompiled_mode); | 2761 ASSERT(FLAG_precompiled_mode); |
2753 const bool optimized = function.IsOptimizable(); // False for natives. | 2762 const bool optimized = function.IsOptimizable(); // False for natives. |
2754 return PrecompileFunctionHelper(pipeline, function, optimized); | 2763 return PrecompileFunctionHelper(pipeline, function, optimized); |
2755 } | 2764 } |
2756 | 2765 |
2757 #endif // DART_PRECOMPILER | 2766 #endif // DART_PRECOMPILER |
2758 | 2767 |
2759 } // namespace dart | 2768 } // namespace dart |
OLD | NEW |