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

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

Issue 1723733002: Simplify various name flavors in VM. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address comments Created 4 years, 10 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
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/flow_graph_range_analysis.h" 7 #include "vm/flow_graph_range_analysis.h"
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 #include "vm/os.h" 9 #include "vm/os.h"
10 #include "vm/parser.h" 10 #include "vm/parser.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 String::Handle(dst_type.Name()).ToCString(), 164 String::Handle(dst_type.Name()).ToCString(),
165 dst_name.ToCString()); 165 dst_name.ToCString());
166 } 166 }
167 167
168 168
169 void CompileType::PrintTo(BufferFormatter* f) const { 169 void CompileType::PrintTo(BufferFormatter* f) const {
170 const char* type_name = "?"; 170 const char* type_name = "?";
171 if ((cid_ != kIllegalCid) && (cid_ != kDynamicCid)) { 171 if ((cid_ != kIllegalCid) && (cid_ != kDynamicCid)) {
172 const Class& cls = 172 const Class& cls =
173 Class::Handle(Isolate::Current()->class_table()->At(cid_)); 173 Class::Handle(Isolate::Current()->class_table()->At(cid_));
174 type_name = String::Handle(cls.PrettyName()).ToCString(); 174 type_name = String::Handle(cls.ScrubbedName()).ToCString();
175 } else if (type_ != NULL && 175 } else if (type_ != NULL &&
176 !type_->Equals(Type::Handle(Type::DynamicType()))) { 176 !type_->Equals(Type::Handle(Type::DynamicType()))) {
177 type_name = type_->ToCString(); 177 type_name = type_->ToCString();
178 } else if (!is_nullable()) { 178 } else if (!is_nullable()) {
179 type_name = "!null"; 179 type_name = "!null";
180 } 180 }
181 181
182 f->Print("T{%s%s}", type_name, is_nullable_ ? "?" : ""); 182 f->Print("T{%s%s}", type_name, is_nullable_ ? "?" : "");
183 } 183 }
184 184
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 558
559 void RelationalOpInstr::PrintOperandsTo(BufferFormatter* f) const { 559 void RelationalOpInstr::PrintOperandsTo(BufferFormatter* f) const {
560 f->Print("%s, ", Token::Str(kind())); 560 f->Print("%s, ", Token::Str(kind()));
561 left()->PrintTo(f); 561 left()->PrintTo(f);
562 f->Print(", "); 562 f->Print(", ");
563 right()->PrintTo(f); 563 right()->PrintTo(f);
564 } 564 }
565 565
566 566
567 void AllocateObjectInstr::PrintOperandsTo(BufferFormatter* f) const { 567 void AllocateObjectInstr::PrintOperandsTo(BufferFormatter* f) const {
568 f->Print("%s", String::Handle(cls().PrettyName()).ToCString()); 568 f->Print("%s", String::Handle(cls().ScrubbedName()).ToCString());
569 for (intptr_t i = 0; i < ArgumentCount(); i++) { 569 for (intptr_t i = 0; i < ArgumentCount(); i++) {
570 f->Print(", "); 570 f->Print(", ");
571 PushArgumentAt(i)->value()->PrintTo(f); 571 PushArgumentAt(i)->value()->PrintTo(f);
572 } 572 }
573 573
574 if (Identity().IsNotAliased()) { 574 if (Identity().IsNotAliased()) {
575 f->Print(" <not-aliased>"); 575 f->Print(" <not-aliased>");
576 } 576 }
577 } 577 }
578 578
579 579
580 void MaterializeObjectInstr::PrintOperandsTo(BufferFormatter* f) const { 580 void MaterializeObjectInstr::PrintOperandsTo(BufferFormatter* f) const {
581 f->Print("%s", String::Handle(cls_.PrettyName()).ToCString()); 581 f->Print("%s", String::Handle(cls_.ScrubbedName()).ToCString());
582 for (intptr_t i = 0; i < InputCount(); i++) { 582 for (intptr_t i = 0; i < InputCount(); i++) {
583 f->Print(", "); 583 f->Print(", ");
584 f->Print("%s: ", slots_[i]->ToCString()); 584 f->Print("%s: ", slots_[i]->ToCString());
585 InputAt(i)->PrintTo(f); 585 InputAt(i)->PrintTo(f);
586 } 586 }
587 } 587 }
588 588
589 589
590 void LoadFieldInstr::PrintOperandsTo(BufferFormatter* f) const { 590 void LoadFieldInstr::PrintOperandsTo(BufferFormatter* f) const {
591 instance()->PrintTo(f); 591 instance()->PrintTo(f);
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 f->Print("%s, ", Token::Str(op_kind())); 919 f->Print("%s, ", Token::Str(op_kind()));
920 value()->PrintTo(f); 920 value()->PrintTo(f);
921 } 921 }
922 922
923 923
924 void CheckClassIdInstr::PrintOperandsTo(BufferFormatter* f) const { 924 void CheckClassIdInstr::PrintOperandsTo(BufferFormatter* f) const {
925 value()->PrintTo(f); 925 value()->PrintTo(f);
926 926
927 const Class& cls = 927 const Class& cls =
928 Class::Handle(Isolate::Current()->class_table()->At(cid())); 928 Class::Handle(Isolate::Current()->class_table()->At(cid()));
929 f->Print(", %s", String::Handle(cls.PrettyName()).ToCString()); 929 f->Print(", %s", String::Handle(cls.ScrubbedName()).ToCString());
930 } 930 }
931 931
932 932
933 void CheckClassInstr::PrintOperandsTo(BufferFormatter* f) const { 933 void CheckClassInstr::PrintOperandsTo(BufferFormatter* f) const {
934 value()->PrintTo(f); 934 value()->PrintTo(f);
935 PrintICDataHelper(f, unary_checks()); 935 PrintICDataHelper(f, unary_checks());
936 if (IsNullCheck()) { 936 if (IsNullCheck()) {
937 f->Print(" nullcheck"); 937 f->Print(" nullcheck");
938 } 938 }
939 } 939 }
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
1253 } 1253 }
1254 1254
1255 1255
1256 bool FlowGraphPrinter::ShouldPrint(const Function& function) { 1256 bool FlowGraphPrinter::ShouldPrint(const Function& function) {
1257 return false; 1257 return false;
1258 } 1258 }
1259 1259
1260 #endif // !PRODUCT 1260 #endif // !PRODUCT
1261 1261
1262 } // namespace dart 1262 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698