Bug 101665 - DFG should know that int == null is always false
Summary: DFG should know that int == null is always false
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on:
Blocks: 101680
  Show dependency treegraph
 
Reported: 2012-11-08 16:42 PST by Filip Pizlo
Modified: 2012-11-08 18:12 PST (History)
7 users (show)

See Also:


Attachments
the patch (2.59 KB, patch)
2012-11-08 16:45 PST, Filip Pizlo
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2012-11-08 16:42:24 PST
Patch forthcoming.
Comment 1 Filip Pizlo 2012-11-08 16:45:53 PST
Created attachment 173146 [details]
the patch
Comment 2 Filip Pizlo 2012-11-08 17:58:29 PST
Landed in http://trac.webkit.org/changeset/133990
Comment 3 Darin Adler 2012-11-08 18:06:04 PST
Comment on attachment 173146 [details]
the patch

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

> Source/JavaScriptCore/ChangeLog:3
> +        DFG should know that int == null is always false

Seems more specific than I would have expected. Isn’t double == null also always false? And string == null? And lots of other cases like that?
Comment 4 Filip Pizlo 2012-11-08 18:11:48 PST
(In reply to comment #3)
> (From update of attachment 173146 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=173146&action=review
> 
> > Source/JavaScriptCore/ChangeLog:3
> > +        DFG should know that int == null is always false
> 
> Seems more specific than I would have expected. Isn’t double == null also always false? And string == null? And lots of other cases like that?

You're right, this is too specific.  On the other hand, I was playing it safe because even for int == null Gavin and I ended up scratching our heads over whether or not 0 is equal to null.

Also, whereas we have test coverage for int == null being compiled correctly (V8/crypto), we don't have such coverage for the other cases.  So, that patch will require somewhat more work since I don't want to add optimizations that aren't covered.

I've opened a bug for this: https://bugs.webkit.org/show_bug.cgi?id=101680