As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact
Last Comment Bug 766218 - IonMonkey: Make "value === boolean" fast
: IonMonkey: Make "value === boolean" fast
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Jan de Mooij [:jandem]
: Jason Orendorff [:jorendorff]
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:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

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 User image 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;

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

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 User image Jan de Mooij [:jandem] 2012-06-20 07:32:00 PDT
Created attachment 634914 [details] [diff] [review]

Fixes a small perf issue.
Comment 3 User image 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 User image Jan de Mooij [:jandem] 2012-06-26 02:28:10 PDT
Created attachment 636639 [details] [diff] [review]

Different approach, applies on top of bug 768027.
Comment 5 User image Jan de Mooij [:jandem] 2012-06-29 02:41:59 PDT

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