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

Unified Diff: runtime/vm/compiler.cc

Issue 2951053003: VM(RegExp): Allow OSR optimization of RegExp :matcher functions. (Closed)
Patch Set: Fix bugs with stack growing and block pruning Created 3 years, 6 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/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);

Powered by Google App Engine
This is Rietveld 408576698