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

Issue 776143005: Optimize Object.seal and Object.preventExtensions (Closed)

Created:
6 years ago by adamk
Modified:
6 years ago
Reviewers:
Igor Sheludko
CC:
v8-dev, Toon Verwaest
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Project:
v8
Visibility:
Public.

Description

Optimize Object.seal and Object.preventExtensions They both now run fast (due to utilizing transitions instead of always creating new maps) and sealed or non-extensible objects can stay in fast mode after transitioning. This almost entirely reuses the code for transitioning objects frozen by Object.freeze(), with the added benefit of freeing up a bit on the map (we no longer keep track of frozen-ness, as that bit wasn't used for anything interesting). BUG=v8:3662, chromium:115960 LOG=y

Patch Set 1 #

Patch Set 2 : Fix a misplaced Freeze call, add more tests #

Patch Set 3 : Add support for preventExtensions #

Total comments: 4

Patch Set 4 : Responded to code review #

Patch Set 5 : Add nonextensible and sealed as special transitions #

Unified diffs Side-by-side diffs Delta from patch set Stats (+330 lines, -93 lines) Patch
M src/globals.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/heap/heap.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/objects.h View 1 2 3 5 chunks +19 lines, -7 lines 0 comments Download
M src/objects.cc View 1 2 3 8 chunks +87 lines, -50 lines 0 comments Download
M src/objects-inl.h View 1 2 3 1 chunk +0 lines, -10 lines 0 comments Download
M src/objects-printer.cc View 1 2 3 2 chunks +6 lines, -6 lines 0 comments Download
M src/runtime/runtime.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/runtime/runtime-object.cc View 1 2 3 1 chunk +15 lines, -0 lines 0 comments Download
M src/transitions-inl.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M src/v8natives.js View 1 2 3 2 chunks +20 lines, -13 lines 0 comments Download
M test/mjsunit/object-freeze.js View 1 1 chunk +9 lines, -0 lines 0 comments Download
A + test/mjsunit/object-freeze-global.js View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M test/mjsunit/object-prevent-extensions.js View 1 2 2 chunks +34 lines, -0 lines 0 comments Download
M test/mjsunit/object-seal.js View 1 1 chunk +129 lines, -0 lines 0 comments Download
A + test/mjsunit/object-seal-global.js View 1 2 3 1 chunk +3 lines, -5 lines 0 comments Download

Messages

Total messages: 16 (6 generated)
adamk
6 years ago (2014-12-04 02:15:10 UTC) #2
adamk
Now supports Object.preventExtensions, too.
6 years ago (2014-12-04 20:57:12 UTC) #3
adamk
Review ping? Igor, I get the impression this is right up your alley.
6 years ago (2014-12-09 21:50:50 UTC) #6
Igor Sheludko
It's really great that we now have one more free bit in the map! lgtm ...
6 years ago (2014-12-10 10:36:15 UTC) #7
Igor Sheludko
+ one nit: https://codereview.chromium.org/776143005/diff/40001/src/objects-printer.cc File src/objects-printer.cc (right): https://codereview.chromium.org/776143005/diff/40001/src/objects-printer.cc#newcode1139 src/objects-printer.cc:1139: if (key == GetHeap()->frozen_symbol()) { Please ...
6 years ago (2014-12-10 11:31:15 UTC) #8
adamk
https://codereview.chromium.org/776143005/diff/40001/src/objects-printer.cc File src/objects-printer.cc (right): https://codereview.chromium.org/776143005/diff/40001/src/objects-printer.cc#newcode1139 src/objects-printer.cc:1139: if (key == GetHeap()->frozen_symbol()) { On 2014/12/10 11:31:15, Igor ...
6 years ago (2014-12-10 18:46:01 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/776143005/60001
6 years ago (2014-12-10 18:46:26 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: v8_linux_arm64_rel on tryserver.v8 (http://build.chromium.org/p/tryserver.v8/builders/v8_linux_arm64_rel/builds/1686)
6 years ago (2014-12-10 19:08:17 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/776143005/80001
6 years ago (2014-12-10 19:23:26 UTC) #15
commit-bot: I haz the power
6 years ago (2014-12-10 20:02:55 UTC) #16
Message was sent while issue was closed.
Committed patchset #5 (id:80001)

Powered by Google App Engine
This is Rietveld 408576698