Bug 196116

Summary: Remove an invalid assertion in DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNullOrUndefined().
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: fpizlo, keith_miller, msaboff, rmorisset, saam, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch. fpizlo: review+

Description Mark Lam 2019-03-21 16:17:38 PDT
The DFG backend should not make assumptions about what optimizations the front end will or will not do.  The assertion asserts that the operand cannot be known to be a cell.  However, it is not guaranteed that the front end will fold away this case.  Also, the DFG backend is perfectly capable of generating code to handle the case where the operand is a cell.

<rdar://problem/48976951>
Comment 1 Mark Lam 2019-03-21 16:24:59 PDT
Created attachment 365639 [details]
proposed patch.
Comment 2 Filip Pizlo 2019-03-21 16:26:52 PDT
Comment on attachment 365639 [details]
proposed patch.

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

> Source/JavaScriptCore/ChangeLog:10
> +        The DFG backend should not make assumptions about what optimizations the front end
> +        will or will not do.  The assertion asserts that the operand cannot be known to be

You're right - the DFG is making a back assumption here because optimizations should be optional.
Comment 3 Filip Pizlo 2019-03-21 16:27:06 PDT
(In reply to Filip Pizlo from comment #2)
> Comment on attachment 365639 [details]
> proposed patch.
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=365639&action=review
> 
> > Source/JavaScriptCore/ChangeLog:10
> > +        The DFG backend should not make assumptions about what optimizations the front end
> > +        will or will not do.  The assertion asserts that the operand cannot be known to be
> 
> You're right - the DFG is making a back assumption here because
> optimizations should be optional.

*bad assumption
Comment 4 Mark Lam 2019-03-21 16:35:33 PDT
Thanks for the review.  Landed in r243344: <http://trac.webkit.org/r243344>.
Comment 5 Saam Barati 2019-03-21 19:22:01 PDT
Comment on attachment 365639 [details]
proposed patch.

LGTM too.