| Index: src/objects.h
|
| diff --git a/src/objects.h b/src/objects.h
|
| index 85087270bef2f112a5561422b09fbf5df1f18a2c..94c977d7559656ba29818ce6afb369202e17a1f5 100644
|
| --- a/src/objects.h
|
| +++ b/src/objects.h
|
| @@ -8902,7 +8902,7 @@ class String: public Name {
|
| static const int kEmptyStringHash = kIsNotArrayIndexMask;
|
|
|
| // Maximal string length.
|
| - static const int kMaxLength = (1 << (32 - 2)) - 1;
|
| + static const int kMaxLength = (1 << 28) - 16;
|
|
|
| // Max length for computing hash. For strings longer than this limit the
|
| // string length is used as the hash value.
|
| @@ -9064,9 +9064,7 @@ class SeqOneByteString: public SeqString {
|
|
|
| // Maximal memory usage for a single sequential ASCII string.
|
| static const int kMaxSize = 512 * MB - 1;
|
| - // Maximal length of a single sequential ASCII string.
|
| - // Q.v. String::kMaxLength which is the maximal size of concatenated strings.
|
| - static const int kMaxLength = (kMaxSize - kHeaderSize);
|
| + STATIC_CHECK((kMaxSize - kHeaderSize) >= String::kMaxLength);
|
|
|
| private:
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(SeqOneByteString);
|
| @@ -9106,9 +9104,8 @@ class SeqTwoByteString: public SeqString {
|
|
|
| // Maximal memory usage for a single sequential two-byte string.
|
| static const int kMaxSize = 512 * MB - 1;
|
| - // Maximal length of a single sequential two-byte string.
|
| - // Q.v. String::kMaxLength which is the maximal size of concatenated strings.
|
| - static const int kMaxLength = (kMaxSize - kHeaderSize) / sizeof(uint16_t);
|
| + STATIC_CHECK(static_cast<int>((kMaxSize - kHeaderSize)/sizeof(uint16_t)) >=
|
| + String::kMaxLength);
|
|
|
| private:
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(SeqTwoByteString);
|
|
|