http://codereview.chromium.org/7795018/diff/1/src/arm/code-stubs-arm.cc
File src/arm/code-stubs-arm.cc (right):

http://codereview.chromium.org/7795018/diff/1/src/arm/code-stubs-arm.cc#newcode5527
src/arm/code-stubs-arm.cc:5527: __ b(gt, &runtime);  // External strings
go to runtime.
On 2011/08/31 14:14:13, Erik Corry wrote:
Update comment to say that external and sliced strings go to runtime.

Note that (with FLAG_string_slices==true) this bailout only happens if
the string is shorter than SlicedString::kMinLength, and an external or
sliced string.

http://codereview.chromium.org/7795018/diff/1/src/arm/code-stubs-arm.cc#newcode5666
src/arm/code-stubs-arm.cc:5666: // Cons string.  Check whether it is
flat, then fetch first part.
On 2011/08/31 14:14:13, Erik Corry wrote:
How do we get here if it's a cons string?

A cons string's string representation bits has the kIsIndirectStringMask
set (both cons and slices are "indirect strings"), therefore it is not
bailed out to runtime, and further checked whether it has the
kSlicedNotConsMask bit set. Since that bit is not set, we do not jump to
sliced_string, but proceed with the part that handles cons strings.

http://codereview.chromium.org/7795018/diff/1/src/arm/code-stubs-arm.cc#newcode5675
src/arm/code-stubs-arm.cc:5675: // Sliced string.  Fetch parent and
correct start index by offset.
On 2011/08/31 14:14:13, Erik Corry wrote:
Do you have test coverage here?  I think we already bailed to runtime
in this
case.

We only bail out in the case when the original string is a slice if the
substring length is shorter than SlicedString::kMinLength. In that case
we do not create a slice, but create a seq string, to which we copy the
content.

If the substring length is longer or equal SlicedString::kMinLength and
FLAG_string_slices==true, then the code jumps to the label create_slice.


I added a cctest for slice of slice to check the string shapes.

http://codereview.chromium.org/7795018/

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to