Closed Bug 1963672 Opened 22 days ago Closed 16 days ago

Optimize and tidy up some LSafepoint methods

Categories

(Core :: JavaScript Engine: JIT, task)

task

Tracking

()

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

addBoxedValue has quadratic behavior for no good reason.

See bug 1938512 comment 11 where this showed up in a profile from Mayank.

This avoids quadratic behavior that showed up in a profile. It's also consistent
with what we do in addGcPointer, addSlotsOrElementsPointer, etc.

(Furthermore, all jit-tests passed when turning this check into an assertion and
this vector is converted to a BitSet of slots when we encode the safepoint.)

This likely was based on the nunbox code for 32-bit platforms where we need a
lookup because we have separate type and payload halves, but that doesn't apply
to 64-bit.

This also avoids some redundant assertInvariants calls.

Also turn some alloc.isGeneralReg() checks into assertions because GC things
can't be in float registers.

Attachment #9484663 - Attachment description: Bug 1963672 part 2 - Inline addRegister methods into the caller. r?iain! → Bug 1963672 part 2 - Inline addRegister methods into their callers. r?iain!

Nunbox handling for 32-bit platforms also had quadratic behavior and has gotten
pretty complicated over the years.

This patch rewrites it with a simpler approach: we now add the separate type and
payload parts to a vector initially (similar to the other things stored in safepoints)
without trying to combine them. Then at the end we sort the entries and process them
all at once.

Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/360898bc3638 part 1 - Remove hasValueSlot check from LSafepoint::addBoxedValue. r=iain https://hg.mozilla.org/integration/autoland/rev/80fb19bd626e part 2 - Inline addRegister methods into their callers. r=iain https://hg.mozilla.org/integration/autoland/rev/f479a53a3df5 part 3 - Optimize nunbox handling in safepoints. r=iain
Status: ASSIGNED → RESOLVED
Closed: 16 days ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch

Profile with latest Nightly which hopefully has the patches from this bug: https://share.firefox.dev/4kcSHlf
(Looks to me like the Lsnapshot stuff is mostly gone)

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: