Chromium Code Reviews| Index: src/jsregexp.h |
| =================================================================== |
| --- src/jsregexp.h (revision 5911) |
| +++ src/jsregexp.h (working copy) |
| @@ -597,7 +597,9 @@ |
| // succeed. If we have found at least 'still_to_find' characters that |
| // must be consumed there is no need to ask any following nodes whether |
| // they are sure to eat any more characters. |
| - virtual int EatsAtLeast(int still_to_find, int recursion_depth) = 0; |
| + virtual int EatsAtLeast(int still_to_find, |
|
Lasse Reichstein
2010/12/03 09:12:43
Add explanation of not_at_start parameter - what h
Erik Corry
2010/12/03 09:26:08
I think I will explain, but not rename, since we u
|
| + int recursion_depth, |
| + bool not_at_start) = 0; |
| // Emits some quick code that checks whether the preloaded characters match. |
| // Falls through on certain failure, jumps to the label on possible success. |
| // If the node cannot make a quick check it does nothing and returns false. |
| @@ -765,7 +767,9 @@ |
| RegExpNode* on_success); |
| virtual void Accept(NodeVisitor* visitor); |
| virtual void Emit(RegExpCompiler* compiler, Trace* trace); |
| - virtual int EatsAtLeast(int still_to_find, int recursion_depth); |
| + virtual int EatsAtLeast(int still_to_find, |
| + int recursion_depth, |
| + bool not_at_start); |
| virtual void GetQuickCheckDetails(QuickCheckDetails* details, |
| RegExpCompiler* compiler, |
| int filled_in, |
| @@ -829,7 +833,9 @@ |
| } |
| virtual void Accept(NodeVisitor* visitor); |
| virtual void Emit(RegExpCompiler* compiler, Trace* trace); |
| - virtual int EatsAtLeast(int still_to_find, int recursion_depth); |
| + virtual int EatsAtLeast(int still_to_find, |
| + int recursion_depth, |
| + bool not_at_start); |
| virtual void GetQuickCheckDetails(QuickCheckDetails* details, |
| RegExpCompiler* compiler, |
| int characters_filled_in, |
| @@ -897,7 +903,9 @@ |
| } |
| virtual void Accept(NodeVisitor* visitor); |
| virtual void Emit(RegExpCompiler* compiler, Trace* trace); |
| - virtual int EatsAtLeast(int still_to_find, int recursion_depth); |
| + virtual int EatsAtLeast(int still_to_find, |
| + int recursion_depth, |
| + bool not_at_start); |
| virtual void GetQuickCheckDetails(QuickCheckDetails* details, |
| RegExpCompiler* compiler, |
| int filled_in, |
| @@ -925,7 +933,9 @@ |
| int start_register() { return start_reg_; } |
| int end_register() { return end_reg_; } |
| virtual void Emit(RegExpCompiler* compiler, Trace* trace); |
| - virtual int EatsAtLeast(int still_to_find, int recursion_depth); |
| + virtual int EatsAtLeast(int still_to_find, |
| + int recursion_depth, |
| + bool not_at_start); |
| virtual void GetQuickCheckDetails(QuickCheckDetails* details, |
| RegExpCompiler* compiler, |
| int characters_filled_in, |
| @@ -946,7 +956,9 @@ |
| explicit EndNode(Action action) : action_(action) { } |
| virtual void Accept(NodeVisitor* visitor); |
| virtual void Emit(RegExpCompiler* compiler, Trace* trace); |
| - virtual int EatsAtLeast(int still_to_find, int recursion_depth) { return 0; } |
| + virtual int EatsAtLeast(int still_to_find, |
| + int recursion_depth, |
| + bool not_at_start) { return 0; } |
| virtual void GetQuickCheckDetails(QuickCheckDetails* details, |
| RegExpCompiler* compiler, |
| int characters_filled_in, |
| @@ -1028,10 +1040,13 @@ |
| ZoneList<GuardedAlternative>* alternatives() { return alternatives_; } |
| DispatchTable* GetTable(bool ignore_case); |
| virtual void Emit(RegExpCompiler* compiler, Trace* trace); |
| - virtual int EatsAtLeast(int still_to_find, int recursion_depth); |
| + virtual int EatsAtLeast(int still_to_find, |
| + int recursion_depth, |
| + bool not_at_start); |
| int EatsAtLeastHelper(int still_to_find, |
| int recursion_depth, |
| - RegExpNode* ignore_this_node); |
| + RegExpNode* ignore_this_node, |
| + bool not_at_start); |
| virtual void GetQuickCheckDetails(QuickCheckDetails* details, |
| RegExpCompiler* compiler, |
| int characters_filled_in, |
| @@ -1054,7 +1069,7 @@ |
| void GenerateGuard(RegExpMacroAssembler* macro_assembler, |
| Guard* guard, |
| Trace* trace); |
| - int CalculatePreloadCharacters(RegExpCompiler* compiler); |
| + int CalculatePreloadCharacters(RegExpCompiler* compiler, bool not_at_start); |
| void EmitOutOfLineContinuation(RegExpCompiler* compiler, |
| Trace* trace, |
| GuardedAlternative alternative, |
| @@ -1077,7 +1092,9 @@ |
| AddAlternative(this_must_fail); |
| AddAlternative(then_do_this); |
| } |
| - virtual int EatsAtLeast(int still_to_find, int recursion_depth); |
| + virtual int EatsAtLeast(int still_to_find, |
| + int recursion_depth, |
| + bool not_at_start); |
| virtual void GetQuickCheckDetails(QuickCheckDetails* details, |
| RegExpCompiler* compiler, |
| int characters_filled_in, |
| @@ -1102,7 +1119,9 @@ |
| void AddLoopAlternative(GuardedAlternative alt); |
| void AddContinueAlternative(GuardedAlternative alt); |
| virtual void Emit(RegExpCompiler* compiler, Trace* trace); |
| - virtual int EatsAtLeast(int still_to_find, int recursion_depth); |
| + virtual int EatsAtLeast(int still_to_find, |
| + int recursion_depth, |
| + bool not_at_start); |
| virtual void GetQuickCheckDetails(QuickCheckDetails* details, |
| RegExpCompiler* compiler, |
| int characters_filled_in, |