OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
10 #include "src/builtins.h" | 10 #include "src/builtins.h" |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 // of the string. | 575 // of the string. |
576 const uint32_t kStringRepresentationMask = 0x03; | 576 const uint32_t kStringRepresentationMask = 0x03; |
577 enum StringRepresentationTag { | 577 enum StringRepresentationTag { |
578 kSeqStringTag = 0x0, | 578 kSeqStringTag = 0x0, |
579 kConsStringTag = 0x1, | 579 kConsStringTag = 0x1, |
580 kExternalStringTag = 0x2, | 580 kExternalStringTag = 0x2, |
581 kSlicedStringTag = 0x3 | 581 kSlicedStringTag = 0x3 |
582 }; | 582 }; |
583 const uint32_t kIsIndirectStringMask = 0x1; | 583 const uint32_t kIsIndirectStringMask = 0x1; |
584 const uint32_t kIsIndirectStringTag = 0x1; | 584 const uint32_t kIsIndirectStringTag = 0x1; |
585 STATIC_ASSERT((kSeqStringTag & kIsIndirectStringMask) == 0); | 585 STATIC_ASSERT((kSeqStringTag & kIsIndirectStringMask) == 0); // NOLINT |
586 STATIC_ASSERT((kExternalStringTag & kIsIndirectStringMask) == 0); | 586 STATIC_ASSERT((kExternalStringTag & kIsIndirectStringMask) == 0); // NOLINT |
587 STATIC_ASSERT( | 587 STATIC_ASSERT((kConsStringTag & |
588 (kConsStringTag & kIsIndirectStringMask) == kIsIndirectStringTag); | 588 kIsIndirectStringMask) == kIsIndirectStringTag); // NOLINT |
589 STATIC_ASSERT( | 589 STATIC_ASSERT((kSlicedStringTag & |
590 (kSlicedStringTag & kIsIndirectStringMask) == kIsIndirectStringTag); | 590 kIsIndirectStringMask) == kIsIndirectStringTag); // NOLINT |
591 | 591 |
592 // Use this mask to distinguish between cons and slice only after making | 592 // Use this mask to distinguish between cons and slice only after making |
593 // sure that the string is one of the two (an indirect string). | 593 // sure that the string is one of the two (an indirect string). |
594 const uint32_t kSlicedNotConsMask = kSlicedStringTag & ~kConsStringTag; | 594 const uint32_t kSlicedNotConsMask = kSlicedStringTag & ~kConsStringTag; |
595 STATIC_ASSERT(IS_POWER_OF_TWO(kSlicedNotConsMask)); | 595 STATIC_ASSERT(IS_POWER_OF_TWO(kSlicedNotConsMask)); |
596 | 596 |
597 // If bit 7 is clear, then bit 3 indicates whether this two-byte | 597 // If bit 7 is clear, then bit 3 indicates whether this two-byte |
598 // string actually contains one byte data. | 598 // string actually contains one byte data. |
599 const uint32_t kOneByteDataHintMask = 0x08; | 599 const uint32_t kOneByteDataHintMask = 0x08; |
600 const uint32_t kOneByteDataHintTag = 0x08; | 600 const uint32_t kOneByteDataHintTag = 0x08; |
(...skipping 10470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11071 } else { | 11071 } else { |
11072 value &= ~(1 << bit_position); | 11072 value &= ~(1 << bit_position); |
11073 } | 11073 } |
11074 return value; | 11074 return value; |
11075 } | 11075 } |
11076 }; | 11076 }; |
11077 | 11077 |
11078 } } // namespace v8::internal | 11078 } } // namespace v8::internal |
11079 | 11079 |
11080 #endif // V8_OBJECTS_H_ | 11080 #endif // V8_OBJECTS_H_ |
OLD | NEW |