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 9220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9231 class ExternalString: public String { | 9231 class ExternalString: public String { |
9232 public: | 9232 public: |
9233 DECLARE_CAST(ExternalString) | 9233 DECLARE_CAST(ExternalString) |
9234 | 9234 |
9235 // Layout description. | 9235 // Layout description. |
9236 static const int kResourceOffset = POINTER_SIZE_ALIGN(String::kSize); | 9236 static const int kResourceOffset = POINTER_SIZE_ALIGN(String::kSize); |
9237 static const int kShortSize = kResourceOffset + kPointerSize; | 9237 static const int kShortSize = kResourceOffset + kPointerSize; |
9238 static const int kResourceDataOffset = kResourceOffset + kPointerSize; | 9238 static const int kResourceDataOffset = kResourceOffset + kPointerSize; |
9239 static const int kSize = kResourceDataOffset + kPointerSize; | 9239 static const int kSize = kResourceDataOffset + kPointerSize; |
9240 | 9240 |
9241 static const int kMaxShortLength = | |
9242 (kShortSize - SeqString::kHeaderSize) / kCharSize; | |
9243 | |
9244 // Return whether external string is short (data pointer is not cached). | 9241 // Return whether external string is short (data pointer is not cached). |
9245 inline bool is_short(); | 9242 inline bool is_short(); |
9246 | 9243 |
9247 STATIC_ASSERT(kResourceOffset == Internals::kStringResourceOffset); | 9244 STATIC_ASSERT(kResourceOffset == Internals::kStringResourceOffset); |
9248 | 9245 |
9249 private: | 9246 private: |
9250 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalString); | 9247 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalString); |
9251 }; | 9248 }; |
9252 | 9249 |
9253 | 9250 |
(...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10796 } | 10793 } |
10797 return value; | 10794 return value; |
10798 } | 10795 } |
10799 }; | 10796 }; |
10800 | 10797 |
10801 | 10798 |
10802 } // NOLINT, false-positive due to second-order macros. | 10799 } // NOLINT, false-positive due to second-order macros. |
10803 } // NOLINT, false-positive due to second-order macros. | 10800 } // NOLINT, false-positive due to second-order macros. |
10804 | 10801 |
10805 #endif // V8_OBJECTS_H_ | 10802 #endif // V8_OBJECTS_H_ |
OLD | NEW |