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

Issue 5122005: Add a fast case to Array.join when all the elements and the separator are fla... (Closed)

Created:
10 years, 1 month ago by William Hesse
Modified:
9 years, 7 months ago
Reviewers:
Lasse Reichstein
CC:
v8-dev
Visibility:
Public.

Description

Add a fast case to Array.join when all the elements and the separator are flat ascii strings. Committed: http://code.google.com/p/v8/source/detail?r=5860

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 30

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+471 lines, -1 line) Patch
M src/arm/codegen-arm.h View 4 1 chunk +1 line, -0 lines 0 comments Download
M src/arm/codegen-arm.cc View 4 1 chunk +9 lines, -0 lines 0 comments Download
M src/arm/full-codegen-arm.cc View 4 1 chunk +7 lines, -0 lines 0 comments Download
M src/array.js View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M src/ia32/codegen-ia32.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M src/ia32/codegen-ia32.cc View 1 2 3 4 1 chunk +184 lines, -0 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 2 3 4 1 chunk +184 lines, -0 lines 0 comments Download
M src/ia32/macro-assembler-ia32.h View 4 1 chunk +17 lines, -0 lines 0 comments Download
M src/ia32/macro-assembler-ia32.cc View 4 1 chunk +51 lines, -0 lines 0 comments Download
M src/runtime.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M src/x64/codegen-x64.h View 4 1 chunk +1 line, -0 lines 0 comments Download
M src/x64/codegen-x64.cc View 4 1 chunk +5 lines, -0 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 4 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
William Hesse
The code in full-codegen and in codegen is identical, except for the start and end. ...
10 years, 1 month ago (2010-11-18 11:36:02 UTC) #1
Lasse Reichstein
LGTM. Definitly factor out identical loops. They do the same operation: Add a sequential ASCII ...
10 years, 1 month ago (2010-11-18 13:26:54 UTC) #2
William Hesse
Most changes made. Works on all platforms now. http://codereview.chromium.org/5122005/diff/11001/src/ia32/codegen-ia32.cc File src/ia32/codegen-ia32.cc (right): http://codereview.chromium.org/5122005/diff/11001/src/ia32/codegen-ia32.cc#newcode6682 src/ia32/codegen-ia32.cc:6682: __ ...
10 years, 1 month ago (2010-11-18 17:13:03 UTC) #3
Lasse Reichstein
http://codereview.chromium.org/5122005/diff/11001/src/ia32/codegen-ia32.cc File src/ia32/codegen-ia32.cc (right): http://codereview.chromium.org/5122005/diff/11001/src/ia32/codegen-ia32.cc#newcode6703 src/ia32/codegen-ia32.cc:6703: __ mov(array_length, scratch); But they are not equivalent. I ...
10 years, 1 month ago (2010-11-18 17:49:09 UTC) #4
Lasse Reichstein
10 years, 1 month ago (2010-11-18 17:54:17 UTC) #5
William Hesse
10 years, 1 month ago (2010-11-19 08:53:43 UTC) #6
http://codereview.chromium.org/5122005/diff/11001/src/ia32/codegen-ia32.cc
File src/ia32/codegen-ia32.cc (right):

http://codereview.chromium.org/5122005/diff/11001/src/ia32/codegen-ia32.cc#ne...
src/ia32/codegen-ia32.cc:6703: __ mov(array_length, scratch);
That is if you are reading it with a plan to change it or improve it, in which
case you should be aware of the register shortage, and the need to put specific
things in registers.

But this can be changed when it is rewritten with a separate checking and
counting loop, an allocation, and a copying loop.  Taking the allocation out of
the loops frees up a lot of variables.

On 2010/11/18 17:49:09, Lasse Reichstein wrote:
> But they are not equivalent. I was about to suggest that you used array_length
> in the calculations above, instead of using scratch and then moving scratch to
> array_length ... until I realized that array_length was an Operand.
> 
> Reading what's written doesn't need distinguishing, but understanding why it's
> written as it is, does.

http://codereview.chromium.org/5122005/diff/11001/src/ia32/codegen-ia32.cc#ne...
src/ia32/codegen-ia32.cc:6769: __ jmp(&copy_loop_1_entry);
On 2010/11/18 17:49:09, Lasse Reichstein wrote:
> You wouldn't need the entry label then, so the label count is the same.
> Go for optimal! Great isn't good enough! :)

Done.

Powered by Google App Engine
This is Rietveld 408576698