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

Issue 2087009: Custom call IC-s for String.prototype.{charAt,charCodeAt}. (Closed)

Created:
10 years, 7 months ago by Vitaly Repeshko
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Custom call IC-s for String.prototype.{charAt,charCodeAt}. These string methods can be composed from two basic blocks: charCodeAt and fromCharCode, both of which have fast cases for certain types of inputs. In this patch these two blocks are refactored to allow generating the fast cases without having to jump around the slow cases. In the slow cases since they can now be invoked both from inline runtime functions and from IC stubs we either have to save/restore state of the current frame or enter/leave a new internal frame. This is handled by new RuntimeCallHelper interface. Its implementation for virtual frame is based on FrameRegisterState class extracted from DeferredCode class. Committed: http://code.google.com/p/v8/source/detail?r=4733

Patch Set 1 #

Total comments: 6

Patch Set 2 : Review fixes. Full codegen. #

Patch Set 3 : Initial x64 port. Bug fixes. #

Patch Set 4 : ARM port. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+2249 lines, -1069 lines) Patch
M src/arm/codegen-arm.h View 2 chunks +5 lines, -34 lines 0 comments Download
M src/arm/codegen-arm.cc View 6 chunks +375 lines, -138 lines 0 comments Download
M src/arm/full-codegen-arm.cc View 2 chunks +102 lines, -101 lines 0 comments Download
M src/arm/ic-arm.cc View 1 chunk +20 lines, -51 lines 0 comments Download
M src/arm/stub-cache-arm.cc View 1 chunk +20 lines, -0 lines 0 comments Download
M src/codegen.h View 1 2 5 chunks +250 lines, -18 lines 1 comment Download
M src/full-codegen.h View 1 chunk +3 lines, -2 lines 0 comments Download
M src/full-codegen.cc View 1 chunk +72 lines, -0 lines 0 comments Download
M src/ia32/codegen-ia32.h View 1 2 3 chunks +7 lines, -33 lines 0 comments Download
M src/ia32/codegen-ia32.cc View 1 2 7 chunks +367 lines, -146 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 2 3 2 chunks +100 lines, -100 lines 0 comments Download
M src/ia32/ic-ia32.cc View 1 2 1 chunk +18 lines, -49 lines 0 comments Download
M src/ia32/stub-cache-ia32.cc View 1 2 1 chunk +134 lines, -0 lines 0 comments Download
M src/ia32/virtual-frame-ia32.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/jump-target-heavy.cc View 2 chunks +16 lines, -13 lines 0 comments Download
M src/jump-target-light.cc View 1 chunk +9 lines, -1 line 0 comments Download
M src/objects.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/string.js View 5 chunks +12 lines, -27 lines 0 comments Download
M src/stub-cache.h View 1 chunk +5 lines, -3 lines 0 comments Download
M src/x64/codegen-x64.h View 2 chunks +5 lines, -34 lines 0 comments Download
M src/x64/codegen-x64.cc View 7 chunks +367 lines, -148 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 3 2 chunks +99 lines, -95 lines 0 comments Download
M src/x64/ic-x64.cc View 1 chunk +17 lines, -50 lines 0 comments Download
M src/x64/stub-cache-x64.cc View 1 chunk +19 lines, -0 lines 0 comments Download
M src/x64/virtual-frame-x64.h View 1 chunk +1 line, -1 line 0 comments Download
M test/mjsunit/string-charat.js View 1 2 2 chunks +201 lines, -23 lines 0 comments Download
M test/mjsunit/string-index.js View 2 chunks +23 lines, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
Vitaly Repeshko
Mads, This patch has to be implemented for all architectures, but I only covered the ...
10 years, 7 months ago (2010-05-17 11:57:45 UTC) #1
Mads Ager (chromium)
http://codereview.chromium.org/2087009/diff/1/3 File src/ia32/codegen-ia32.cc (right): http://codereview.chromium.org/2087009/diff/1/3#newcode6133 src/ia32/codegen-ia32.cc:6133: deferred->fast_case_generator()->GenerateFast(masm_); It seems backwards to me that the deferred ...
10 years, 7 months ago (2010-05-18 11:00:12 UTC) #2
Vitaly Repeshko
Addressed the first round of comments. Also updated ia32 full codegen to support the new ...
10 years, 7 months ago (2010-05-19 14:51:22 UTC) #3
Mads Ager (chromium)
LGTM
10 years, 7 months ago (2010-05-20 10:31:30 UTC) #4
Vitaly Repeshko
On 2010/05/20 10:31:30, Mads Ager wrote: > LGTM I ported the generators and inline runtime ...
10 years, 7 months ago (2010-05-25 14:03:42 UTC) #5
Vitaly Repeshko
On 2010/05/25 14:03:42, Vitaly wrote: > On 2010/05/20 10:31:30, Mads Ager wrote: > > LGTM ...
10 years, 7 months ago (2010-05-26 00:38:26 UTC) #6
Mads Ager (chromium)
10 years, 7 months ago (2010-05-26 09:17:07 UTC) #7
LGTM

http://codereview.chromium.org/2087009/diff/16001/17006
File src/codegen.h (right):

http://codereview.chromium.org/2087009/diff/16001/17006#newcode691
src/codegen.h:691: enum StringIndexFlags {
How about renaming these to something like:

INDEX_IS_NUMBER
INDEX_IS_ARRAY_INDEX

I think that makes it easier to read at the call site. 

I would also like the comments on the generators to say how the code generated
depends on these flags.

Powered by Google App Engine
This is Rietveld 408576698