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

Issue 10238005: Use map transitions when defining accessor properties. (Closed)

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

Description

Use map transitions when defining accessor properties. AccessorPairs can now contain map transitions, which is similar to our current handling of CONSTANT_FUNCTION/CONSTANT_TRANSITION, but generalized to a pair for holding info about the getter and the setter. This way we can achieve map sharing for objects with accessor properties, which is a prerequisite for making them fast via inlining. We fall back to the previous way of handling accessor properties when sharing is not possible or we don't handle a special case. Note: When an exisiting accessor property is redefined we could in principle move the AccessorPair out of the descriptor into the object itself (again just like the way we do something similar for CONSTANT_FUNCTION/CONSTANT_TRANSITION), but this would require a new property kind for holding a pair of values. Perhaps we can implement this later, but for now this hopefully rare case is handled like before, losing map sharing and potentially creating more maps than strictly necessary. Committed: https://code.google.com/p/v8/source/detail?r=11496

Patch Set 1 #

Total comments: 10

Patch Set 2 : Addressed comments #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+375 lines, -4 lines) Patch
M src/objects.h View 1 3 chunks +22 lines, -1 line 0 comments Download
M src/objects.cc View 1 4 chunks +177 lines, -3 lines 1 comment Download
A test/mjsunit/accessor-map-sharing.js View 1 chunk +176 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Sven Panne
8 years, 8 months ago (2012-04-26 12:19:00 UTC) #1
Michael Starzinger
First round. A few nits and one real comment. https://chromiumcodereview.appspot.com/10238005/diff/1/src/objects.cc File src/objects.cc (right): https://chromiumcodereview.appspot.com/10238005/diff/1/src/objects.cc#newcode4436 src/objects.cc:4436: ...
8 years, 7 months ago (2012-05-02 13:30:14 UTC) #2
Sven Panne
Comments addressed, new CL uploaded... https://chromiumcodereview.appspot.com/10238005/diff/1/src/objects.cc File src/objects.cc (right): https://chromiumcodereview.appspot.com/10238005/diff/1/src/objects.cc#newcode4436 src/objects.cc:4436: MaybeObject* getterOk = GetHeap()->undefined_value(); ...
8 years, 7 months ago (2012-05-03 09:39:02 UTC) #3
Michael Starzinger
LGTM (with once comment). https://chromiumcodereview.appspot.com/10238005/diff/5002/src/objects.cc File src/objects.cc (right): https://chromiumcodereview.appspot.com/10238005/diff/5002/src/objects.cc#newcode4420 src/objects.cc:4420: // accessors, not for the ...
8 years, 7 months ago (2012-05-03 12:23:34 UTC) #4
Erik Corry
This change regressed the context create benchmark 25% and increased the memory use. It would ...
8 years, 7 months ago (2012-05-07 10:52:13 UTC) #5
Michael Starzinger
8 years, 7 months ago (2012-05-08 12:47:59 UTC) #6
On 2012/05/07 10:52:13, Erik Corry wrote:
> This change regressed the context create benchmark 25% and increased the
memory
> use.  It would be nice to understand both issues.

Ouch, probably both related to what's serialized into the snapshot I guess.
Unfortunately Sven is on leave and I'm unsure when he will return.

Powered by Google App Engine
This is Rietveld 408576698