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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 12220150: When canonicalizing branch on StrictCompare ensure that branch gets correct environment. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address issues Created 7 years, 10 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
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 7b8e997150c84ea4da8d6cf68d74312d98a54121..48edba328def479ce21179cdd7aacdf382e20986 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -1821,7 +1821,16 @@ Instruction* BranchInstr::Canonicalize(FlowGraphOptimizer* optimizer) {
Definition* replacement = comparison()->Canonicalize(optimizer);
if (replacement == comparison() || replacement == NULL) return this;
ComparisonInstr* comp = replacement->AsComparison();
- if (comp == NULL) return this;
+ if ((comp == NULL) || comp->CanDeoptimize()) return this;
+
+ // Check that comparison is not serving as a pending deoptimization target
+ // for conversions.
+ for (intptr_t i = 0; i < comp->InputCount(); i++) {
+ if (comp->RequiredInputRepresentation(i) !=
+ comp->InputAt(i)->definition()->representation()) {
+ return this;
+ }
+ }
// Replace the comparison if the replacement is used at this branch,
// and has exactly one use.
« no previous file with comments | « no previous file | tests/language/branch_canonicalization_test.dart » ('j') | tests/language/branch_canonicalization_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698