| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 ICData& ic_data = ICData::ZoneHandle(zone()); | 220 ICData& ic_data = ICData::ZoneHandle(zone()); |
| 221 ic_data ^= old_saved_ic_data.At(i); | 221 ic_data ^= old_saved_ic_data.At(i); |
| 222 (*deopt_id_to_ic_data_)[ic_data.deopt_id()] = &ic_data; | 222 (*deopt_id_to_ic_data_)[ic_data.deopt_id()] = &ic_data; |
| 223 } | 223 } |
| 224 } | 224 } |
| 225 ASSERT(assembler != NULL); | 225 ASSERT(assembler != NULL); |
| 226 ASSERT(!list_class_.IsNull()); | 226 ASSERT(!list_class_.IsNull()); |
| 227 } | 227 } |
| 228 | 228 |
| 229 | 229 |
| 230 bool FlowGraphCompiler::IsUnboxedField(const Field& field) { |
| 231 bool valid_class = (SupportsUnboxedDoubles() && |
| 232 (field.guarded_cid() == kDoubleCid)) || |
| 233 (SupportsUnboxedSimd128() && |
| 234 (field.guarded_cid() == kFloat32x4Cid)) || |
| 235 (SupportsUnboxedSimd128() && |
| 236 (field.guarded_cid() == kFloat64x2Cid)); |
| 237 return field.is_unboxing_candidate() |
| 238 && !field.is_final() |
| 239 && !field.is_nullable() |
| 240 && valid_class; |
| 241 } |
| 242 |
| 243 |
| 244 bool FlowGraphCompiler::IsPotentialUnboxedField(const Field& field) { |
| 245 return field.is_unboxing_candidate() && |
| 246 (FlowGraphCompiler::IsUnboxedField(field) || |
| 247 (!field.is_final() && (field.guarded_cid() == kIllegalCid))); |
| 248 } |
| 249 |
| 250 |
| 230 void FlowGraphCompiler::InitCompiler() { | 251 void FlowGraphCompiler::InitCompiler() { |
| 231 pc_descriptors_list_ = new(zone()) DescriptorList(64); | 252 pc_descriptors_list_ = new(zone()) DescriptorList(64); |
| 232 exception_handlers_list_ = new(zone())ExceptionHandlerList(); | 253 exception_handlers_list_ = new(zone())ExceptionHandlerList(); |
| 233 block_info_.Clear(); | 254 block_info_.Clear(); |
| 234 // Conservative detection of leaf routines used to remove the stack check | 255 // Conservative detection of leaf routines used to remove the stack check |
| 235 // on function entry. | 256 // on function entry. |
| 236 bool is_leaf = !parsed_function().function().IsClosureFunction() | 257 bool is_leaf = !parsed_function().function().IsClosureFunction() |
| 237 && is_optimizing() | 258 && is_optimizing() |
| 238 && !flow_graph().IsCompiledForOsr(); | 259 && !flow_graph().IsCompiledForOsr(); |
| 239 // Initialize block info and search optimized (non-OSR) code for calls | 260 // Initialize block info and search optimized (non-OSR) code for calls |
| (...skipping 1580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1820 | 1841 |
| 1821 | 1842 |
| 1822 void FlowGraphCompiler::FrameStateClear() { | 1843 void FlowGraphCompiler::FrameStateClear() { |
| 1823 ASSERT(!is_optimizing()); | 1844 ASSERT(!is_optimizing()); |
| 1824 frame_state_.TruncateTo(0); | 1845 frame_state_.TruncateTo(0); |
| 1825 } | 1846 } |
| 1826 #endif | 1847 #endif |
| 1827 | 1848 |
| 1828 | 1849 |
| 1829 } // namespace dart | 1850 } // namespace dart |
| OLD | NEW |