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

Unified Diff: src/objects-inl.h

Issue 11308066: Rename IsAsciiRepresentation (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month 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.cc ('k') | src/regexp-macro-assembler.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 d8b184575dbd24d5cc17a45e9c5ffac12eeb7c01..384cf79e400798875e02ebc6cc8cda89fdf1a1d8 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -232,7 +232,7 @@ bool Object::IsSeqString() {
bool Object::IsSeqOneByteString() {
if (!IsString()) return false;
return StringShape(String::cast(this)).IsSequential() &&
- String::cast(this)->IsAsciiRepresentation();
+ String::cast(this)->IsOneByteRepresentation();
}
@@ -252,7 +252,7 @@ bool Object::IsExternalString() {
bool Object::IsExternalAsciiString() {
if (!IsString()) return false;
return StringShape(String::cast(this)).IsExternal() &&
- String::cast(this)->IsAsciiRepresentation();
+ String::cast(this)->IsOneByteRepresentation();
}
@@ -295,7 +295,7 @@ bool StringShape::IsSymbol() {
}
-bool String::IsAsciiRepresentation() {
+bool String::IsOneByteRepresentation() {
uint32_t type = map()->instance_type();
return (type & kStringEncodingMask) == kOneByteStringTag;
}
@@ -307,7 +307,7 @@ bool String::IsTwoByteRepresentation() {
}
-bool String::IsAsciiRepresentationUnderneath() {
+bool String::IsOneByteRepresentationUnderneath() {
uint32_t type = map()->instance_type();
STATIC_ASSERT(kIsIndirectStringTag != 0);
STATIC_ASSERT((kIsIndirectStringMask & kStringEncodingMask) == 0);
@@ -318,7 +318,7 @@ bool String::IsAsciiRepresentationUnderneath() {
case kTwoByteStringTag:
return false;
default: // Cons or sliced string. Need to go deeper.
- return GetUnderlying()->IsAsciiRepresentation();
+ return GetUnderlying()->IsOneByteRepresentation();
}
}
@@ -2489,7 +2489,7 @@ void String::Set(int index, uint16_t value) {
ASSERT(index >= 0 && index < length());
ASSERT(StringShape(this).IsSequential());
- return this->IsAsciiRepresentation()
+ return this->IsOneByteRepresentation()
? SeqOneByteString::cast(this)->SeqOneByteStringSet(index, value)
: SeqTwoByteString::cast(this)->SeqTwoByteStringSet(index, value);
}
@@ -4112,7 +4112,7 @@ bool Script::HasValidSource() {
if (!src->IsString()) return true;
String* src_str = String::cast(src);
if (!StringShape(src_str).IsExternal()) return true;
- if (src_str->IsAsciiRepresentation()) {
+ if (src_str->IsOneByteRepresentation()) {
return ExternalAsciiString::cast(src)->resource() != NULL;
} else if (src_str->IsTwoByteRepresentation()) {
return ExternalTwoByteString::cast(src)->resource() != NULL;
« no previous file with comments | « src/objects.cc ('k') | src/regexp-macro-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698