Add constant index optimisation to DataView load and store instructions
Categories
(Core :: JavaScript Engine: JIT, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox143 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
(Blocks 1 open bug)
Details
Attachments
(6 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
The constant index optimisation to use Address
instead of BaseIndex
wasn't implemented in https://phabricator.services.mozilla.com/D74623 (bug 1065894), because at that time Spectre index-masking was always enabled.
Assignee | ||
Comment 1•1 month ago
|
||
Using Address
for constant indices wasn't implemented in D74623, because
Spectre index-masking prevented this optimisation. Now that index-masking
isn't always used, we can add the Address
optimisation.
dv.getInt32(0, true)
was compiled to:
[Codegen] # LIR=ArrayBufferViewElements
[Codegen] movq 0x30(%rax), %rax
[Codegen] # LIR=Integer64
[Codegen] xorl %edx, %edx
[Codegen] # LIR=LoadDataViewElement
[Codegen] movl 0x0(%rax,%rdx,1), %ecx
And is now compiled to:
[Codegen] # LIR=ArrayBufferViewElements
[Codegen] movq 0x30(%rax), %rax
[Codegen] # LIR=LoadDataViewElement
[Codegen] movl 0x0(%rax), %ecx
Assignee | ||
Comment 2•1 month ago
|
||
Using ToAddressOrBaseIndex
allows to remove some duplicated code.
Updated•1 month ago
|
Assignee | ||
Comment 3•1 month ago
|
||
Assignee | ||
Comment 4•1 month ago
|
||
emitElementPostWriteBarrier
is always called with index
being a Register
.
Assignee | ||
Comment 5•1 month ago
|
||
Similar to parts 1-3, add ToAddressOrBaseObjectElementIndex
to remove a bit of
duplicated code.
Assignee | ||
Comment 6•1 month ago
|
||
Comment 9•1 month ago
|
||
Assignee | ||
Comment 10•1 month ago
|
||
GCC doesn't compile code where a template parameter has the same name as another type definition:
struct S {};
struct U {
using I = S;
template <typename I>
static I f(I i);
};
template <typename I>
I U::f(I i) { return i; }
int g(int i) { return U::f(i); }
Comment 11•1 month ago
|
||
Comment 12•1 month ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5acde56d1c3b
https://hg.mozilla.org/mozilla-central/rev/1504f8fde668
https://hg.mozilla.org/mozilla-central/rev/85c16faa35b5
https://hg.mozilla.org/mozilla-central/rev/1f09e4e1321c
https://hg.mozilla.org/mozilla-central/rev/4135001f01b8
https://hg.mozilla.org/mozilla-central/rev/4518aedf5a98
Updated•25 days ago
|
Description
•