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

Issue 669075: Fix a special case (zero length result array). (Closed)

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

Description

Fix a special case (zero length result array). Committed: http://code.google.com/p/v8/source/detail?r=4026

Patch Set 1 #

Total comments: 4

Patch Set 2 : Addressing Vitaly's concerns #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -2 lines) Patch
M src/builtins.cc View 3 chunks +15 lines, -2 lines 0 comments Download
M test/mjsunit/array-slice.js View 1 chunk +11 lines, -0 lines 0 comments Download
M test/mjsunit/array-splice.js View 1 1 chunk +11 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
antonm
10 years, 9 months ago (2010-03-04 18:28:52 UTC) #1
Vitaly Repeshko
LGTM. http://codereview.chromium.org/669075/diff/1/2 File src/builtins.cc (right): http://codereview.chromium.org/669075/diff/1/2#newcode258 src/builtins.cc:258: result_array->set_length(Smi::FromInt(0)); You could do result_array->SetContent(Heap::empty_fixed_array()) instead of these ...
10 years, 9 months ago (2010-03-04 18:36:57 UTC) #2
antonm
10 years, 9 months ago (2010-03-04 21:25:55 UTC) #3
Thanks, a lot, Vitaly.

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

http://codereview.chromium.org/669075/diff/1/2#newcode258
src/builtins.cc:258: result_array->set_length(Smi::FromInt(0));
On 2010/03/04 18:36:57, Vitaly wrote:
> You could do result_array->SetContent(Heap::empty_fixed_array()) instead of
> these two lines if performance is not too important here.

If you don't mind, I'd rather keep as is---not to make someone else to (falsely)
think it's an easy optimization spot.

http://codereview.chromium.org/669075/diff/1/4
File test/mjsunit/array-splice.js (right):

http://codereview.chromium.org/669075/diff/1/4#newcode45
test/mjsunit/array-splice.js:45: // Check various variants of empty array's
slicing.
On 2010/03/04 18:36:57, Vitaly wrote:
> splicing?

Thanks.  Done.

Powered by Google App Engine
This is Rietveld 408576698