| 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 9213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9224 class ExternalString: public String { | 9224 class ExternalString: public String { |
| 9225 public: | 9225 public: |
| 9226 DECLARE_CAST(ExternalString) | 9226 DECLARE_CAST(ExternalString) |
| 9227 | 9227 |
| 9228 // Layout description. | 9228 // Layout description. |
| 9229 static const int kResourceOffset = POINTER_SIZE_ALIGN(String::kSize); | 9229 static const int kResourceOffset = POINTER_SIZE_ALIGN(String::kSize); |
| 9230 static const int kShortSize = kResourceOffset + kPointerSize; | 9230 static const int kShortSize = kResourceOffset + kPointerSize; |
| 9231 static const int kResourceDataOffset = kResourceOffset + kPointerSize; | 9231 static const int kResourceDataOffset = kResourceOffset + kPointerSize; |
| 9232 static const int kSize = kResourceDataOffset + kPointerSize; | 9232 static const int kSize = kResourceDataOffset + kPointerSize; |
| 9233 | 9233 |
| 9234 static const int kMaxShortLength = | |
| 9235 (kShortSize - SeqString::kHeaderSize) / kCharSize; | |
| 9236 | |
| 9237 // Return whether external string is short (data pointer is not cached). | 9234 // Return whether external string is short (data pointer is not cached). |
| 9238 inline bool is_short(); | 9235 inline bool is_short(); |
| 9239 | 9236 |
| 9240 STATIC_ASSERT(kResourceOffset == Internals::kStringResourceOffset); | 9237 STATIC_ASSERT(kResourceOffset == Internals::kStringResourceOffset); |
| 9241 | 9238 |
| 9242 private: | 9239 private: |
| 9243 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalString); | 9240 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalString); |
| 9244 }; | 9241 }; |
| 9245 | 9242 |
| 9246 | 9243 |
| (...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10780 } | 10777 } |
| 10781 return value; | 10778 return value; |
| 10782 } | 10779 } |
| 10783 }; | 10780 }; |
| 10784 | 10781 |
| 10785 | 10782 |
| 10786 } // NOLINT, false-positive due to second-order macros. | 10783 } // NOLINT, false-positive due to second-order macros. |
| 10787 } // NOLINT, false-positive due to second-order macros. | 10784 } // NOLINT, false-positive due to second-order macros. |
| 10788 | 10785 |
| 10789 #endif // V8_OBJECTS_H_ | 10786 #endif // V8_OBJECTS_H_ |
| OLD | NEW |