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 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 void FlowGraphCompiler::AddExceptionHandler(intptr_t try_index, | 778 void FlowGraphCompiler::AddExceptionHandler(intptr_t try_index, |
779 intptr_t outer_try_index, | 779 intptr_t outer_try_index, |
780 intptr_t pc_offset, | 780 intptr_t pc_offset, |
781 const Array& handler_types, | 781 const Array& handler_types, |
782 bool needs_stacktrace) { | 782 bool needs_stacktrace) { |
783 exception_handlers_list_->AddHandler(try_index, outer_try_index, pc_offset, | 783 exception_handlers_list_->AddHandler(try_index, outer_try_index, pc_offset, |
784 handler_types, needs_stacktrace); | 784 handler_types, needs_stacktrace); |
785 } | 785 } |
786 | 786 |
787 | 787 |
788 void FlowGraphCompiler::SetNeedsStacktrace(intptr_t try_index) { | 788 void FlowGraphCompiler::SetNeedsStackTrace(intptr_t try_index) { |
789 exception_handlers_list_->SetNeedsStacktrace(try_index); | 789 exception_handlers_list_->SetNeedsStackTrace(try_index); |
790 } | 790 } |
791 | 791 |
792 | 792 |
793 // Uses current pc position and try-index. | 793 // Uses current pc position and try-index. |
794 void FlowGraphCompiler::AddCurrentDescriptor(RawPcDescriptors::Kind kind, | 794 void FlowGraphCompiler::AddCurrentDescriptor(RawPcDescriptors::Kind kind, |
795 intptr_t deopt_id, | 795 intptr_t deopt_id, |
796 TokenPosition token_pos) { | 796 TokenPosition token_pos) { |
797 // When running with optimizations disabled, don't emit deopt-descriptors. | 797 // When running with optimizations disabled, don't emit deopt-descriptors. |
798 if (!CanOptimize() && (kind == RawPcDescriptors::kDeopt)) return; | 798 if (!CanOptimize() && (kind == RawPcDescriptors::kDeopt)) return; |
799 pc_descriptors_list()->AddDescriptor(kind, assembler()->CodeSize(), deopt_id, | 799 pc_descriptors_list()->AddDescriptor(kind, assembler()->CodeSize(), deopt_id, |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1063 info = deopt_infos_[i]->CreateDeoptInfo(this, &builder, array); | 1063 info = deopt_infos_[i]->CreateDeoptInfo(this, &builder, array); |
1064 reason_and_flags = DeoptTable::EncodeReasonAndFlags( | 1064 reason_and_flags = DeoptTable::EncodeReasonAndFlags( |
1065 deopt_infos_[i]->reason(), deopt_infos_[i]->flags()); | 1065 deopt_infos_[i]->reason(), deopt_infos_[i]->flags()); |
1066 DeoptTable::SetEntry(array, i, offset, info, reason_and_flags); | 1066 DeoptTable::SetEntry(array, i, offset, info, reason_and_flags); |
1067 } | 1067 } |
1068 return array.raw(); | 1068 return array.raw(); |
1069 } | 1069 } |
1070 } | 1070 } |
1071 | 1071 |
1072 | 1072 |
1073 void FlowGraphCompiler::FinalizeStackmaps(const Code& code) { | 1073 void FlowGraphCompiler::FinalizeStackMaps(const Code& code) { |
1074 if (stackmap_table_builder_ == NULL) { | 1074 if (stackmap_table_builder_ == NULL) { |
1075 code.set_stackmaps(Object::null_array()); | 1075 code.set_stackmaps(Object::null_array()); |
1076 } else { | 1076 } else { |
1077 // Finalize the stack map array and add it to the code object. | 1077 // Finalize the stack map array and add it to the code object. |
1078 code.set_stackmaps( | 1078 code.set_stackmaps( |
1079 Array::Handle(stackmap_table_builder_->FinalizeStackmaps(code))); | 1079 Array::Handle(stackmap_table_builder_->FinalizeStackMaps(code))); |
1080 } | 1080 } |
1081 } | 1081 } |
1082 | 1082 |
1083 | 1083 |
1084 void FlowGraphCompiler::FinalizeVarDescriptors(const Code& code) { | 1084 void FlowGraphCompiler::FinalizeVarDescriptors(const Code& code) { |
1085 if (code.is_optimized()) { | 1085 if (code.is_optimized()) { |
1086 // Optimized code does not need variable descriptors. They are | 1086 // Optimized code does not need variable descriptors. They are |
1087 // only stored in the unoptimized version. | 1087 // only stored in the unoptimized version. |
1088 code.set_var_descriptors(Object::empty_var_descriptors()); | 1088 code.set_var_descriptors(Object::empty_var_descriptors()); |
1089 return; | 1089 return; |
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1981 | 1981 |
1982 | 1982 |
1983 void FlowGraphCompiler::FrameStateClear() { | 1983 void FlowGraphCompiler::FrameStateClear() { |
1984 ASSERT(!is_optimizing()); | 1984 ASSERT(!is_optimizing()); |
1985 frame_state_.TruncateTo(0); | 1985 frame_state_.TruncateTo(0); |
1986 } | 1986 } |
1987 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) | 1987 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) |
1988 | 1988 |
1989 | 1989 |
1990 } // namespace dart | 1990 } // namespace dart |
OLD | NEW |