Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: runtime/vm/flow_graph_compiler.cc

Issue 1077793003: Remove redundant variable descriptors from optimized code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/debugger.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/debugger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698