RESOLVED FIXED 143247
Object.preventExtensions/seal/freeze makes code much slower
https://bugs.webkit.org/show_bug.cgi?id=143247
Summary Object.preventExtensions/seal/freeze makes code much slower
Elliott Sprehn
Reported 2015-03-30 18:39:48 PDT
If you have class Foo { constructor() { this.property = 1; Object.preventExtensions(this); } } calling new Foo() seems to be 2-3x slower than doing so without the call to preventExtensions. This is not the case in v8 or Firefox. This pattern is really nice since it catches bad assignments and typos in code.
Attachments
work in progress (16.61 KB, patch)
2016-07-17 17:51 PDT, Filip Pizlo
no flags
the patch (22.60 KB, patch)
2016-07-17 18:41 PDT, Filip Pizlo
no flags
the patch (29.25 KB, patch)
2016-07-17 18:43 PDT, Filip Pizlo
buildbot: commit-queue-
Archive of layout-test-results from ews106 for mac-yosemite-wk2 (836.09 KB, application/zip)
2016-07-17 19:49 PDT, Build Bot
no flags
Archive of layout-test-results from ews114 for mac-yosemite (1.54 MB, application/zip)
2016-07-17 19:52 PDT, Build Bot
no flags
the patch (29.57 KB, patch)
2016-07-17 21:05 PDT, Filip Pizlo
no flags
performance (79.15 KB, text/plain)
2016-07-17 22:05 PDT, Filip Pizlo
no flags
the patch (29.56 KB, patch)
2016-07-17 22:06 PDT, Filip Pizlo
msaboff: review+
Filip Pizlo
Comment 1 2016-07-17 17:51:16 PDT
Created attachment 283875 [details] work in progress
Filip Pizlo
Comment 2 2016-07-17 18:41:05 PDT
Created attachment 283877 [details] the patch
Filip Pizlo
Comment 3 2016-07-17 18:43:52 PDT
Created attachment 283878 [details] the patch The previous patch didn't include the LayoutTests additions. I'm still testing this, but so far it appears to work like a charm.
Filip Pizlo
Comment 4 2016-07-17 18:45:14 PDT
Comment on attachment 283878 [details] the patch I'm seeing crashes. I'll put up a better patch once I figure out what those are all about.
Build Bot
Comment 5 2016-07-17 19:49:00 PDT
Comment on attachment 283878 [details] the patch Attachment 283878 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/1699149 New failing tests: js/preventExtensions.html
Build Bot
Comment 6 2016-07-17 19:49:05 PDT
Created attachment 283879 [details] Archive of layout-test-results from ews106 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Build Bot
Comment 7 2016-07-17 19:52:43 PDT
Comment on attachment 283878 [details] the patch Attachment 283878 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/1699142 New failing tests: js/preventExtensions.html
Build Bot
Comment 8 2016-07-17 19:52:47 PDT
Created attachment 283880 [details] Archive of layout-test-results from ews114 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews114 Port: mac-yosemite Platform: Mac OS X 10.10.5
Filip Pizlo
Comment 9 2016-07-17 21:05:53 PDT
Created attachment 283882 [details] the patch Fixed the test failure.
Filip Pizlo
Comment 10 2016-07-17 22:05:51 PDT
Created attachment 283883 [details] performance
Filip Pizlo
Comment 11 2016-07-17 22:06:23 PDT
Created attachment 283884 [details] the patch Included perf data.
Michael Saboff
Comment 12 2016-07-18 10:41:36 PDT
Comment on attachment 283884 [details] the patch r=me
Filip Pizlo
Comment 13 2016-07-18 13:13:59 PDT
Keith Miller
Comment 14 2016-08-02 16:57:32 PDT
Looks like this breaks some test262 tests. Specifically: JSTests/test262/test/built-ins/Object/freeze/15.2.3.9-2-c-2.js JSTests/test262/test/built-ins/Object/freeze/15.2.3.9-2-c-3.js JSTests/test262/test/built-ins/Object/freeze/15.2.3.9-2-c-4.js Which can be run with: jsc JSTests/test262/harness/assert.js JSTests/test262/harness/sta.js JSTests/test262/harness/propertyHelper.js <testFile>
Filip Pizlo
Comment 15 2016-08-02 17:02:57 PDT
(In reply to comment #14) > Looks like this breaks some test262 tests. > > Specifically: > > JSTests/test262/test/built-ins/Object/freeze/15.2.3.9-2-c-2.js > JSTests/test262/test/built-ins/Object/freeze/15.2.3.9-2-c-3.js > JSTests/test262/test/built-ins/Object/freeze/15.2.3.9-2-c-4.js > > Which can be run with: > > jsc JSTests/test262/harness/assert.js JSTests/test262/harness/sta.js > JSTests/test262/harness/propertyHelper.js <testFile> Filed: https://bugs.webkit.org/show_bug.cgi?id=160479
Note You need to log in before you can comment on or make changes to this bug.