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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 isolate_->object_store()->float32x4_class())), | 190 isolate_->object_store()->float32x4_class())), |
191 float64x2_class_(Class::ZoneHandle( | 191 float64x2_class_(Class::ZoneHandle( |
192 isolate_->object_store()->float64x2_class())), | 192 isolate_->object_store()->float64x2_class())), |
193 int32x4_class_(Class::ZoneHandle( | 193 int32x4_class_(Class::ZoneHandle( |
194 isolate_->object_store()->int32x4_class())), | 194 isolate_->object_store()->int32x4_class())), |
195 list_class_(Class::ZoneHandle( | 195 list_class_(Class::ZoneHandle( |
196 Library::Handle(Library::CoreLibrary()). | 196 Library::Handle(Library::CoreLibrary()). |
197 LookupClass(Symbols::List()))), | 197 LookupClass(Symbols::List()))), |
198 parallel_move_resolver_(this), | 198 parallel_move_resolver_(this), |
199 pending_deoptimization_env_(NULL), | 199 pending_deoptimization_env_(NULL), |
200 entry_patch_pc_offset_(Code::kInvalidPc), | |
201 patch_code_pc_offset_(Code::kInvalidPc), | |
202 lazy_deopt_pc_offset_(Code::kInvalidPc), | 200 lazy_deopt_pc_offset_(Code::kInvalidPc), |
203 deopt_id_to_ic_data_(NULL), | 201 deopt_id_to_ic_data_(NULL), |
204 inlined_code_intervals_(Array::ZoneHandle(Object::empty_array().raw())), | 202 inlined_code_intervals_(Array::ZoneHandle(Object::empty_array().raw())), |
205 inline_id_to_function_(inline_id_to_function), | 203 inline_id_to_function_(inline_id_to_function), |
206 caller_inline_id_(caller_inline_id) { | 204 caller_inline_id_(caller_inline_id) { |
207 ASSERT(flow_graph->parsed_function().function().raw() == | 205 ASSERT(flow_graph->parsed_function().function().raw() == |
208 parsed_function.function().raw()); | 206 parsed_function.function().raw()); |
209 if (!is_optimizing) { | 207 if (!is_optimizing) { |
210 const intptr_t len = isolate()->deopt_id(); | 208 const intptr_t len = isolate()->deopt_id(); |
211 deopt_id_to_ic_data_ = new(zone()) ZoneGrowableArray<const ICData*>(len); | 209 deopt_id_to_ic_data_ = new(zone()) ZoneGrowableArray<const ICData*>(len); |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 } | 908 } |
911 } | 909 } |
912 | 910 |
913 | 911 |
914 void FlowGraphCompiler::FinalizePcDescriptors(const Code& code) { | 912 void FlowGraphCompiler::FinalizePcDescriptors(const Code& code) { |
915 ASSERT(pc_descriptors_list_ != NULL); | 913 ASSERT(pc_descriptors_list_ != NULL); |
916 const PcDescriptors& descriptors = PcDescriptors::Handle( | 914 const PcDescriptors& descriptors = PcDescriptors::Handle( |
917 pc_descriptors_list_->FinalizePcDescriptors(code.EntryPoint())); | 915 pc_descriptors_list_->FinalizePcDescriptors(code.EntryPoint())); |
918 if (!is_optimizing_) descriptors.Verify(parsed_function_.function()); | 916 if (!is_optimizing_) descriptors.Verify(parsed_function_.function()); |
919 code.set_pc_descriptors(descriptors); | 917 code.set_pc_descriptors(descriptors); |
920 code.set_entry_patch_pc_offset(entry_patch_pc_offset_); | |
921 code.set_patch_code_pc_offset(patch_code_pc_offset_); | |
922 code.set_lazy_deopt_pc_offset(lazy_deopt_pc_offset_); | 918 code.set_lazy_deopt_pc_offset(lazy_deopt_pc_offset_); |
923 } | 919 } |
924 | 920 |
925 | 921 |
926 RawArray* FlowGraphCompiler::CreateDeoptInfo(Assembler* assembler) { | 922 RawArray* FlowGraphCompiler::CreateDeoptInfo(Assembler* assembler) { |
927 // No deopt information if we 'always_optimize' (no deoptimization allowed). | 923 // No deopt information if we 'always_optimize' (no deoptimization allowed). |
928 if (Compiler::always_optimize()) { | 924 if (Compiler::always_optimize()) { |
929 return Array::empty_array().raw(); | 925 return Array::empty_array().raw(); |
930 } | 926 } |
931 // For functions with optional arguments, all incoming arguments are copied | 927 // For functions with optional arguments, all incoming arguments are copied |
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1832 | 1828 |
1833 | 1829 |
1834 void FlowGraphCompiler::FrameStateClear() { | 1830 void FlowGraphCompiler::FrameStateClear() { |
1835 ASSERT(!is_optimizing()); | 1831 ASSERT(!is_optimizing()); |
1836 frame_state_.TruncateTo(0); | 1832 frame_state_.TruncateTo(0); |
1837 } | 1833 } |
1838 #endif | 1834 #endif |
1839 | 1835 |
1840 | 1836 |
1841 } // namespace dart | 1837 } // namespace dart |
OLD | NEW |