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

Unified Diff: runtime/vm/il_printer.cc

Issue 2891713002: Cleanup: Make CheckClassId instruction more general so it (Closed)
Patch Set: Feedback from Martin Created 3 years, 7 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 | « runtime/vm/flow_graph_type_propagator.cc ('k') | runtime/vm/intermediate_language.h » ('j') | 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 78821fc699b4385a5f02469d1e4eee5ea799c365..63613b85f3a5dd8fa9fe0d2465a159340eace778 100644
--- a/runtime/vm/il_printer.cc
+++ b/runtime/vm/il_printer.cc
@@ -212,7 +212,7 @@ static void PrintTargetsHelper(BufferFormatter* f,
if (i > 0) {
f->Print(" | ");
}
- if (range.cid_start == range.cid_end) {
+ if (range.IsSingleCid()) {
const Class& cls =
Class::Handle(Isolate::Current()->class_table()->At(range.cid_start));
f->Print("%s", String::Handle(cls.Name()).ToCString());
@@ -249,7 +249,7 @@ static void PrintCidsHelper(BufferFormatter* f,
const Class& cls =
Class::Handle(Isolate::Current()->class_table()->At(range.cid_start));
f->Print("%s etc. ", String::Handle(cls.Name()).ToCString());
- if (range.cid_start == range.cid_end) {
+ if (range.IsSingleCid()) {
f->Print(" cid %" Pd, range.cid_start);
} else {
f->Print(" cid %" Pd "-%" Pd, range.cid_start, range.cid_end);
@@ -1055,8 +1055,17 @@ void CheckClassIdInstr::PrintOperandsTo(BufferFormatter* f) const {
value()->PrintTo(f);
const Class& cls =
- Class::Handle(Isolate::Current()->class_table()->At(cid()));
- f->Print(", %s", String::Handle(cls.ScrubbedName()).ToCString());
+ Class::Handle(Isolate::Current()->class_table()->At(cids().cid_start));
+ const String& name = String::Handle(cls.ScrubbedName());
+ if (cids().IsSingleCid()) {
+ f->Print(", %s", name.ToCString());
+ } else {
+ const Class& cls2 =
+ Class::Handle(Isolate::Current()->class_table()->At(cids().cid_end));
+ const String& name2 = String::Handle(cls2.ScrubbedName());
+ f->Print(", cid %" Pd "-%" Pd " %s-%s", cids().cid_start, cids().cid_end,
+ name.ToCString(), name2.ToCString());
+ }
}
« no previous file with comments | « runtime/vm/flow_graph_type_propagator.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698