| Index: src/objects-inl.h
|
| ===================================================================
|
| --- src/objects-inl.h (revision 1138)
|
| +++ src/objects-inl.h (working copy)
|
| @@ -1431,13 +1431,14 @@
|
| }
|
|
|
|
|
| -void String::TryFlatten(StringShape shape) {
|
| +Object* String::TryFlattenIfNotFlat(StringShape shape) {
|
| ASSERT(shape.type() == StringShape(this).type());
|
| // We don't need to flatten strings that are already flat. Since this code
|
| // is inlined, it can be helpful in the flat case to not call out to Flatten.
|
| if (!IsFlat(shape)) {
|
| - Flatten(shape);
|
| + return TryFlatten(shape);
|
| }
|
| + return this;
|
| }
|
|
|
|
|
|
|