Reviewers: Michael Starzinger,
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.
Please review this at http://codereview.chromium.org/10238005/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/objects.h
M src/objects.cc
A test/mjsunit/accessor-map-sharing.js
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev