| 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 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 deopt_infos_.Add(stub); | 855 deopt_infos_.Add(stub); |
| 856 return stub->entry_label(); | 856 return stub->entry_label(); |
| 857 } | 857 } |
| 858 | 858 |
| 859 | 859 |
| 860 void FlowGraphCompiler::FinalizeExceptionHandlers(const Code& code) { | 860 void FlowGraphCompiler::FinalizeExceptionHandlers(const Code& code) { |
| 861 ASSERT(exception_handlers_list_ != NULL); | 861 ASSERT(exception_handlers_list_ != NULL); |
| 862 const ExceptionHandlers& handlers = ExceptionHandlers::Handle( | 862 const ExceptionHandlers& handlers = ExceptionHandlers::Handle( |
| 863 exception_handlers_list_->FinalizeExceptionHandlers(code.EntryPoint())); | 863 exception_handlers_list_->FinalizeExceptionHandlers(code.EntryPoint())); |
| 864 code.set_exception_handlers(handlers); | 864 code.set_exception_handlers(handlers); |
| 865 INC_STAT(isolate(), total_code_size, |
| 866 ExceptionHandlers::InstanceSize(handlers.num_entries())); |
| 867 INC_STAT(isolate(), total_code_size, handlers.num_entries() * sizeof(uword)); |
| 865 } | 868 } |
| 866 | 869 |
| 867 | 870 |
| 868 void FlowGraphCompiler::FinalizePcDescriptors(const Code& code) { | 871 void FlowGraphCompiler::FinalizePcDescriptors(const Code& code) { |
| 869 ASSERT(pc_descriptors_list_ != NULL); | 872 ASSERT(pc_descriptors_list_ != NULL); |
| 870 const PcDescriptors& descriptors = PcDescriptors::Handle( | 873 const PcDescriptors& descriptors = PcDescriptors::Handle( |
| 871 pc_descriptors_list_->FinalizePcDescriptors(code.EntryPoint())); | 874 pc_descriptors_list_->FinalizePcDescriptors(code.EntryPoint())); |
| 872 if (!is_optimizing_) descriptors.Verify(parsed_function_.function()); | 875 if (!is_optimizing_) descriptors.Verify(parsed_function_.function()); |
| 873 code.set_pc_descriptors(descriptors); | 876 code.set_pc_descriptors(descriptors); |
| 874 code.set_entry_patch_pc_offset(entry_patch_pc_offset_); | 877 code.set_entry_patch_pc_offset(entry_patch_pc_offset_); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 info.end_pos = 0; | 943 info.end_pos = 0; |
| 941 info.set_index(parsed_function().current_context_var()->index()); | 944 info.set_index(parsed_function().current_context_var()->index()); |
| 942 var_descs.SetVar(0, Symbols::CurrentContextVar(), &info); | 945 var_descs.SetVar(0, Symbols::CurrentContextVar(), &info); |
| 943 } | 946 } |
| 944 code.set_var_descriptors(var_descs); | 947 code.set_var_descriptors(var_descs); |
| 945 } | 948 } |
| 946 | 949 |
| 947 | 950 |
| 948 void FlowGraphCompiler::FinalizeStaticCallTargetsTable(const Code& code) { | 951 void FlowGraphCompiler::FinalizeStaticCallTargetsTable(const Code& code) { |
| 949 ASSERT(code.static_calls_target_table() == Array::null()); | 952 ASSERT(code.static_calls_target_table() == Array::null()); |
| 950 code.set_static_calls_target_table( | 953 const Array& targets = |
| 951 Array::Handle(Array::MakeArray(static_calls_target_table_))); | 954 Array::Handle(Array::MakeArray(static_calls_target_table_)); |
| 955 code.set_static_calls_target_table(targets); |
| 956 INC_STAT(isolate(), total_code_size, targets.Length() * sizeof(uword)); |
| 952 } | 957 } |
| 953 | 958 |
| 954 | 959 |
| 955 // Returns 'true' if code generation for this function is complete, i.e., | 960 // Returns 'true' if code generation for this function is complete, i.e., |
| 956 // no fall-through to regular code is needed. | 961 // no fall-through to regular code is needed. |
| 957 void FlowGraphCompiler::TryIntrinsify() { | 962 void FlowGraphCompiler::TryIntrinsify() { |
| 958 // Intrinsification skips arguments checks, therefore disable if in checked | 963 // Intrinsification skips arguments checks, therefore disable if in checked |
| 959 // mode. | 964 // mode. |
| 960 if (FLAG_intrinsify && !isolate()->TypeChecksEnabled()) { | 965 if (FLAG_intrinsify && !isolate()->TypeChecksEnabled()) { |
| 961 if (parsed_function().function().kind() == RawFunction::kImplicitGetter) { | 966 if (parsed_function().function().kind() == RawFunction::kImplicitGetter) { |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1722 | 1727 |
| 1723 | 1728 |
| 1724 void FlowGraphCompiler::FrameStateClear() { | 1729 void FlowGraphCompiler::FrameStateClear() { |
| 1725 ASSERT(!is_optimizing()); | 1730 ASSERT(!is_optimizing()); |
| 1726 frame_state_.TruncateTo(0); | 1731 frame_state_.TruncateTo(0); |
| 1727 } | 1732 } |
| 1728 #endif | 1733 #endif |
| 1729 | 1734 |
| 1730 | 1735 |
| 1731 } // namespace dart | 1736 } // namespace dart |
| OLD | NEW |