Closed Bug 1869759 Opened 7 months ago Closed 7 months ago

Reuse allocation sites after purging IC stubs

Categories

(Core :: JavaScript Engine, task)

task

Tracking

()

RESOLVED FIXED
122 Branch
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 ICScripts. 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.

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.

Flags: needinfo?(jcoppeard)

(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.

Flags: needinfo?(jcoppeard)
Assignee: nobody → jdemooij
Status: NEW → ASSIGNED

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

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
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: