Chromium Code Reviews| Index: src/objects-inl.h |
| diff --git a/src/objects-inl.h b/src/objects-inl.h |
| index 4112f933d7a59226778e6df19e470ac359a5a35c..319c1643d3716e22a59e5d95b11e35c0a9d0ff41 100644 |
| --- a/src/objects-inl.h |
| +++ b/src/objects-inl.h |
| @@ -237,31 +237,20 @@ bool StringShape::IsSymbol() { |
| bool String::IsAsciiRepresentation() { |
| uint32_t type = map()->instance_type(); |
| - if ((type & kStringRepresentationMask) == kConsStringTag && |
| - ConsString::cast(this)->second()->length() == 0) { |
| - return ConsString::cast(this)->first()->IsAsciiRepresentation(); |
| - } |
| return (type & kStringEncodingMask) == kAsciiStringTag; |
| } |
| bool String::IsTwoByteRepresentation() { |
| uint32_t type = map()->instance_type(); |
| - if ((type & kStringRepresentationMask) == kConsStringTag && |
| - ConsString::cast(this)->second()->length() == 0) { |
| - return ConsString::cast(this)->first()->IsTwoByteRepresentation(); |
| - } |
| return (type & kStringEncodingMask) == kTwoByteStringTag; |
| } |
| -bool String::IsExternalTwoByteStringWithAsciiChars() { |
| - if (!IsExternalTwoByteString()) return false; |
| - const uc16* data = ExternalTwoByteString::cast(this)->resource()->data(); |
| - for (int i = 0, len = length(); i < len; i++) { |
| - if (data[i] > kMaxAsciiCharCode) return false; |
| - } |
| - return true; |
| +bool String::HasAsciiChars() { |
|
Søren Thygesen Gjesse
2010/06/10 13:55:46
HasAsciiChars() -> HasOnlyAsciiChars()?
|
| + uint32_t type = map()->instance_type(); |
| + return (type & kStringEncodingMask) == kAsciiStringTag || |
| + (type & kAsciiDataHintMask) == kAsciiDataHintTag; |
| } |