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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 10876079: Clean up LoadInstanceField and StoreInstanceField. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 11378)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -1130,6 +1130,18 @@
}
+Definition* CheckClassComp::TryReplace(BindInstr* instr) const {
+ const intptr_t v_cid = value()->ResultCid();
+ const intptr_t num_checks = ic_data()->NumberOfChecks();
+ if ((num_checks == 1) &&
+ (v_cid == ic_data()->GetReceiverClassIdAt(0))) {
+ // No checks needed.
+ return NULL;
+ }
+ return instr;
+}
+
+
Definition* CheckSmiComp::TryReplace(BindInstr* instr) const {
return (value()->ResultCid() == kSmiCid) ? NULL : instr;
}

Powered by Google App Engine
This is Rietveld 408576698