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 9274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9285 class ExternalString: public String { | 9285 class ExternalString: public String { |
9286 public: | 9286 public: |
9287 DECLARE_CAST(ExternalString) | 9287 DECLARE_CAST(ExternalString) |
9288 | 9288 |
9289 // Layout description. | 9289 // Layout description. |
9290 static const int kResourceOffset = POINTER_SIZE_ALIGN(String::kSize); | 9290 static const int kResourceOffset = POINTER_SIZE_ALIGN(String::kSize); |
9291 static const int kShortSize = kResourceOffset + kPointerSize; | 9291 static const int kShortSize = kResourceOffset + kPointerSize; |
9292 static const int kResourceDataOffset = kResourceOffset + kPointerSize; | 9292 static const int kResourceDataOffset = kResourceOffset + kPointerSize; |
9293 static const int kSize = kResourceDataOffset + kPointerSize; | 9293 static const int kSize = kResourceDataOffset + kPointerSize; |
9294 | 9294 |
9295 static const int kMaxShortLength = | |
9296 (kShortSize - SeqString::kHeaderSize) / kCharSize; | |
9297 | |
9298 // Return whether external string is short (data pointer is not cached). | 9295 // Return whether external string is short (data pointer is not cached). |
9299 inline bool is_short(); | 9296 inline bool is_short(); |
9300 | 9297 |
9301 STATIC_ASSERT(kResourceOffset == Internals::kStringResourceOffset); | 9298 STATIC_ASSERT(kResourceOffset == Internals::kStringResourceOffset); |
9302 | 9299 |
9303 private: | 9300 private: |
9304 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalString); | 9301 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalString); |
9305 }; | 9302 }; |
9306 | 9303 |
9307 | 9304 |
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10835 } | 10832 } |
10836 return value; | 10833 return value; |
10837 } | 10834 } |
10838 }; | 10835 }; |
10839 | 10836 |
10840 | 10837 |
10841 } // NOLINT, false-positive due to second-order macros. | 10838 } // NOLINT, false-positive due to second-order macros. |
10842 } // NOLINT, false-positive due to second-order macros. | 10839 } // NOLINT, false-positive due to second-order macros. |
10843 | 10840 |
10844 #endif // V8_OBJECTS_H_ | 10841 #endif // V8_OBJECTS_H_ |
OLD | NEW |