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

Unified Diff: runtime/vm/regexp_assembler_ir.cc

Issue 2950783003: VM(RegExp): Allow OSR optimization of RegExp :matcher functions. (Closed)
Patch Set: 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
« no previous file with comments | « runtime/vm/regexp_assembler_ir.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/regexp_assembler_ir.cc
diff --git a/runtime/vm/regexp_assembler_ir.cc b/runtime/vm/regexp_assembler_ir.cc
index 2bdc701b8315cd222701a57599d7709d829dae86..fe7c4827b446dddf0bed4595f4091f4389db08c7 100644
--- a/runtime/vm/regexp_assembler_ir.cc
+++ b/runtime/vm/regexp_assembler_ir.cc
@@ -78,6 +78,7 @@ IRRegExpMacroAssembler::IRRegExpMacroAssembler(
intptr_t capture_count,
const ParsedFunction* parsed_function,
const ZoneGrowableArray<const ICData*>& ic_data_array,
+ intptr_t osr_id,
Zone* zone)
: RegExpMacroAssembler(zone),
thread_(Thread::Current()),
@@ -125,7 +126,7 @@ IRRegExpMacroAssembler::IRRegExpMacroAssembler(
*parsed_function_,
new (zone) TargetEntryInstr(block_id_.Alloc(), kInvalidTryIndex,
GetNextDeoptId()),
- Compiler::kNoOSRDeoptId);
+ osr_id);
start_block_ = new (zone)
JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex, GetNextDeoptId());
success_block_ = new (zone)
@@ -223,7 +224,7 @@ void IRRegExpMacroAssembler::GenerateEntryBlock() {
void IRRegExpMacroAssembler::GenerateBacktrackBlock() {
set_current_instruction(backtrack_block_);
TAG();
- CheckPreemption();
+ CheckPreemption(/*is_backtrack=*/true);
const intptr_t entries_count = entry_block_->indirect_entries().length();
@@ -1767,10 +1768,16 @@ IndirectEntryInstr* IRRegExpMacroAssembler::IndirectWithJoinGoto(
}
-void IRRegExpMacroAssembler::CheckPreemption() {
+void IRRegExpMacroAssembler::CheckPreemption(bool is_backtrack) {
TAG();
- AppendInstruction(new (Z) CheckStackOverflowInstr(TokenPosition::kNoSource, 0,
- GetNextDeoptId()));
+
+ // Setting non-zero loop_depth turns this CheckStackOverflow into
erikcorry 2017/06/21 07:54:07 This is confusing. "Turns it into an OSR entry" s
Vyacheslav Egorov (Google) 2017/06/21 11:42:04 Done.
+ // an OSR entry.
+ AppendInstruction(new (Z) CheckStackOverflowInstr(
+ TokenPosition::kNoSource,
+ /*loop_depth=*/1, GetNextDeoptId(),
+ is_backtrack ? CheckStackOverflowInstr::kFull
+ : CheckStackOverflowInstr::kOsrEntry));
}
« no previous file with comments | « runtime/vm/regexp_assembler_ir.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698