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

Unified Diff: runtime/vm/il_printer.cc

Issue 563763003: Cleanup printing of propagated types to make it easier to read. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/il_printer.cc
diff --git a/runtime/vm/il_printer.cc b/runtime/vm/il_printer.cc
index e973258a0008136a2cc81a4981d2a0f14528a141..0f5ec22e3edd5623f1c0f4942c08d6e122e4504d 100644
--- a/runtime/vm/il_printer.cc
+++ b/runtime/vm/il_printer.cc
@@ -112,16 +112,20 @@ void FlowGraphPrinter::PrintTypeCheck(const ParsedFunction& parsed_function,
void CompileType::PrintTo(BufferFormatter* f) const {
- f->Print("T{");
- f->Print("%s, ", is_nullable_ ? "null" : "not-null");
- if (cid_ != kIllegalCid) {
+ const char* type_name = "?";
+ if ((cid_ != kIllegalCid) &&
Florian Schneider 2014/09/11 13:30:24 Fits one line?
Vyacheslav Egorov (Google) 2014/09/11 13:36:42 Done.
+ (cid_ != kDynamicCid)) {
const Class& cls =
Class::Handle(Isolate::Current()->class_table()->At(cid_));
- f->Print("%s, ", String::Handle(cls.Name()).ToCString());
- } else {
- f->Print("?, ");
+ type_name = String::Handle(cls.PrettyName()).ToCString();
+ } else if (type_ != NULL &&
Florian Schneider 2014/09/11 13:30:24 Maybe move indentation until (
Vyacheslav Egorov (Google) 2014/09/11 13:36:42 Done.
+ !type_->Equals(Type::Handle(Type::DynamicType()))) {
+ type_name = type_->ToCString();
+ } else if (!is_nullable()) {
+ type_name = "!null";
}
- f->Print("%s}", (type_ != NULL) ? type_->ToCString() : "?");
+
+ f->Print("T{%s%s}", type_name, is_nullable_ ? "?" : "");
}
@@ -223,7 +227,9 @@ void Definition::PrintTo(BufferFormatter* f) const {
range_->PrintTo(f);
}
- if (type_ != NULL) {
+ if (type_ != NULL &&
+ ((type_->ToNullableCid() != kDynamicCid) ||
Florian Schneider 2014/09/11 13:30:24 Fits one line?
Vyacheslav Egorov (Google) 2014/09/11 13:36:42 Done.
+ !type_->is_nullable())) {
f->Print(" ");
type_->PrintTo(f);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698