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

Issue 9466047: Handle CALLBACKS correctly in IsProperty functions. (Closed)

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

Description

Handle CALLBACKS correctly in IsProperty functions. With transitions in AccessorPairs, it is not enough to look at the PropertyType alone to decide whether we look at a property or not: For objects with JavaScript accessors, we have to look into the AccessorPair itself and see if one of its 2 parts is actually a JavaScript accessor. Therefore, a predicate with a PropertyType argument alone doesn't make sense anymore, we might need the associated value, too. Things are complicated by the fact that the holder in a LookupResult can be NULL, so we must be careful to retrieve its value only when it is really needed. To achieve the needed call-by-name semantics, a new Entry is introduced, which is basically a closure over a DescriptorArray and an index into this array (C++0x to the rescue!). GCC is clever enough to inline this class, so we pay no runtime penalty for this abstraction. It's all a bit ugly, but this is caused by the current structure of Descriptor, DescriptorArray and LookupResult: Things would be much easier if DescriptorArray were, well, an array of Descriptors, and LookupResult were a 'Maybe Descriptor' (in Haskell-terms). Committed: https://code.google.com/p/v8/source/detail?r=10847

Patch Set 1 #

Total comments: 2

Patch Set 2 : Incorporated review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+60 lines, -24 lines) Patch
M src/objects.h View 1 3 chunks +27 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/property.h View 2 chunks +31 lines, -3 lines 0 comments Download
M src/property-details.h View 1 chunk +0 lines, -20 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Sven Panne
8 years, 10 months ago (2012-02-27 10:46:09 UTC) #1
Kevin Millikin (Google)
http://codereview.chromium.org/9466047/diff/1/src/objects.h File src/objects.h (right): http://codereview.chromium.org/9466047/diff/1/src/objects.h#newcode2592 src/objects.h:2592: // An entry in a DescriptorArray, represented as a ...
8 years, 10 months ago (2012-02-27 15:24:19 UTC) #2
Sven Panne
8 years, 9 months ago (2012-02-28 07:19:13 UTC) #3
http://codereview.chromium.org/9466047/diff/1/src/objects.h
File src/objects.h (right):

http://codereview.chromium.org/9466047/diff/1/src/objects.h#newcode2592
src/objects.h:2592: // An entry in a DescriptorArray, represented as a closure.
On 2012/02/27 15:24:19, kmillikin wrote:
> I'd avoid the 'scary' term closure---it makes this sound more complicated than
> it is (and I don't want to think about which of the two member functions is
> application).
> 
> Just write that it's a pair of (array, index).  LGTM.

Done.

Powered by Google App Engine
This is Rietveld 408576698