I think the idea of adding Set to the accessors is great, but I think the exact
mechanics of the methods in the accessor subclasses need a bit more work.


http://codereview.chromium.org/8352046/diff/1/src/elements.cc
File src/elements.cc (right):

http://codereview.chromium.org/8352046/diff/1/src/elements.cc#newcode97
src/elements.cc:97: PropertyAttributes attributes) = 0;
Use CRTP here. The virtual Set method should call the static Set method
that is specialized by the subclasses.

http://codereview.chromium.org/8352046/diff/1/src/elements.cc#newcode99
src/elements.cc:99: virtual MaybeObject* SetInternal(FixedArrayBase*
backing_store,
Can you get away with a single Set wrapper in the common base class that
handles setting elements based on the return result of SetInternal, and
only have a single method that needs to be implemented in subclasses?

http://codereview.chromium.org/8352046/diff/1/src/elements.h
File src/elements.h (right):

http://codereview.chromium.org/8352046/diff/1/src/elements.h#newcode94
src/elements.h:94: // is responsible for updating the object reference
to the backing store.
The separation of responsibility seems clear in the comment, but it
would suggest to me that Set is exactly that caller that updates the
object reference to the backing store and not much more. It would be
great if each template subclass only had to implement a single
specialized CRTP method.

http://codereview.chromium.org/8352046/

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to