Implement StoreToTypedArray for BigInt
Categories
(Core :: JavaScript Engine: JIT, enhancement, P2)
Tracking
()
People
(Reporter: terpri, Assigned: anba)
References
Details
Attachments
(4 files)
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
CacheIR.cpp:
Disallow bigint properties right away in GetPropIRGenerator::tryAttachTypedObject
to fix a null-pointer crash in CacheIRCompiler::emitLoadTypedObjectResultShared
,
which passes fail = nullptr
to MacroAssembler::loadFromTypedArray
, even though
loadFromTypedArray
always uses the fail
Label for bigint types.
IonBuilder.cpp:
Ensure we don't create MLoadUnboxedScalar
or MStoreUnboxedScalar
for bigint
types, because the former always leads to a bailout and the latter asserts when
bigint types are used.
Assignee | ||
Comment 2•5 years ago
|
||
Provide an inline assembly implementation of BigInt::toUint64()
resp. BigInt::toInt64()
.
Depends on D48333
Assignee | ||
Comment 3•5 years ago
|
||
Depends on D48334
Assignee | ||
Comment 4•5 years ago
|
||
Depends on D48335
Comment 5•5 years ago
|
||
Just curious, do you have some micro-benchmarks comparing before/after? It's always nice to see speedups :)
Assignee | ||
Comment 6•5 years ago
|
||
Sure:
// store: 465ms -> 35ms
function f() {
var xs = [
new BigInt64Array(10),
new BigInt64Array(10),
];
var t = dateNow();
for (var i = 0; i < 5000000; ++i) {
xs[i&1][i&7] = 0n;
}
print(dateNow() - t);
}
And for bug 1536702:
// load: 480ms -> 145ms
function f() {
var xs = [
new BigInt64Array(10),
new BigInt64Array(10),
];
var q = 0;
var t = dateNow();
for (var i = 0; i < 5000000; ++i) {
if (xs[i&1][i&7]) q++;
}
print(dateNow() - t);
}
Comment 7•5 years ago
|
||
Nice :D
Assignee | ||
Comment 8•5 years ago
|
||
Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=b7f2642014bc4d47da9f5c0ecc53a5ceab71836e
Pushed by csabou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7bb7d2354ec7
Part 1: Avoid crashes for TypedObjects using bigint properties. r=jandem
https://hg.mozilla.org/integration/autoland/rev/e48626d69e77
Part 2: Add support for reading [u]int64 values from a BigInt to the MacroAssembler. r=jandem
https://hg.mozilla.org/integration/autoland/rev/e512b7dafc1f
Part 3: Inline stores to BigInt TypedArray/Objects in CacheIR. r=jandem
https://hg.mozilla.org/integration/autoland/rev/f1e9ada5d498
Part 4: Add test cases for storing BigInt values to TypedArray/Objects. r=jandem
Comment 10•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7bb7d2354ec7
https://hg.mozilla.org/mozilla-central/rev/e48626d69e77
https://hg.mozilla.org/mozilla-central/rev/e512b7dafc1f
https://hg.mozilla.org/mozilla-central/rev/f1e9ada5d498
Updated•4 years ago
|
Description
•