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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 case kOneByteStringTag: | 348 case kOneByteStringTag: |
349 return false; | 349 return false; |
350 case kTwoByteStringTag: | 350 case kTwoByteStringTag: |
351 return true; | 351 return true; |
352 default: // Cons or sliced string. Need to go deeper. | 352 default: // Cons or sliced string. Need to go deeper. |
353 return GetUnderlying()->IsTwoByteRepresentation(); | 353 return GetUnderlying()->IsTwoByteRepresentation(); |
354 } | 354 } |
355 } | 355 } |
356 | 356 |
357 | 357 |
358 bool String::HasOnlyAsciiChars() { | 358 bool String::HasOnlyOneByteChars() { |
359 uint32_t type = map()->instance_type(); | 359 uint32_t type = map()->instance_type(); |
360 return (type & kAsciiDataHintMask) == kAsciiDataHintTag; | 360 return (type & kOneByteDataHintMask) == kOneByteDataHintTag; |
361 } | 361 } |
362 | 362 |
363 | 363 |
364 bool String::IsOneByteConvertible() { | 364 bool String::IsOneByteConvertible() { |
365 return HasOnlyAsciiChars() || IsOneByteRepresentation(); | 365 return HasOnlyOneByteChars() || IsOneByteRepresentation(); |
366 } | 366 } |
367 | 367 |
368 | 368 |
369 bool StringShape::IsCons() { | 369 bool StringShape::IsCons() { |
370 return (type_ & kStringRepresentationMask) == kConsStringTag; | 370 return (type_ & kStringRepresentationMask) == kConsStringTag; |
371 } | 371 } |
372 | 372 |
373 | 373 |
374 bool StringShape::IsSliced() { | 374 bool StringShape::IsSliced() { |
375 return (type_ & kStringRepresentationMask) == kSlicedStringTag; | 375 return (type_ & kStringRepresentationMask) == kSlicedStringTag; |
(...skipping 5808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6184 #undef WRITE_UINT32_FIELD | 6184 #undef WRITE_UINT32_FIELD |
6185 #undef READ_SHORT_FIELD | 6185 #undef READ_SHORT_FIELD |
6186 #undef WRITE_SHORT_FIELD | 6186 #undef WRITE_SHORT_FIELD |
6187 #undef READ_BYTE_FIELD | 6187 #undef READ_BYTE_FIELD |
6188 #undef WRITE_BYTE_FIELD | 6188 #undef WRITE_BYTE_FIELD |
6189 | 6189 |
6190 | 6190 |
6191 } } // namespace v8::internal | 6191 } } // namespace v8::internal |
6192 | 6192 |
6193 #endif // V8_OBJECTS_INL_H_ | 6193 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |