OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/globals.h" // Needed here to get TARGET_ARCH_XXX. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX. |
6 | 6 |
7 #include "vm/flow_graph_compiler.h" | 7 #include "vm/flow_graph_compiler.h" |
8 | 8 |
9 #include "vm/bit_vector.h" | 9 #include "vm/bit_vector.h" |
10 #include "vm/cha.h" | 10 #include "vm/cha.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 DECLARE_FLAG(int, reoptimization_counter_threshold); | 64 DECLARE_FLAG(int, reoptimization_counter_threshold); |
65 DECLARE_FLAG(int, stacktrace_every); | 65 DECLARE_FLAG(int, stacktrace_every); |
66 DECLARE_FLAG(charp, stacktrace_filter); | 66 DECLARE_FLAG(charp, stacktrace_filter); |
67 DECLARE_FLAG(bool, support_debugger); | 67 DECLARE_FLAG(bool, support_debugger); |
68 DECLARE_FLAG(bool, use_field_guards); | 68 DECLARE_FLAG(bool, use_field_guards); |
69 DECLARE_FLAG(bool, use_cha_deopt); | 69 DECLARE_FLAG(bool, use_cha_deopt); |
70 DECLARE_FLAG(bool, use_osr); | 70 DECLARE_FLAG(bool, use_osr); |
71 DECLARE_FLAG(bool, warn_on_javascript_compatibility); | 71 DECLARE_FLAG(bool, warn_on_javascript_compatibility); |
72 DECLARE_FLAG(bool, precompile_collect_closures); | 72 DECLARE_FLAG(bool, precompile_collect_closures); |
73 DECLARE_FLAG(bool, print_stop_message); | 73 DECLARE_FLAG(bool, print_stop_message); |
| 74 DECLARE_FLAG(bool, lazy_dispatchers); |
| 75 DECLARE_FLAG(bool, interpret_irregexp); |
| 76 DECLARE_FLAG(bool, enable_mirrors); |
| 77 DECLARE_FLAG(bool, link_natives_lazily); |
74 | 78 |
| 79 static void PrecompilationModeHandler(bool value) { |
| 80 if (value) { |
| 81 #if defined(TARGET_ARCH_IA32) |
| 82 FATAL("Precompilation not supported on IA32"); |
| 83 #endif |
75 | 84 |
76 static void NooptModeHandler(bool value) { | |
77 if (value) { | |
78 FLAG_always_megamorphic_calls = true; | 85 FLAG_always_megamorphic_calls = true; |
79 FLAG_polymorphic_with_deopt = false; | 86 FLAG_polymorphic_with_deopt = false; |
80 FLAG_optimization_counter_threshold = -1; | 87 FLAG_optimization_counter_threshold = -1; |
81 FLAG_use_field_guards = false; | 88 FLAG_use_field_guards = false; |
82 FLAG_use_osr = false; | 89 FLAG_use_osr = false; |
83 FLAG_emit_edge_counters = false; | 90 FLAG_emit_edge_counters = false; |
84 FLAG_support_debugger = false; | 91 FLAG_support_debugger = false; |
85 FLAG_ic_range_profiling = false; | 92 FLAG_ic_range_profiling = false; |
86 FLAG_collect_code = false; | 93 FLAG_collect_code = false; |
87 FLAG_load_deferred_eagerly = true; | 94 FLAG_load_deferred_eagerly = true; |
88 FLAG_deoptimize_alot = false; // Used in some tests. | 95 FLAG_deoptimize_alot = false; // Used in some tests. |
89 FLAG_deoptimize_every = 0; // Used in some tests. | 96 FLAG_deoptimize_every = 0; // Used in some tests. |
90 FLAG_guess_other_cid = true; | 97 FLAG_guess_other_cid = true; |
91 Compiler::set_always_optimize(true); | 98 Compiler::set_always_optimize(true); |
92 // Triggers assert if we try to recompile (e.g., because of deferred | 99 // Triggers assert if we try to recompile (e.g., because of deferred |
93 // loading, deoptimization, ...). Noopt mode simulates behavior | 100 // loading, deoptimization, ...). Noopt mode simulates behavior |
94 // of precompiled code, therefore do not allow recompilation. | 101 // of precompiled code, therefore do not allow recompilation. |
95 Compiler::set_allow_recompilation(false); | 102 Compiler::set_allow_recompilation(false); |
96 // TODO(srdjan): Enable CHA deoptimization when eager class finalization is | 103 // TODO(srdjan): Enable CHA deoptimization when eager class finalization is |
97 // implemented, either with precompilation or as a special pass. | 104 // implemented, either with precompilation or as a special pass. |
98 FLAG_use_cha_deopt = false; | 105 FLAG_use_cha_deopt = false; |
99 // Calling the PrintStopMessage stub is not supported in precompiled code | 106 // Calling the PrintStopMessage stub is not supported in precompiled code |
100 // since it is done at places where no pool pointer is loaded. | 107 // since it is done at places where no pool pointer is loaded. |
101 FLAG_print_stop_message = false; | 108 FLAG_print_stop_message = false; |
102 } | |
103 } | |
104 | 109 |
105 | |
106 // --noopt disables optimizer and tunes unoptimized code to run as fast | |
107 // as possible. | |
108 DEFINE_FLAG_HANDLER(NooptModeHandler, | |
109 noopt, | |
110 "Run fast unoptimized code only."); | |
111 | |
112 | |
113 DECLARE_FLAG(bool, lazy_dispatchers); | |
114 DECLARE_FLAG(bool, interpret_irregexp); | |
115 DECLARE_FLAG(bool, enable_mirrors); | |
116 DECLARE_FLAG(bool, link_natives_lazily); | |
117 | |
118 static void PrecompileModeHandler(bool value) { | |
119 if (value) { | |
120 #if defined(TARGET_ARCH_IA32) | |
121 FATAL("Precompilation not supported on IA32"); | |
122 #endif | |
123 | |
124 NooptModeHandler(true); | |
125 FLAG_lazy_dispatchers = false; | 110 FLAG_lazy_dispatchers = false; |
126 FLAG_interpret_irregexp = true; | 111 FLAG_interpret_irregexp = true; |
127 FLAG_enable_mirrors = false; | 112 FLAG_enable_mirrors = false; |
128 FLAG_precompile_collect_closures = true; | 113 FLAG_precompile_collect_closures = true; |
129 FLAG_link_natives_lazily = true; | 114 FLAG_link_natives_lazily = true; |
130 FLAG_fields_may_be_reset = true; | 115 FLAG_fields_may_be_reset = true; |
131 FLAG_allow_absolute_addresses = false; | 116 FLAG_allow_absolute_addresses = false; |
132 } | 117 } |
133 } | 118 } |
134 | 119 |
135 | 120 |
136 DEFINE_FLAG_HANDLER(PrecompileModeHandler, | 121 DEFINE_FLAG_HANDLER(PrecompilationModeHandler, |
137 precompile, | 122 precompilation, |
138 "Precompilation mode"); | 123 "Precompilation mode"); |
139 | 124 |
140 | 125 |
141 // Assign locations to incoming arguments, i.e., values pushed above spill slots | 126 // Assign locations to incoming arguments, i.e., values pushed above spill slots |
142 // with PushArgument. Recursively allocates from outermost to innermost | 127 // with PushArgument. Recursively allocates from outermost to innermost |
143 // environment. | 128 // environment. |
144 void CompilerDeoptInfo::AllocateIncomingParametersRecursive( | 129 void CompilerDeoptInfo::AllocateIncomingParametersRecursive( |
145 Environment* env, | 130 Environment* env, |
146 intptr_t* stack_height) { | 131 intptr_t* stack_height) { |
147 if (env == NULL) return; | 132 if (env == NULL) return; |
(...skipping 1702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1850 | 1835 |
1851 | 1836 |
1852 void FlowGraphCompiler::FrameStateClear() { | 1837 void FlowGraphCompiler::FrameStateClear() { |
1853 ASSERT(!is_optimizing()); | 1838 ASSERT(!is_optimizing()); |
1854 frame_state_.TruncateTo(0); | 1839 frame_state_.TruncateTo(0); |
1855 } | 1840 } |
1856 #endif | 1841 #endif |
1857 | 1842 |
1858 | 1843 |
1859 } // namespace dart | 1844 } // namespace dart |
OLD | NEW |