Chromium Code Reviews| 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); |
| } |