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

Unified Diff: src/string-search.h

Issue 11759008: Introduce ENABLE_LATIN_1 compile flag (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix FilterASCII Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/string.js ('k') | src/unicode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/string-search.h
diff --git a/src/string-search.h b/src/string-search.h
index 8c3456aa0ac97bc6fb4ea7fb2b1640b61937e930..ae5f60809d0cd904599448704aba88071306f1ba 100644
--- a/src/string-search.h
+++ b/src/string-search.h
@@ -61,12 +61,12 @@ class StringSearchBase {
// to compensate for the algorithmic overhead compared to simple brute force.
static const int kBMMinPatternLength = 7;
- static inline bool IsAsciiString(Vector<const char>) {
+ static inline bool IsOneByteString(Vector<const char> string) {
return true;
}
- static inline bool IsAsciiString(Vector<const uc16> string) {
- return String::IsAscii(string.start(), string.length());
+ static inline bool IsOneByteString(Vector<const uc16> string) {
+ return String::IsOneByte(string.start(), string.length());
}
friend class Isolate;
@@ -81,7 +81,7 @@ class StringSearch : private StringSearchBase {
pattern_(pattern),
start_(Max(0, pattern.length() - kBMMaxShift)) {
if (sizeof(PatternChar) > sizeof(SubjectChar)) {
- if (!IsAsciiString(pattern_)) {
+ if (!IsOneByteString(pattern_)) {
strategy_ = &FailSearch;
return;
}
@@ -156,7 +156,7 @@ class StringSearch : private StringSearchBase {
return bad_char_occurrence[static_cast<int>(char_code)];
}
if (sizeof(PatternChar) == 1) {
- if (static_cast<unsigned int>(char_code) > String::kMaxAsciiCharCodeU) {
+ if (static_cast<unsigned int>(char_code) > String::kMaxOneByteCharCodeU) {
return -1;
}
return bad_char_occurrence[static_cast<unsigned int>(char_code)];
@@ -223,7 +223,8 @@ int StringSearch<PatternChar, SubjectChar>::SingleCharSearch(
return static_cast<int>(pos - subject.start());
} else {
if (sizeof(PatternChar) > sizeof(SubjectChar)) {
- if (static_cast<uc16>(pattern_first_char) > String::kMaxAsciiCharCodeU) {
+ if (static_cast<uc16>(pattern_first_char) >
+ String::kMaxOneByteCharCodeU) {
return -1;
}
}
« no previous file with comments | « src/string.js ('k') | src/unicode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698