Bug 186462 - [DFG] Fold GetByVal if the indexed value is non configurable and non writable
Summary: [DFG] Fold GetByVal if the indexed value is non configurable and non writable
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-06-09 10:37 PDT by Yusuke Suzuki
Modified: 2018-07-22 09:56 PDT (History)
7 users (show)

See Also:


Attachments
Patch (9.47 KB, patch)
2018-07-21 13:01 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (22.62 KB, patch)
2018-07-21 15:42 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (28.17 KB, patch)
2018-07-21 16:27 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews103 for mac-sierra (2.37 MB, application/zip)
2018-07-21 17:44 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews123 for ios-simulator-wk2 (2.32 MB, application/zip)
2018-07-21 18:30 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews115 for mac-sierra (3.09 MB, application/zip)
2018-07-21 18:31 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews117 for mac-sierra (3.12 MB, application/zip)
2018-07-21 20:20 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews122 for ios-simulator-wk2 (2.32 MB, application/zip)
2018-07-21 20:29 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews205 for win-future (10.72 MB, application/zip)
2018-07-21 20:30 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews104 for mac-sierra-wk2 (2.89 MB, application/zip)
2018-07-21 21:43 PDT, EWS Watchlist
no flags Details
Patch (30.31 KB, patch)
2018-07-22 08:31 PDT, Yusuke Suzuki
saam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2018-06-09 10:37:06 PDT
If the indexed value is non-writable and non-configurable, we can fold it into a constant in DFG AI.
This is useful since tagged templates' values in arrays have these attributes.
Comment 1 Yusuke Suzuki 2018-07-21 13:01:00 PDT
Created attachment 345517 [details]
Patch
Comment 2 Yusuke Suzuki 2018-07-21 13:01:41 PDT
WIP: SparseValueMapEntry is not updated with locking. So the above patch is not completed.
Comment 3 EWS Watchlist 2018-07-21 13:02:39 PDT
Attachment 345517 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/SparseArrayValueMap.h:117:  The parameter name "i" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Yusuke Suzuki 2018-07-21 15:42:00 PDT
Created attachment 345518 [details]
Patch
Comment 5 Yusuke Suzuki 2018-07-21 16:27:19 PDT
Created attachment 345519 [details]
Patch
Comment 6 EWS Watchlist 2018-07-21 17:44:12 PDT
Comment on attachment 345519 [details]
Patch

Attachment 345519 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/8612005

New failing tests:
js/mozilla/strict/15.4.4.9.html
js/arguments.html
js/mozilla/strict/10.6.html
js/mozilla/strict/15.4.4.8.html
js/mozilla/strict/15.4.4.12.html
js/mozilla/strict/15.4.4.13.html
js/dom/Object-defineProperty.html
js/array-defineOwnProperty.html
js/dom/reflect-set-onto-dom.html
js/mozilla/strict/8.12.5.html
Comment 7 EWS Watchlist 2018-07-21 17:44:14 PDT
Created attachment 345521 [details]
Archive of layout-test-results from ews103 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 8 EWS Watchlist 2018-07-21 17:46:11 PDT
Comment on attachment 345519 [details]
Patch

Attachment 345519 [details] did not pass jsc-ews (mac):
Output: https://webkit-queues.webkit.org/results/8611981

New failing tests:
jsc-layout-tests.yaml/js/script-tests/array-defineOwnProperty.js.layout
jsc-layout-tests.yaml/js/script-tests/array-defineOwnProperty.js.layout-dfg-eager-no-cjit
stress/arguments-define-property.js.ftl-eager
stress/arguments-define-property.js.ftl-no-cjit-small-pool
stress/arguments-define-property.js.dfg-eager
stress/arguments-define-property.js.default
stress/arguments-define-property.js.ftl-eager-no-cjit
ChakraCore.yaml/ChakraCore/test/es5/array_length.js.default
stress/arguments-define-property.js.ftl-no-cjit-no-inline-validate
stress/arguments-define-property.js.dfg-eager-no-cjit-validate
stress/arguments-define-property.js.no-cjit-collect-continuously
stress/arguments-define-property.js.ftl-no-cjit-b3o1
jsc-layout-tests.yaml/js/script-tests/arguments.js.layout-dfg-eager-no-cjit
stress/arguments-define-property.js.ftl-no-cjit-validate-sampling-profiler
jsc-layout-tests.yaml/js/script-tests/arguments.js.layout-no-cjit
jsc-layout-tests.yaml/js/script-tests/arguments.js.layout
jsc-layout-tests.yaml/js/script-tests/arguments.js.layout-no-llint
stress/arguments-define-property.js.ftl-eager-no-cjit-b3o1
stress/arguments-define-property.js.ftl-no-cjit-no-put-stack-validate
ChakraCore.yaml/ChakraCore/test/Miscellaneous/HasOnlyWritableDataPropertiesCache.js.default
jsc-layout-tests.yaml/js/script-tests/array-defineOwnProperty.js.layout-no-cjit
jsc-layout-tests.yaml/js/script-tests/arguments.js.layout-ftl-no-cjit
stress/arguments-define-property.js.no-llint
jsc-layout-tests.yaml/js/script-tests/array-defineOwnProperty.js.layout-ftl-no-cjit
stress/arguments-define-property.js.dfg-maximal-flush-validate-no-cjit
ChakraCore.yaml/ChakraCore/test/es5/defineIndexProperty.js.default
jsc-layout-tests.yaml/js/script-tests/arguments.js.layout-ftl-eager-no-cjit
stress/arguments-define-property.js.no-cjit-validate-phases
jsc-layout-tests.yaml/js/script-tests/array-defineOwnProperty.js.layout-ftl-eager-no-cjit
jsc-layout-tests.yaml/js/script-tests/array-defineOwnProperty.js.layout-no-llint
jsc-layout-tests.yaml/js/script-tests/arguments.js.layout-no-ftl
stress/arguments-define-property.js.no-ftl
jsc-layout-tests.yaml/js/script-tests/array-defineOwnProperty.js.layout-no-ftl
apiTests
Comment 9 EWS Watchlist 2018-07-21 18:30:10 PDT
Comment on attachment 345519 [details]
Patch

Attachment 345519 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/8612067

New failing tests:
js/mozilla/strict/15.4.4.9.html
js/arguments.html
js/mozilla/strict/10.6.html
js/mozilla/strict/15.4.4.8.html
js/mozilla/strict/15.4.4.12.html
js/mozilla/strict/15.4.4.13.html
js/dom/Object-defineProperty.html
js/array-defineOwnProperty.html
js/dom/reflect-set-onto-dom.html
js/mozilla/strict/8.12.5.html
Comment 10 EWS Watchlist 2018-07-21 18:30:11 PDT
Created attachment 345524 [details]
Archive of layout-test-results from ews123 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews123  Port: ios-simulator-wk2  Platform: Mac OS X 10.13.4
Comment 11 EWS Watchlist 2018-07-21 18:31:51 PDT
Comment on attachment 345519 [details]
Patch

Attachment 345519 [details] did not pass mac-debug-ews (mac):
Output: https://webkit-queues.webkit.org/results/8612056

New failing tests:
js/mozilla/strict/15.4.4.9.html
js/arguments.html
js/mozilla/strict/10.6.html
js/mozilla/strict/15.4.4.8.html
js/mozilla/strict/15.4.4.12.html
js/mozilla/strict/15.4.4.13.html
js/dom/Object-defineProperty.html
js/array-defineOwnProperty.html
js/dom/reflect-set-onto-dom.html
js/mozilla/strict/8.12.5.html
Comment 12 EWS Watchlist 2018-07-21 18:31:53 PDT
Created attachment 345525 [details]
Archive of layout-test-results from ews115 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews115  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 13 EWS Watchlist 2018-07-21 20:20:24 PDT
Comment on attachment 345519 [details]
Patch

Attachment 345519 [details] did not pass mac-debug-ews (mac):
Output: https://webkit-queues.webkit.org/results/8612950

