Chromium Code Reviews| Index: src/jsregexp.h |
| =================================================================== |
| --- src/jsregexp.h (revision 11692) |
| +++ src/jsregexp.h (working copy) |
| @@ -581,8 +581,10 @@ |
| // we look forward. This is used for a Boyer-Moore-like string searching |
| // implementation. TODO(erikcorry): This should share more code with |
| // EatsAtLeast, GetQuickCheckDetails. |
| + static const int kFillInBMBudget = 200; |
| virtual void FillInBMInfo(int offset, |
| int recursion_depth, |
| + int budget, |
|
ulan
2012/06/01 11:24:04
Please add a description for budget.
|
| BoyerMooreLookahead* bm, |
| bool not_at_start) { |
| UNREACHABLE(); |
| @@ -685,9 +687,11 @@ |
| virtual RegExpNode* FilterASCII(int depth); |
| virtual void FillInBMInfo(int offset, |
| int recursion_depth, |
| + int budget, |
| BoyerMooreLookahead* bm, |
| bool not_at_start) { |
| - on_success_->FillInBMInfo(offset, recursion_depth + 1, bm, not_at_start); |
| + on_success_->FillInBMInfo( |
| + offset, recursion_depth + 1, budget - 1, bm, not_at_start); |
| if (offset == 0) set_bm_info(not_at_start, bm); |
| } |
| @@ -742,6 +746,7 @@ |
| } |
| virtual void FillInBMInfo(int offset, |
| int recursion_depth, |
| + int budget, |
| BoyerMooreLookahead* bm, |
| bool not_at_start); |
| Type type() { return type_; } |
| @@ -813,6 +818,7 @@ |
| RegExpCompiler* compiler); |
| virtual void FillInBMInfo(int offset, |
| int recursion_depth, |
| + int budget, |
| BoyerMooreLookahead* bm, |
| bool not_at_start); |
| void CalculateOffsets(); |
| @@ -875,6 +881,7 @@ |
| bool not_at_start); |
| virtual void FillInBMInfo(int offset, |
| int recursion_depth, |
| + int budget, |
| BoyerMooreLookahead* bm, |
| bool not_at_start); |
| AssertionNodeType type() { return type_; } |
| @@ -915,6 +922,7 @@ |
| } |
| virtual void FillInBMInfo(int offset, |
| int recursion_depth, |
| + int budget, |
| BoyerMooreLookahead* bm, |
| bool not_at_start); |
| @@ -942,6 +950,7 @@ |
| } |
| virtual void FillInBMInfo(int offset, |
| int recursion_depth, |
| + int budget, |
| BoyerMooreLookahead* bm, |
| bool not_at_start) { |
| // Returning 0 from EatsAtLeast should ensure we never get here. |
| @@ -1034,6 +1043,7 @@ |
| bool not_at_start); |
| virtual void FillInBMInfo(int offset, |
| int recursion_depth, |
| + int budget, |
| BoyerMooreLookahead* bm, |
| bool not_at_start); |
| @@ -1086,10 +1096,11 @@ |
| bool not_at_start); |
| virtual void FillInBMInfo(int offset, |
| int recursion_depth, |
| + int budget, |
| BoyerMooreLookahead* bm, |
| bool not_at_start) { |
| alternatives_->at(1).node()->FillInBMInfo( |
| - offset, recursion_depth + 1, bm, not_at_start); |
| + offset, recursion_depth + 1, budget - 1, bm, not_at_start); |
| if (offset == 0) set_bm_info(not_at_start, bm); |
| } |
| // For a negative lookahead we don't emit the quick check for the |
| @@ -1121,6 +1132,7 @@ |
| bool not_at_start); |
| virtual void FillInBMInfo(int offset, |
| int recursion_depth, |
| + int budget, |
| BoyerMooreLookahead* bm, |
| bool not_at_start); |
| RegExpNode* loop_node() { return loop_node_; } |