Bug 215308 - [JSC] Speculate children first in DFG NewArray
Summary: [JSC] Speculate children first in DFG NewArray
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-08-07 23:04 PDT by Yusuke Suzuki
Modified: 2020-08-08 00:47 PDT (History)
7 users (show)

See Also:


Attachments
Patch (13.29 KB, patch)
2020-08-07 23:10 PDT, Yusuke Suzuki
mark.lam: 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 2020-08-07 23:04:05 PDT
[JSC] Speculate children first in DFG NewArray
Comment 1 Yusuke Suzuki 2020-08-07 23:10:13 PDT
Created attachment 406249 [details]
Patch
Comment 2 Yusuke Suzuki 2020-08-07 23:13:39 PDT
<rdar://problem/64749263>
Comment 3 Mark Lam 2020-08-08 00:10:38 PDT
Comment on attachment 406249 [details]
Patch

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

r=me

> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:8456
> +        // Because we first speculate on all of the children here, we never exit after creating

I suggest /we never/we can never/.

> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:8457
> +        // uninitialized contiguous JSArray, which ensures that we never produce half-baked JSArray.

I suggest /we never produce half-baked/we will never produce a half-baked/.

> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:12237
> +    // After the allocation, we must not exit until we fill butterfly completely.

I wonder if we should add a VM::disallowOSRExit flag that we can set here if ASSERT_ENABLED and assert that the flag is not set in the OSR Exit ramp.  We'll also need to clear the flag below.  Maybe we can do that in another patch later.

> Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:6755
> +        // Because we first speculate on all of the children here, we never exit after creating
> +        // uninitialized contiguous JSArray, which ensures that we never produce half-baked JSArray.

Ditto: same suggestions as in above DFG comment.
Comment 4 Yusuke Suzuki 2020-08-08 00:34:36 PDT
media/remote-control-command-seek.html is recently failing in multiple EWS attempts with different patches.

https://ews-build.webkit.org/#/builders/32/builds/15348
https://ews-build.webkit.org/#/builders/32/builds/15361
Comment 5 Yusuke Suzuki 2020-08-08 00:35:10 PDT
Comment on attachment 406249 [details]
Patch

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

>> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:8456
>> +        // Because we first speculate on all of the children here, we never exit after creating
> 
> I suggest /we never/we can never/.

Fixed.

>> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:8457
>> +        // uninitialized contiguous JSArray, which ensures that we never produce half-baked JSArray.
> 
> I suggest /we never produce half-baked/we will never produce a half-baked/.

Fixed.

>> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:12237
>> +    // After the allocation, we must not exit until we fill butterfly completely.
> 
> I wonder if we should add a VM::disallowOSRExit flag that we can set here if ASSERT_ENABLED and assert that the flag is not set in the OSR Exit ramp.  We'll also need to clear the flag below.  Maybe we can do that in another patch later.

Sounds good. I'll file a bug for that.

>> Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:6755
>> +        // uninitialized contiguous JSArray, which ensures that we never produce half-baked JSArray.
> 
> Ditto: same suggestions as in above DFG comment.

Ditto.
Comment 6 Yusuke Suzuki 2020-08-08 00:44:57 PDT
Committed r265405: <https://trac.webkit.org/changeset/265405>
Comment 7 Yusuke Suzuki 2020-08-08 00:47:28 PDT
Opened for extension. https://bugs.webkit.org/show_bug.cgi?id=215310