Closed Bug 1797011 Opened 2 years ago Closed 2 years ago

Make nsFrameList and AbsoluteFrameList be move-only

Categories

(Core :: Layout, task)

task

Tracking

()

RESOLVED FIXED
108 Branch
Tracking Status
firefox108 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

Details

(Keywords: perf-alert)

Attachments

(4 files)

This is a follow up of Bug 1641085 Part 1. That is, I'd like to get rid of nsFrameList's copy constructor and copy assignment operator so that the frames' ownership and ownership transfer is clearer.

This patch doesn't change behavior, and eliminates copy construction of
nsFrameList via utilizing const-references to store the return value of
GetChildList(). This is the first step toward making nsFrameList a move-only
class.

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED

This patch doesn't change behavior.

AbsoluteFrameList is a derived class of nsFrameList, so we change it a move-only
class in order to nsFrameList move-only in Part 3.

Some detail of this patch:

  • Define move constructor and move assignment operator for AbsoluteFrameList.
    This effectively disables the auto generated copy constructor and copy
    assignement operator.

  • Initialize nsFrameConstructorSaveState's member variables in class definition,
    and remove its constructor.

  • Remove mSavedFixedList since we can rewire the logic in
    ~nsFrameConstructorSaveState and PushAbsoluteContainingBlock() to make it
    redundant.

  • Make self-assignment correct in nsFrameList's move assignment operator.

Depends on D160013

This patch doesn't change behavior.

Depends on D160014

Attachment #9299963 - Attachment description: Bug 1797011 Part 4 - Rename AbsoluteFrameList::mContainingBlock to match coding style. r?emilio,#layout → Bug 1797011 Part 4 - Rename AbsoluteFrameList::containingBlock to mContainingBlock to match coding style. r?emilio,#layout
Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/9a3f104b78c5 Part 1 - Delete nsFrameList's copy constructor. r=layout-reviewers,emilio https://hg.mozilla.org/integration/autoland/rev/360739dfb6d1 Part 2 - Make AbsoluteFrameList a move-only class; improve nsFrameConstructorSaveState and PushAbsoluteContainingBlock(). r=emilio https://hg.mozilla.org/integration/autoland/rev/515757be2f7e Part 3 - Delete nsFrameList's copy assigment operator. r=emilio https://hg.mozilla.org/integration/autoland/rev/e55bef9aa488 Part 4 - Rename AbsoluteFrameList::containingBlock to mContainingBlock to match coding style. r=emilio,layout-reviewers
Attachment #9299963 - Attachment description: Bug 1797011 Part 4 - Rename AbsoluteFrameList::containingBlock to mContainingBlock to match coding style. r?emilio,#layout → Bug 1797011 Part 4 - Rename AbsoluteFrameList::mContainingBlock to match coding style. r?emilio,#layout
Attachment #9299963 - Attachment description: Bug 1797011 Part 4 - Rename AbsoluteFrameList::mContainingBlock to match coding style. r?emilio,#layout → Bug 1797011 Part 4 - Rename AbsoluteFrameList::containingBlock to mContainingBlock to match coding style. r?emilio,#layout
Flags: needinfo?(aethanyc)
Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/18e0c89e758c Part 1 - Delete nsFrameList's copy constructor. r=layout-reviewers,emilio https://hg.mozilla.org/integration/autoland/rev/3f443cbb5bdd Part 2 - Make AbsoluteFrameList a move-only class; improve nsFrameConstructorSaveState and PushAbsoluteContainingBlock(). r=emilio https://hg.mozilla.org/integration/autoland/rev/800047b26683 Part 3 - Delete nsFrameList's copy assigment operator. r=emilio https://hg.mozilla.org/integration/autoland/rev/59a4b2b70632 Part 4 - Rename AbsoluteFrameList::containingBlock to mContainingBlock to match coding style. r=emilio,layout-reviewers
Regressions: 1797703
Blocks: 1798373

(In reply to Pulsebot from comment #5)

Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/9a3f104b78c5
Part 1 - Delete nsFrameList's copy constructor. r=layout-reviewers,emilio
https://hg.mozilla.org/integration/autoland/rev/360739dfb6d1
Part 2 - Make AbsoluteFrameList a move-only class; improve
nsFrameConstructorSaveState and PushAbsoluteContainingBlock(). r=emilio
https://hg.mozilla.org/integration/autoland/rev/515757be2f7e
Part 3 - Delete nsFrameList's copy assigment operator. r=emilio
https://hg.mozilla.org/integration/autoland/rev/e55bef9aa488
Part 4 - Rename AbsoluteFrameList::containingBlock to mContainingBlock to
match coding style. r=emilio,layout-reviewers

== Change summary for alert #35821 (as of Thu, 27 Oct 2022 15:00:44 GMT) ==

Regressions:

Ratio Test Platform Options Absolute values (old vs new)
7% imgur ContentfulSpeedIndex linux1804-64-shippable-qr cold fission webrender 1,077.58 -> 1,154.67
7% amazon ContentfulSpeedIndex windows10-64-shippable-qr bytecode-cached fission warm webrender 308.48 -> 329.83

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
11% amazon loadtime linux1804-64-shippable-qr bytecode-cached cold fission webrender 1,147.25 -> 1,017.71
9% imdb fcp linux1804-64-shippable-qr cold fission webrender 630.00 -> 576.04
8% amazon SpeedIndex windows10-64-shippable-qr bytecode-cached cold fission webrender 558.67 -> 514.92
6% imdb SpeedIndex linux1804-64-shippable-qr cold fission webrender 896.24 -> 842.83
4% buzzfeed LastVisualChange macosx1015-64-shippable-qr cold fission webrender 1,090.00 -> 1,043.33
4% imdb PerceptualSpeedIndex linux1804-64-shippable-qr cold fission webrender 1,255.48 -> 1,209.58

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=35821

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

Attachment

General

Created:
Updated:
Size: