Changeset 80217 in webkit for trunk/Source/JavaScriptCore/yarr/YarrPattern.cpp
- Timestamp:
- Mar 3, 2011, 2:22:56 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/yarr/YarrPattern.cpp
r80018 r80217 815 815 } 816 816 817 bool addBeginTerm(PatternTerm term, Vector<TermChain>* beginTerms, PatternAlternative* alternative, unsigned numTerms, unsigned termIndex, unsigned depth)818 {819 if (term.quantityType == QuantifierFixedCount) {820 beginTerms->append(TermChain(term));821 if (depth < 2 && termIndex < numTerms - 1 && term.quantityCount == 1)822 setupAlternativeBeginTerms(alternative, &beginTerms->last().hotTerms, termIndex + 1, depth + 1);823 } else if (termIndex != numTerms - 1) {824 beginTerms->append(TermChain(term));825 return true;826 }827 828 return false;829 }830 831 817 // This function collects the terms which are potentially matching the first number of depth characters in the result. 832 818 // If this function returns false then it found at least one term which makes the beginning character … … 864 850 865 851 case PatternTerm::TypePatternCharacter: 866 if (addBeginTerm(term, beginTerms, alternative, numTerms, termIndex, depth)) { 852 if (termIndex != numTerms - 1) { 853 beginTerms->append(TermChain(term)); 867 854 termIndex++; 868 855 checkNext = true; 856 } else if (term.quantityType == QuantifierFixedCount) { 857 beginTerms->append(TermChain(term)); 858 if (depth < 2 && termIndex < numTerms - 1 && term.quantityCount == 1) 859 if (!setupAlternativeBeginTerms(alternative, &beginTerms->last().hotTerms, termIndex + 1, depth + 1)) 860 return false; 869 861 } 862 870 863 break; 871 864 … … 884 877 termIndex++; 885 878 checkNext = true; 886 887 879 } 888 880 … … 993 985 994 986 constructor.setupOffsets(); 995 // TODO: Disabling the begin characters optimization due to problems found 996 // in https://bugs.webkit.org/show_bug.cgi?id=54978. 997 // A new defect was filed to track this issue: 998 // https://bugs.webkit.org/show_bug.cgi?id=55479 999 // constructor.setupBeginChars(); 987 constructor.setupBeginChars(); 1000 988 1001 989 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.