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

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

Issue 22184003: Fix a bug in compilation of try-finally. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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/flow_graph_builder.cc ('k') | runtime/vm/parser.h » ('j') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/il_printer.h" 5 #include "vm/il_printer.h"
6 6
7 #include "vm/intermediate_language.h" 7 #include "vm/intermediate_language.h"
8 #include "vm/os.h" 8 #include "vm/os.h"
9 #include "vm/parser.h" 9 #include "vm/parser.h"
10 10
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 Definition* def = defns[i]; 814 Definition* def = defns[i];
815 f->Print("\n "); 815 f->Print("\n ");
816 def->PrintTo(f); 816 def->PrintTo(f);
817 } 817 }
818 f->Print("\n}"); 818 f->Print("\n}");
819 } 819 }
820 } 820 }
821 821
822 822
823 void JoinEntryInstr::PrintTo(BufferFormatter* f) const { 823 void JoinEntryInstr::PrintTo(BufferFormatter* f) const {
824 f->Print("B%"Pd"[join]:%"Pd" pred(", block_id(), GetDeoptId()); 824 if (try_index() != CatchClauseNode::kInvalidTryIndex) {
825 f->Print("B%"Pd"[join try_idx %"Pd"]:%"Pd" pred(",
826 block_id(), try_index(), GetDeoptId());
827 } else {
828 f->Print("B%"Pd"[join]:%"Pd" pred(", block_id(), GetDeoptId());
829 }
825 for (intptr_t i = 0; i < predecessors_.length(); ++i) { 830 for (intptr_t i = 0; i < predecessors_.length(); ++i) {
826 if (i > 0) f->Print(", "); 831 if (i > 0) f->Print(", ");
827 f->Print("B%"Pd, predecessors_[i]->block_id()); 832 f->Print("B%"Pd, predecessors_[i]->block_id());
828 } 833 }
829 f->Print(")"); 834 f->Print(")");
830 if (phis_ != NULL) { 835 if (phis_ != NULL) {
831 f->Print(" {"); 836 f->Print(" {");
832 for (intptr_t i = 0; i < phis_->length(); ++i) { 837 for (intptr_t i = 0; i < phis_->length(); ++i) {
833 if ((*phis_)[i] == NULL) continue; 838 if ((*phis_)[i] == NULL) continue;
834 f->Print("\n "); 839 f->Print("\n ");
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 f->Print("%"Pd, index()); 875 f->Print("%"Pd, index());
871 } 876 }
872 877
873 878
874 void CheckStackOverflowInstr::PrintOperandsTo(BufferFormatter* f) const { 879 void CheckStackOverflowInstr::PrintOperandsTo(BufferFormatter* f) const {
875 if (in_loop()) f->Print("depth %"Pd, loop_depth()); 880 if (in_loop()) f->Print("depth %"Pd, loop_depth());
876 } 881 }
877 882
878 883
879 void TargetEntryInstr::PrintTo(BufferFormatter* f) const { 884 void TargetEntryInstr::PrintTo(BufferFormatter* f) const {
880 f->Print("B%"Pd"[target]:%"Pd, block_id(), GetDeoptId()); 885 if (try_index() != CatchClauseNode::kInvalidTryIndex) {
886 f->Print("B%"Pd"[target try_idx %"Pd"]:%"Pd,
887 block_id(), try_index(), GetDeoptId());
888 } else {
889 f->Print("B%"Pd"[target]:%"Pd, block_id(), GetDeoptId());
890 }
881 if (HasParallelMove()) { 891 if (HasParallelMove()) {
882 f->Print(" "); 892 f->Print(" ");
883 parallel_move()->PrintTo(f); 893 parallel_move()->PrintTo(f);
884 } 894 }
885 } 895 }
886 896
887 897
888 void CatchBlockEntryInstr::PrintTo(BufferFormatter* f) const { 898 void CatchBlockEntryInstr::PrintTo(BufferFormatter* f) const {
889 f->Print("B%"Pd"[target catch %"Pd"]", block_id(), catch_try_index()); 899 f->Print("B%"Pd"[target catch try_idx %"Pd" catch_try_idx %"Pd"]",
900 block_id(), try_index(), catch_try_index());
890 if (HasParallelMove()) { 901 if (HasParallelMove()) {
891 f->Print(" "); 902 f->Print(" ");
892 parallel_move()->PrintTo(f); 903 parallel_move()->PrintTo(f);
893 } 904 }
894 905
895 const GrowableArray<Definition*>& defns = initial_definitions_; 906 const GrowableArray<Definition*>& defns = initial_definitions_;
896 if (defns.length() > 0) { 907 if (defns.length() > 0) {
897 f->Print(" {"); 908 f->Print(" {");
898 for (intptr_t i = 0; i < defns.length(); ++i) { 909 for (intptr_t i = 0; i < defns.length(); ++i) {
899 Definition* def = defns[i]; 910 Definition* def = defns[i];
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 f->Print(" ["); 970 f->Print(" [");
960 locations_[i].PrintTo(f); 971 locations_[i].PrintTo(f);
961 f->Print("]"); 972 f->Print("]");
962 } 973 }
963 } 974 }
964 f->Print(" }"); 975 f->Print(" }");
965 if (outer_ != NULL) outer_->PrintTo(f); 976 if (outer_ != NULL) outer_->PrintTo(f);
966 } 977 }
967 978
968 } // namespace dart 979 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698