OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 3908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3919 inline int length(); | 3919 inline int length(); |
3920 inline void set_length(int value); | 3920 inline void set_length(int value); |
3921 | 3921 |
3922 // Get and set the hash field of the string. | 3922 // Get and set the hash field of the string. |
3923 inline uint32_t hash_field(); | 3923 inline uint32_t hash_field(); |
3924 inline void set_hash_field(uint32_t value); | 3924 inline void set_hash_field(uint32_t value); |
3925 | 3925 |
3926 inline bool IsAsciiRepresentation(); | 3926 inline bool IsAsciiRepresentation(); |
3927 inline bool IsTwoByteRepresentation(); | 3927 inline bool IsTwoByteRepresentation(); |
3928 | 3928 |
| 3929 // Check whether this string is an external two-byte string that in |
| 3930 // fact contains only ascii characters. |
| 3931 // |
| 3932 // Such strings may appear when the embedder prefers two-byte |
| 3933 // representations even for ascii data. |
| 3934 inline bool IsExternalTwoByteStringWithAsciiChars(); |
| 3935 |
3929 // Get and set individual two byte chars in the string. | 3936 // Get and set individual two byte chars in the string. |
3930 inline void Set(int index, uint16_t value); | 3937 inline void Set(int index, uint16_t value); |
3931 // Get individual two byte char in the string. Repeated calls | 3938 // Get individual two byte char in the string. Repeated calls |
3932 // to this method are not efficient unless the string is flat. | 3939 // to this method are not efficient unless the string is flat. |
3933 inline uint16_t Get(int index); | 3940 inline uint16_t Get(int index); |
3934 | 3941 |
3935 // Try to flatten the top level ConsString that is hiding behind this | 3942 // Try to flatten the top level ConsString that is hiding behind this |
3936 // string. This is a no-op unless the string is a ConsString. Flatten | 3943 // string. This is a no-op unless the string is a ConsString. Flatten |
3937 // mutates the ConsString and might return a failure. | 3944 // mutates the ConsString and might return a failure. |
3938 Object* SlowTryFlatten(PretenureFlag pretenure); | 3945 Object* SlowTryFlatten(PretenureFlag pretenure); |
(...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5074 } else { | 5081 } else { |
5075 value &= ~(1 << bit_position); | 5082 value &= ~(1 << bit_position); |
5076 } | 5083 } |
5077 return value; | 5084 return value; |
5078 } | 5085 } |
5079 }; | 5086 }; |
5080 | 5087 |
5081 } } // namespace v8::internal | 5088 } } // namespace v8::internal |
5082 | 5089 |
5083 #endif // V8_OBJECTS_H_ | 5090 #endif // V8_OBJECTS_H_ |
OLD | NEW |