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

Issue 954001: Add Array.concat builtin for the most common case. (Closed)

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

Description

Add Array.concat builtin for the most common case. Committed: http://code.google.com/p/v8/source/detail?r=4129

Patch Set 1 #

Patch Set 2 : Adding counters #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -1 line) Patch
M src/array.js View 1 1 chunk +1 line, -1 line 0 comments Download
M src/builtins.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/builtins.cc View 1 1 chunk +57 lines, -0 lines 6 comments Download
M src/runtime.cc View 1 chunk +1 line, -0 lines 0 comments Download
M src/v8-counters.h View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
antonm
Lasse, Mads, may you have a look? I am aware of ArrayConcat in runtime, but ...
10 years, 9 months ago (2010-03-15 07:53:11 UTC) #1
Mads Ager (chromium)
LGTM
10 years, 9 months ago (2010-03-15 08:17:00 UTC) #2
Lasse Reichstein
LGTM http://codereview.chromium.org/954001/diff/4001/5002 File src/builtins.cc (right): http://codereview.chromium.org/954001/diff/4001/5002#newcode742 src/builtins.cc:742: if (!IsJSArrayWithFastElements(receiver_obj, &receiver_elms) I personally don't like test ...
10 years, 9 months ago (2010-03-15 11:45:41 UTC) #3
antonm
10 years, 9 months ago (2010-03-15 14:53:11 UTC) #4
Lasse, sorry, I've submitted the CL already.  Sending another CL to you.

http://codereview.chromium.org/954001/diff/4001/5002
File src/builtins.cc (right):

http://codereview.chromium.org/954001/diff/4001/5002#newcode742
src/builtins.cc:742: if (!IsJSArrayWithFastElements(receiver_obj,
&receiver_elms)
On 2010/03/15 11:45:41, Lasse Reichstein wrote:
> I personally don't like test functions with side effects. Could you just do
the
> assignments after the if-statement instead?
> 

It used to save some cycles, at least in previous versions.  If you like, I can
run another experiment to see how much (if anything) does it buy us now.

http://codereview.chromium.org/954001/diff/4001/5002#newcode755
src/builtins.cc:755: ASSERT(receiver_len <= (Smi::kMaxValue - arg_len));
On 2010/03/15 11:45:41, Lasse Reichstein wrote:
> Maybe comment that this assertion holds because both arrays have fast elements
> (possibly rewriting it in terms of FixedArray::kMaxLength).

Done

http://codereview.chromium.org/954001/diff/4001/5002#newcode758
src/builtins.cc:758: if (result_len > FixedArray::kMaxSize) {
On 2010/03/15 11:45:41, Lasse Reichstein wrote:
> FixedArray::kMaxLength (length is in elements, size is in bytes).

Oh yes, thanks a lot for spotting this.

Powered by Google App Engine
This is Rietveld 408576698