Bug 164531 - Spread(ArrayUse:@child) should participate in CSE
Summary: Spread(ArrayUse:@child) should participate in CSE
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords:
Depends on: 164258
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-08 15:48 PST by Saam Barati
Modified: 2018-01-19 13:41 PST (History)
12 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2016-11-08 15:48:08 PST
After I land https://bugs.webkit.org/show_bug.cgi?id=164258, we will emit Spread(ArrayUse:@child) only when we know that the iterator protocol is proven to be non-observable.
This means we can CSE two Spread(ArrayUse:@child) together when we've proven that nobody changes @child in between the two Spreads.
Comment 1 Saam Barati 2016-11-08 15:48:53 PST
It's important to also note that Spread will allocate a JSFixedArray, but JSFixedArray is a VM internal cell, it's not observable to user code. Therefore, it's ok to simply drop the second allocation and use the first one.
Comment 2 David Kilzer (:ddkilzer) 2018-01-19 13:37:35 PST
Since the comment mentioning this bug was removed in r227229, can this be changed to RESOLVED/WONTFIX?
Comment 3 Saam Barati 2018-01-19 13:41:35 PST
(In reply to David Kilzer (:ddkilzer) from comment #2)
> Since the comment mentioning this bug was removed in r227229, can this be
> changed to RESOLVED/WONTFIX?

I think it's worth keeping this. We could theoretically do this if we speculated in some particular way. Or if we proved the input to Spread doesn't have a symbol iterator.