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

Issue 9152001: Introduce a new AccessorPair type for handling JavaScript accessors. (Closed)

Created:
8 years, 11 months ago by Sven Panne
Modified:
8 years, 11 months ago
CC:
v8-dev
Visibility:
Public.

Description

Introduce a new AccessorPair type for handling JavaScript accessors. Using a seaparate type for this instead of a 2-element FixedArray has some advantages: First of all AccessorPair is one word smaller, which is not much, but anyway. The real advantage of this change is that we get a better typing internally, making it much easier to find and modify all the places having to do with JavaScript accessors. This change is part of a series introducing map sharing for objects with JavaScript accessors. More to come...

Patch Set 1 #

Patch Set 2 : Rebased #

Total comments: 10

Patch Set 3 : Incorporated review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+177 lines, -105 lines) Patch
M include/v8.h View 1 chunk +1 line, -1 line 0 comments Download
M src/bootstrapper.cc View 6 chunks +21 lines, -21 lines 0 comments Download
M src/factory.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M src/factory.cc View 1 chunk +7 lines, -0 lines 0 comments Download
M src/heap.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M src/heap.cc View 1 chunk +13 lines, -0 lines 0 comments Download
M src/objects.h View 1 6 chunks +33 lines, -5 lines 0 comments Download
M src/objects.cc View 1 2 12 chunks +33 lines, -34 lines 0 comments Download
M src/objects-debug.cc View 1 chunk +7 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 chunk +3 lines, -0 lines 0 comments Download
M src/objects-printer.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M src/profile-generator.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M src/runtime.cc View 3 chunks +11 lines, -11 lines 0 comments Download
M tools/grokdump.py View 2 chunks +30 lines, -29 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Sven Panne
8 years, 11 months ago (2012-01-10 07:28:46 UTC) #1
Kevin Millikin (Chromium)
LGTM. My concern is that the names AccessorPair and AccessorInfo are too similar and it's ...
8 years, 11 months ago (2012-01-10 08:57:29 UTC) #2
Sven Panne
8 years, 11 months ago (2012-01-10 09:45:03 UTC) #3
http://codereview.chromium.org/9152001/diff/1001/src/factory.h
File src/factory.h (right):

http://codereview.chromium.org/9152001/diff/1001/src/factory.h#newcode72
src/factory.h:72: Handle<AccessorPair> NewAccessorPair();
On 2012/01/10 08:57:30, Kevin Millikin wrote:
> Maybe a comment here and also in heap.h about why these are always pretenured
> (I'm not sure why they are).
> 
> I'm also not sure why we pretenure all structs.  It's not obviously best.

Done.

http://codereview.chromium.org/9152001/diff/1001/src/heap.h
File src/heap.h (right):

http://codereview.chromium.org/9152001/diff/1001/src/heap.h#newcode619
src/heap.h:619: MaybeObject* AllocateAccessorPair();
On 2012/01/10 08:57:30, Kevin Millikin wrote:
> MUST_USE_RESULT to warn if a developer does not check for allocation failure.

Done.

http://codereview.chromium.org/9152001/diff/1001/src/objects.cc
File src/objects.cc (right):

http://codereview.chromium.org/9152001/diff/1001/src/objects.cc#newcode4611
src/objects.cc:4611: if (!maybe_accessors->To<Object>(&accessors)) return
maybe_accessors;
On 2012/01/10 08:57:30, Kevin Millikin wrote:
> Huh.  Maybe we should get rid of MaybeObject::ToObject since it is the same
> implementation (minus the Object::cast) as MaybeObject::To<Object>.  Or else
> continue using ToObject.

IMHO ToObject should be on death row... >:-) The templated version is much more
useful, so we can remove ToObject in a separate CL.

http://codereview.chromium.org/9152001/diff/1001/src/objects.cc#newcode4736
src/objects.cc:4736: AccessorPair *accessors = AccessorPair::cast(element);
On 2012/01/10 08:57:30, Kevin Millikin wrote:
> Misplaced *.

Done.

http://codereview.chromium.org/9152001/diff/1001/src/objects.cc#newcode4754
src/objects.cc:4754: AccessorPair *accessors = AccessorPair::cast(obj);
On 2012/01/10 08:57:30, Kevin Millikin wrote:
> Misplaced *.

Done.

Powered by Google App Engine
This is Rietveld 408576698