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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 13878017: Convert EqualityCompare to StrictCompare if reciever is either null or guaranteed to have default e… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address Srdjan's comments Created 7 years, 8 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_optimizer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 0c64c347fe51721707a272bef7e638cfb00ed102..c897711bdadefdf01ece556fa2a4c6515df32112 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -1316,16 +1316,7 @@ Instruction* CheckClassInstr::Canonicalize(FlowGraphOptimizer* optimizer) {
return this;
}
- const intptr_t num_checks = unary_checks().NumberOfChecks();
-
- for (intptr_t i = 0; i < num_checks; i++) {
- if (value_cid == unary_checks().GetReceiverClassIdAt(i)) {
- // No checks needed.
- return NULL;
- }
- }
-
- return this;
+ return unary_checks().HasReceiverClassId(value_cid) ? NULL : this;
}
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698