Index: src/jsregexp.h |
=================================================================== |
--- src/jsregexp.h (revision 1152) |
+++ src/jsregexp.h (working copy) |
@@ -592,8 +592,10 @@ |
// false for failure. |
virtual bool Emit(RegExpCompiler* compiler, Trace* trace) = 0; |
// How many characters must this node consume at a minimum in order to |
- // succeed. |
- virtual int EatsAtLeast(int recursion_depth) = 0; |
+ // 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; |
// 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. |
@@ -733,7 +735,7 @@ |
RegExpNode* on_success); |
virtual void Accept(NodeVisitor* visitor); |
virtual bool Emit(RegExpCompiler* compiler, Trace* trace); |
- virtual int EatsAtLeast(int recursion_depth); |
+ virtual int EatsAtLeast(int still_to_find, int recursion_depth); |
virtual void GetQuickCheckDetails(QuickCheckDetails* details, |
RegExpCompiler* compiler, |
int filled_in) { |
@@ -792,7 +794,7 @@ |
} |
virtual void Accept(NodeVisitor* visitor); |
virtual bool Emit(RegExpCompiler* compiler, Trace* trace); |
- virtual int EatsAtLeast(int recursion_depth); |
+ virtual int EatsAtLeast(int still_to_find, int recursion_depth); |
virtual void GetQuickCheckDetails(QuickCheckDetails* details, |
RegExpCompiler* compiler, |
int characters_filled_in); |
@@ -850,7 +852,7 @@ |
} |
virtual void Accept(NodeVisitor* visitor); |
virtual bool Emit(RegExpCompiler* compiler, Trace* trace); |
- virtual int EatsAtLeast(int recursion_depth); |
+ virtual int EatsAtLeast(int still_to_find, int recursion_depth); |
virtual void GetQuickCheckDetails(QuickCheckDetails* details, |
RegExpCompiler* compiler, |
int filled_in) { |
@@ -877,7 +879,7 @@ |
int start_register() { return start_reg_; } |
int end_register() { return end_reg_; } |
virtual bool Emit(RegExpCompiler* compiler, Trace* trace); |
- virtual int EatsAtLeast(int recursion_depth); |
+ virtual int EatsAtLeast(int still_to_find, int recursion_depth); |
virtual void GetQuickCheckDetails(QuickCheckDetails* details, |
RegExpCompiler* compiler, |
int characters_filled_in) { |
@@ -897,7 +899,7 @@ |
explicit EndNode(Action action) : action_(action) { } |
virtual void Accept(NodeVisitor* visitor); |
virtual bool Emit(RegExpCompiler* compiler, Trace* trace); |
- virtual int EatsAtLeast(int recursion_depth) { return 0; } |
+ virtual int EatsAtLeast(int still_to_find, int recursion_depth) { return 0; } |
virtual void GetQuickCheckDetails(QuickCheckDetails* details, |
RegExpCompiler* compiler, |
int characters_filled_in) { |
@@ -971,8 +973,10 @@ |
ZoneList<GuardedAlternative>* alternatives() { return alternatives_; } |
DispatchTable* GetTable(bool ignore_case); |
virtual bool Emit(RegExpCompiler* compiler, Trace* trace); |
- virtual int EatsAtLeast(int recursion_depth); |
- int EatsAtLeastHelper(int recursion_depth, RegExpNode* ignore_this_node); |
+ virtual int EatsAtLeast(int still_to_find, int recursion_depth); |
+ int EatsAtLeastHelper(int still_to_find, |
+ int recursion_depth, |
+ RegExpNode* ignore_this_node); |
virtual void GetQuickCheckDetails(QuickCheckDetails* details, |
RegExpCompiler* compiler, |
int characters_filled_in); |
@@ -1012,7 +1016,7 @@ |
AddAlternative(this_must_fail); |
AddAlternative(then_do_this); |
} |
- virtual int EatsAtLeast(int recursion_depth); |
+ virtual int EatsAtLeast(int still_to_find, int recursion_depth); |
virtual void GetQuickCheckDetails(QuickCheckDetails* details, |
RegExpCompiler* compiler, |
int characters_filled_in); |
@@ -1035,7 +1039,7 @@ |
void AddLoopAlternative(GuardedAlternative alt); |
void AddContinueAlternative(GuardedAlternative alt); |
virtual bool Emit(RegExpCompiler* compiler, Trace* trace); |
- virtual int EatsAtLeast(int recursion_depth); // Returns 0. |
+ virtual int EatsAtLeast(int still_to_find, int recursion_depth); |
virtual void GetQuickCheckDetails(QuickCheckDetails* details, |
RegExpCompiler* compiler, |
int characters_filled_in); |