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

Unified Diff: runtime/vm/redundancy_elimination.cc

Issue 2411823003: VM support for running Kernel binaries. (Closed)
Patch Set: Address comments 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
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | runtime/vm/scopes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/redundancy_elimination.cc
diff --git a/runtime/vm/redundancy_elimination.cc b/runtime/vm/redundancy_elimination.cc
index 0dffdf2a352eaa47bbc902d5f9544b51c6215851..c13ec9d2fcb23f568faa0d4141bc794fc31bd477 100644
--- a/runtime/vm/redundancy_elimination.cc
+++ b/runtime/vm/redundancy_elimination.cc
@@ -3353,10 +3353,15 @@ void TryCatchAnalyzer::Optimize(FlowGraph* flow_graph) {
GrowableArray<Definition*> cdefs(idefs->length());
cdefs.AddArray(*idefs);
- // exception_var and stacktrace_var are never constant.
- intptr_t ex_idx = base - catch_entry->exception_var().index();
- intptr_t st_idx = base - catch_entry->stacktrace_var().index();
- cdefs[ex_idx] = cdefs[st_idx] = NULL;
+ // exception_var and stacktrace_var are never constant. In asynchronous or
+ // generator functions they may be context-allocated in which case they are
+ // not tracked in the environment anyway.
+ if (!catch_entry->exception_var().is_captured()) {
+ cdefs[base - catch_entry->exception_var().index()] = NULL;
+ }
+ if (!catch_entry->stacktrace_var().is_captured()) {
+ cdefs[base - catch_entry->stacktrace_var().index()] = NULL;
+ }
for (BlockIterator block_it = flow_graph->reverse_postorder_iterator();
!block_it.Done();
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | runtime/vm/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698