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

Unified Diff: runtime/vm/il_printer.cc

Issue 2955073005: VM-codegen: Add IL instruction to check if a Smi is in a constant range
Patch Set: Created 3 years, 6 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
Index: runtime/vm/il_printer.cc
diff --git a/runtime/vm/il_printer.cc b/runtime/vm/il_printer.cc
index 653d564e6a8feb722191aa3a05cbafd76556c4ea..dcbcb6ebbaa711c331637f6b1f81977473f8cba8 100644
--- a/runtime/vm/il_printer.cc
+++ b/runtime/vm/il_printer.cc
@@ -1070,6 +1070,22 @@ void UnaryDoubleOpInstr::PrintOperandsTo(BufferFormatter* f) const {
}
+void SmiRangeComparisonInstr::PrintOperandsTo(BufferFormatter* f) const {
+ // This is currently only used for tests on Cids, so we print the range of
+ // cids as class names, too.
+ const Class& from_cls =
+ Class::Handle(Isolate::Current()->class_table()->At(from_));
+ const String& from_name = String::Handle(from_cls.ScrubbedName());
+ const Class& to_cls =
+ Class::Handle(Isolate::Current()->class_table()->At(to_));
+ const String& to_name = String::Handle(to_cls.ScrubbedName());
+ f->Print(" (/*%s*/ %" Pd " <= ", from_name.ToCString(), from_);
+ input()->PrintTo(f);
+ f->Print(" <= %" Pd " /*%s*/) ? %s : %s", to_, to_name.ToCString(),
+ is_negated_ ? "false" : "true", is_negated_ ? "true" : "false");
+}
+
+
void CheckClassIdInstr::PrintOperandsTo(BufferFormatter* f) const {
value()->PrintTo(f);

Powered by Google App Engine
This is Rietveld 408576698