Bug 183694

Summary: [DFG][FTL] Add vectorLengthHint for NewArray
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, fpizlo, jfbastien, keith_miller, mark.lam, msaboff, saam, ticaiolima, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch saam: review+

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>