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

Unified Diff: runtime/vm/redundancy_elimination.cc

Issue 2390423002: Fix try-catch optimizer. (Closed)
Patch Set: Created 4 years, 2 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/redundancy_elimination.cc
diff --git a/runtime/vm/redundancy_elimination.cc b/runtime/vm/redundancy_elimination.cc
index f7bc9b77c655b6f49491380f6c4680d4f592d191..0dffdf2a352eaa47bbc902d5f9544b51c6215851 100644
--- a/runtime/vm/redundancy_elimination.cc
+++ b/runtime/vm/redundancy_elimination.cc
@@ -3372,10 +3372,14 @@ void TryCatchAnalyzer::Optimize(FlowGraph* flow_graph) {
ASSERT(env != NULL);
for (intptr_t env_idx = 0; env_idx < cdefs.length(); ++env_idx) {
if (cdefs[env_idx] != NULL &&
+ !cdefs[env_idx]->IsConstant() &&
env->ValueAt(env_idx)->BindsToConstant()) {
+ // If the recorded definition is not a constant, record this
+ // definition as the current constant definition.
cdefs[env_idx] = env->ValueAt(env_idx)->definition();
}
if (cdefs[env_idx] != env->ValueAt(env_idx)->definition()) {
+ // Non-constant definitions are reset to NULL.
cdefs[env_idx] = NULL;
}
}
« no previous file with comments | « no previous file | tests/language/try_catch_regress_27483_test.dart » ('j') | tests/language/try_catch_regress_27483_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698