Home | History | Annotate | Download | only in src

Lines Matching refs:search

13 // String Search object.
16 // Class holding constants and methods that apply to all string search variants,
22 // search will not be optimal, since we only build tables for a suffix
32 // there is no search speed degradation.
78 int Search(Vector<const SubjectChar> subject, int index) {
105 static int SingleCharSearch(StringSearch<PatternChar, SubjectChar>* search,
109 static int LinearSearch(StringSearch<PatternChar, SubjectChar>* search,
113 static int InitialSearch(StringSearch<PatternChar, SubjectChar>* search,
118 StringSearch<PatternChar, SubjectChar>* search,
122 static int BoyerMooreSearch(StringSearch<PatternChar, SubjectChar>* search,
181 // The pattern to search for.
183 // Pointer to implementation of the search.
191 // Single Character Pattern Search Strategy
196 StringSearch<PatternChar, SubjectChar>* search,
199 DCHECK_EQ(1, search->pattern_.length());
200 PatternChar pattern_first_char = search->pattern_[0];
225 // Linear Search Strategy
245 // Simple linear search for short patterns. Never bails out.
248 StringSearch<PatternChar, SubjectChar>* search,
251 Vector<const PatternChar> pattern = search->pattern_;
280 // Boyer-Moore string search
285 StringSearch<PatternChar, SubjectChar>* search,
288 Vector<const PatternChar> pattern = search->pattern_;
292 int start = search->start_;
294 int* bad_char_occurence = search->bad_char_table();
295 int* good_suffix_shift = search->good_suffix_shift_table();
299 // Continue search from i.
403 // Boyer-Moore-Horspool string search.
408 StringSearch<PatternChar, SubjectChar>* search,
411 Vector<const PatternChar> pattern = search->pattern_;
414 int* char_occurrences = search->bad_char_table();
421 // Perform search
447 search->PopulateBoyerMooreTable();
448 search->strategy_ = &BoyerMooreSearch;
449 return BoyerMooreSearch(search, subject, index);
486 // Linear string search with bailout to BMH.
489 // Simple linear search for short patterns, which bails out if the string
493 StringSearch<PatternChar, SubjectChar>* search,
496 Vector<const PatternChar> pattern = search->pattern_;
533 search->PopulateBoyerMooreHorspoolTable();
534 search->strategy_ = &BoyerMooreHorspoolSearch;
535 return BoyerMooreHorspoolSearch(search, subject, i);
542 // Perform a a single stand-alone search.
543 // If searching multiple times for the same pattern, a search
544 // object should be constructed once and the Search function then called
545 // for each search.
551 StringSearch<PatternChar, SubjectChar> search(isolate, pattern);
552 return search.Search(subject, start_index);