Closed Bug 1642610 Opened 1 month ago Closed 1 month ago

Optimize Math.random in CacheIR and Warp

Categories

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

task

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 2 open bugs)

Details

Attachments

(5 files)

Using Ion's RNG code for CacheIR too makes Baseline quite a lot faster on some Math.random micro-benchmarks.

Note that the math-random.js jit-test is a good correctness test for this. It
overrides the RNG's seed, generates a few thousand numbers, and then checks some
of them. I verified this test fails if I add a bug to the Math.random JIT code.

Depends on D77800

Depends on D77801

Drive-by performance improvement. convertUInt64ToDouble is slower because it has
a different code path for negative inputs but that can't happen here.

Depends on D77802

Blocks: 1642680

Based on the existing convertUInt64ToDouble.

Depends on D77802

Attachment #9153407 - Attachment description: Bug 1642610 part 4 - Use convertInt64ToDouble instead of convertUInt64ToDouble. r?iain! → Bug 1642610 part 5 - Use convertInt64ToDouble instead of convertUInt64ToDouble. r?iain!
Depends on: 1643283
Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/034c28800409
part 1 - Move Ion's Math.random code to the MacroAssembler. r=iain
https://hg.mozilla.org/integration/autoland/rev/a58f7048e7f4
part 2 - Optimize Math.random in CacheIR. r=iain
https://hg.mozilla.org/integration/autoland/rev/e519a1393ea3
part 3 - Transpile MathRandomResult. r=iain
https://hg.mozilla.org/integration/autoland/rev/897c90b9b4c1
part 4 - Implement convertInt64ToDouble for ARM32 and MIPS32. r=arai
https://hg.mozilla.org/integration/autoland/rev/0aea458b79e4
part 5 - Use convertInt64ToDouble instead of convertUInt64ToDouble. r=iain
You need to log in before you can comment on or make changes to this bug.