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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 case kTwoByteStringTag: | 334 case kTwoByteStringTag: |
335 return true; | 335 return true; |
336 default: // Cons or sliced string. Need to go deeper. | 336 default: // Cons or sliced string. Need to go deeper. |
337 return GetUnderlying()->IsTwoByteRepresentation(); | 337 return GetUnderlying()->IsTwoByteRepresentation(); |
338 } | 338 } |
339 } | 339 } |
340 | 340 |
341 | 341 |
342 bool String::HasOnlyAsciiChars() { | 342 bool String::HasOnlyAsciiChars() { |
343 uint32_t type = map()->instance_type(); | 343 uint32_t type = map()->instance_type(); |
344 return (type & kStringEncodingMask) == kOneByteStringTag || | 344 return (type & kAsciiDataHintMask) == kAsciiDataHintTag; |
345 (type & kAsciiDataHintMask) == kAsciiDataHintTag; | |
346 } | 345 } |
347 | 346 |
348 | 347 |
349 bool StringShape::IsCons() { | 348 bool StringShape::IsCons() { |
350 return (type_ & kStringRepresentationMask) == kConsStringTag; | 349 return (type_ & kStringRepresentationMask) == kConsStringTag; |
351 } | 350 } |
352 | 351 |
353 | 352 |
354 bool StringShape::IsSliced() { | 353 bool StringShape::IsSliced() { |
355 return (type_ & kStringRepresentationMask) == kSlicedStringTag; | 354 return (type_ & kStringRepresentationMask) == kSlicedStringTag; |
(...skipping 5201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5557 #undef WRITE_UINT32_FIELD | 5556 #undef WRITE_UINT32_FIELD |
5558 #undef READ_SHORT_FIELD | 5557 #undef READ_SHORT_FIELD |
5559 #undef WRITE_SHORT_FIELD | 5558 #undef WRITE_SHORT_FIELD |
5560 #undef READ_BYTE_FIELD | 5559 #undef READ_BYTE_FIELD |
5561 #undef WRITE_BYTE_FIELD | 5560 #undef WRITE_BYTE_FIELD |
5562 | 5561 |
5563 | 5562 |
5564 } } // namespace v8::internal | 5563 } } // namespace v8::internal |
5565 | 5564 |
5566 #endif // V8_OBJECTS_INL_H_ | 5565 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |