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 28 matching lines...) Expand all Loading... |
39 #include "vm/timer.h" | 39 #include "vm/timer.h" |
40 | 40 |
41 namespace dart { | 41 namespace dart { |
42 | 42 |
43 DEFINE_FLAG(bool, allocation_sinking, true, | 43 DEFINE_FLAG(bool, allocation_sinking, true, |
44 "Attempt to sink temporary allocations to side exits"); | 44 "Attempt to sink temporary allocations to side exits"); |
45 DEFINE_FLAG(bool, common_subexpression_elimination, true, | 45 DEFINE_FLAG(bool, common_subexpression_elimination, true, |
46 "Do common subexpression elimination."); | 46 "Do common subexpression elimination."); |
47 DEFINE_FLAG(bool, constant_propagation, true, | 47 DEFINE_FLAG(bool, constant_propagation, true, |
48 "Do conditional constant propagation/unreachable code elimination."); | 48 "Do conditional constant propagation/unreachable code elimination."); |
49 DEFINE_FLAG(int, deoptimization_counter_threshold, 16, | 49 DEFINE_FLAG(int, max_deoptimization_counter_threshold, 16, |
50 "How many times we allow deoptimization before we disallow optimization."); | 50 "How many times we allow deoptimization before we disallow optimization."); |
51 DEFINE_FLAG(bool, disassemble, false, "Disassemble dart code."); | 51 DEFINE_FLAG(bool, disassemble, false, "Disassemble dart code."); |
52 DEFINE_FLAG(bool, disassemble_optimized, false, "Disassemble optimized code."); | 52 DEFINE_FLAG(bool, disassemble_optimized, false, "Disassemble optimized code."); |
53 DEFINE_FLAG(bool, loop_invariant_code_motion, true, | 53 DEFINE_FLAG(bool, loop_invariant_code_motion, true, |
54 "Do loop invariant code motion."); | 54 "Do loop invariant code motion."); |
55 DEFINE_FLAG(bool, print_flow_graph, false, "Print the IR flow graph."); | 55 DEFINE_FLAG(bool, print_flow_graph, false, "Print the IR flow graph."); |
56 DEFINE_FLAG(bool, print_flow_graph_optimized, false, | 56 DEFINE_FLAG(bool, print_flow_graph_optimized, false, |
57 "Print the IR flow graph when optimizing."); | 57 "Print the IR flow graph when optimizing."); |
58 DEFINE_FLAG(bool, print_ic_data_map, false, | 58 DEFINE_FLAG(bool, print_ic_data_map, false, |
59 "Print the deopt-id to ICData map in optimizing compiler."); | 59 "Print the deopt-id to ICData map in optimizing compiler."); |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 // TimerScope needs an isolate to be properly terminated in case of a | 632 // TimerScope needs an isolate to be properly terminated in case of a |
633 // LongJump. | 633 // LongJump. |
634 { | 634 { |
635 CSTAT_TIMER_SCOPE(thread(), graphbuilder_timer); | 635 CSTAT_TIMER_SCOPE(thread(), graphbuilder_timer); |
636 ZoneGrowableArray<const ICData*>* ic_data_array = | 636 ZoneGrowableArray<const ICData*>* ic_data_array = |
637 new(zone) ZoneGrowableArray<const ICData*>(); | 637 new(zone) ZoneGrowableArray<const ICData*>(); |
638 if (optimized()) { | 638 if (optimized()) { |
639 // Extract type feedback before the graph is built, as the graph | 639 // Extract type feedback before the graph is built, as the graph |
640 // builder uses it to attach it to nodes. | 640 // builder uses it to attach it to nodes. |
641 ASSERT(function.deoptimization_counter() < | 641 ASSERT(function.deoptimization_counter() < |
642 FLAG_deoptimization_counter_threshold); | 642 FLAG_max_deoptimization_counter_threshold); |
643 | 643 |
644 // 'Freeze' ICData in background compilation so that it does not | 644 // 'Freeze' ICData in background compilation so that it does not |
645 // change while compiling. | 645 // change while compiling. |
646 const bool clone_descriptors = Compiler::IsBackgroundCompilation(); | 646 const bool clone_descriptors = Compiler::IsBackgroundCompilation(); |
647 function.RestoreICDataMap(ic_data_array, clone_descriptors); | 647 function.RestoreICDataMap(ic_data_array, clone_descriptors); |
648 | 648 |
649 if (FLAG_print_ic_data_map) { | 649 if (FLAG_print_ic_data_map) { |
650 for (intptr_t i = 0; i < ic_data_array->length(); i++) { | 650 for (intptr_t i = 0; i < ic_data_array->length(); i++) { |
651 if ((*ic_data_array)[i] != NULL) { | 651 if ((*ic_data_array)[i] != NULL) { |
652 THR_Print("%" Pd " ", i); | 652 THR_Print("%" Pd " ", i); |
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2031 } | 2031 } |
2032 | 2032 |
2033 | 2033 |
2034 void BackgroundCompiler::EnsureInit(Thread* thread) { | 2034 void BackgroundCompiler::EnsureInit(Thread* thread) { |
2035 UNREACHABLE(); | 2035 UNREACHABLE(); |
2036 } | 2036 } |
2037 | 2037 |
2038 #endif // DART_PRECOMPILED | 2038 #endif // DART_PRECOMPILED |
2039 | 2039 |
2040 } // namespace dart | 2040 } // namespace dart |
OLD | NEW |