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

Issue 6100005: Make better use of the %_FastAsciiArrayJoin function. (Closed)

Created:
9 years, 11 months ago by sandholm
Modified:
9 years, 7 months ago
Reviewers:
Lasse Reichstein
CC:
v8-dev
Visibility:
Public.

Description

Make better use of the %_FastAsciiArrayJoin function.

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 6

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -16 lines) Patch
M src/array.js View 1 2 1 chunk +27 lines, -16 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
sandholm
9 years, 11 months ago (2011-01-07 14:46:32 UTC) #1
Lasse Reichstein
LGTM. http://codereview.chromium.org/6100005/diff/2001/src/array.js File src/array.js (right): http://codereview.chromium.org/6100005/diff/2001/src/array.js#newcode148 src/array.js:148: if (!IS_UNDEFINED(e) || (i in array)) { If ...
9 years, 11 months ago (2011-01-07 14:58:57 UTC) #2
sandholm
9 years, 11 months ago (2011-01-08 12:49:52 UTC) #3
http://codereview.chromium.org/6100005/diff/2001/src/array.js
File src/array.js (right):

http://codereview.chromium.org/6100005/diff/2001/src/array.js#newcode148
src/array.js:148: if (!IS_UNDEFINED(e) || (i in array)) {
On 2011/01/07 14:58:58, Lasse Reichstein wrote:
> If all actually used convert functions convert undefined to the empty string,
> feel free to omit the (i in array) test, and document that convert isn't
called
> on undefined either.

Done.

http://codereview.chromium.org/6100005/diff/2001/src/array.js#newcode152
src/array.js:152: elements[i] = '';
On 2011/01/07 14:58:58, Lasse Reichstein wrote:
> Would it be slower to have a separate counter for inserts, and not insert
empty
> strings at all?
> (And remember to set the length at the end).
You need to know where the separator goes, hence a single counter wouldn't
suffice.

http://codereview.chromium.org/6100005/diff/2001/src/array.js#newcode164
src/array.js:164: }
On 2011/01/07 14:58:58, Lasse Reichstein wrote:
> If you run backwards, you could expand the array in-place, and not allocate a
> second array.
> If the array had twice the size from the start, you wouldn't even need to
expand
> it - but you would waste some memory in some cases.

Done.

Powered by Google App Engine
This is Rietveld 408576698