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 | 9 |
10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
(...skipping 9355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9366 class ExternalString: public String { | 9366 class ExternalString: public String { |
9367 public: | 9367 public: |
9368 DECLARE_CAST(ExternalString) | 9368 DECLARE_CAST(ExternalString) |
9369 | 9369 |
9370 // Layout description. | 9370 // Layout description. |
9371 static const int kResourceOffset = POINTER_SIZE_ALIGN(String::kSize); | 9371 static const int kResourceOffset = POINTER_SIZE_ALIGN(String::kSize); |
9372 static const int kShortSize = kResourceOffset + kPointerSize; | 9372 static const int kShortSize = kResourceOffset + kPointerSize; |
9373 static const int kResourceDataOffset = kResourceOffset + kPointerSize; | 9373 static const int kResourceDataOffset = kResourceOffset + kPointerSize; |
9374 static const int kSize = kResourceDataOffset + kPointerSize; | 9374 static const int kSize = kResourceDataOffset + kPointerSize; |
9375 | 9375 |
9376 static const int kMaxShortLength = | |
9377 (kShortSize - SeqString::kHeaderSize) / kCharSize; | |
9378 | |
9379 // Return whether external string is short (data pointer is not cached). | 9376 // Return whether external string is short (data pointer is not cached). |
9380 inline bool is_short(); | 9377 inline bool is_short(); |
9381 | 9378 |
9382 STATIC_ASSERT(kResourceOffset == Internals::kStringResourceOffset); | 9379 STATIC_ASSERT(kResourceOffset == Internals::kStringResourceOffset); |
9383 | 9380 |
9384 private: | 9381 private: |
9385 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalString); | 9382 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalString); |
9386 }; | 9383 }; |
9387 | 9384 |
9388 | 9385 |
(...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10922 } | 10919 } |
10923 return value; | 10920 return value; |
10924 } | 10921 } |
10925 }; | 10922 }; |
10926 | 10923 |
10927 | 10924 |
10928 } // NOLINT, false-positive due to second-order macros. | 10925 } // NOLINT, false-positive due to second-order macros. |
10929 } // NOLINT, false-positive due to second-order macros. | 10926 } // NOLINT, false-positive due to second-order macros. |
10930 | 10927 |
10931 #endif // V8_OBJECTS_H_ | 10928 #endif // V8_OBJECTS_H_ |
OLD | NEW |