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

Issue 3595013: Do not shortcut union of keys if lhs is empty. (Closed)

Created:
10 years, 2 months ago by antonm
Modified:
9 years, 4 months ago
Reviewers:
Kasper Lund
CC:
v8-dev, sebastian.morawietz_googlemail.com
Visibility:
Public.

Description

Do not shortcut union of keys if lhs is empty. The problem is other array may have holes, for example when fixed array comes from JSArray (in case of named interceptor). If that would prove to be a performance problem, we could pass an additional argument into UnionOfKeys to hold actual length. Committed: http://code.google.com/p/v8/source/detail?r=5591

Patch Set 1 #

Total comments: 11

Patch Set 2 : Addressing Kasper's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -4 lines) Patch
M src/handles.cc View 1 5 chunks +15 lines, -0 lines 0 comments Download
M src/objects.cc View 1 2 chunks +16 lines, -4 lines 0 comments Download
M test/cctest/test-api.cc View 1 1 chunk +28 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
antonm
Kasper, may you have a look?
10 years, 2 months ago (2010-10-05 12:26:28 UTC) #1
Kasper Lund
LGTM. http://codereview.chromium.org/3595013/diff/1/2 File src/handles.cc (right): http://codereview.chromium.org/3595013/diff/1/2#newcode638 src/handles.cc:638: static void CheckKeys(Handle<FixedArray> array) { Maybe turns this ...
10 years, 2 months ago (2010-10-05 12:39:12 UTC) #2
antonm
10 years, 2 months ago (2010-10-05 13:09:58 UTC) #3
Thanks a lot for review, Kasper.  Submitting.

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

http://codereview.chromium.org/3595013/diff/1/2#newcode638
src/handles.cc:638: static void CheckKeys(Handle<FixedArray> array) {
On 2010/10/05 12:39:12, Kasper Lund wrote:
> Maybe turns this into a function that returns a bool and call it like:
> 
>    ASSERT(ContainsOnlyValidKeys(array))
> 
> and let the implementation be valid in release mode too. Less ifdef'ing makes
me
> happy.

Done.  That requires USE for Release mode though

http://codereview.chromium.org/3595013/diff/1/3
File src/objects.cc (right):

http://codereview.chromium.org/3595013/diff/1/3#newcode3606
src/objects.cc:3606: // We cannot optimize if this is empty, as other my have
holes
On 2010/10/05 12:39:12, Kasper Lund wrote:
> Maybe quote 'this'. Maybe explain why 'this' cannot have holes.
> 
> my => may
> not keys => non keys?

Almost done.  I failed to find proper explanation why this shouldn't contain any
holes and just added another check, even though it is somewhat redundant.

http://codereview.chromium.org/3595013/diff/1/4
File test/cctest/test-api.cc (right):

http://codereview.chromium.org/3595013/diff/1/4#newcode11486
test/cctest/test-api.cc:11486: 
On 2010/10/05 12:39:12, Kasper Lund wrote:
> Two newlines between the functions definitions.

Sorry, all addressed, haven't done enough style adjustment to foreign code, mea
culpa.

Powered by Google App Engine
This is Rietveld 408576698