| 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 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 code.set_stackmaps(Object::null_array()); | 881 code.set_stackmaps(Object::null_array()); |
| 882 } else { | 882 } else { |
| 883 // Finalize the stack map array and add it to the code object. | 883 // Finalize the stack map array and add it to the code object. |
| 884 code.set_stackmaps( | 884 code.set_stackmaps( |
| 885 Array::Handle(stackmap_table_builder_->FinalizeStackmaps(code))); | 885 Array::Handle(stackmap_table_builder_->FinalizeStackmaps(code))); |
| 886 } | 886 } |
| 887 } | 887 } |
| 888 | 888 |
| 889 | 889 |
| 890 void FlowGraphCompiler::FinalizeVarDescriptors(const Code& code) { | 890 void FlowGraphCompiler::FinalizeVarDescriptors(const Code& code) { |
| 891 if (code.is_optimized()) { |
| 892 // Optimized code does not need variable descriptors. They are |
| 893 // only stored in the unoptimized version. |
| 894 code.set_var_descriptors(Object::empty_var_descriptors()); |
| 895 return; |
| 896 } |
| 891 LocalVarDescriptors& var_descs = LocalVarDescriptors::Handle(); | 897 LocalVarDescriptors& var_descs = LocalVarDescriptors::Handle(); |
| 892 if (parsed_function().node_sequence() == NULL) { | 898 if (parsed_function().node_sequence() == NULL) { |
| 893 ASSERT(flow_graph().IsIrregexpFunction()); | 899 ASSERT(flow_graph().IsIrregexpFunction()); |
| 894 var_descs = LocalVarDescriptors::New(1); | 900 var_descs = LocalVarDescriptors::New(1); |
| 895 RawLocalVarDescriptors::VarInfo info; | 901 RawLocalVarDescriptors::VarInfo info; |
| 896 info.set_kind(RawLocalVarDescriptors::kSavedCurrentContext); | 902 info.set_kind(RawLocalVarDescriptors::kSavedCurrentContext); |
| 897 info.scope_id = 0; | 903 info.scope_id = 0; |
| 898 info.begin_pos = 0; | 904 info.begin_pos = 0; |
| 899 info.end_pos = 0; | 905 info.end_pos = 0; |
| 900 info.set_index(parsed_function().current_context_var()->index()); | 906 info.set_index(parsed_function().current_context_var()->index()); |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1674 | 1680 |
| 1675 | 1681 |
| 1676 void FlowGraphCompiler::FrameStateClear() { | 1682 void FlowGraphCompiler::FrameStateClear() { |
| 1677 ASSERT(!is_optimizing()); | 1683 ASSERT(!is_optimizing()); |
| 1678 frame_state_.TruncateTo(0); | 1684 frame_state_.TruncateTo(0); |
| 1679 } | 1685 } |
| 1680 #endif | 1686 #endif |
| 1681 | 1687 |
| 1682 | 1688 |
| 1683 } // namespace dart | 1689 } // namespace dart |
| OLD | NEW |