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

Issue 9428026: Cleaned up setting of accessors. (Closed)

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

Description

Cleaned up setting of accessors. This CL is an intermediate step only, in the end we need to have a single DefineOrRedefineAccessorProperty call for a single Object.defineProperty call. Currently we can end up making two such calls, making the necessary access checks extremely ugly and hard (impossible?) to get right for complete spec conformance. The bulk of the change is quite mechanical: * Prepare an AccessorPair *before* we add it to our data structures, eliminating the previous voodoo-like threading of a placeholder. * The previous item makes it possible to activate our check that we do not share AccessorPairs by accident. * Split a monster method into 2 quite unrelated methods. * Use templated To method in a few places. Committed: https://code.google.com/p/v8/source/detail?r=10788

Patch Set 1 #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+151 lines, -134 lines) Patch
M src/heap.cc View 1 chunk +1 line, -3 lines 0 comments Download
M src/objects.h View 2 chunks +17 lines, -2 lines 0 comments Download
M src/objects.cc View 11 chunks +133 lines, -129 lines 10 comments Download

Messages

Total messages: 6 (0 generated)
Sven Panne
8 years, 10 months ago (2012-02-22 09:03:10 UTC) #1
Michael Starzinger
LGTM. https://chromiumcodereview.appspot.com/9428026/diff/1/src/objects.cc File src/objects.cc (right): https://chromiumcodereview.appspot.com/9428026/diff/1/src/objects.cc#newcode4418 src/objects.cc:4418: return GetHeap()->undefined_value(); I prefer having the result of ...
8 years, 10 months ago (2012-02-22 10:24:38 UTC) #2
Sven Panne
https://chromiumcodereview.appspot.com/9428026/diff/1/src/objects.cc File src/objects.cc (right): https://chromiumcodereview.appspot.com/9428026/diff/1/src/objects.cc#newcode4418 src/objects.cc:4418: return GetHeap()->undefined_value(); On 2012/02/22 10:24:38, Michael Starzinger wrote: > ...
8 years, 10 months ago (2012-02-22 10:52:18 UTC) #3
fschneider
dbc: http://codereview.chromium.org/9428026/diff/1/src/objects.cc File src/objects.cc (right): http://codereview.chromium.org/9428026/diff/1/src/objects.cc#newcode4418 src/objects.cc:4418: return GetHeap()->undefined_value(); On 2012/02/22 10:52:18, Sven Panne wrote: ...
8 years, 10 months ago (2012-02-24 10:33:17 UTC) #4
Sven Panne
http://codereview.chromium.org/9428026/diff/1/src/objects.cc File src/objects.cc (right): http://codereview.chromium.org/9428026/diff/1/src/objects.cc#newcode4418 src/objects.cc:4418: return GetHeap()->undefined_value(); On 2012/02/24 10:33:17, fschneider wrote: > [...] ...
8 years, 10 months ago (2012-02-24 11:47:17 UTC) #5
Michael Starzinger
8 years, 10 months ago (2012-02-24 12:44:09 UTC) #6
https://chromiumcodereview.appspot.com/9428026/diff/1/src/objects.cc
File src/objects.cc (right):

https://chromiumcodereview.appspot.com/9428026/diff/1/src/objects.cc#newcode4418
src/objects.cc:4418: return GetHeap()->undefined_value();
On 2012/02/24 11:47:17, Sven Panne wrote:
> On 2012/02/24 10:33:17, fschneider wrote:
> > [...] I don't buy the conciseness argument. heap->undefined_value() results
in
> shorter lines.
> 
> It's not about shorter lines, it's all about having a smaller "mental context"
> one has to carry around in one's brain when  trying to understand code, and
> every local variable adds to this mental context. In the end it's all a
> judgement call...

Knowing that "heap" refers to the one and only heap object in the current
isolate is constant in my brain. So no additional pressure on my mental context
in this case. Having to read "GetHeap()" makes me start to wonder: "Hang on, it
needs the map to get the heap, is the map in a consistent state? How much does
it cost to take that indirection?", that's much more pressure on my mental
context.

Just my two cents.

Powered by Google App Engine
This is Rietveld 408576698