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 7075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7086 : buffer_(Vector<const byte>::cast(chars)), | 7086 : buffer_(Vector<const byte>::cast(chars)), |
7087 state_(TWO_BYTE) { } | 7087 state_(TWO_BYTE) { } |
7088 FlatContent() : buffer_(), state_(NON_FLAT) { } | 7088 FlatContent() : buffer_(), state_(NON_FLAT) { } |
7089 | 7089 |
7090 Vector<const byte> buffer_; | 7090 Vector<const byte> buffer_; |
7091 State state_; | 7091 State state_; |
7092 | 7092 |
7093 friend class String; | 7093 friend class String; |
7094 }; | 7094 }; |
7095 | 7095 |
| 7096 enum AsciiHint { MAYBE_ASCII = 0, |
| 7097 ASCII = 1, |
| 7098 NOT_ASCII = 2 }; |
| 7099 |
7096 // Get and set the length of the string. | 7100 // Get and set the length of the string. |
7097 inline int length(); | 7101 inline int length(); |
7098 inline void set_length(int value); | 7102 inline void set_length(int value); |
7099 | 7103 |
7100 // Get and set the hash field of the string. | 7104 // Get and set the hash field of the string. |
7101 inline uint32_t hash_field(); | 7105 inline uint32_t hash_field(); |
7102 inline void set_hash_field(uint32_t value); | 7106 inline void set_hash_field(uint32_t value); |
7103 | 7107 |
7104 // Returns whether this string has only ASCII chars, i.e. all of them can | 7108 // Returns whether this string has only ASCII chars, i.e. all of them can |
7105 // be ASCII encoded. This might be the case even if the string is | 7109 // be ASCII encoded. This might be the case even if the string is |
(...skipping 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8915 } else { | 8919 } else { |
8916 value &= ~(1 << bit_position); | 8920 value &= ~(1 << bit_position); |
8917 } | 8921 } |
8918 return value; | 8922 return value; |
8919 } | 8923 } |
8920 }; | 8924 }; |
8921 | 8925 |
8922 } } // namespace v8::internal | 8926 } } // namespace v8::internal |
8923 | 8927 |
8924 #endif // V8_OBJECTS_H_ | 8928 #endif // V8_OBJECTS_H_ |
OLD | NEW |