Index: runtime/vm/compiler.cc |
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc |
index f5a702a4b622834bf5e2607a3194e15aef3ed489..09f67c56e73ed114b5d3ecfee167a127cb4efaff 100644 |
--- a/runtime/vm/compiler.cc |
+++ b/runtime/vm/compiler.cc |
@@ -168,17 +168,20 @@ FlowGraph* IrregexpCompilationPipeline::BuildFlowGraph( |
const ZoneGrowableArray<const ICData*>& ic_data_array, |
intptr_t osr_id) { |
// Compile to the dart IR. |
- RegExpEngine::CompilationResult result = RegExpEngine::CompileIR( |
- parsed_function->regexp_compile_data(), parsed_function, ic_data_array); |
+ RegExpEngine::CompilationResult result = |
+ RegExpEngine::CompileIR(parsed_function->regexp_compile_data(), |
+ parsed_function, ic_data_array, osr_id); |
backtrack_goto_ = result.backtrack_goto; |
// Allocate variables now that we know the number of locals. |
parsed_function->AllocateIrregexpVariables(result.num_stack_locals); |
- // Build the flow graph. |
- FlowGraphBuilder builder(*parsed_function, ic_data_array, |
- /* not building var desc */ NULL, |
- /* not inlining */ NULL, osr_id); |
+ // When compiling for OSR, use a depth first search to prune instructions |
erikcorry
2017/06/22 13:08:06
Actually "use a depth first search to find the ent
Vyacheslav Egorov (Google)
2017/06/22 14:58:48
Renamed to RelinkToOsrEntry()
|
+ // unreachable from the OSR entry. Catch entries are always considered |
+ // reachable, even if they become unreachable after OSR. |
+ if (osr_id != Compiler::kNoOSRDeoptId) { |
+ result.graph_entry->PruneUnreachableForOSR(zone, result.num_blocks); |
+ } |
return new (zone) |
FlowGraph(*parsed_function, result.graph_entry, result.num_blocks); |