| 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 5681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5692 // Computes the size for an AsciiString instance of a given length. | 5692 // Computes the size for an AsciiString instance of a given length. |
| 5693 static int SizeFor(int length) { | 5693 static int SizeFor(int length) { |
| 5694 return OBJECT_POINTER_ALIGN(kHeaderSize + length * kCharSize); | 5694 return OBJECT_POINTER_ALIGN(kHeaderSize + length * kCharSize); |
| 5695 } | 5695 } |
| 5696 | 5696 |
| 5697 // Layout description. | 5697 // Layout description. |
| 5698 static const int kHeaderSize = String::kSize; | 5698 static const int kHeaderSize = String::kSize; |
| 5699 static const int kAlignedSize = POINTER_SIZE_ALIGN(kHeaderSize); | 5699 static const int kAlignedSize = POINTER_SIZE_ALIGN(kHeaderSize); |
| 5700 | 5700 |
| 5701 // Maximal memory usage for a single sequential ASCII string. | 5701 // Maximal memory usage for a single sequential ASCII string. |
| 5702 static const int kMaxSize = 512 * MB; | 5702 static const int kMaxSize = 512 * MB - 1; |
| 5703 // Maximal length of a single sequential ASCII string. | 5703 // Maximal length of a single sequential ASCII string. |
| 5704 // Q.v. String::kMaxLength which is the maximal size of concatenated strings. | 5704 // Q.v. String::kMaxLength which is the maximal size of concatenated strings. |
| 5705 static const int kMaxLength = (kMaxSize - kHeaderSize); | 5705 static const int kMaxLength = (kMaxSize - kHeaderSize); |
| 5706 | 5706 |
| 5707 // Support for StringInputBuffer. | 5707 // Support for StringInputBuffer. |
| 5708 inline void SeqAsciiStringReadBlockIntoBuffer(ReadBlockBuffer* buffer, | 5708 inline void SeqAsciiStringReadBlockIntoBuffer(ReadBlockBuffer* buffer, |
| 5709 unsigned* offset, | 5709 unsigned* offset, |
| 5710 unsigned chars); | 5710 unsigned chars); |
| 5711 inline const unibrow::byte* SeqAsciiStringReadBlock(unsigned* remaining, | 5711 inline const unibrow::byte* SeqAsciiStringReadBlock(unsigned* remaining, |
| 5712 unsigned* offset, | 5712 unsigned* offset, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5746 // Computes the size for a TwoByteString instance of a given length. | 5746 // Computes the size for a TwoByteString instance of a given length. |
| 5747 static int SizeFor(int length) { | 5747 static int SizeFor(int length) { |
| 5748 return OBJECT_POINTER_ALIGN(kHeaderSize + length * kShortSize); | 5748 return OBJECT_POINTER_ALIGN(kHeaderSize + length * kShortSize); |
| 5749 } | 5749 } |
| 5750 | 5750 |
| 5751 // Layout description. | 5751 // Layout description. |
| 5752 static const int kHeaderSize = String::kSize; | 5752 static const int kHeaderSize = String::kSize; |
| 5753 static const int kAlignedSize = POINTER_SIZE_ALIGN(kHeaderSize); | 5753 static const int kAlignedSize = POINTER_SIZE_ALIGN(kHeaderSize); |
| 5754 | 5754 |
| 5755 // Maximal memory usage for a single sequential two-byte string. | 5755 // Maximal memory usage for a single sequential two-byte string. |
| 5756 static const int kMaxSize = 512 * MB; | 5756 static const int kMaxSize = 512 * MB - 1; |
| 5757 // Maximal length of a single sequential two-byte string. | 5757 // Maximal length of a single sequential two-byte string. |
| 5758 // Q.v. String::kMaxLength which is the maximal size of concatenated strings. | 5758 // Q.v. String::kMaxLength which is the maximal size of concatenated strings. |
| 5759 static const int kMaxLength = (kMaxSize - kHeaderSize) / sizeof(uint16_t); | 5759 static const int kMaxLength = (kMaxSize - kHeaderSize) / sizeof(uint16_t); |
| 5760 | 5760 |
| 5761 // Support for StringInputBuffer. | 5761 // Support for StringInputBuffer. |
| 5762 inline void SeqTwoByteStringReadBlockIntoBuffer(ReadBlockBuffer* buffer, | 5762 inline void SeqTwoByteStringReadBlockIntoBuffer(ReadBlockBuffer* buffer, |
| 5763 unsigned* offset_ptr, | 5763 unsigned* offset_ptr, |
| 5764 unsigned chars); | 5764 unsigned chars); |
| 5765 | 5765 |
| 5766 private: | 5766 private: |
| (...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6755 } else { | 6755 } else { |
| 6756 value &= ~(1 << bit_position); | 6756 value &= ~(1 << bit_position); |
| 6757 } | 6757 } |
| 6758 return value; | 6758 return value; |
| 6759 } | 6759 } |
| 6760 }; | 6760 }; |
| 6761 | 6761 |
| 6762 } } // namespace v8::internal | 6762 } } // namespace v8::internal |
| 6763 | 6763 |
| 6764 #endif // V8_OBJECTS_H_ | 6764 #endif // V8_OBJECTS_H_ |
| OLD | NEW |