Add inlining support for BigInt.as{Int,Uint}N
Categories
(Core :: JavaScript Engine: JIT, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox86 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
Details
Attachments
(5 files)
Add inlining support for BigInt.as{Int,Uint}N()
to improve the performance when using BigInt
for int64 operations. Inlining support more than doubles our performance for the test case from https://github.com/tc39/proposal-bigint/issues/117. (Make sure to use JSGC_DISABLE_POISONING=1
to avoid measuring GC poisoning cost.)
This bug is also a prerequisite for optimising BigInt
on int64 values without actually allocating BigInt
objects. When most BigInt
allocations can be optimised away, the "sha512-with-bigints.js" test case even runs slightly faster than "sha512-with-runtime-long.js" for us. But we also regressed "sha512-with-runtime-long.js" with Warp (by ~50% when compared to Ion, IIRC), so that should probably be taken into account, too.
Assignee | ||
Comment 1•5 years ago
|
||
The fast path didn't handle the no-op case, which actually made the fast-path
slower for the case when no conversion is necessary.
Assignee | ||
Comment 2•5 years ago
|
||
Add CacheIR support for Big.as{Uint,Int}N()
so we can optimise these functions
more efficiently in Warp in part 5.
Depends on D101167
Assignee | ||
Comment 3•5 years ago
|
||
Support Signed/NotSigned in preparation for part 5.
Depends on D101168
Assignee | ||
Comment 4•5 years ago
|
||
For the next part we want to call these methods without having to worry about
the edx:eax
restriction on x86.
Depends on D101169
Assignee | ||
Comment 5•5 years ago
|
||
BigInt.as{Int,Uint}N(bits, x)
with bits={32,64} are expected to be common enough
to warrant providing specialised code. For example BigInt.asIntN(64, x + y)
can
be used to inform the compiler to perform Int64 additions.
Depends on D101170
Comment 7•5 years ago
|
||
Backed out for build bustages.
Log: https://treeherder.mozilla.org/logviewer?job_id=326591926&repo=autoland&lineNumber=2600
Backout: https://hg.mozilla.org/integration/autoland/rev/c12bbd1b6404576ad6a74ad01a67e9245df38d88
Assignee | ||
Comment 8•5 years ago
|
||
Missing #include
leading to non-unified builds bustage. I'll update the patch shortly. Thanks for the info!
Comment 10•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/18f3ee438da2
https://hg.mozilla.org/mozilla-central/rev/501a75fb9ffb
https://hg.mozilla.org/mozilla-central/rev/d6617eb8f783
https://hg.mozilla.org/mozilla-central/rev/095a87205614
https://hg.mozilla.org/mozilla-central/rev/4711d0893629
Comment 11•5 years ago
|
||
bugherder |
Description
•