Fix maybeDensifySparseElements to not reshape for each element
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox90 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(8 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 | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
In NativeObject::maybeDensifySparseElements, we remove each sparse-element property one by one. Because the object is in dictionary mode, this will result in a new shape being allocated for each property we remove. This is slow and adds unnecessary GC pressure; we can change this to allocate just a single new shape.
Densification is rare; most websites don't hit this code at all. However it's easy to fix and this refactoring will also make it easier to change this code for the ReShape work.
| Assignee | ||
Comment 1•4 years ago
|
||
| Assignee | ||
Comment 2•4 years ago
|
||
Depends on D113347
| Assignee | ||
Comment 3•4 years ago
|
||
After the previous patch this is only called for dictionary objects.
The caller already has the ShapeTable it can pass in.
Depends on D113348
| Assignee | ||
Comment 4•4 years ago
|
||
This is just moving code, no other changes.
Depends on D113349
| Assignee | ||
Comment 5•4 years ago
|
||
Depends on D113350
| Assignee | ||
Comment 6•4 years ago
|
||
Depends on D113351
| Assignee | ||
Comment 7•4 years ago
|
||
Densify all properties and then assign a new shape to the object, instead of
allocating a new shape for each property being densified. This is faster and
avoids some GC pressure.
Depends on D113352
| Assignee | ||
Comment 8•4 years ago
|
||
Depends on D113353
Comment 10•4 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/6804ae862058
https://hg.mozilla.org/mozilla-central/rev/9ca23b2a317a
https://hg.mozilla.org/mozilla-central/rev/6e77fb213892
https://hg.mozilla.org/mozilla-central/rev/877d6461487e
https://hg.mozilla.org/mozilla-central/rev/4b56f6c94f2e
https://hg.mozilla.org/mozilla-central/rev/b5521fed2101
https://hg.mozilla.org/mozilla-central/rev/60ceda12b56d
https://hg.mozilla.org/mozilla-central/rev/a76135d2790a
Description
•