| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 <iosfwd> | 8 #include <iosfwd> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // - ScriptContextTable | 102 // - ScriptContextTable |
| 103 // - WeakFixedArray | 103 // - WeakFixedArray |
| 104 // - FixedDoubleArray | 104 // - FixedDoubleArray |
| 105 // - Name | 105 // - Name |
| 106 // - String | 106 // - String |
| 107 // - SeqString | 107 // - SeqString |
| 108 // - SeqOneByteString | 108 // - SeqOneByteString |
| 109 // - SeqTwoByteString | 109 // - SeqTwoByteString |
| 110 // - SlicedString | 110 // - SlicedString |
| 111 // - ConsString | 111 // - ConsString |
| 112 // - ThinString | |
| 113 // - ExternalString | 112 // - ExternalString |
| 114 // - ExternalOneByteString | 113 // - ExternalOneByteString |
| 115 // - ExternalTwoByteString | 114 // - ExternalTwoByteString |
| 116 // - InternalizedString | 115 // - InternalizedString |
| 117 // - SeqInternalizedString | 116 // - SeqInternalizedString |
| 118 // - SeqOneByteInternalizedString | 117 // - SeqOneByteInternalizedString |
| 119 // - SeqTwoByteInternalizedString | 118 // - SeqTwoByteInternalizedString |
| 120 // - ConsInternalizedString | 119 // - ConsInternalizedString |
| 121 // - ExternalInternalizedString | 120 // - ExternalInternalizedString |
| 122 // - ExternalOneByteInternalizedString | 121 // - ExternalOneByteInternalizedString |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 V(ONE_BYTE_INTERNALIZED_STRING_TYPE) \ | 328 V(ONE_BYTE_INTERNALIZED_STRING_TYPE) \ |
| 330 V(EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE) \ | 329 V(EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE) \ |
| 331 V(EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE) \ | 330 V(EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE) \ |
| 332 V(SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE) \ | 331 V(SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE) \ |
| 333 V(SHORT_EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE) \ | 332 V(SHORT_EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE) \ |
| 334 V(SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE) \ | 333 V(SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE) \ |
| 335 V(STRING_TYPE) \ | 334 V(STRING_TYPE) \ |
| 336 V(CONS_STRING_TYPE) \ | 335 V(CONS_STRING_TYPE) \ |
| 337 V(EXTERNAL_STRING_TYPE) \ | 336 V(EXTERNAL_STRING_TYPE) \ |
| 338 V(SLICED_STRING_TYPE) \ | 337 V(SLICED_STRING_TYPE) \ |
| 339 V(THIN_STRING_TYPE) \ | |
| 340 V(ONE_BYTE_STRING_TYPE) \ | 338 V(ONE_BYTE_STRING_TYPE) \ |
| 341 V(CONS_ONE_BYTE_STRING_TYPE) \ | 339 V(CONS_ONE_BYTE_STRING_TYPE) \ |
| 342 V(EXTERNAL_ONE_BYTE_STRING_TYPE) \ | 340 V(EXTERNAL_ONE_BYTE_STRING_TYPE) \ |
| 343 V(SLICED_ONE_BYTE_STRING_TYPE) \ | 341 V(SLICED_ONE_BYTE_STRING_TYPE) \ |
| 344 V(THIN_ONE_BYTE_STRING_TYPE) \ | |
| 345 V(EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE) \ | 342 V(EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE) \ |
| 346 V(SHORT_EXTERNAL_STRING_TYPE) \ | 343 V(SHORT_EXTERNAL_STRING_TYPE) \ |
| 347 V(SHORT_EXTERNAL_ONE_BYTE_STRING_TYPE) \ | 344 V(SHORT_EXTERNAL_ONE_BYTE_STRING_TYPE) \ |
| 348 V(SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE) \ | 345 V(SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE) \ |
| 349 \ | 346 \ |
| 350 V(SYMBOL_TYPE) \ | 347 V(SYMBOL_TYPE) \ |
| 351 V(HEAP_NUMBER_TYPE) \ | 348 V(HEAP_NUMBER_TYPE) \ |
| 352 V(SIMD128_VALUE_TYPE) \ | 349 V(SIMD128_VALUE_TYPE) \ |
| 353 V(ODDBALL_TYPE) \ | 350 V(ODDBALL_TYPE) \ |
| 354 \ | 351 \ |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 V(SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE, \ | 515 V(SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE, \ |
| 519 ExternalTwoByteString::kShortSize, short_external_internalized_string, \ | 516 ExternalTwoByteString::kShortSize, short_external_internalized_string, \ |
| 520 ShortExternalInternalizedString) \ | 517 ShortExternalInternalizedString) \ |
| 521 V(SHORT_EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE, \ | 518 V(SHORT_EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE, \ |
| 522 ExternalOneByteString::kShortSize, \ | 519 ExternalOneByteString::kShortSize, \ |
| 523 short_external_one_byte_internalized_string, \ | 520 short_external_one_byte_internalized_string, \ |
| 524 ShortExternalOneByteInternalizedString) \ | 521 ShortExternalOneByteInternalizedString) \ |
| 525 V(SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE, \ | 522 V(SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE, \ |
| 526 ExternalTwoByteString::kShortSize, \ | 523 ExternalTwoByteString::kShortSize, \ |
| 527 short_external_internalized_string_with_one_byte_data, \ | 524 short_external_internalized_string_with_one_byte_data, \ |
| 528 ShortExternalInternalizedStringWithOneByteData) \ | 525 ShortExternalInternalizedStringWithOneByteData) |
| 529 V(THIN_STRING_TYPE, ThinString::kSize, thin_string, ThinString) \ | |
| 530 V(THIN_ONE_BYTE_STRING_TYPE, ThinString::kSize, thin_one_byte_string, \ | |
| 531 ThinOneByteString) | |
| 532 | 526 |
| 533 // A struct is a simple object a set of object-valued fields. Including an | 527 // A struct is a simple object a set of object-valued fields. Including an |
| 534 // object type in this causes the compiler to generate most of the boilerplate | 528 // object type in this causes the compiler to generate most of the boilerplate |
| 535 // code for the class including allocation and garbage collection routines, | 529 // code for the class including allocation and garbage collection routines, |
| 536 // casts and predicates. All you need to define is the class, methods and | 530 // casts and predicates. All you need to define is the class, methods and |
| 537 // object verification routines. Easy, no? | 531 // object verification routines. Easy, no? |
| 538 // | 532 // |
| 539 // Note that for subtle reasons related to the ordering or numerical values of | 533 // Note that for subtle reasons related to the ordering or numerical values of |
| 540 // type tags, elements in this list have to be added to the INSTANCE_TYPE_LIST | 534 // type tags, elements in this list have to be added to the INSTANCE_TYPE_LIST |
| 541 // manually. | 535 // manually. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 const uint32_t kIsNotStringMask = 0x80; | 567 const uint32_t kIsNotStringMask = 0x80; |
| 574 const uint32_t kStringTag = 0x0; | 568 const uint32_t kStringTag = 0x0; |
| 575 const uint32_t kNotStringTag = 0x80; | 569 const uint32_t kNotStringTag = 0x80; |
| 576 | 570 |
| 577 // Bit 6 indicates that the object is an internalized string (if set) or not. | 571 // Bit 6 indicates that the object is an internalized string (if set) or not. |
| 578 // Bit 7 has to be clear as well. | 572 // Bit 7 has to be clear as well. |
| 579 const uint32_t kIsNotInternalizedMask = 0x40; | 573 const uint32_t kIsNotInternalizedMask = 0x40; |
| 580 const uint32_t kNotInternalizedTag = 0x40; | 574 const uint32_t kNotInternalizedTag = 0x40; |
| 581 const uint32_t kInternalizedTag = 0x0; | 575 const uint32_t kInternalizedTag = 0x0; |
| 582 | 576 |
| 583 // If bit 7 is clear then bit 3 indicates whether the string consists of | 577 // If bit 7 is clear then bit 2 indicates whether the string consists of |
| 584 // two-byte characters or one-byte characters. | 578 // two-byte characters or one-byte characters. |
| 585 const uint32_t kStringEncodingMask = 0x8; | 579 const uint32_t kStringEncodingMask = 0x4; |
| 586 const uint32_t kTwoByteStringTag = 0x0; | 580 const uint32_t kTwoByteStringTag = 0x0; |
| 587 const uint32_t kOneByteStringTag = 0x8; | 581 const uint32_t kOneByteStringTag = 0x4; |
| 588 | 582 |
| 589 // If bit 7 is clear, the low-order 3 bits indicate the representation | 583 // If bit 7 is clear, the low-order 2 bits indicate the representation |
| 590 // of the string. | 584 // of the string. |
| 591 const uint32_t kStringRepresentationMask = 0x07; | 585 const uint32_t kStringRepresentationMask = 0x03; |
| 592 enum StringRepresentationTag { | 586 enum StringRepresentationTag { |
| 593 kSeqStringTag = 0x0, | 587 kSeqStringTag = 0x0, |
| 594 kConsStringTag = 0x1, | 588 kConsStringTag = 0x1, |
| 595 kExternalStringTag = 0x2, | 589 kExternalStringTag = 0x2, |
| 596 kSlicedStringTag = 0x3, | 590 kSlicedStringTag = 0x3 |
| 597 kThinStringTag = 0x5 | |
| 598 }; | 591 }; |
| 599 const uint32_t kIsIndirectStringMask = 0x1; | 592 const uint32_t kIsIndirectStringMask = 0x1; |
| 600 const uint32_t kIsIndirectStringTag = 0x1; | 593 const uint32_t kIsIndirectStringTag = 0x1; |
| 601 STATIC_ASSERT((kSeqStringTag & kIsIndirectStringMask) == 0); // NOLINT | 594 STATIC_ASSERT((kSeqStringTag & kIsIndirectStringMask) == 0); // NOLINT |
| 602 STATIC_ASSERT((kExternalStringTag & kIsIndirectStringMask) == 0); // NOLINT | 595 STATIC_ASSERT((kExternalStringTag & kIsIndirectStringMask) == 0); // NOLINT |
| 603 STATIC_ASSERT((kConsStringTag & | 596 STATIC_ASSERT((kConsStringTag & |
| 604 kIsIndirectStringMask) == kIsIndirectStringTag); // NOLINT | 597 kIsIndirectStringMask) == kIsIndirectStringTag); // NOLINT |
| 605 STATIC_ASSERT((kSlicedStringTag & | 598 STATIC_ASSERT((kSlicedStringTag & |
| 606 kIsIndirectStringMask) == kIsIndirectStringTag); // NOLINT | 599 kIsIndirectStringMask) == kIsIndirectStringTag); // NOLINT |
| 607 STATIC_ASSERT((kThinStringTag & kIsIndirectStringMask) == kIsIndirectStringTag); | |
| 608 | 600 |
| 609 // If bit 7 is clear, then bit 4 indicates whether this two-byte | 601 // Use this mask to distinguish between cons and slice only after making |
| 602 // sure that the string is one of the two (an indirect string). |
| 603 const uint32_t kSlicedNotConsMask = kSlicedStringTag & ~kConsStringTag; |
| 604 STATIC_ASSERT(IS_POWER_OF_TWO(kSlicedNotConsMask)); |
| 605 |
| 606 // If bit 7 is clear, then bit 3 indicates whether this two-byte |
| 610 // string actually contains one byte data. | 607 // string actually contains one byte data. |
| 611 const uint32_t kOneByteDataHintMask = 0x10; | 608 const uint32_t kOneByteDataHintMask = 0x08; |
| 612 const uint32_t kOneByteDataHintTag = 0x10; | 609 const uint32_t kOneByteDataHintTag = 0x08; |
| 613 | 610 |
| 614 // If bit 7 is clear and string representation indicates an external string, | 611 // If bit 7 is clear and string representation indicates an external string, |
| 615 // then bit 5 indicates whether the data pointer is cached. | 612 // then bit 4 indicates whether the data pointer is cached. |
| 616 const uint32_t kShortExternalStringMask = 0x20; | 613 const uint32_t kShortExternalStringMask = 0x10; |
| 617 const uint32_t kShortExternalStringTag = 0x20; | 614 const uint32_t kShortExternalStringTag = 0x10; |
| 615 |
| 618 | 616 |
| 619 // A ConsString with an empty string as the right side is a candidate | 617 // A ConsString with an empty string as the right side is a candidate |
| 620 // for being shortcut by the garbage collector. We don't allocate any | 618 // for being shortcut by the garbage collector. We don't allocate any |
| 621 // non-flat internalized strings, so we do not shortcut them thereby | 619 // non-flat internalized strings, so we do not shortcut them thereby |
| 622 // avoiding turning internalized strings into strings. The bit-masks | 620 // avoiding turning internalized strings into strings. The bit-masks |
| 623 // below contain the internalized bit as additional safety. | 621 // below contain the internalized bit as additional safety. |
| 624 // See heap.cc, mark-compact.cc and objects-visiting.cc. | 622 // See heap.cc, mark-compact.cc and objects-visiting.cc. |
| 625 const uint32_t kShortcutTypeMask = | 623 const uint32_t kShortcutTypeMask = |
| 626 kIsNotStringMask | | 624 kIsNotStringMask | |
| 627 kIsNotInternalizedMask | | 625 kIsNotInternalizedMask | |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE = | 669 EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE = |
| 672 EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE | | 670 EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE | |
| 673 kNotInternalizedTag, | 671 kNotInternalizedTag, |
| 674 SHORT_EXTERNAL_STRING_TYPE = | 672 SHORT_EXTERNAL_STRING_TYPE = |
| 675 SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE | kNotInternalizedTag, | 673 SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE | kNotInternalizedTag, |
| 676 SHORT_EXTERNAL_ONE_BYTE_STRING_TYPE = | 674 SHORT_EXTERNAL_ONE_BYTE_STRING_TYPE = |
| 677 SHORT_EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE | kNotInternalizedTag, | 675 SHORT_EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE | kNotInternalizedTag, |
| 678 SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE = | 676 SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE = |
| 679 SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE | | 677 SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE | |
| 680 kNotInternalizedTag, | 678 kNotInternalizedTag, |
| 681 THIN_STRING_TYPE = kTwoByteStringTag | kThinStringTag | kNotInternalizedTag, | |
| 682 THIN_ONE_BYTE_STRING_TYPE = | |
| 683 kOneByteStringTag | kThinStringTag | kNotInternalizedTag, | |
| 684 | 679 |
| 685 // Non-string names | 680 // Non-string names |
| 686 SYMBOL_TYPE = kNotStringTag, // FIRST_NONSTRING_TYPE, LAST_NAME_TYPE | 681 SYMBOL_TYPE = kNotStringTag, // FIRST_NONSTRING_TYPE, LAST_NAME_TYPE |
| 687 | 682 |
| 688 // Other primitives (cannot contain non-map-word pointers to heap objects). | 683 // Other primitives (cannot contain non-map-word pointers to heap objects). |
| 689 HEAP_NUMBER_TYPE, | 684 HEAP_NUMBER_TYPE, |
| 690 SIMD128_VALUE_TYPE, | 685 SIMD128_VALUE_TYPE, |
| 691 ODDBALL_TYPE, // LAST_PRIMITIVE_TYPE | 686 ODDBALL_TYPE, // LAST_PRIMITIVE_TYPE |
| 692 | 687 |
| 693 // Objects allocated in their own spaces (never in new space). | 688 // Objects allocated in their own spaces (never in new space). |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1028 V(String) \ | 1023 V(String) \ |
| 1029 V(SeqString) \ | 1024 V(SeqString) \ |
| 1030 V(ExternalString) \ | 1025 V(ExternalString) \ |
| 1031 V(ConsString) \ | 1026 V(ConsString) \ |
| 1032 V(SlicedString) \ | 1027 V(SlicedString) \ |
| 1033 V(ExternalTwoByteString) \ | 1028 V(ExternalTwoByteString) \ |
| 1034 V(ExternalOneByteString) \ | 1029 V(ExternalOneByteString) \ |
| 1035 V(SeqTwoByteString) \ | 1030 V(SeqTwoByteString) \ |
| 1036 V(SeqOneByteString) \ | 1031 V(SeqOneByteString) \ |
| 1037 V(InternalizedString) \ | 1032 V(InternalizedString) \ |
| 1038 V(ThinString) \ | |
| 1039 V(Symbol) \ | 1033 V(Symbol) \ |
| 1040 \ | 1034 \ |
| 1041 V(FixedTypedArrayBase) \ | 1035 V(FixedTypedArrayBase) \ |
| 1042 V(FixedUint8Array) \ | 1036 V(FixedUint8Array) \ |
| 1043 V(FixedInt8Array) \ | 1037 V(FixedInt8Array) \ |
| 1044 V(FixedUint16Array) \ | 1038 V(FixedUint16Array) \ |
| 1045 V(FixedInt16Array) \ | 1039 V(FixedInt16Array) \ |
| 1046 V(FixedUint32Array) \ | 1040 V(FixedUint32Array) \ |
| 1047 V(FixedInt32Array) \ | 1041 V(FixedInt32Array) \ |
| 1048 V(FixedFloat32Array) \ | 1042 V(FixedFloat32Array) \ |
| (...skipping 8223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9272 // concrete performance benefit at that particular point in the code. | 9266 // concrete performance benefit at that particular point in the code. |
| 9273 class StringShape BASE_EMBEDDED { | 9267 class StringShape BASE_EMBEDDED { |
| 9274 public: | 9268 public: |
| 9275 inline explicit StringShape(const String* s); | 9269 inline explicit StringShape(const String* s); |
| 9276 inline explicit StringShape(Map* s); | 9270 inline explicit StringShape(Map* s); |
| 9277 inline explicit StringShape(InstanceType t); | 9271 inline explicit StringShape(InstanceType t); |
| 9278 inline bool IsSequential(); | 9272 inline bool IsSequential(); |
| 9279 inline bool IsExternal(); | 9273 inline bool IsExternal(); |
| 9280 inline bool IsCons(); | 9274 inline bool IsCons(); |
| 9281 inline bool IsSliced(); | 9275 inline bool IsSliced(); |
| 9282 inline bool IsThin(); | |
| 9283 inline bool IsIndirect(); | 9276 inline bool IsIndirect(); |
| 9284 inline bool IsExternalOneByte(); | 9277 inline bool IsExternalOneByte(); |
| 9285 inline bool IsExternalTwoByte(); | 9278 inline bool IsExternalTwoByte(); |
| 9286 inline bool IsSequentialOneByte(); | 9279 inline bool IsSequentialOneByte(); |
| 9287 inline bool IsSequentialTwoByte(); | 9280 inline bool IsSequentialTwoByte(); |
| 9288 inline bool IsInternalized(); | 9281 inline bool IsInternalized(); |
| 9289 inline StringRepresentationTag representation_tag(); | 9282 inline StringRepresentationTag representation_tag(); |
| 9290 inline uint32_t encoding_tag(); | 9283 inline uint32_t encoding_tag(); |
| 9291 inline uint32_t full_representation_tag(); | 9284 inline uint32_t full_representation_tag(); |
| 9292 inline uint32_t size_tag(); | 9285 inline uint32_t size_tag(); |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9986 | 9979 |
| 9987 typedef FixedBodyDescriptor<kFirstOffset, kSecondOffset + kPointerSize, kSize> | 9980 typedef FixedBodyDescriptor<kFirstOffset, kSecondOffset + kPointerSize, kSize> |
| 9988 BodyDescriptor; | 9981 BodyDescriptor; |
| 9989 | 9982 |
| 9990 DECLARE_VERIFIER(ConsString) | 9983 DECLARE_VERIFIER(ConsString) |
| 9991 | 9984 |
| 9992 private: | 9985 private: |
| 9993 DISALLOW_IMPLICIT_CONSTRUCTORS(ConsString); | 9986 DISALLOW_IMPLICIT_CONSTRUCTORS(ConsString); |
| 9994 }; | 9987 }; |
| 9995 | 9988 |
| 9996 // The ThinString class describes string objects that are just references | |
| 9997 // to another string object. They are used for in-place internalization when | |
| 9998 // the original string cannot actually be internalized in-place: in these | |
| 9999 // cases, the original string is converted to a ThinString pointing at its | |
| 10000 // internalized version (which is allocated as a new object). | |
| 10001 // In terms of memory layout and most algorithms operating on strings, | |
| 10002 // ThinStrings can be thought of as "one-part cons strings". | |
| 10003 class ThinString : public String { | |
| 10004 public: | |
| 10005 // Actual string that this ThinString refers to. | |
| 10006 inline String* actual() const; | |
| 10007 inline void set_actual(String* s, | |
| 10008 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | |
| 10009 | |
| 10010 V8_EXPORT_PRIVATE uint16_t ThinStringGet(int index); | |
| 10011 | |
| 10012 DECLARE_CAST(ThinString) | |
| 10013 DECLARE_VERIFIER(ThinString) | |
| 10014 | |
| 10015 // Layout description. | |
| 10016 static const int kActualOffset = String::kSize; | |
| 10017 static const int kSize = kActualOffset + kPointerSize; | |
| 10018 | |
| 10019 typedef FixedBodyDescriptor<kActualOffset, kSize, kSize> BodyDescriptor; | |
| 10020 | |
| 10021 private: | |
| 10022 DISALLOW_COPY_AND_ASSIGN(ThinString); | |
| 10023 }; | |
| 10024 | 9989 |
| 10025 // The Sliced String class describes strings that are substrings of another | 9990 // The Sliced String class describes strings that are substrings of another |
| 10026 // sequential string. The motivation is to save time and memory when creating | 9991 // sequential string. The motivation is to save time and memory when creating |
| 10027 // a substring. A Sliced String is described as a pointer to the parent, | 9992 // a substring. A Sliced String is described as a pointer to the parent, |
| 10028 // the offset from the start of the parent string and the length. Using | 9993 // the offset from the start of the parent string and the length. Using |
| 10029 // a Sliced String therefore requires unpacking of the parent string and | 9994 // a Sliced String therefore requires unpacking of the parent string and |
| 10030 // adding the offset to the start address. A substring of a Sliced String | 9995 // adding the offset to the start address. A substring of a Sliced String |
| 10031 // are not nested since the double indirection is simplified when creating | 9996 // are not nested since the double indirection is simplified when creating |
| 10032 // such a substring. | 9997 // such a substring. |
| 10033 // Currently missing features are: | 9998 // Currently missing features are: |
| (...skipping 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11747 } | 11712 } |
| 11748 }; | 11713 }; |
| 11749 | 11714 |
| 11750 | 11715 |
| 11751 } // NOLINT, false-positive due to second-order macros. | 11716 } // NOLINT, false-positive due to second-order macros. |
| 11752 } // NOLINT, false-positive due to second-order macros. | 11717 } // NOLINT, false-positive due to second-order macros. |
| 11753 | 11718 |
| 11754 #include "src/objects/object-macros-undef.h" | 11719 #include "src/objects/object-macros-undef.h" |
| 11755 | 11720 |
| 11756 #endif // V8_OBJECTS_H_ | 11721 #endif // V8_OBJECTS_H_ |
| OLD | NEW |