OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 }; | 489 }; |
490 const uint32_t kIsIndirectStringMask = 0x1; | 490 const uint32_t kIsIndirectStringMask = 0x1; |
491 const uint32_t kIsIndirectStringTag = 0x1; | 491 const uint32_t kIsIndirectStringTag = 0x1; |
492 STATIC_ASSERT((kSeqStringTag & kIsIndirectStringMask) == 0); | 492 STATIC_ASSERT((kSeqStringTag & kIsIndirectStringMask) == 0); |
493 STATIC_ASSERT((kExternalStringTag & kIsIndirectStringMask) == 0); | 493 STATIC_ASSERT((kExternalStringTag & kIsIndirectStringMask) == 0); |
494 STATIC_ASSERT( | 494 STATIC_ASSERT( |
495 (kConsStringTag & kIsIndirectStringMask) == kIsIndirectStringTag); | 495 (kConsStringTag & kIsIndirectStringMask) == kIsIndirectStringTag); |
496 STATIC_ASSERT( | 496 STATIC_ASSERT( |
497 (kSlicedStringTag & kIsIndirectStringMask) == kIsIndirectStringTag); | 497 (kSlicedStringTag & kIsIndirectStringMask) == kIsIndirectStringTag); |
498 | 498 |
| 499 // Use this mask to distinguish between cons and slice only after making |
| 500 // sure that the string is one of the two (an indirect string). |
| 501 const uint32_t kSlicedNotConsMask = kSlicedStringTag & ~kConsStringTag; |
| 502 STATIC_ASSERT(IS_POWER_OF_TWO(kSlicedNotConsMask) && kSlicedNotConsMask != 0); |
| 503 |
499 // If bit 7 is clear, then bit 3 indicates whether this two-byte | 504 // If bit 7 is clear, then bit 3 indicates whether this two-byte |
500 // string actually contains ascii data. | 505 // string actually contains ascii data. |
501 const uint32_t kAsciiDataHintMask = 0x08; | 506 const uint32_t kAsciiDataHintMask = 0x08; |
502 const uint32_t kAsciiDataHintTag = 0x08; | 507 const uint32_t kAsciiDataHintTag = 0x08; |
503 | 508 |
504 | 509 |
505 // A ConsString with an empty string as the right side is a candidate | 510 // A ConsString with an empty string as the right side is a candidate |
506 // for being shortcut by the garbage collector unless it is a | 511 // for being shortcut by the garbage collector unless it is a |
507 // symbol. It's not common to have non-flat symbols, so we do not | 512 // symbol. It's not common to have non-flat symbols, so we do not |
508 // shortcut them thereby avoiding turning symbols into strings. See | 513 // shortcut them thereby avoiding turning symbols into strings. See |
(...skipping 6944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7453 } else { | 7458 } else { |
7454 value &= ~(1 << bit_position); | 7459 value &= ~(1 << bit_position); |
7455 } | 7460 } |
7456 return value; | 7461 return value; |
7457 } | 7462 } |
7458 }; | 7463 }; |
7459 | 7464 |
7460 } } // namespace v8::internal | 7465 } } // namespace v8::internal |
7461 | 7466 |
7462 #endif // V8_OBJECTS_H_ | 7467 #endif // V8_OBJECTS_H_ |
OLD | NEW |