Lines Matching refs:subject
414 void FindOneByteStringIndices(base::Vector<const uint8_t> subject,
418 // Collect indices of pattern in subject using memchr.
420 const uint8_t* subject_start = subject.begin();
421 const uint8_t* subject_end = subject_start + subject.length();
433 void FindTwoByteStringIndices(const base::Vector<const base::uc16> subject,
437 const base::uc16* subject_start = subject.begin();
438 const base::uc16* subject_end = subject_start + subject.length();
450 base::Vector<const SubjectChar> subject,
454 // Collect indices of pattern in subject.
460 index = search.Search(subject, index);
468 void FindStringIndicesDispatch(Isolate* isolate, String subject, String pattern,
472 String::FlatContent subject_content = subject.GetFlatContent(no_gc);
546 Isolate* isolate, Handle<String> subject, Handle<JSRegExp> pattern_regexp,
548 DCHECK(subject->IsFlat());
555 int subject_len = subject->length();
559 FindStringIndicesDispatch(isolate, *subject, pattern, indices, 0xFFFFFFFF);
561 if (indices->empty()) return *subject;
594 // Copy non-matched subject content.
596 String::WriteToFlat(*subject, result->GetChars(no_gc) + result_pos,
610 // Add remaining subject content at the end.
612 String::WriteToFlat(*subject, result->GetChars(no_gc) + result_pos,
617 RegExp::SetLastMatchInfo(isolate, last_match_info, subject, 0, match_indices);
625 Isolate* isolate, Handle<String> subject, Handle<JSRegExp> regexp,
627 DCHECK(subject->IsFlat());
631 int subject_length = subject->length();
634 if (!RegExp::EnsureFullyCompiled(isolate, regexp, subject)) {
644 if (subject->IsOneByteRepresentation() &&
647 isolate, subject, regexp, replacement, last_match_info);
650 isolate, subject, regexp, replacement, last_match_info);
654 RegExpGlobalCache global_cache(regexp, subject, isolate);
660 return *subject;
667 ReplacementStringBuilder builder(isolate->heap(), subject, expected_parts);
695 RegExp::SetLastMatchInfo(isolate, last_match_info, subject, capture_count,
703 Isolate* isolate, Handle<String> subject, Handle<JSRegExp> regexp,
705 DCHECK(subject->IsFlat());
710 if (subject->IsOneByteRepresentation()) {
712 isolate, subject, regexp, empty_string, last_match_info);
715 isolate, subject, regexp, empty_string, last_match_info);
719 RegExpGlobalCache global_cache(regexp, subject, isolate);
725 return *subject;
731 int subject_length = subject->length();
753 // Add substring subject[prev;start] to answer string.
754 String::WriteToFlat(*subject, answer->GetChars(no_gc) + position, prev,
765 RegExp::SetLastMatchInfo(isolate, last_match_info, subject, capture_count,
769 // Add substring subject[prev;length] to answer string.
770 String::WriteToFlat(*subject, answer->GetChars(no_gc) + position, prev,
803 Handle<String> subject = args.at<String>(0);
808 int subject_length = subject->length();
815 RegExpResultsCache::Lookup(isolate->heap(), *subject, *pattern,
829 // of the subject.
831 subject = String::Flatten(isolate, subject);
836 FindStringIndicesDispatch(isolate, *subject, *pattern, indices, limit);
856 elements->set(0, *subject);
862 isolate->factory()->NewProperSubString(subject, part_start, part_end);
870 RegExpResultsCache::Enter(isolate, subject, pattern, elements,
884 Handle<String> subject, int32_t index,
890 CHECK_GE(subject->length(), index);
892 return RegExp::Exec(isolate, regexp, subject, index, last_match_info,
897 Isolate* isolate, Handle<JSRegExp> regexp, Handle<String> subject,
903 CHECK_GE(subject->length(), index);
905 return RegExp::ExperimentalOneshotExec(isolate, regexp, subject, index,
915 Handle<String> subject = args.at<String>(1);
920 isolate, RegExpExec(isolate, regexp, subject, index, last_match_info,
928 Handle<String> subject = args.at<String>(1);
933 isolate, RegExpExec(isolate, regexp, subject, index, last_match_info,
941 Handle<String> subject = args.at<String>(1);
947 ExperimentalOneshotExec(isolate, regexp, subject, index, last_match_info,
956 Handle<String> subject = args.at<String>(1);
962 ExperimentalOneshotExec(isolate, regexp, subject, index, last_match_info,
984 Handle<String> subject,
987 subject_ = String::Flatten(isolate, subject);
1068 VectorBackedMatch(Isolate* isolate, Handle<String> subject,
1076 subject_ = String::Flatten(isolate, subject);
1166 static Object SearchRegExpMultiple(Isolate* isolate, Handle<String> subject,
1172 DCHECK(subject->IsFlat());
1188 int subject_length = subject->length();
1195 isolate->heap(), *subject, regexp->data(), &last_match_cache,
1210 RegExp::SetLastMatchInfo(isolate, last_match_array, subject,
1217 RegExpGlobalCache global_cache(regexp, subject, isolate);
1253 match = isolate->factory()->NewProperSubString(subject, match_start,
1257 isolate->factory()->NewSubString(subject, match_start, match_end);
1263 // subject, i.e., 3 + capture count in total. If the RegExp contains
1282 isolate->factory()->NewSubString(subject, start, end);
1291 elements->set(cursor++, *subject);
1318 RegExp::SetLastMatchInfo(isolate, last_match_array, subject, capture_count,
1337 isolate, subject, handle(regexp->data(), isolate), copied_fixed_array,
1470 Handle<String> subject = args.at<String>(1);
1477 subject = String::Flatten(isolate, subject);
1482 result = SearchRegExpMultiple<false>(isolate, subject, regexp,
1485 result = SearchRegExpMultiple<true>(isolate, subject, regexp,
1495 Handle<String> subject = args.at<String>(0);
1524 if (last_index <= static_cast<uint32_t>(subject->length())) {
1527 RegExp::Exec(isolate, regexp, subject, last_index, last_match_info));
1532 return *subject;
1546 builder.AppendString(factory->NewSubString(subject, 0, index));
1549 // and subject for the replace function invocation. If the RegExp contains
1587 argv[cursor++] = subject;
1608 factory->NewSubString(subject, end_of_match, subject->length()));