Closed Bug 1772123 Opened 2 years ago Closed 2 years ago

Ion's RA: reorder methods in BacktrackingAllocator.{cpp,h}

Categories

(Core :: JavaScript Engine: JIT, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
103 Branch
Tracking Status
firefox103 --- fixed

People

(Reporter: jseward, Assigned: jseward)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

BacktrackingAllocator.cpp is a big, complex file. It contains the complete
register allocation pipeline and has dozens of methods and functions.
Unfortunately the organisation is poor, obscures the overall structure, and is
hard to follow:

  • often, no clear grouping of methods/functions into logical groups

  • inadequate group-heading comments, needed for top level navigation

  • inconsistencies in whether methods are defined before or after their use
    points

  • inconsistencies in the sequence of methods relative to flow in the allocator
    pipeline

Any attempt to clean up the allocator first needs to address these structuring
issues. This patch:

  • makes no functional changes -- it merely reorders methods in
    BacktrackingAllocator.cpp and adds a handful of top-level section marker
    comments. The sequencing of methods is now definition-before-use. The top
    level group sequencing has been changed so as to match the actual flow of
    data through the allocation pipeline.

  • The contents of class BacktrackingAllocator in BacktrackingAllocator.h are
    rearranged to follow the .cpp changes. The rest of this file is unchanged.

  • minor change: BacktrackingAllocator::SpillWeightFromUsePolicy was a free
    method in the .h file. Has been moved to the .cpp file.

  • minor change: typedef LiveRangeVector is unused and has been removed.

Blocks: sm-regalloc

BacktrackingAllocator.cpp is a big, complex file. It contains the complete
register allocation pipeline and has dozens of methods and functions.
Unfortunately the organisation is poor, which obscures the overall structure
makes it hard to follow:

  • often, no clear grouping of methods/functions into logical groups

  • inadequate group-heading comments, needed for top level navigation

  • inconsistencies in whether methods are defined before or after their use
    points

  • inconsistencies in the sequence of methods relative to flow in the allocator
    pipeline

Any attempt to clean up the allocator first needs to address these structuring
issues:

  • This patch makes no functional changes -- it merely reorders methods in
    BacktrackingAllocator.cpp and adds a handful of top-level section marker
    comments. The sequencing of methods is now definition-before-use. The top
    level group sequencing has been changed so as to match the actual flow of
    data through the allocation pipeline.

  • The contents of class BacktrackingAllocator in BacktrackingAllocator.h are
    rearranged to follow the .cpp changes. The rest of this file is unchanged.

  • minor change: BacktrackingAllocator::SpillWeightFromUsePolicy was a free
    method in the .h file. Has been moved to the .cpp file.

  • minor change: typedef LiveRangeVector is unused and has been removed.

Blocks: 1772282
Pushed by nfay@mozilla.com:
https://hg.mozilla.org/mozilla-central/rev/7903ed468b9c
Ion's RA: reorder methods in BacktrackingAllocator.{cpp,h}.  r=jandem.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: