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 7114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7125 : buffer_(Vector<const byte>::cast(chars)), | 7125 : buffer_(Vector<const byte>::cast(chars)), |
7126 state_(TWO_BYTE) { } | 7126 state_(TWO_BYTE) { } |
7127 FlatContent() : buffer_(), state_(NON_FLAT) { } | 7127 FlatContent() : buffer_(), state_(NON_FLAT) { } |
7128 | 7128 |
7129 Vector<const byte> buffer_; | 7129 Vector<const byte> buffer_; |
7130 State state_; | 7130 State state_; |
7131 | 7131 |
7132 friend class String; | 7132 friend class String; |
7133 }; | 7133 }; |
7134 | 7134 |
| 7135 enum AsciiHint { MAYBE_ASCII = 0, |
| 7136 STRICT_ASCII = 1, |
| 7137 NOT_ASCII = 2 }; |
| 7138 |
7135 // Get and set the length of the string. | 7139 // Get and set the length of the string. |
7136 inline int length(); | 7140 inline int length(); |
7137 inline void set_length(int value); | 7141 inline void set_length(int value); |
7138 | 7142 |
7139 // Get and set the hash field of the string. | 7143 // Get and set the hash field of the string. |
7140 inline uint32_t hash_field(); | 7144 inline uint32_t hash_field(); |
7141 inline void set_hash_field(uint32_t value); | 7145 inline void set_hash_field(uint32_t value); |
7142 | 7146 |
7143 // Returns whether this string has only ASCII chars, i.e. all of them can | 7147 // Returns whether this string has only ASCII chars, i.e. all of them can |
7144 // be ASCII encoded. This might be the case even if the string is | 7148 // 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... |
8954 } else { | 8958 } else { |
8955 value &= ~(1 << bit_position); | 8959 value &= ~(1 << bit_position); |
8956 } | 8960 } |
8957 return value; | 8961 return value; |
8958 } | 8962 } |
8959 }; | 8963 }; |
8960 | 8964 |
8961 } } // namespace v8::internal | 8965 } } // namespace v8::internal |
8962 | 8966 |
8963 #endif // V8_OBJECTS_H_ | 8967 #endif // V8_OBJECTS_H_ |
OLD | NEW |