New failing tests:
js/mozilla/strict/15.4.4.9.html
js/arguments.html
js/mozilla/strict/10.6.html
js/mozilla/strict/15.4.4.8.html
js/mozilla/strict/15.4.4.12.html
js/mozilla/strict/15.4.4.13.html
js/dom/Object-defineProperty.html
js/array-defineOwnProperty.html
js/dom/reflect-set-onto-dom.html
js/mozilla/strict/8.12.5.html
Comment 14 EWS Watchlist 2018-07-21 20:20:26 PDT
Created attachment 345533 [details]
Archive of layout-test-results from ews117 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews117  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 15 EWS Watchlist 2018-07-21 20:29:11 PDT
Comment on attachment 345519 [details]
Patch

Attachment 345519 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/8612962

New failing tests:
js/mozilla/strict/15.4.4.9.html
js/arguments.html
js/mozilla/strict/10.6.html
js/mozilla/strict/15.4.4.8.html
js/mozilla/strict/15.4.4.12.html
js/mozilla/strict/15.4.4.13.html
js/dom/Object-defineProperty.html
js/array-defineOwnProperty.html
js/dom/reflect-set-onto-dom.html
js/mozilla/strict/8.12.5.html
Comment 16 EWS Watchlist 2018-07-21 20:29:13 PDT
Created attachment 345534 [details]
Archive of layout-test-results from ews122 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122  Port: ios-simulator-wk2  Platform: Mac OS X 10.13.4
Comment 17 EWS Watchlist 2018-07-21 20:30:42 PDT
Comment on attachment 345519 [details]
Patch

Attachment 345519 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/8613006

Number of test failures exceeded the failure limit.
Comment 18 EWS Watchlist 2018-07-21 20:30:52 PDT
Created attachment 345535 [details]
Archive of layout-test-results from ews205 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews205  Port: win-future  Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Comment 19 EWS Watchlist 2018-07-21 21:43:04 PDT
Comment on attachment 345519 [details]
Patch

Attachment 345519 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/8613531

New failing tests:
js/mozilla/strict/15.4.4.9.html
js/arguments.html
js/mozilla/strict/10.6.html
js/mozilla/strict/15.4.4.8.html
js/mozilla/strict/15.4.4.12.html
js/mozilla/strict/15.4.4.13.html
js/dom/Object-defineProperty.html
js/array-defineOwnProperty.html
js/dom/reflect-set-onto-dom.html
js/mozilla/strict/8.12.5.html
Comment 20 EWS Watchlist 2018-07-21 21:43:06 PDT
Created attachment 345536 [details]
Archive of layout-test-results from ews104 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 21 Yusuke Suzuki 2018-07-22 08:31:32 PDT
Created attachment 345537 [details]
Patch
Comment 22 Saam Barati 2018-07-22 09:33:28 PDT
Comment on attachment 345537 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=345537&action=review

> Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1898
> +                if (node->arrayMode().type() == Array::ArrayStorage || node->arrayMode().type() == Array::SlowPutArrayStorage) {

The name of the lambda this code is inside of needs to be changed since this extends beyond CoW folding

> Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp:190
> +    WTF::loadLoadFence();

This can use Dependency instead of loadLoadFence so it's fast on ARM if we decide to support ARM in the future. On x86, if you refactor this to us Dependency you'll just end up with the same code being emitted.
Comment 23 Yusuke Suzuki 2018-07-22 09:46:47 PDT
Comment on attachment 345537 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=345537&action=review

>> Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1898
>> +                if (node->arrayMode().type() == Array::ArrayStorage || node->arrayMode().type() == Array::SlowPutArrayStorage) {
> 
> The name of the lambda this code is inside of needs to be changed since this extends beyond CoW folding

Oops, right. Fixed.

>> Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp:190
>> +    WTF::loadLoadFence();
> 
> This can use Dependency instead of loadLoadFence so it's fast on ARM if we decide to support ARM in the future. On x86, if you refactor this to us Dependency you'll just end up with the same code being emitted.

Good call! Fixed.
Comment 24 Yusuke Suzuki 2018-07-22 09:54:44 PDT
Committed r234089: <https://trac.webkit.org/changeset/234089>
Comment 25 Radar WebKit Bug Importer 2018-07-22 09:56:08 PDT
<rdar://problem/42480098>