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

Issue 2108203002: Implement immutable prototype chains (Closed)

Created:
4 years, 5 months ago by Dan Ehrenberg
Modified:
4 years, 5 months ago
CC:
Paweł Hajdan Jr., v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Implement immutable prototype chains This patch implements "immutable prototype exotic objects" from the ECMAScript spec, which are objects whose __proto__ cannot be changed, but are not otherwise frozen. They are introduced in order to prevent a Proxy from being introduced to the prototype chain of the global object. The API is extended by a SetImmutablePrototype() call in ObjectTemplate, which can be used to vend new immutable prototype objects. Additionally, Object.prototype is an immutable prototype object. In the implementation, a new bit is added to Maps to say whether the prototype is immutable, which is read by SetPrototype. Map transitions to the immutable prototype state are not saved in the transition tree because the main use case is just for the prototype chain of the global object, which there will be only one of per Context, so no need to take up the extra word for a pointer in each full transition tree. BUG=v8:5149 Committed: https://crrev.com/0ff7b4830c82b9e6a9f14d375b05ee64009e1d01 Cr-Commit-Position: refs/heads/master@{#37482}

Patch Set 1 #

Patch Set 2 : Various fixes #

Patch Set 3 : fix typo #

Patch Set 4 : fix test expectations #

Patch Set 5 : simplify #

Total comments: 9

Patch Set 6 : changes from review #

Patch Set 7 : internal field count is an int, not a bool #

Patch Set 8 : Add another DCHECK #

Patch Set 9 : reverse bitfield arguments #

Total comments: 2

Patch Set 10 : IsImmutableProto #

Unified diffs Side-by-side diffs Delta from patch set Stats (+152 lines, -27 lines) Patch
M include/v8.h View 1 2 3 4 5 6 7 8 9 1 chunk +11 lines, -0 lines 0 comments Download
M src/api.cc View 1 2 3 4 5 6 7 8 9 3 chunks +12 lines, -3 lines 0 comments Download
M src/api-natives.cc View 1 2 3 4 5 3 chunks +6 lines, -3 lines 0 comments Download
M src/bootstrapper.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M src/messages.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M src/objects.h View 1 2 3 4 5 6 7 8 9 6 chunks +20 lines, -5 lines 0 comments Download
M src/objects.cc View 1 2 3 4 5 6 7 8 9 3 chunks +29 lines, -0 lines 0 comments Download
M src/objects-debug.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M src/objects-inl.h View 1 2 3 4 5 6 7 8 9 2 chunks +26 lines, -2 lines 0 comments Download
M src/objects-printer.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ForOf.golden View 1 2 3 4 4 chunks +4 lines, -4 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/Generators.golden View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/test-api.cc View 1 chunk +29 lines, -0 lines 0 comments Download
M test/mjsunit/es6/proxies-global-reference.js View 1 1 chunk +2 lines, -5 lines 0 comments Download
M test/mjsunit/regress/regress-1403.js View 1 chunk +1 line, -1 line 0 comments Download
M test/mjsunit/regress/regress-crbug-571517.js View 1 1 chunk +4 lines, -1 line 0 comments Download

Messages

