Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1046)

Issue 8889012: Avoid bailing out to runtime for short substrings. (Closed)

Created:
9 years ago by Yang
Modified:
9 years ago
Reviewers:
rossberg
CC:
v8-dev
Visibility:
Public.

Description

Avoid bailing out to runtime for short substrings. This significantly improves the speed for creating short substrings (less than 13 characters) from slices, flat cons strings and external strings. TEST=string-external-cached.js, string-slices.js Committed: http://code.google.com/p/v8/source/detail?r=10221

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+114 lines, -71 lines) Patch
M src/ia32/code-stubs-ia32.cc View 6 chunks +92 lines, -70 lines 2 comments Download
M test/mjsunit/string-external-cached.js View 2 chunks +5 lines, -1 line 0 comments Download
M test/mjsunit/string-slices.js View 1 chunk +17 lines, -0 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Yang
PTAL.
9 years ago (2011-12-08 14:27:14 UTC) #1
rossberg
9 years ago (2011-12-08 15:36:32 UTC) #2
lgtm

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

http://codereview.chromium.org/8889012/diff/1/src/ia32/code-stubs-ia32.cc#new...
src/ia32/code-stubs-ia32.cc:6102: __ cmp(ecx, 2);
Nit: could avoid the SmiUntag here and SmiTag later and just compare to
Smi::FromInt(2) directly here, and load Smi::FromInt(2) in line 6131, and cmp to
Smi::FromInt(SlicedString::kMinLength) in line 6182.

http://codereview.chromium.org/8889012/diff/1/src/ia32/code-stubs-ia32.cc#new...
src/ia32/code-stubs-ia32.cc:6151: // Cons string.  Check whether it is flat,
then fetch first part.
Nit: Maybe add comment about the flat cons invariant.

Powered by Google App Engine
This is Rietveld 408576698