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

Unified Diff: src/objects-inl.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/objects-debug.cc ('k') | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 89623bd02c131e0a8f0e14baf1df739e8c9c9fdc..ec96c7cd384c53ec692a4b4b545c5b6ae6b79c3e 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -345,6 +345,11 @@ bool String::HasOnlyAsciiChars() {
}
+bool String::IsOneByteConvertible() {
+ return HasOnlyAsciiChars() || IsOneByteRepresentation();
+}
+
+
bool StringShape::IsCons() {
return (type_ & kStringRepresentationMask) == kConsStringTag;
}
@@ -2605,7 +2610,7 @@ uint16_t SeqOneByteString::SeqOneByteStringGet(int index) {
void SeqOneByteString::SeqOneByteStringSet(int index, uint16_t value) {
- ASSERT(index >= 0 && index < length() && value <= kMaxAsciiCharCode);
+ ASSERT(index >= 0 && index < length() && value <= kMaxOneByteCharCode);
WRITE_BYTE_FIELD(this, kHeaderSize + index * kCharSize,
static_cast<byte>(value));
}
@@ -2621,6 +2626,11 @@ char* SeqOneByteString::GetChars() {
}
+uint8_t* SeqOneByteString::GetCharsU() {
+ return reinterpret_cast<uint8_t*>(GetCharsAddress());
+}
+
+
Address SeqTwoByteString::GetCharsAddress() {
return FIELD_ADDR(this, kHeaderSize);
}
« no previous file with comments | « src/objects-debug.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698