Make IsPackedArray not depend on TI
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox80 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(9 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
If TI is disabled we always return false from IsPackedArray. This hurts performance for things like new Set(arr)
or new <TypedArray>(arr)
because fast paths depend on IsPackedArray.
To fix this we can add a NON_PACKED flag to ObjectElements. We can then use that instead of the TI flag in IsPackedArray. Even with TI enabled this should be more precise because the flag is specific to the object instead of the whole group.
This will also make it possible to emit CacheIR for the IsPackedArray intrinsic.
Assignee | ||
Comment 1•5 years ago
|
||
Assignee | ||
Comment 2•5 years ago
|
||
Depends on D82958
Assignee | ||
Comment 3•5 years ago
|
||
Depends on D82959
Assignee | ||
Comment 4•5 years ago
|
||
The goal is to have just one place where OBJECT_FLAG_NON_PACKED is set.
Depends on D82960
Assignee | ||
Comment 5•5 years ago
|
||
Depends on D82961
Assignee | ||
Comment 6•5 years ago
|
||
The old code in ensureDenseElements marked non-packed before extending the
elements capacity. That's a problem because it can be the statically-allocated
EmptyObjectElements and we can't set the flag on that.
It's clearer to do the non-packed check in ensureDenseInitializedLength.
Depends on D82962
Assignee | ||
Comment 7•5 years ago
|
||
Re-organize the code. Add an early return instead of a big if-statement.
Change the initlen reference to a plain uint32_t.
Depends on D82963
Assignee | ||
Comment 8•5 years ago
|
||
Also move it down a bit because we only need to do this when writing to an
index > initlength.
Depends on D82964
Assignee | ||
Comment 9•5 years ago
|
||
This way IsPackedArray does not depend on TI and can be used with Warp.
Adds MStoreHoleValueElement for JSOp::InitElemArray writing a hole value. This
instruction writes the hole value and sets the NON_PACKED flag. ICs don't
optimize writing holes.
We now also check in debug builds that if IsPackedArray returns true, the first
few elements aren't the magic hole value.
Depends on D82965
Comment 10•5 years ago
|
||
Just to clarify. This doesn't actually remove the TI support for NON_PACKED. And MIsPackedArray + MCallOptimize both still depend on TI.
Comment 11•5 years ago
|
||
![]() |
||
Comment 12•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1b1c0c802a6b
https://hg.mozilla.org/mozilla-central/rev/4a7666aa3cc6
https://hg.mozilla.org/mozilla-central/rev/d34278f7a4a7
https://hg.mozilla.org/mozilla-central/rev/c7a06239c860
https://hg.mozilla.org/mozilla-central/rev/9a6e4bca8f6a
https://hg.mozilla.org/mozilla-central/rev/726d3e7fd042
https://hg.mozilla.org/mozilla-central/rev/5c435dbe3a72
https://hg.mozilla.org/mozilla-central/rev/783890691a76
https://hg.mozilla.org/mozilla-central/rev/f112125cab4d
Comment 13•5 years ago
|
||
Would you have a look into this failure please? Your new assertion is triggering in this comm-central test.
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=309809202&repo=comm-central&lineNumber=3711
Assignee | ||
Comment 14•5 years ago
|
||
(In reply to Geoff Lankow (:darktrojan) from comment #13)
Would you have a look into this failure please? Your new assertion is triggering in this comm-central test.
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=309809202&repo=comm-central&lineNumber=3711
Sorry about that. Fuzzing found the same bug and I have a patch for it that will hopefully land soon.
Description
•