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

Issue 1036002: More generic version of Array.concat builtin. (Closed)

Created:
10 years, 9 months ago by antonm
Modified:
9 years, 4 months ago
CC:
v8-dev
Visibility:
Public.

Description

More generic version of Array.concat builtin. Committed: http://code.google.com/p/v8/source/detail?r=4151

Patch Set 1 #

Total comments: 4

Patch Set 2 : Lasses' comments #

Patch Set 3 : USE to make compiler happy #

Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -28 lines) Patch
M src/builtins.cc View 1 2 2 chunks +31 lines, -26 lines 0 comments Download
M src/v8-counters.h View 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
antonm
Lasse, Mads, here comes promised more generic version of Array.concat. Lasse, this patch should obsolete ...
10 years, 9 months ago (2010-03-16 04:20:52 UTC) #1
Lasse Reichstein
LGTM, and I'll ignore the other CL. http://codereview.chromium.org/1036002/diff/1/2 File src/builtins.cc (right): http://codereview.chromium.org/1036002/diff/1/2#newcode748 src/builtins.cc:748: result_len += ...
10 years, 9 months ago (2010-03-16 09:50:14 UTC) #2
Lasse Reichstein
Bonus comment. http://codereview.chromium.org/1036002/diff/1/2 File src/builtins.cc (right): http://codereview.chromium.org/1036002/diff/1/2#newcode741 src/builtins.cc:741: FixedArray* elms = NULL; elms isn't used ...
10 years, 9 months ago (2010-03-16 10:33:30 UTC) #3
antonm
10 years, 9 months ago (2010-03-16 10:51:23 UTC) #4
Thanks a lot for review, Lasse.

Running throw the tests and submitting.

http://codereview.chromium.org/1036002/diff/1/2
File src/builtins.cc (right):

http://codereview.chromium.org/1036002/diff/1/2#newcode741
src/builtins.cc:741: FixedArray* elms = NULL;
On 2010/03/16 10:33:30, Lasse Reichstein wrote:
> elms isn't used anywhere, so the function with side-effect is wasted here.
> Wouldn't it be simpler to just check manually:
>  if(!arg->IsJSArray() || !JSArray::cast(arg)->HasFastElements()) {
> 

Sure.

http://codereview.chromium.org/1036002/diff/1/2#newcode748
src/builtins.cc:748: result_len += len;
On 2010/03/16 09:50:14, Lasse Reichstein wrote:
> Might want comment stating why this can't overflow: (FixedArray::kMaxLength <
> (max positive int / 2)), so being <= kMaxLength means that adding another
> array's length won't overflow.

Done.  And static assert added.

Powered by Google App Engine
This is Rietveld 408576698