Last Comment Bug 766218 - IonMonkey: Make "value === boolean" fast
: IonMonkey: Make "value === boolean" fast
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Jan de Mooij [:jandem]
:
: Jason Orendorff [:jorendorff]
Mentors:
Depends on: 839315
Blocks: IonSpeed 765980
  Show dependency treegraph
 
Reported: 2012-06-19 11:25 PDT by Jan de Mooij [:jandem]
Modified: 2013-02-18 08:11 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (33.44 KB, patch)
2012-06-20 06:26 PDT, Jan de Mooij [:jandem]
no flags Details | Diff | Splinter Review
Patch (33.74 KB, patch)
2012-06-20 07:32 PDT, Jan de Mooij [:jandem]
no flags Details | Diff | Splinter Review
Patch (33.58 KB, patch)
2012-06-26 02:28 PDT, Jan de Mooij [:jandem]
dvander: review+
Details | Diff | Splinter Review

Description Jan de Mooij [:jandem] 2012-06-19 11:25:47 PDT
JM has a fast path for this and we need it for V8 earley-boyer.

A micro-benchmark:
--
function f() {
    var a = [{}, true];
    var res = 0;

    for (var i=0; i<10000000; i++) {
        if (a[i & 1] !== false)
            res += 1;
    }
    print(res);
}

var t = new Date;
f();
print(new Date - t);
--
JM+TI :  22 ms
Ion   : 170 ms
Comment 1 Jan de Mooij [:jandem] 2012-06-20 06:26:28 PDT
Created attachment 634877 [details] [diff] [review]
Patch

I tried to use MCompare with different LIR instructions, but adding MCompareConstant seemed a bit simpler. The patch also has a few minor, unrelated MCompare changes.

On earley-boyer, this seems to get rid of all calls to StrictlyEqual<false> (!==). There are still some stub calls left for the === in sc_assq, one of the operands there has type "int or string".
Comment 2 Jan de Mooij [:jandem] 2012-06-20 07:32:00 PDT
Created attachment 634914 [details] [diff] [review]
Patch

Fixes a small perf issue.
Comment 3 David Anderson [:dvander] 2012-06-20 19:07:48 PDT
This is about a 15% perf win on earley-boyer on my machine - nice! Will review tonight.
Comment 4 Jan de Mooij [:jandem] 2012-06-26 02:28:10 PDT
Created attachment 636639 [details] [diff] [review]
Patch

Different approach, applies on top of bug 768027.
Comment 5 Jan de Mooij [:jandem] 2012-06-29 02:41:59 PDT
https://hg.mozilla.org/projects/ionmonkey/rev/82120910b08f

Note You need to log in before you can comment on or make changes to this bug.