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 3819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3830 | 3830 |
3831 // Get and set individual two byte chars in the string. | 3831 // Get and set individual two byte chars in the string. |
3832 inline void Set(int index, uint16_t value); | 3832 inline void Set(int index, uint16_t value); |
3833 // Get individual two byte char in the string. Repeated calls | 3833 // Get individual two byte char in the string. Repeated calls |
3834 // to this method are not efficient unless the string is flat. | 3834 // to this method are not efficient unless the string is flat. |
3835 inline uint16_t Get(int index); | 3835 inline uint16_t Get(int index); |
3836 | 3836 |
3837 // Try to flatten the top level ConsString that is hiding behind this | 3837 // Try to flatten the top level ConsString that is hiding behind this |
3838 // string. This is a no-op unless the string is a ConsString. Flatten | 3838 // string. This is a no-op unless the string is a ConsString. Flatten |
3839 // mutates the ConsString and might return a failure. | 3839 // mutates the ConsString and might return a failure. |
3840 Object* TryFlatten(); | 3840 Object* SlowTryFlatten(PretenureFlag pretenure); |
3841 | 3841 |
3842 // Try to flatten the string. Checks first inline to see if it is necessary. | 3842 // Try to flatten the string. Checks first inline to see if it is necessary. |
3843 // Do not handle allocation failures. After calling TryFlattenIfNotFlat, the | 3843 // Do not handle allocation failures. After calling TryFlatten, the |
3844 // string could still be a ConsString, in which case a failure is returned. | 3844 // string could still be a ConsString, in which case a failure is returned. |
3845 // Use FlattenString from Handles.cc to be sure to flatten. | 3845 // Use FlattenString from Handles.cc to be sure to flatten. |
3846 inline Object* TryFlattenIfNotFlat(); | 3846 inline Object* TryFlatten(PretenureFlag pretenure = NOT_TENURED); |
3847 | 3847 |
3848 Vector<const char> ToAsciiVector(); | 3848 Vector<const char> ToAsciiVector(); |
3849 Vector<const uc16> ToUC16Vector(); | 3849 Vector<const uc16> ToUC16Vector(); |
3850 | 3850 |
3851 // Mark the string as an undetectable object. It only applies to | 3851 // Mark the string as an undetectable object. It only applies to |
3852 // ascii and two byte string types. | 3852 // ascii and two byte string types. |
3853 bool MarkAsUndetectable(); | 3853 bool MarkAsUndetectable(); |
3854 | 3854 |
3855 // Return a substring. | 3855 // Return a substring. |
3856 Object* SubString(int from, int to); | 3856 Object* SubString(int from, int to, PretenureFlag pretenure = NOT_TENURED); |
3857 | 3857 |
3858 // String equality operations. | 3858 // String equality operations. |
3859 inline bool Equals(String* other); | 3859 inline bool Equals(String* other); |
3860 bool IsEqualTo(Vector<const char> str); | 3860 bool IsEqualTo(Vector<const char> str); |
3861 | 3861 |
3862 // Return a UTF8 representation of the string. The string is null | 3862 // Return a UTF8 representation of the string. The string is null |
3863 // terminated but may optionally contain nulls. Length is returned | 3863 // terminated but may optionally contain nulls. Length is returned |
3864 // in length_output if length_output is not a null pointer The string | 3864 // in length_output if length_output is not a null pointer The string |
3865 // should be nearly flat, otherwise the performance of this method may | 3865 // should be nearly flat, otherwise the performance of this method may |
3866 // be very slow (quadratic in the length). Setting robustness_flag to | 3866 // be very slow (quadratic in the length). Setting robustness_flag to |
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4976 } else { | 4976 } else { |
4977 value &= ~(1 << bit_position); | 4977 value &= ~(1 << bit_position); |
4978 } | 4978 } |
4979 return value; | 4979 return value; |
4980 } | 4980 } |
4981 }; | 4981 }; |
4982 | 4982 |
4983 } } // namespace v8::internal | 4983 } } // namespace v8::internal |
4984 | 4984 |
4985 #endif // V8_OBJECTS_H_ | 4985 #endif // V8_OBJECTS_H_ |
OLD | NEW |