Bug 82656 - DFG should optimize a==b for a being an object and b being either an object or null/undefined, and vice versa
Summary: DFG should optimize a==b for a being an object and b being either an object o...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-29 14:18 PDT by Filip Pizlo
Modified: 2012-03-30 19:27 PDT (History)
2 users (show)

See Also:


Attachments
work in progress (21.89 KB, patch)
2012-03-29 14:24 PDT, Filip Pizlo
webkit-ews: commit-queue-
Details | Formatted Diff | Diff
the patch (29.56 KB, patch)
2012-03-29 18:34 PDT, 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-03-29 14:18:16 PDT
V8-raytrace does this.  I figure others might want to do that as well, since it seems like a sensible thing to do.

This bug doesn't extend to going all out and optimizing the case where in a==b both a and b can be either null or object, since I don't yet have evidence that there are enough hot spots in the code out there that do that.

Patch forthcoming.
Comment 1 Filip Pizlo 2012-03-29 14:24:45 PDT
Created attachment 134666 [details]
work in progress

Almost done, but still need to do 32-bit and run some more tests.  Putting up for EWS to see that my 64-bit code doesn't make non-Mac ports sad.
Comment 2 Early Warning System Bot 2012-03-29 15:17:35 PDT
Comment on attachment 134666 [details]
work in progress

Attachment 134666 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/12194493
Comment 3 Early Warning System Bot 2012-03-29 15:23:43 PDT
Comment on attachment 134666 [details]
work in progress

Attachment 134666 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/12212042
Comment 4 Gustavo Noronha (kov) 2012-03-29 16:13:09 PDT
Comment on attachment 134666 [details]
work in progress

Attachment 134666 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/12206020
Comment 5 Filip Pizlo 2012-03-29 18:34:08 PDT
Created attachment 134708 [details]
the patch

It appears to work now.
Comment 6 Oliver Hunt 2012-03-29 18:54:09 PDT
Comment on attachment 134708 [details]
the patch

CompareEq should always predict bool shouldn't it?  It would seem easier to just do a single forNode(nodeIndex).set(PredictBoolean); in the AbstractState logic for it?

r=me
Comment 7 Filip Pizlo 2012-03-29 19:05:59 PDT
(In reply to comment #6)
> (From update of attachment 134708 [details])
> CompareEq should always predict bool shouldn't it?  It would seem easier to just do a single forNode(nodeIndex).set(PredictBoolean); in the AbstractState logic for it?

You might have a point there. ;-)

I will make the change that you speak of.
Comment 8 Filip Pizlo 2012-03-30 19:27:17 PDT
Landed in http://trac.webkit.org/changeset/112762