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

Issue 669156: Removed dangerous Factory::NewUninitializedFixedArray. (Closed)

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

Description

Removed dangerous Factory::NewUninitializedFixedArray. This was used in runtime StringToArray function which I simplified keeping its performance for ascii strings. Committed: http://code.google.com/p/v8/source/detail?r=4035

Patch Set 1 #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+32 lines, -31 lines) Patch
M src/factory.h View 1 chunk +0 lines, -4 lines 0 comments Download
M src/factory.cc View 1 chunk +0 lines, -6 lines 0 comments Download
M src/runtime.cc View 2 chunks +32 lines, -21 lines 8 comments Download

Messages

Total messages: 4 (0 generated)
Vitaly Repeshko
10 years, 9 months ago (2010-03-05 12:13:04 UTC) #1
Mads Ager (chromium)
LGTM, thanks! http://codereview.chromium.org/669156/diff/1/4 File src/runtime.cc (right): http://codereview.chromium.org/669156/diff/1/4#newcode4263 src/runtime.cc:4263: FixedArray* raw_elements = FixedArray::cast(obj); Let's put elements ...
10 years, 9 months ago (2010-03-05 12:17:16 UTC) #2
antonm
LGTM http://codereview.chromium.org/669156/diff/1/4 File src/runtime.cc (right): http://codereview.chromium.org/669156/diff/1/4#newcode4234 src/runtime.cc:4234: if (i < length) { maybe lift this ...
10 years, 9 months ago (2010-03-05 12:18:05 UTC) #3
Vitaly Repeshko
10 years, 9 months ago (2010-03-05 12:32:10 UTC) #4
Thanks for review!
Anton, thanks for spotting this!

This is now submitted.


-- Vitaly

http://codereview.chromium.org/669156/diff/1/4
File src/runtime.cc (right):

http://codereview.chromium.org/669156/diff/1/4#newcode4234
src/runtime.cc:4234: if (i < length) {
On 2010/03/05 12:18:05, antonm wrote:
> maybe lift this filling into the loop itself:
> 
> if (value == undefined) {
>   // fill the rest of array
>   return
> }
> 
> ?

I'd like to keep the fast loop as simple as possible to avoid confusing the poor
compiler.

http://codereview.chromium.org/669156/diff/1/4#newcode4236
src/runtime.cc:4236: memset(elements->data_start() + i, 0, length - i);
On 2010/03/05 12:18:05, antonm wrote:
> not insisting, but something like Smi::FromInt(0) == 0 might be helpful for
next
> generations.

Done.

http://codereview.chromium.org/669156/diff/1/4#newcode4261
src/runtime.cc:4261: Object* obj =
Heap::AllocateUninitializedFixedArray(length);
On 2010/03/05 12:18:05, antonm wrote:
> maybe add a comment that uninitialized array will never leak into GC?

Done.

http://codereview.chromium.org/669156/diff/1/4#newcode4263
src/runtime.cc:4263: FixedArray* raw_elements = FixedArray::cast(obj);
On 2010/03/05 12:17:16, Mads Ager wrote:
> Let's put elements in a handle right away here and pass *elements to
> CopyCachedAsciiCharsToArray.

Done.

Powered by Google App Engine
This is Rietveld 408576698