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

Issue 10388047: Implement correct checking for inherited readonliness on assignment. (Closed)

Created:
8 years, 7 months ago by rossberg
Modified:
8 years, 6 months ago
Reviewers:
Michael Starzinger
CC:
v8-dev
Visibility:
Public.

Description

Implement correct checking for inherited readonliness on assignment. Removes 6 out of 8 of our remaining unintentional failures on test262. Also fixes treatment of inherited setters added after the fact. Specifically: - In the runtime, when looking for setter callbacks in the prototype chain, also look for read-only properties. If one is found, reject (exception in strict mode). If a proxy is found, invoke proper trap. Note: this folds in the CanPut function from the spec and avoids an extra lookup over the prototype chain. - In generated code for stores, insert a test for the maps from the prototype chain, but only up to the object where the property already exists (which may be the object itself). In Hydrogen, if the found property is read-only or not cacheable (e.g. a proxy), bail out; in a stub, generate an unconditional miss (to get an exception in strict mode). - Add test cases and adapt existing test expectations. R=mstarzinger@chromium.org BUG= TEST= Committed: https://code.google.com/p/v8/source/detail?r=11694

Patch Set 1 #

Patch Set 2 : Ported to x64 & ARM. #

Total comments: 21

Patch Set 3 : Addressed Michael's comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+640 lines, -232 lines) Patch
M src/arm/stub-cache-arm.cc View 1 5 chunks +59 lines, -9 lines 0 comments Download
M src/hydrogen.cc View 1 2 6 chunks +36 lines, -8 lines 0 comments Download
M src/ia32/stub-cache-ia32.cc View 1 6 chunks +59 lines, -11 lines 0 comments Download
M src/objects.h View 1 2 3 chunks +14 lines, -13 lines 0 comments Download
M src/objects.cc View 1 2 9 chunks +134 lines, -132 lines 0 comments Download
M src/stub-cache.h View 2 chunks +11 lines, -8 lines 0 comments Download
M src/x64/stub-cache-x64.cc View 1 6 chunks +59 lines, -10 lines 0 comments Download
M test/cctest/test-api.cc View 4 chunks +10 lines, -9 lines 0 comments Download
M test/mjsunit/harmony/proxies.js View 3 chunks +21 lines, -11 lines 0 comments Download
M test/mjsunit/override-read-only-property.js View 1 chunk +4 lines, -4 lines 0 comments Download
A test/mjsunit/readonly.js View 1 chunk +228 lines, -0 lines 0 comments Download
M test/mjsunit/regress/regress-1199637.js View 2 chunks +1 line, -3 lines 0 comments Download
M test/mjsunit/regress/regress-334.js View 1 chunk +2 lines, -1 line 0 comments Download
M test/mjsunit/with-readonly.js View 1 chunk +2 lines, -2 lines 0 comments Download
M test/test262/test262.status View 1 chunk +0 lines, -11 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
rossberg
8 years, 7 months ago (2012-05-09 13:15:04 UTC) #1
Michael Starzinger
In general this LGTM. Only a few nits to address. https://chromiumcodereview.appspot.com/10388047/diff/1015/src/hydrogen.cc File src/hydrogen.cc (right): https://chromiumcodereview.appspot.com/10388047/diff/1015/src/hydrogen.cc#newcode4278 ...
8 years, 6 months ago (2012-05-30 13:08:55 UTC) #2
rossberg
PTAL. https://chromiumcodereview.appspot.com/10388047/diff/1015/src/hydrogen.cc File src/hydrogen.cc (right): https://chromiumcodereview.appspot.com/10388047/diff/1015/src/hydrogen.cc#newcode4278 src/hydrogen.cc:4278: CHECK_ALIVE({}); On 2012/05/30 13:08:55, Michael Starzinger wrote: > ...
8 years, 6 months ago (2012-05-31 13:31:27 UTC) #3
Michael Starzinger
LGTM. https://chromiumcodereview.appspot.com/10388047/diff/1015/src/objects.cc File src/objects.cc (right): https://chromiumcodereview.appspot.com/10388047/diff/1015/src/objects.cc#newcode2051 src/objects.cc:2051: void JSObject::LookupCallbackSetterInPrototypes(String* name, On 2012/05/31 13:31:28, rossberg wrote: ...
8 years, 6 months ago (2012-06-01 08:34:04 UTC) #4
rossberg
8 years, 6 months ago (2012-06-01 09:42:47 UTC) #5
https://chromiumcodereview.appspot.com/10388047/diff/1015/test/mjsunit/regres...
File test/mjsunit/regress/regress-334.js (right):

https://chromiumcodereview.appspot.com/10388047/diff/1015/test/mjsunit/regres...
test/mjsunit/regress/regress-334.js:50: print(i);
On 2012/06/01 08:34:04, Michael Starzinger wrote:
> On 2012/05/30 13:08:55, Michael Starzinger wrote:
> > Can we remove this debugging code again.
> 
> I think you missed that one.

Indeed, thanks!

Powered by Google App Engine
This is Rietveld 408576698