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