Index: src/objects.h |
=================================================================== |
--- src/objects.h (revision 1138) |
+++ src/objects.h (working copy) |
@@ -3131,16 +3131,18 @@ |
// to this method are not efficient unless the string is flat. |
inline uint16_t Get(StringShape shape, int index); |
- // Flatten the top level ConsString that is hiding behind this |
+ // Try to flatten the top level ConsString that is hiding behind this |
// string. This is a no-op unless the string is a ConsString or a |
// SlicedString. Flatten mutates the ConsString and might return a |
// failure. |
- Object* Flatten(StringShape shape); |
- // Try to flatten the string. Do not allow handling of allocation |
- // failures. After calling TryFlatten, the string could still be a |
- // ConsString. |
- inline void TryFlatten(StringShape shape); |
+ Object* TryFlatten(StringShape shape); |
+ // Try to flatten the string. Checks first inline to see if it is necessary. |
+ // Do not handle allocation failures. After calling TryFlattenIfNotFlat, the |
+ // string could still be a ConsString, in which case a failure is returned. |
+ // Use FlattenString from Handles.cc to be sure to flatten. |
+ inline Object* TryFlattenIfNotFlat(StringShape shape); |
+ |
Vector<const char> ToAsciiVector(); |
Vector<const uc16> ToUC16Vector(); |