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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 11886044: Set statically known ResultCid for AllocateObject. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
« runtime/vm/il_printer.cc ('K') | « runtime/vm/intermediate_language.h ('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 93b89ffc76daf82942794b275c64755e8ffead03..1933f8d7565e002cb8a576e7f0faba9188ce0014 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -1748,12 +1748,19 @@ Definition* StrictCompareInstr::Canonicalize(FlowGraphOptimizer* optimizer) {
Instruction* CheckClassInstr::Canonicalize(FlowGraphOptimizer* optimizer) {
const intptr_t value_cid = value()->ResultCid();
+ if (value_cid == kDynamicCid) {
+ return this;
+ }
+
const intptr_t num_checks = unary_checks().NumberOfChecks();
- if ((num_checks == 1) &&
- (value_cid == unary_checks().GetReceiverClassIdAt(0))) {
- // No checks needed.
- return NULL;
+
+ for (intptr_t i = 0; i < num_checks; i++) {
+ if (value_cid == unary_checks().GetReceiverClassIdAt(i)) {
+ // No checks needed.
+ return NULL;
+ }
}
+
return this;
}
« runtime/vm/il_printer.cc ('K') | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698