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 7182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7193 // do any heap allocations. This is useful when printing stack traces. | 7193 // do any heap allocations. This is useful when printing stack traces. |
7194 SmartArrayPointer<uc16> ToWideCString( | 7194 SmartArrayPointer<uc16> ToWideCString( |
7195 RobustnessFlag robustness_flag = FAST_STRING_TRAVERSAL); | 7195 RobustnessFlag robustness_flag = FAST_STRING_TRAVERSAL); |
7196 | 7196 |
7197 // Tells whether the hash code has been computed. | 7197 // Tells whether the hash code has been computed. |
7198 inline bool HasHashCode(); | 7198 inline bool HasHashCode(); |
7199 | 7199 |
7200 // Returns a hash value used for the property table | 7200 // Returns a hash value used for the property table |
7201 inline uint32_t Hash(); | 7201 inline uint32_t Hash(); |
7202 | 7202 |
7203 static bool ComputeArrayIndex(unibrow::CharacterStream* buffer, | 7203 bool ComputeArrayIndex(uint32_t* index); |
7204 uint32_t* index, | |
7205 int length); | |
7206 | 7204 |
7207 // Externalization. | 7205 // Externalization. |
7208 bool MakeExternal(v8::String::ExternalStringResource* resource); | 7206 bool MakeExternal(v8::String::ExternalStringResource* resource); |
7209 bool MakeExternal(v8::String::ExternalAsciiStringResource* resource); | 7207 bool MakeExternal(v8::String::ExternalAsciiStringResource* resource); |
7210 | 7208 |
7211 // Conversion. | 7209 // Conversion. |
7212 inline bool AsArrayIndex(uint32_t* index); | 7210 inline bool AsArrayIndex(uint32_t* index); |
7213 | 7211 |
7214 // Casting. | 7212 // Casting. |
7215 static inline String* cast(Object* obj); | 7213 static inline String* cast(Object* obj); |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7891 unsigned consumed_; | 7889 unsigned consumed_; |
7892 ConsString* root_; | 7890 ConsString* root_; |
7893 DISALLOW_COPY_AND_ASSIGN(ConsStringIteratorOp); | 7891 DISALLOW_COPY_AND_ASSIGN(ConsStringIteratorOp); |
7894 }; | 7892 }; |
7895 | 7893 |
7896 | 7894 |
7897 // Note: this class is not GC-safe. | 7895 // Note: this class is not GC-safe. |
7898 class StringCharacterStream { | 7896 class StringCharacterStream { |
7899 public: | 7897 public: |
7900 inline StringCharacterStream(String* string, | 7898 inline StringCharacterStream(String* string, |
7901 unsigned offset, | 7899 ConsStringIteratorOp* op, |
7902 ConsStringIteratorOp* op); | 7900 unsigned offset = 0); |
7903 inline uint16_t GetNext(); | 7901 inline uint16_t GetNext(); |
7904 inline bool HasMore(); | 7902 inline bool HasMore(); |
7905 inline void Reset(String* string, unsigned offset, ConsStringIteratorOp* op); | 7903 inline void Reset(String* string, unsigned offset = 0); |
7906 inline void VisitOneByteString(const uint8_t* chars, unsigned length); | 7904 inline void VisitOneByteString(const uint8_t* chars, unsigned length); |
7907 inline void VisitTwoByteString(const uint16_t* chars, unsigned length); | 7905 inline void VisitTwoByteString(const uint16_t* chars, unsigned length); |
7908 | 7906 |
7909 private: | 7907 private: |
7910 bool is_one_byte_; | 7908 bool is_one_byte_; |
7911 union { | 7909 union { |
7912 const uint8_t* buffer8_; | 7910 const uint8_t* buffer8_; |
7913 const uint16_t* buffer16_; | 7911 const uint16_t* buffer16_; |
7914 }; | 7912 }; |
7915 const uint8_t* end_; | 7913 const uint8_t* end_; |
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8887 } else { | 8885 } else { |
8888 value &= ~(1 << bit_position); | 8886 value &= ~(1 << bit_position); |
8889 } | 8887 } |
8890 return value; | 8888 return value; |
8891 } | 8889 } |
8892 }; | 8890 }; |
8893 | 8891 |
8894 } } // namespace v8::internal | 8892 } } // namespace v8::internal |
8895 | 8893 |
8896 #endif // V8_OBJECTS_H_ | 8894 #endif // V8_OBJECTS_H_ |
OLD | NEW |