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

Unified Diff: src/unicode-inl.h

Issue 11880045: Cleanup latin-1 conversion check in regexp engine (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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/unicode.h ('k') | test/cctest/test-strings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/unicode-inl.h
diff --git a/src/unicode-inl.h b/src/unicode-inl.h
index c3a00ed710eb1da94ea8e2fe5e56cadd4db9f3be..b4e2cb52130c5ca8cb94c6ca26f403a28dd1cb56 100644
--- a/src/unicode-inl.h
+++ b/src/unicode-inl.h
@@ -79,6 +79,36 @@ template <class T, int s> int Mapping<T, s>::CalculateValue(uchar c, uchar n,
}
+bool Latin1::NonLatin1CanBeConvertedToLatin1(uint16_t c) {
+ ASSERT(c > Latin1::kMaxChar);
+ switch (c) {
+ case 0x130:
+ case 0x131:
+ case 0x149:
+ case 0x178:
+ case 0x17f:
+ case 0x1f0:
+ case 0x1e96:
+ case 0x1e97:
+ case 0x1e98:
+ case 0x1e99:
+ case 0x1e9a:
+ case 0x1e9e:
+ case 0x212a:
+ case 0x212b:
+ case 0xfb00:
+ case 0xfb01:
+ case 0xfb02:
+ case 0xfb03:
+ case 0xfb04:
+ case 0xfb05:
+ case 0xfb06:
+ return true;
+ }
+ return false;
+}
+
+
unsigned Utf8::Encode(char* str, uchar c, int previous) {
static const int kMask = ~(1 << 6);
if (c <= kMaxOneByteChar) {
« no previous file with comments | « src/unicode.h ('k') | test/cctest/test-strings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698