OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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.h" | 5 #include "vm/compiler.h" |
6 | 6 |
7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
8 | 8 |
9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
10 #include "vm/block_scheduler.h" | 10 #include "vm/block_scheduler.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 "Do conditional constant propagation/unreachable code elimination."); | 52 "Do conditional constant propagation/unreachable code elimination."); |
53 DEFINE_FLAG(int, max_deoptimization_counter_threshold, 16, | 53 DEFINE_FLAG(int, max_deoptimization_counter_threshold, 16, |
54 "How many times we allow deoptimization before we disallow optimization."); | 54 "How many times we allow deoptimization before we disallow optimization."); |
55 DEFINE_FLAG(bool, loop_invariant_code_motion, true, | 55 DEFINE_FLAG(bool, loop_invariant_code_motion, true, |
56 "Do loop invariant code motion."); | 56 "Do loop invariant code motion."); |
57 DEFINE_FLAG(bool, print_flow_graph, false, "Print the IR flow graph."); | 57 DEFINE_FLAG(bool, print_flow_graph, false, "Print the IR flow graph."); |
58 DEFINE_FLAG(bool, print_flow_graph_optimized, false, | 58 DEFINE_FLAG(bool, print_flow_graph_optimized, false, |
59 "Print the IR flow graph when optimizing."); | 59 "Print the IR flow graph when optimizing."); |
60 DEFINE_FLAG(bool, print_ic_data_map, false, | 60 DEFINE_FLAG(bool, print_ic_data_map, false, |
61 "Print the deopt-id to ICData map in optimizing compiler."); | 61 "Print the deopt-id to ICData map in optimizing compiler."); |
62 DEFINE_FLAG(bool, print_code_source_map, false, "Print code source map."); | |
62 DEFINE_FLAG(bool, range_analysis, true, "Enable range analysis"); | 63 DEFINE_FLAG(bool, range_analysis, true, "Enable range analysis"); |
63 DEFINE_FLAG(bool, reorder_basic_blocks, true, "Enable basic-block reordering."); | 64 DEFINE_FLAG(bool, reorder_basic_blocks, true, "Enable basic-block reordering."); |
64 DEFINE_FLAG(bool, trace_compiler, false, "Trace compiler operations."); | 65 DEFINE_FLAG(bool, trace_compiler, false, "Trace compiler operations."); |
65 DEFINE_FLAG(bool, trace_optimizing_compiler, false, | 66 DEFINE_FLAG(bool, trace_optimizing_compiler, false, |
66 "Trace only optimizing compiler operations."); | 67 "Trace only optimizing compiler operations."); |
67 DEFINE_FLAG(bool, trace_bailout, false, "Print bailout from ssa compiler."); | 68 DEFINE_FLAG(bool, trace_bailout, false, "Print bailout from ssa compiler."); |
68 DEFINE_FLAG(bool, use_inlining, true, "Enable call-site inlining"); | 69 DEFINE_FLAG(bool, use_inlining, true, "Enable call-site inlining"); |
69 DEFINE_FLAG(bool, verify_compiler, false, | 70 DEFINE_FLAG(bool, verify_compiler, false, |
70 "Enable compiler verification assertions"); | 71 "Enable compiler verification assertions"); |
71 | 72 |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
461 code.SetInlinedCallerIdMap(caller_inlining_id_map_array); | 462 code.SetInlinedCallerIdMap(caller_inlining_id_map_array); |
462 | 463 |
463 graph_compiler->FinalizePcDescriptors(code); | 464 graph_compiler->FinalizePcDescriptors(code); |
464 code.set_deopt_info_array(deopt_info_array); | 465 code.set_deopt_info_array(deopt_info_array); |
465 | 466 |
466 graph_compiler->FinalizeStackmaps(code); | 467 graph_compiler->FinalizeStackmaps(code); |
467 graph_compiler->FinalizeVarDescriptors(code); | 468 graph_compiler->FinalizeVarDescriptors(code); |
468 graph_compiler->FinalizeExceptionHandlers(code); | 469 graph_compiler->FinalizeExceptionHandlers(code); |
469 graph_compiler->FinalizeStaticCallTargetsTable(code); | 470 graph_compiler->FinalizeStaticCallTargetsTable(code); |
470 | 471 |
472 // Set the code source map after setting the inlined information because | |
rmacnak
2016/02/25 23:04:40
NOT_IN_PRODUCT
Cutch
2016/02/26 15:59:21
Done.
| |
473 // we use the inlined information when printing. | |
474 const CodeSourceMap& code_source_map = | |
475 CodeSourceMap::Handle( | |
476 zone, | |
477 graph_compiler->code_source_map_builder()->Finalize()); | |
478 code.set_code_source_map(code_source_map); | |
479 if (FLAG_print_code_source_map) { | |
480 CodeSourceMap::Dump(code_source_map, code, function); | |
481 } | |
471 if (optimized()) { | 482 if (optimized()) { |
472 // Installs code while at safepoint. | 483 // Installs code while at safepoint. |
473 if (thread()->IsMutatorThread()) { | 484 if (thread()->IsMutatorThread()) { |
474 const bool is_osr = osr_id() != Compiler::kNoOSRDeoptId; | 485 const bool is_osr = osr_id() != Compiler::kNoOSRDeoptId; |
475 function.InstallOptimizedCode(code, is_osr); | 486 function.InstallOptimizedCode(code, is_osr); |
476 } else { | 487 } else { |
477 // Background compilation. | 488 // Background compilation. |
478 // Before installing code check generation counts if the code may | 489 // Before installing code check generation counts if the code may |
479 // have become invalid. | 490 // have become invalid. |
480 const bool trace_compiler = | 491 const bool trace_compiler = |
(...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1837 } | 1848 } |
1838 | 1849 |
1839 | 1850 |
1840 void BackgroundCompiler::EnsureInit(Thread* thread) { | 1851 void BackgroundCompiler::EnsureInit(Thread* thread) { |
1841 UNREACHABLE(); | 1852 UNREACHABLE(); |
1842 } | 1853 } |
1843 | 1854 |
1844 #endif // DART_PRECOMPILED_RUNTIME | 1855 #endif // DART_PRECOMPILED_RUNTIME |
1845 | 1856 |
1846 } // namespace dart | 1857 } // namespace dart |
OLD | NEW |