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

Unified Diff: runtime/vm/regexp.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/regexp.cc
diff --git a/runtime/vm/regexp.cc b/runtime/vm/regexp.cc
index 3516bc8423e5c5470188e4794bb6f39c02cc1dc5..c9a42361db15e9079d3071e6a051bd34638d3e06 100644
--- a/runtime/vm/regexp.cc
+++ b/runtime/vm/regexp.cc
@@ -3029,6 +3029,7 @@ void BoyerMooreLookahead::EmitSkipInstructions(RegExpMacroAssembler* masm) {
BlockLabel cont, again;
masm->BindBlock(&again);
+ masm->CheckPreemption(/*is_backtrack=*/false);
masm->LoadCurrentCharacter(max_lookahead, &cont, true);
masm->CheckBitInTable(boolean_skip_table, &cont);
masm->AdvanceCurrentPosition(skip_distance);
@@ -3235,6 +3236,7 @@ Trace* ChoiceNode::EmitGreedyLoop(RegExpCompiler* compiler,
greedy_match_trace.set_backtrack(&greedy_match_failed);
BlockLabel loop_label;
macro_assembler->BindBlock(&loop_label);
+ macro_assembler->CheckPreemption(/*is_backtrack=*/false);
greedy_match_trace.set_stop_node(this);
greedy_match_trace.set_loop_label(&loop_label);
(*alternatives_)[0].node()->Emit(compiler, &greedy_match_trace);
@@ -4818,7 +4820,8 @@ void TextNode::FillInBMInfo(intptr_t initial_offset,
RegExpEngine::CompilationResult RegExpEngine::CompileIR(
RegExpCompileData* data,
const ParsedFunction* parsed_function,
- const ZoneGrowableArray<const ICData*>& ic_data_array) {
+ const ZoneGrowableArray<const ICData*>& ic_data_array,
+ intptr_t osr_id) {
ASSERT(!FLAG_interpret_irregexp);
Zone* zone = Thread::Current()->zone();
@@ -4894,9 +4897,9 @@ RegExpEngine::CompilationResult RegExpEngine::CompileIR(
// Native regexp implementation.
- IRRegExpMacroAssembler* macro_assembler =
- new (zone) IRRegExpMacroAssembler(specialization_cid, data->capture_count,
- parsed_function, ic_data_array, zone);
+ IRRegExpMacroAssembler* macro_assembler = new (zone)
+ IRRegExpMacroAssembler(specialization_cid, data->capture_count,
+ parsed_function, ic_data_array, osr_id, zone);
// Inserted here, instead of in Assembler, because it depends on information
// in the AST that isn't replicated in the Node structure.

Powered by Google App Engine
This is Rietveld 408576698