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

Unified Diff: runtime/vm/il_printer.cc

Issue 12529008: Collect type feedback for fields. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 2c921d6549fc66b3eda15e9c348828cf0b3b018e..0213ae37804e5e7e111a811558996671c66ff399 100644
--- a/runtime/vm/il_printer.cc
+++ b/runtime/vm/il_printer.cc
@@ -396,6 +396,22 @@ void NativeCallInstr::PrintOperandsTo(BufferFormatter* f) const {
}
+void GuardFieldInstr::PrintOperandsTo(BufferFormatter* f) const {
+ const char* expected = "?";
+ if (field().guarded_cid() != kIllegalCid) {
+ const Class& cls = Class::Handle(
+ Isolate::Current()->class_table()->At(field().guarded_cid()));
+ expected = String::Handle(cls.Name()).ToCString();
+ }
+
+ f->Print("%s [%s %s], ",
+ String::Handle(field().name()).ToCString(),
+ field().is_nullable() ? "nullable" : "non-nullable",
+ expected);
+ value()->PrintTo(f);
+}
+
+
void StoreInstanceFieldInstr::PrintOperandsTo(BufferFormatter* f) const {
f->Print("%s {%"Pd"}, ",
String::Handle(field().name()).ToCString(),
@@ -482,7 +498,26 @@ void CreateClosureInstr::PrintOperandsTo(BufferFormatter* f) const {
void LoadFieldInstr::PrintOperandsTo(BufferFormatter* f) const {
value()->PrintTo(f);
- f->Print(", %"Pd", immutable=%d", offset_in_bytes(), immutable_);
+ f->Print(", %"Pd, offset_in_bytes());
+
+ if (field_name_ != NULL) {
+ f->Print(" {%s}", field_name_);
+ }
+
+ if (field() != NULL) {
+ const char* expected = "?";
+ if (field()->guarded_cid() != kIllegalCid) {
+ const Class& cls = Class::Handle(
+ Isolate::Current()->class_table()->At(field()->guarded_cid()));
+ expected = String::Handle(cls.Name()).ToCString();
+ }
+
+ f->Print(" [%s %s]",
+ field()->is_nullable() ? "nullable" : "non-nullable",
+ expected);
+ }
+
+ f->Print(", immutable=%d", immutable_);
}
@@ -574,6 +609,9 @@ void UnarySmiOpInstr::PrintOperandsTo(BufferFormatter* f) const {
void CheckClassInstr::PrintOperandsTo(BufferFormatter* f) const {
value()->PrintTo(f);
PrintICData(f, unary_checks());
+ if (null_check()) {
+ f->Print(" nullcheck");
+ }
}

Powered by Google App Engine
This is Rietveld 408576698