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" |
11 #include "vm/compiler.h" | 11 #include "vm/compiler.h" |
12 #include "vm/dart_entry.h" | 12 #include "vm/dart_entry.h" |
13 #include "vm/debugger.h" | 13 #include "vm/debugger.h" |
14 #include "vm/deopt_instructions.h" | 14 #include "vm/deopt_instructions.h" |
15 #include "vm/exceptions.h" | 15 #include "vm/exceptions.h" |
16 #include "vm/flow_graph_allocator.h" | 16 #include "vm/flow_graph_allocator.h" |
17 #include "vm/il_printer.h" | 17 #include "vm/il_printer.h" |
18 #include "vm/intrinsifier.h" | 18 #include "vm/intrinsifier.h" |
19 #include "vm/locations.h" | 19 #include "vm/locations.h" |
20 #include "vm/log.h" | 20 #include "vm/log.h" |
21 #include "vm/longjump.h" | 21 #include "vm/longjump.h" |
22 #include "vm/object_store.h" | 22 #include "vm/object_store.h" |
23 #include "vm/parser.h" | 23 #include "vm/parser.h" |
24 #include "vm/raw_object.h" | 24 #include "vm/raw_object.h" |
25 #include "vm/stack_frame.h" | 25 #include "vm/stack_frame.h" |
26 #include "vm/stub_code.h" | 26 #include "vm/stub_code.h" |
27 #include "vm/symbols.h" | 27 #include "vm/symbols.h" |
| 28 #include "vm/timeline.h" |
28 | 29 |
29 namespace dart { | 30 namespace dart { |
30 | 31 |
31 DEFINE_FLAG(bool, allow_absolute_addresses, true, | 32 DEFINE_FLAG(bool, allow_absolute_addresses, true, |
32 "Allow embedding absolute addresses in generated code."); | 33 "Allow embedding absolute addresses in generated code."); |
33 DEFINE_FLAG(bool, always_megamorphic_calls, false, | 34 DEFINE_FLAG(bool, always_megamorphic_calls, false, |
34 "Instance call always as megamorphic."); | 35 "Instance call always as megamorphic."); |
35 DEFINE_FLAG(bool, enable_simd_inline, true, | 36 DEFINE_FLAG(bool, enable_simd_inline, true, |
36 "Enable inlining of SIMD related method calls."); | 37 "Enable inlining of SIMD related method calls."); |
37 DEFINE_FLAG(int, min_optimization_counter_threshold, 5000, | 38 DEFINE_FLAG(int, min_optimization_counter_threshold, 5000, |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 | 244 |
244 | 245 |
245 bool FlowGraphCompiler::IsPotentialUnboxedField(const Field& field) { | 246 bool FlowGraphCompiler::IsPotentialUnboxedField(const Field& field) { |
246 return field.is_unboxing_candidate() && | 247 return field.is_unboxing_candidate() && |
247 (FlowGraphCompiler::IsUnboxedField(field) || | 248 (FlowGraphCompiler::IsUnboxedField(field) || |
248 (!field.is_final() && (field.guarded_cid() == kIllegalCid))); | 249 (!field.is_final() && (field.guarded_cid() == kIllegalCid))); |
249 } | 250 } |
250 | 251 |
251 | 252 |
252 void FlowGraphCompiler::InitCompiler() { | 253 void FlowGraphCompiler::InitCompiler() { |
| 254 TimelineDurationScope tds(thread(), |
| 255 isolate()->GetCompilerStream(), |
| 256 "InitCompiler"); |
253 pc_descriptors_list_ = new(zone()) DescriptorList(64); | 257 pc_descriptors_list_ = new(zone()) DescriptorList(64); |
254 exception_handlers_list_ = new(zone())ExceptionHandlerList(); | 258 exception_handlers_list_ = new(zone())ExceptionHandlerList(); |
255 block_info_.Clear(); | 259 block_info_.Clear(); |
256 // Conservative detection of leaf routines used to remove the stack check | 260 // Conservative detection of leaf routines used to remove the stack check |
257 // on function entry. | 261 // on function entry. |
258 bool is_leaf = !parsed_function().function().IsClosureFunction() | 262 bool is_leaf = !parsed_function().function().IsClosureFunction() |
259 && is_optimizing() | 263 && is_optimizing() |
260 && !flow_graph().IsCompiledForOsr(); | 264 && !flow_graph().IsCompiledForOsr(); |
261 // Initialize block info and search optimized (non-OSR) code for calls | 265 // Initialize block info and search optimized (non-OSR) code for calls |
262 // indicating a non-leaf routine and calls without IC data indicating | 266 // indicating a non-leaf routine and calls without IC data indicating |
(...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1852 | 1856 |
1853 | 1857 |
1854 void FlowGraphCompiler::FrameStateClear() { | 1858 void FlowGraphCompiler::FrameStateClear() { |
1855 ASSERT(!is_optimizing()); | 1859 ASSERT(!is_optimizing()); |
1856 frame_state_.TruncateTo(0); | 1860 frame_state_.TruncateTo(0); |
1857 } | 1861 } |
1858 #endif | 1862 #endif |
1859 | 1863 |
1860 | 1864 |
1861 } // namespace dart | 1865 } // namespace dart |
OLD | NEW |