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

Unified Diff: runtime/vm/regexp_assembler.h

Issue 722243002: Indirectly dispatch all backtracking jumps through the same block. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: return on unreachable Created 6 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/regexp.cc ('k') | runtime/vm/regexp_assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/regexp_assembler.h
diff --git a/runtime/vm/regexp_assembler.h b/runtime/vm/regexp_assembler.h
index 92a7f28dd382f62a953e3edbf1d85458514f2692..810f8fa3889aa7693395e276f289f9603dcab14a 100644
--- a/runtime/vm/regexp_assembler.h
+++ b/runtime/vm/regexp_assembler.h
@@ -328,25 +328,20 @@ class IRRegExpMacroAssembler: public RegExpMacroAssembler {
virtual void PrintBlocks();
+ IndirectGotoInstr* backtrack_goto() const { return backtrack_goto_; }
GraphEntryInstr* graph_entry() const { return entry_block_; }
intptr_t num_stack_locals() const { return local_id_.Count(); }
intptr_t num_blocks() const { return block_id_.Count(); }
- // A table mapping block ids to block offsets, used to look up offsets
- // for indirect goto instructions.
- void FinalizeBlockOffsetTable();
-
- // Fill in indirect goto successors.
- void FinalizeIndirectGotos();
+ // Generate a dispatch block implementing backtracking. Must be done after
+ // graph construction.
+ void GenerateBacktrackBlock();
private:
// Generate the contents of preset blocks. The entry block is the entry point
// of the generated code.
void GenerateEntryBlock();
- // Performs backtracking, i.e. popping an offset from the stack and doing
- // an indirect goto.
- void GenerateBacktrackBlock();
// Copies capture indices into the result area and returns true.
void GenerateSuccessBlock();
// Returns false.
@@ -567,9 +562,13 @@ class IRRegExpMacroAssembler: public RegExpMacroAssembler {
GraphEntryInstr* entry_block_;
JoinEntryInstr* start_block_;
JoinEntryInstr* success_block_;
- JoinEntryInstr* backtrack_block_;
JoinEntryInstr* exit_block_;
+ // Shared backtracking block.
+ JoinEntryInstr* backtrack_block_;
+ // Single indirect goto instruction which performs all backtracking.
+ IndirectGotoInstr* backtrack_goto_;
+
const ParsedFunction* parsed_function_;
const ZoneGrowableArray<const ICData*>& ic_data_array_;
@@ -617,8 +616,6 @@ class IRRegExpMacroAssembler: public RegExpMacroAssembler {
// The actual array object used as the stack.
GrowableObjectArray& stack_array_;
- GrowableArray<IndirectGotoInstr*> igotos_;
-
IdAllocator block_id_;
IdAllocator temp_id_;
IdAllocator arg_id_;
« no previous file with comments | « runtime/vm/regexp.cc ('k') | runtime/vm/regexp_assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698