Bug 226599

Summary: [FTL] Have a more generic fast path for compareStrictEq on Untyped/Untyped in FTLLowerDFGToB3
Product: WebKit Reporter: Robin Morisset <rmorisset>
Component: JavaScriptCoreAssignee: Robin Morisset <rmorisset>
Status: ASSIGNED ---    
Severity: Normal CC: ews-watchlist, fpizlo, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch rmorisset: review?, rmorisset: commit-queue?

Description Robin Morisset 2021-06-03 14:41:04 PDT
There is already such a path in the DFG, so currently the FTL is producing worse code than the DFG in this instance.
Comment 1 Robin Morisset 2021-06-03 14:59:37 PDT
Technically there already is a fast path, but only for Int32/Int32.
Comment 2 Robin Morisset 2021-06-03 15:05:27 PDT
Created attachment 430505 [details]
Patch
Comment 3 Filip Pizlo 2021-06-03 16:17:31 PDT
Comment on attachment 430505 [details]
Patch

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

> Source/JavaScriptCore/ChangeLog:23
> +        if (isCell(left) && isCell(right))

Isn't the thing that requires the slow path that both left and right are either strings or bigints?
Comment 4 Robin Morisset 2021-06-03 16:34:16 PDT
Comment on attachment 430505 [details]
Patch

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

>> Source/JavaScriptCore/ChangeLog:23
>> +        if (isCell(left) && isCell(right))
> 
> Isn't the thing that requires the slow path that both left and right are either strings or bigints?

Yes, but checking whether a Cell is either a HeapBigInt or a String would be quite a bit of code, so I am approximating here (going to the slow path even for things like Object == Object).
Note that I use the more precise condition when it comes to pruning that check with the abstract interpreter (so if we can prove it is Object == Object, we'll generate the ideal code without all of these checks).
Comment 5 Radar WebKit Bug Importer 2021-06-10 14:42:26 PDT
<rdar://problem/79161356>