Closed Bug 1752281 Opened 4 months ago Closed 4 months ago

Improve CacheIR support for null/undefined/bool for unary/binary arithmetic ops

Categories

(Core :: JavaScript Engine: JIT, task, P3)

task

Tracking

()

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

Attachments

(7 files)

I have some patches that improve the micro-benchmark below from 580 ms to 9 ms locally.

Based on the profile there, this might help bug 1745639. These types also show up a number of times while browsing various websites.

function f(a, b) {
    var res = 0;
    for (var i = 0; i < 10_000_000; i++) {
        res = (a + i) + -b;
    }
    return res;
}
var t = new Date;
f(null, undefined);
print(new Date - t);

This is similar to the Int64 stub fields we already support.

It's straight-forward to support null here in addition to int32 and boolean.

Depends on D137121

Depends on D137125

See Also: → 1752504
Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b2931a447f7e
part 1 - Add support for CacheIR stub fields storing a double. r=iain
https://hg.mozilla.org/integration/autoland/rev/afb4a471cd8f
part 2 - Add LoadDoubleConstant CacheIR instruction. r=iain
https://hg.mozilla.org/integration/autoland/rev/b564ab08d861
part 3 - Optimize null operand for binary arithmetic ops with int32 result. r=iain
https://hg.mozilla.org/integration/autoland/rev/6bb50e480f6c
part 4 - Optimize boolean or null operand for unary arithmetic ops with int32 result. r=iain
https://hg.mozilla.org/integration/autoland/rev/aae92d923cca
part 5 - Optimize null/undefined/boolean operands for binary arithmetic ops with double result. r=iain
https://hg.mozilla.org/integration/autoland/rev/cd1d702f97b1
part 6 - Optimize null/undefined/boolean operands for unary arithmetic ops with double result. r=iain
https://hg.mozilla.org/integration/autoland/rev/1d6c7a604dd6
part 7 - Add tests. r=iain
You need to log in before you can comment on or make changes to this bug.