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

Issue 8352046: Refactor how elements are redefined by the runtime.

Created:
9 years, 2 months ago by Michael Starzinger
Modified:
9 years, 2 months ago
Reviewers:
danno
CC:
v8-dev
Visibility:
Public.

Description

Refactor how elements are redefined by the runtime. This is a refactoring change only. There is a bug in the current implementation of how the runtime redefines non-strict argument elements which will be fixed in a subsequent change. R=danno@chromium.org

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+179 lines, -16 lines) Patch
M src/elements.h View 2 chunks +13 lines, -0 lines 1 comment Download
M src/elements.cc View 6 chunks +162 lines, -2 lines 2 comments Download
M src/runtime.cc View 2 chunks +4 lines, -14 lines 0 comments Download

Messages

Total messages: 1 (0 generated)
danno
9 years, 2 months ago (2011-10-24 21:09:02 UTC) #1
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.

Powered by Google App Engine
This is Rietveld 408576698