Bug 183694 - [DFG][FTL] Add vectorLengthHint for NewArray
Summary: [DFG][FTL] Add vectorLengthHint for 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: 2018-03-16 03:43 PDT by Yusuke Suzuki
Modified: 2018-03-20 00:59 PDT (History)
9 users (show)

See Also:


Attachments
Patch (8.69 KB, patch)
2018-03-16 03:46 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-03-16 03:43:23 PDT
[DFG][FTL] Add vectorLengthHint for NewArray
Comment 1 Yusuke Suzuki 2018-03-16 03:46:52 PDT
Created attachment 335928 [details]
Patch
Comment 2 Caio Lima 2018-03-16 04:07:20 PDT
Comment on attachment 335928 [details]
Patch

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

LGTM. I have some suggestions in the tests. Also, why not create a microbenchmark for that?

> JSTests/stress/vector-length-hint-new-array.js:3
> +        throw new Error('bad value: ' + actual);

I think you should print the expected value as well. I helps a lot when it crashes on EWS.
Comment 3 Saam Barati 2018-03-19 22:06:37 PDT
Comment on attachment 335928 [details]
Patch

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

r=me

> Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp:3734
> +            ASSERT(vectorLengthHint >= numElements);

I’d make this a validation rule
Comment 4 Yusuke Suzuki 2018-03-20 00:43:48 PDT
Comment on attachment 335928 [details]
Patch

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

Thank you

>> Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp:3734
>> +            ASSERT(vectorLengthHint >= numElements);
> 
> I’d make this a validation rule

Added that rules.

>> JSTests/stress/vector-length-hint-new-array.js:3
>> +        throw new Error('bad value: ' + actual);
> 
> I think you should print the expected value as well. I helps a lot when it crashes on EWS.

Added
Comment 5 Yusuke Suzuki 2018-03-20 00:58:27 PDT
Committed r229743: <https://trac.webkit.org/changeset/229743>
Comment 6 Radar WebKit Bug Importer 2018-03-20 00:59:20 PDT
<rdar://problem/38655034>