OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 7703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7714 public: | 7714 public: |
7715 // Casting | 7715 // Casting |
7716 static inline ExternalString* cast(Object* obj); | 7716 static inline ExternalString* cast(Object* obj); |
7717 | 7717 |
7718 // Layout description. | 7718 // Layout description. |
7719 static const int kResourceOffset = POINTER_SIZE_ALIGN(String::kSize); | 7719 static const int kResourceOffset = POINTER_SIZE_ALIGN(String::kSize); |
7720 static const int kShortSize = kResourceOffset + kPointerSize; | 7720 static const int kShortSize = kResourceOffset + kPointerSize; |
7721 static const int kResourceDataOffset = kResourceOffset + kPointerSize; | 7721 static const int kResourceDataOffset = kResourceOffset + kPointerSize; |
7722 static const int kSize = kResourceDataOffset + kPointerSize; | 7722 static const int kSize = kResourceDataOffset + kPointerSize; |
7723 | 7723 |
| 7724 static const int kMaxShortLength = |
| 7725 (kShortSize - SeqString::kHeaderSize) / kCharSize; |
| 7726 |
7724 // Return whether external string is short (data pointer is not cached). | 7727 // Return whether external string is short (data pointer is not cached). |
7725 inline bool is_short(); | 7728 inline bool is_short(); |
7726 | 7729 |
7727 STATIC_CHECK(kResourceOffset == Internals::kStringResourceOffset); | 7730 STATIC_CHECK(kResourceOffset == Internals::kStringResourceOffset); |
7728 | 7731 |
7729 private: | 7732 private: |
7730 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalString); | 7733 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalString); |
7731 }; | 7734 }; |
7732 | 7735 |
7733 | 7736 |
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8950 } else { | 8953 } else { |
8951 value &= ~(1 << bit_position); | 8954 value &= ~(1 << bit_position); |
8952 } | 8955 } |
8953 return value; | 8956 return value; |
8954 } | 8957 } |
8955 }; | 8958 }; |
8956 | 8959 |
8957 } } // namespace v8::internal | 8960 } } // namespace v8::internal |
8958 | 8961 |
8959 #endif // V8_OBJECTS_H_ | 8962 #endif // V8_OBJECTS_H_ |
OLD | NEW |