Lines Matching defs:ranges

960 // even_label is for ranges[i] to ranges[i + 1] where i - start_index is even.
961 // odd_label is for ranges[i] to ranges[i + 1] where i - start_index is odd.
963 ZoneList<base::uc32>* ranges, uint32_t start_index,
975 DCHECK_EQ(ranges->at(i) & ~kMask, base);
977 DCHECK(start_index == 0 || (ranges->at(start_index - 1) & ~kMask) <= base);
992 for (uint32_t i = 0; i < (ranges->at(start_index) & kMask) && i < kSize;
999 for (j = (ranges->at(i) & kMask); j < (ranges->at(i + 1) & kMask); j++) {
1017 void CutOutRange(RegExpMacroAssembler* masm, ZoneList<base::uc32>* ranges,
1023 EmitDoubleBoundaryTest(masm, ranges->at(cut_index),
1024 ranges->at(cut_index + 1) - 1, &dummy, in_range_label,
1028 // range that is a merger of the two ranges on either side of the one we
1031 ranges->at(j) = ranges->at(j - 1);
1034 ranges->at(j) = ranges->at(j + 1);
1040 void SplitSearchSpace(ZoneList<base::uc32>* ranges, uint32_t start_index,
1046 base::uc32 first = ranges->at(start_index);
1047 base::uc32 last = ranges->at(end_index) - 1;
1050 *border = (ranges->at(start_index) & ~kMask) + kSize;
1052 if (ranges->at(*new_start_index) > *border) break;
1063 // 128-character space can take up a lot of space in the ranges array if,
1074 ranges->at(binary_chop_index) >= first + 2 * kSize) {
1076 uint32_t new_border = (ranges->at(binary_chop_index) | kMask) + 1;
1079 if (ranges->at(scan_forward_for_section_border) > new_border) {
1090 if (ranges->at(*new_end_index) == *border) {
1093 if (*border >= ranges->at(end_index)) {
1094 *border = ranges->at(end_index);
1106 void GenerateBranches(RegExpMacroAssembler* masm, ZoneList<base::uc32>* ranges,
1114 base::uc32 first = ranges->at(start_index);
1115 base::uc32 last = ranges->at(end_index) - 1;
1138 // first, then try arbitrary ranges in the second round.
1142 if (ranges->at(i) == ranges->at(i + 1) - 1) {
1148 CutOutRange(masm, ranges, start_index, end_index, cut, even_label,
1151 GenerateBranches(masm, ranges, start_index + 1, end_index - 1, min_char,
1161 EmitUseLookupTable(masm, ranges, start_index, end_index, min_char,
1168 GenerateBranches(masm, ranges, start_index + 1, end_index, first, max_char,
1177 SplitSearchSpace(ranges, start_index, end_index, &new_start_index,
1195 border == ranges->at(new_end_index + 1)));
1198 DCHECK_LT(ranges->at(new_end_index), border);
1199 DCHECK(border < ranges->at(new_start_index) ||
1200 (border == ranges->at(new_start_index) &&
1203 DCHECK(new_start_index == 0 || border >= ranges->at(new_start_index - 1));
1207 GenerateBranches(masm, ranges, start_index, new_end_index, min_char,
1212 GenerateBranches(masm, ranges, new_start_index, end_index, border, max_char,
1222 ZoneList<CharacterRange>* ranges = cc->ranges(zone);
1223 CharacterRange::Canonicalize(ranges);
1226 // ranges to the set of ranges that may actually occur in the subject string.
1227 if (one_byte) CharacterRange::ClampToOneByte(ranges);
1229 const int ranges_length = ranges->length();
1241 if (ranges_length == 1 && ranges->at(0).IsEverything(max_char)) {
1270 if (macro_assembler->CheckCharacterInRangeArray(ranges, on_failure)) {
1274 if (macro_assembler->CheckCharacterNotInRangeArray(ranges, on_failure)) {
1289 CharacterRange& range = ranges->at(i);
1663 ZoneList<CharacterRange>* ranges = tree->ranges(zone());
1664 if (tree->is_negated() || ranges->is_empty()) {
1669 // Likewise for empty ranges (empty ranges can occur e.g. when
1670 // compiling for one-byte subjects and impossible (non-one-byte) ranges
1676 while (ranges->at(first_range).from() > char_mask) {
1678 if (first_range == ranges->length()) {
1684 CharacterRange range = ranges->at(first_range);
1697 for (int i = first_range + 1; i < ranges->length(); i++) {
1698 range = ranges->at(i);
1703 // Here we are combining more ranges into the mask and compare
1706 // with multiple ranges is assumed never to be equivalent to a
1859 bool RangesContainLatin1Equivalents(ZoneList<CharacterRange>* ranges) {
1860 for (int i = 0; i < ranges->length(); i++) {
1862 if (RangeContainsLatin1Equivalents(ranges->at(i))) return true;
1892 ZoneList<CharacterRange>* ranges = cc->ranges(zone());
1893 CharacterRange::Canonicalize(ranges);
1895 int range_count = ranges->length();
1897 if (range_count != 0 && ranges->at(0).from() == 0 &&
1898 ranges->at(0).to() >= String::kMaxOneByteCharCode) {
1900 if (IsIgnoreCase(flags) && RangesContainLatin1Equivalents(ranges)) {
1907 ranges->at(0).from() > String::kMaxOneByteCharCode) {
1909 if (IsIgnoreCase(flags) && RangesContainLatin1Equivalents(ranges)) {
2420 ZoneList<CharacterRange>* ranges,
2423 DCHECK_NOT_NULL(ranges);
2426 return zone->New<TextNode>(zone->New<RegExpCharacterClass>(zone, ranges),
2542 ZoneList<CharacterRange>* ranges = cc->ranges(zone());
2543 CharacterRange::AddCaseEquivalents(isolate, zone(), ranges, is_one_byte);
2557 ZoneList<CharacterRange>* ranges = node->ranges(zone());
2558 CharacterRange::Canonicalize(ranges);
2560 return ranges->length() == 0 ? on_success() : nullptr;
2562 if (ranges->length() != 1) return nullptr;
2564 return ranges->at(0).IsEverything(max_char) ? on_success() : nullptr;
2704 ContainedInLattice AddRange(ContainedInLattice containment, const int* ranges,
2707 DCHECK_EQ(String::kMaxCodePoint + 1, ranges[ranges_length - 1]);
2711 for (int i = 0; i < ranges_length; inside = !inside, last = ranges[i], i++) {
2712 // Consider the range from last to ranges[i].
2714 if (ranges[i] <= new_range.from()) continue;
2715 // New range is wholly inside last-ranges[i]. Note that new_range.to() is
2716 // inclusive, but the values in ranges are not.
2717 if (last <= new_range.from() && new_range.to() < ranges[i]) {
3861 ZoneList<CharacterRange>* ranges = char_class->ranges(zone());
3865 for (int k = 0; k < ranges->length(); k++) {
3866 CharacterRange& range = ranges->at(k);