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

Unified Diff: runtime/vm/kernel_to_il.cc

Issue 2464953002: Add support for OSR in kernel-based FlowGraphBuilder (Closed)
Patch Set: address comments Created 4 years, 1 month 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/intermediate_language.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel_to_il.cc
diff --git a/runtime/vm/kernel_to_il.cc b/runtime/vm/kernel_to_il.cc
index 0aff92bde22c049fe019ecf25664c11b8a31faf7..e5bf5ae5da44bbd5bbf1464de139639857d4cffe 100644
--- a/runtime/vm/kernel_to_il.cc
+++ b/runtime/vm/kernel_to_il.cc
@@ -2750,7 +2750,7 @@ FlowGraph* FlowGraphBuilder::BuildGraphOfFunction(FunctionNode* function,
const Function& dart_function = parsed_function_->function();
TargetEntryInstr* normal_entry = BuildTargetEntry();
graph_entry_ = new (Z)
- GraphEntryInstr(*parsed_function_, normal_entry, Compiler::kNoOSRDeoptId);
+ GraphEntryInstr(*parsed_function_, normal_entry, osr_id_);
SetupDefaultParameterValues(function);
@@ -2917,6 +2917,15 @@ FlowGraph* FlowGraphBuilder::BuildGraphOfFunction(FunctionNode* function,
}
normal_entry->LinkTo(body.entry);
+ // When compiling for OSR, use a depth first search to prune instructions
+ // unreachable from the OSR entry. Catch entries are always considered
+ // reachable, even if they become unreachable after OSR.
+ if (osr_id_ != Compiler::kNoOSRDeoptId) {
+ BitVector* block_marks = new(Z) BitVector(Z, next_block_id_);
+ bool found = graph_entry_->PruneUnreachable(graph_entry_, NULL, osr_id_,
+ block_marks);
+ ASSERT(found);
+ }
return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1);
}
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698