| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 case kTwoByteStringTag: | 326 case kTwoByteStringTag: |
| 327 return true; | 327 return true; |
| 328 default: // Cons or sliced string. Need to go deeper. | 328 default: // Cons or sliced string. Need to go deeper. |
| 329 return GetUnderlying()->IsTwoByteRepresentation(); | 329 return GetUnderlying()->IsTwoByteRepresentation(); |
| 330 } | 330 } |
| 331 } | 331 } |
| 332 | 332 |
| 333 | 333 |
| 334 bool String::HasOnlyAsciiChars() { | 334 bool String::HasOnlyAsciiChars() { |
| 335 uint32_t type = map()->instance_type(); | 335 uint32_t type = map()->instance_type(); |
| 336 return (type & kAsciiDataHintMask) == kAsciiDataHintTag; | 336 return (type & kStringEncodingMask) == kOneByteStringTag || |
| 337 (type & kAsciiDataHintMask) == kAsciiDataHintTag; |
| 337 } | 338 } |
| 338 | 339 |
| 339 | 340 |
| 340 bool StringShape::IsCons() { | 341 bool StringShape::IsCons() { |
| 341 return (type_ & kStringRepresentationMask) == kConsStringTag; | 342 return (type_ & kStringRepresentationMask) == kConsStringTag; |
| 342 } | 343 } |
| 343 | 344 |
| 344 | 345 |
| 345 bool StringShape::IsSliced() { | 346 bool StringShape::IsSliced() { |
| 346 return (type_ & kStringRepresentationMask) == kSlicedStringTag; | 347 return (type_ & kStringRepresentationMask) == kSlicedStringTag; |
| (...skipping 5201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5548 #undef WRITE_UINT32_FIELD | 5549 #undef WRITE_UINT32_FIELD |
| 5549 #undef READ_SHORT_FIELD | 5550 #undef READ_SHORT_FIELD |
| 5550 #undef WRITE_SHORT_FIELD | 5551 #undef WRITE_SHORT_FIELD |
| 5551 #undef READ_BYTE_FIELD | 5552 #undef READ_BYTE_FIELD |
| 5552 #undef WRITE_BYTE_FIELD | 5553 #undef WRITE_BYTE_FIELD |
| 5553 | 5554 |
| 5554 | 5555 |
| 5555 } } // namespace v8::internal | 5556 } } // namespace v8::internal |
| 5556 | 5557 |
| 5557 #endif // V8_OBJECTS_INL_H_ | 5558 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |