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_; |