Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: src/regexp/jsregexp.cc

Issue 2159683002: [regexp] Fix case-insensitive matching for one-byte subjects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-5199.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/regexp/jsregexp.h" 5 #include "src/regexp/jsregexp.h"
6 6
7 #include "src/ast/ast.h" 7 #include "src/ast/ast.h"
8 #include "src/base/platform/platform.h" 8 #include "src/base/platform/platform.h"
9 #include "src/compilation-cache.h" 9 #include "src/compilation-cache.h"
10 #include "src/compiler.h" 10 #include "src/compiler.h"
(...skipping 5872 matching lines...) Expand 10 before | Expand all | Expand 10 after
5883 5883
5884 5884
5885 Vector<const int> CharacterRange::GetWordBounds() { 5885 Vector<const int> CharacterRange::GetWordBounds() {
5886 return Vector<const int>(kWordRanges, kWordRangeCount - 1); 5886 return Vector<const int>(kWordRanges, kWordRangeCount - 1);
5887 } 5887 }
5888 5888
5889 5889
5890 void CharacterRange::AddCaseEquivalents(Isolate* isolate, Zone* zone, 5890 void CharacterRange::AddCaseEquivalents(Isolate* isolate, Zone* zone,
5891 ZoneList<CharacterRange>* ranges, 5891 ZoneList<CharacterRange>* ranges,
5892 bool is_one_byte) { 5892 bool is_one_byte) {
5893 CharacterRange::Canonicalize(ranges);
5893 int range_count = ranges->length(); 5894 int range_count = ranges->length();
5894 for (int i = 0; i < range_count; i++) { 5895 for (int i = 0; i < range_count; i++) {
5895 CharacterRange range = ranges->at(i); 5896 CharacterRange range = ranges->at(i);
5896 uc32 bottom = range.from(); 5897 uc32 bottom = range.from();
5897 if (bottom > String::kMaxUtf16CodeUnit) return; 5898 if (bottom > String::kMaxUtf16CodeUnit) return;
5898 uc32 top = Min(range.to(), String::kMaxUtf16CodeUnit); 5899 uc32 top = Min(range.to(), String::kMaxUtf16CodeUnit);
5899 // Nothing to be done for surrogates. 5900 // Nothing to be done for surrogates.
5900 if (bottom >= kLeadSurrogateStart && top <= kTrailSurrogateEnd) return; 5901 if (bottom >= kLeadSurrogateStart && top <= kTrailSurrogateEnd) return;
5901 if (is_one_byte && !RangeContainsLatin1Equivalents(range)) { 5902 if (is_one_byte && !RangeContainsLatin1Equivalents(range)) {
5902 if (bottom > String::kMaxOneByteCharCode) return; 5903 if (bottom > String::kMaxOneByteCharCode) return;
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after
6875 6876
6876 6877
6877 void RegExpResultsCache::Clear(FixedArray* cache) { 6878 void RegExpResultsCache::Clear(FixedArray* cache) {
6878 for (int i = 0; i < kRegExpResultsCacheSize; i++) { 6879 for (int i = 0; i < kRegExpResultsCacheSize; i++) {
6879 cache->set(i, Smi::FromInt(0)); 6880 cache->set(i, Smi::FromInt(0));
6880 } 6881 }
6881 } 6882 }
6882 6883
6883 } // namespace internal 6884 } // namespace internal
6884 } // namespace v8 6885 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-5199.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698