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

Issue 9616016: Make the runtime entry for setting/changing accessors "atomic". (Closed)

Created:
8 years, 9 months ago by Sven Panne
Modified:
8 years, 9 months ago
Reviewers:
Michael Starzinger
CC:
v8-dev
Visibility:
Public.

Description

Make the runtime entry for setting/changing accessors "atomic". Previously, there were 1 or 2 calls to the runtime when accessors were changed or set. This doesn't really work well with property attributes, leading to some hacks and complicates things even further when trying to share maps in presence of accessors. Therefore, the runtime entry now takes the full triple (getter, setter, attributes), where the getter and/or the setter can be null in case they shouldn't be changed. For now, we do basically the same on the native side as we did before on the JavaScript side, but this will change in future CLs, the current CL is already large enough. Note that object literals with a getter and a setter for the same property still do 2 calls, but this is a little bit more tricky to fix and will be handled in a separate CL. Committed: https://code.google.com/p/v8/source/detail?r=10956

Patch Set 1 #

Patch Set 2 : Whitespace and comment fixes. #

Patch Set 3 : Rebased #

Total comments: 8

Patch Set 4 : Incorporated review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+124 lines, -110 lines) Patch
M src/arm/full-codegen-arm.cc View 1 chunk +9 lines, -5 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 chunk +7 lines, -4 lines 0 comments Download
M src/messages.js View 1 2 chunks +2 lines, -3 lines 0 comments Download
M src/mips/full-codegen-mips.cc View 1 chunk +9 lines, -5 lines 0 comments Download
M src/objects.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/regexp.js View 1 4 chunks +28 lines, -53 lines 0 comments Download
M src/runtime.cc View 1 2 3 5 chunks +54 lines, -23 lines 0 comments Download
M src/v8natives.js View 1 3 chunks +4 lines, -11 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 1 chunk +7 lines, -4 lines 0 comments Download
M test/mjsunit/object-define-property.js View 1 2 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Sven Panne
8 years, 9 months ago (2012-03-06 15:31:16 UTC) #1
Michael Starzinger
LGTM (if all comments addressed). https://chromiumcodereview.appspot.com/9616016/diff/4001/src/runtime.cc File src/runtime.cc (left): https://chromiumcodereview.appspot.com/9616016/diff/4001/src/runtime.cc#oldcode4324 src/runtime.cc:4324: Please leave this empty ...
8 years, 9 months ago (2012-03-07 12:49:14 UTC) #2
Sven Panne
8 years, 9 months ago (2012-03-07 13:23:32 UTC) #3
http://codereview.chromium.org/9616016/diff/4001/src/runtime.cc
File src/runtime.cc (left):

http://codereview.chromium.org/9616016/diff/4001/src/runtime.cc#oldcode4324
src/runtime.cc:4324: 
On 2012/03/07 12:49:14, Michael Starzinger wrote:
> Please leave this empty line in (or at least keep layout in sync with
> Runtime_DefineOrRedefineDataProperty). I cleaned it up a month ago.

Done.

http://codereview.chromium.org/9616016/diff/4001/src/runtime.cc
File src/runtime.cc (right):

http://codereview.chromium.org/9616016/diff/4001/src/runtime.cc#newcode4318
src/runtime.cc:4318: static bool IsValidAccessor(Object* obj) {
On 2012/03/07 12:49:14, Michael Starzinger wrote:
> Since this is only used as part of an assertion, I would prefer to have the
> condition inline instead of in a function.

As discussed offline, it's OK to keep this funtion, because RUNTIME_ASSERT uses
its argument even in release mode.

http://codereview.chromium.org/9616016/diff/4001/src/runtime.cc#newcode4334
src/runtime.cc:4334: CONVERT_ARG_HANDLE_CHECKED(String, name, 1);
On 2012/03/07 12:49:14, Michael Starzinger wrote:
> Is there a particular reason you handlified the name (and not the getter and
> setter)?

The Object class was missing an IsObject predicate, which I added, so we can
consistently use the CONVERT_ARG_HANDLE_CHECKED macro now.

http://codereview.chromium.org/9616016/diff/4001/src/runtime.cc#newcode4349
src/runtime.cc:4349: getter =
FixedArray::cast(array->elements())->get(GETTER_INDEX);
On 2012/03/07 12:49:14, Michael Starzinger wrote:
> I assume that this goes away once the above TODO is addressed? Then I am fine
> with this intermediate step.

Yes, this will vanish, it is just a temporary C++ re-write of the previous
corresponding JavaScript code.

Powered by Google App Engine
This is Rietveld 408576698