| Index: src/jsregexp.h
|
| ===================================================================
|
| --- src/jsregexp.h (revision 11684)
|
| +++ 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.
|
| - virtual void FillInBMInfo(
|
| - int offset, BoyerMooreLookahead* bm, bool not_at_start) {
|
| + virtual void FillInBMInfo(int offset,
|
| + int recursion_depth,
|
| + BoyerMooreLookahead* bm,
|
| + bool not_at_start) {
|
| UNREACHABLE();
|
| }
|
|
|
| @@ -681,9 +683,11 @@
|
| RegExpNode* on_success() { return on_success_; }
|
| void set_on_success(RegExpNode* node) { on_success_ = node; }
|
| virtual RegExpNode* FilterASCII(int depth);
|
| - virtual void FillInBMInfo(
|
| - int offset, BoyerMooreLookahead* bm, bool not_at_start) {
|
| - on_success_->FillInBMInfo(offset, bm, not_at_start);
|
| + virtual void FillInBMInfo(int offset,
|
| + int recursion_depth,
|
| + BoyerMooreLookahead* bm,
|
| + bool not_at_start) {
|
| + on_success_->FillInBMInfo(offset, recursion_depth + 1, bm, not_at_start);
|
| if (offset == 0) set_bm_info(not_at_start, bm);
|
| }
|
|
|
| @@ -736,8 +740,10 @@
|
| return on_success()->GetQuickCheckDetails(
|
| details, compiler, filled_in, not_at_start);
|
| }
|
| - virtual void FillInBMInfo(
|
| - int offset, BoyerMooreLookahead* bm, bool not_at_start);
|
| + virtual void FillInBMInfo(int offset,
|
| + int recursion_depth,
|
| + BoyerMooreLookahead* bm,
|
| + bool not_at_start);
|
| Type type() { return type_; }
|
| // TODO(erikcorry): We should allow some action nodes in greedy loops.
|
| virtual int GreedyLoopTextLength() { return kNodeIsTooComplexForGreedyLoops; }
|
| @@ -805,8 +811,10 @@
|
| virtual int GreedyLoopTextLength();
|
| virtual RegExpNode* GetSuccessorOfOmnivorousTextNode(
|
| RegExpCompiler* compiler);
|
| - virtual void FillInBMInfo(
|
| - int offset, BoyerMooreLookahead* bm, bool not_at_start);
|
| + virtual void FillInBMInfo(int offset,
|
| + int recursion_depth,
|
| + BoyerMooreLookahead* bm,
|
| + bool not_at_start);
|
| void CalculateOffsets();
|
| virtual RegExpNode* FilterASCII(int depth);
|
|
|
| @@ -865,8 +873,10 @@
|
| RegExpCompiler* compiler,
|
| int filled_in,
|
| bool not_at_start);
|
| - virtual void FillInBMInfo(
|
| - int offset, BoyerMooreLookahead* bm, bool not_at_start);
|
| + virtual void FillInBMInfo(int offset,
|
| + int recursion_depth,
|
| + BoyerMooreLookahead* bm,
|
| + bool not_at_start);
|
| AssertionNodeType type() { return type_; }
|
| void set_type(AssertionNodeType type) { type_ = type; }
|
|
|
| @@ -903,8 +913,10 @@
|
| bool not_at_start) {
|
| return;
|
| }
|
| - virtual void FillInBMInfo(
|
| - int offset, BoyerMooreLookahead* bm, bool not_at_start);
|
| + virtual void FillInBMInfo(int offset,
|
| + int recursion_depth,
|
| + BoyerMooreLookahead* bm,
|
| + bool not_at_start);
|
|
|
| private:
|
| int start_reg_;
|
| @@ -928,8 +940,10 @@
|
| // Returning 0 from EatsAtLeast should ensure we never get here.
|
| UNREACHABLE();
|
| }
|
| - virtual void FillInBMInfo(
|
| - int offset, BoyerMooreLookahead* bm, bool not_at_start) {
|
| + virtual void FillInBMInfo(int offset,
|
| + int recursion_depth,
|
| + BoyerMooreLookahead* bm,
|
| + bool not_at_start) {
|
| // Returning 0 from EatsAtLeast should ensure we never get here.
|
| UNREACHABLE();
|
| }
|
| @@ -1018,8 +1032,10 @@
|
| RegExpCompiler* compiler,
|
| int characters_filled_in,
|
| bool not_at_start);
|
| - virtual void FillInBMInfo(
|
| - int offset, BoyerMooreLookahead* bm, bool not_at_start);
|
| + virtual void FillInBMInfo(int offset,
|
| + int recursion_depth,
|
| + BoyerMooreLookahead* bm,
|
| + bool not_at_start);
|
|
|
| bool being_calculated() { return being_calculated_; }
|
| bool not_at_start() { return not_at_start_; }
|
| @@ -1068,9 +1084,12 @@
|
| RegExpCompiler* compiler,
|
| int characters_filled_in,
|
| bool not_at_start);
|
| - virtual void FillInBMInfo(
|
| - int offset, BoyerMooreLookahead* bm, bool not_at_start) {
|
| - alternatives_->at(1).node()->FillInBMInfo(offset, bm, not_at_start);
|
| + virtual void FillInBMInfo(int offset,
|
| + int recursion_depth,
|
| + BoyerMooreLookahead* bm,
|
| + bool not_at_start) {
|
| + alternatives_->at(1).node()->FillInBMInfo(
|
| + offset, recursion_depth + 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
|
| @@ -1100,8 +1119,10 @@
|
| RegExpCompiler* compiler,
|
| int characters_filled_in,
|
| bool not_at_start);
|
| - virtual void FillInBMInfo(
|
| - int offset, BoyerMooreLookahead* bm, bool not_at_start);
|
| + virtual void FillInBMInfo(int offset,
|
| + int recursion_depth,
|
| + BoyerMooreLookahead* bm,
|
| + bool not_at_start);
|
| RegExpNode* loop_node() { return loop_node_; }
|
| RegExpNode* continue_node() { return continue_node_; }
|
| bool body_can_be_zero_length() { return body_can_be_zero_length_; }
|
|
|