Total messages: 46 (20 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2108203002/1
4 years, 5 months ago (2016-06-29 15:30:47 UTC) #2
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_win_compile_dbg on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win_compile_dbg/builds/19928)
4 years, 5 months ago (2016-06-29 15:36:08 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2108203002/20001
4 years, 5 months ago (2016-06-29 15:57:35 UTC) #6
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_android_arm_compile_rel on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_android_arm_compile_rel/builds/20106) v8_linux64_avx2_rel_ng on ...
4 years, 5 months ago (2016-06-29 16:00:25 UTC) #8
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2108203002/40001
4 years, 5 months ago (2016-06-29 16:59:02 UTC) #10
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_presubmit on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/18432)
4 years, 5 months ago (2016-06-29 17:07:42 UTC) #12
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2108203002/80001
4 years, 5 months ago (2016-06-29 17:45:00 UTC) #15
Dan Ehrenberg
4 years, 5 months ago (2016-06-29 18:02:24 UTC) #17
Dan Ehrenberg
https://codereview.chromium.org/2108203002/diff/80001/test/mjsunit/es6/proxies-global-reference.js File test/mjsunit/es6/proxies-global-reference.js (right): https://codereview.chromium.org/2108203002/diff/80001/test/mjsunit/es6/proxies-global-reference.js#newcode9 test/mjsunit/es6/proxies-global-reference.js:9: assertThrows(()=>a, ReferenceError); The loss of this test is a ...
4 years, 5 months ago (2016-06-29 18:04:01 UTC) #18
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 5 months ago (2016-06-29 18:17:58 UTC) #20
jochen (gone - plz use gerrit)
deferring to Toon
4 years, 5 months ago (2016-06-30 15:15:19 UTC) #21
Toon Verwaest
mostly looking good. I like the internal_field_count cleanup :) https://codereview.chromium.org/2108203002/diff/80001/src/api-natives.cc File src/api-natives.cc (right): https://codereview.chromium.org/2108203002/diff/80001/src/api-natives.cc#newcode351 src/api-natives.cc:351: ...
4 years, 5 months ago (2016-06-30 15:35:34 UTC) #22
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2108203002/100001
4 years, 5 months ago (2016-06-30 20:10:34 UTC) #24
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_linux_arm64_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_arm64_rel_ng/builds/4222) v8_linux_arm64_rel_ng_triggered on ...
4 years, 5 months ago (2016-06-30 20:32:18 UTC) #26
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2108203002/120001
4 years, 5 months ago (2016-06-30 20:46:55 UTC) #28
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2108203002/140001
4 years, 5 months ago (2016-06-30 21:57:45 UTC) #30
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_linux64_avx2_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_avx2_rel_ng/builds/4267) v8_linux64_avx2_rel_ng_triggered on ...
4 years, 5 months ago (2016-06-30 22:16:33 UTC) #32
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2108203002/160001
4 years, 5 months ago (2016-06-30 22:42:23 UTC) #34
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 5 months ago (2016-06-30 23:10:35 UTC) #36
Dan Ehrenberg
Addressed comments PTAL https://codereview.chromium.org/2108203002/diff/80001/src/api-natives.cc File src/api-natives.cc (right): https://codereview.chromium.org/2108203002/diff/80001/src/api-natives.cc#newcode351 src/api-natives.cc:351: MAYBE_RETURN(JSObject::SetImmutableProto( On 2016/06/30 at 15:35:33, Toon ...
4 years, 5 months ago (2016-06-30 23:12:41 UTC) #37
Toon Verwaest
lgtm, thanks!
4 years, 5 months ago (2016-07-01 07:24:45 UTC) #38
jochen (gone - plz use gerrit)
lgtm with nit https://codereview.chromium.org/2108203002/diff/160001/include/v8.h File include/v8.h (right): https://codereview.chromium.org/2108203002/diff/160001/include/v8.h#newcode4839 include/v8.h:4839: bool ImmutableProto(); nit. IsImmutableProto()?
4 years, 5 months ago (2016-07-01 14:16:09 UTC) #39
Dan Ehrenberg
https://codereview.chromium.org/2108203002/diff/160001/include/v8.h File include/v8.h (right): https://codereview.chromium.org/2108203002/diff/160001/include/v8.h#newcode4839 include/v8.h:4839: bool ImmutableProto(); On 2016/07/01 at 14:16:09, jochen wrote: > ...
4 years, 5 months ago (2016-07-01 18:51:28 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2108203002/180001
4 years, 5 months ago (2016-07-01 18:51:31 UTC) #43
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years, 5 months ago (2016-07-01 19:17:03 UTC) #44
commit-bot: I haz the power
4 years, 5 months ago (2016-07-01 19:20:27 UTC) #46
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/0ff7b4830c82b9e6a9f14d375b05ee64009e1d01
Cr-Commit-Position: refs/heads/master@{#37482}

Powered by Google App Engine
This is Rietveld 408576698