Reuse allocation sites after purging IC stubs
Categories
(Core :: JavaScript Engine, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox122 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(3 files)
Allocation sites are created for Baseline ICs and allocated in the JitScript
. Since bug 1863939, we can purge all Baseline IC stubs and this includes the NewArray
and NewObject
stubs with allocation sites. When we attach a new stub, we will create a new allocation site for it.
It would be better to reuse the allocation site based on the bytecode offset, to preserve the allocation site data. This would also prevent 'leaking' memory if there's a long-running script/frame.
With trial inlining, we allocate all of the allocation sites in the root script's JitScript
so bytecode offset alone is not sufficient. Furthermore, with the changes in bug 1867193, we can purge inactive ICScript
s. I think the best and simplest solution would be to move the allocation site data from JitScript
to ICScript
and then reuse the allocation sites if we find one with a matching bytecode offset.
Assignee | ||
Comment 1•7 months ago
|
||
Jon, does this sound reasonable to you?
I split this off from bug 1867193 because that already has a number of patches in it, but this would be the final piece to fix that bug.
Comment 2•7 months ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #1)
Yes, this sounds fine. It would indeed be better not to lose this data when when we purge Baseline IC stubs.
Assignee | ||
Comment 3•7 months ago
|
||
The next patch will add more uses.
Updated•7 months ago
|
Assignee | ||
Comment 4•7 months ago
|
||
With this change the allocation site vector only contains same-script allocation
sites. This will allow the next patch to reuse allocation sites based on the bytecode
pc offset.
Depends on D196318
Assignee | ||
Comment 5•7 months ago
|
||
This lets us reuse the allocation site after purging IC stubs, or when we attach
multiple IC stubs for another reason.
Depends on D196319
Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ec74d0938ee4 part 1 - Add JitScript::forEachICScript and use it in a few places. r=iain https://hg.mozilla.org/integration/autoland/rev/25aad2c82129 part 2 - Move allocation sites from JitScript to ICScript. r=jonco https://hg.mozilla.org/integration/autoland/rev/e31c4ed69362 part 3 - Reuse allocation sites based on the bytecode offset. r=jonco
Comment 7•7 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ec74d0938ee4
https://hg.mozilla.org/mozilla-central/rev/25aad2c82129
https://hg.mozilla.org/mozilla-central/rev/e31c4ed69362
Description
•