Clean-up riscv64 branch methods
Categories
(Core :: JavaScript Engine: JIT, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox153 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
(Blocks 1 open bug)
Details
Attachments
(17 external files)
The riscv64 branch methods contain a lot of unused code. Removing the unused code allows to simplify the implementation at lot.
| Assignee | ||
Comment 1•5 months ago
|
||
| Assignee | ||
Comment 2•5 months ago
|
||
After part 1, BranchAndLinkShortHelper is only called from BranchAndLinkShort.
| Assignee | ||
Comment 3•5 months ago
|
||
Just moves the code, so that related methods are placed next to each other.
| Assignee | ||
Comment 4•5 months ago
|
||
The functions are only called from Branch(AndLink)Long, so let's inline
them there.
| Assignee | ||
Comment 5•5 months ago
|
||
| Assignee | ||
Comment 6•5 months ago
|
||
After part 5, BranchShortCheck is only called from BranchShort, so inline
it into its caller.
| Assignee | ||
Comment 7•5 months ago
|
||
Again inline a function which has only a single caller.
| Assignee | ||
Comment 8•5 months ago
|
||
| Assignee | ||
Comment 9•5 months ago
|
||
CalculateOffset is also always called with offset = 0.
| Assignee | ||
Comment 10•5 months ago
|
||
Handle the same register case early instead of in each case block to avoid
code repetition.
| Assignee | ||
Comment 11•5 months ago
|
||
The single argument isNear requires a bound Label, whereas the two
argument isNear handles nullptr and unbound Label. Combine both
methods into a single method which requires a bound Label. (Until isNear
is removed completely in part 16.)
Also remove the unused is_near_branch method.
| Assignee | ||
Comment 12•5 months ago
|
||
Because it only delegates to branchOffsetHelper.
| Assignee | ||
Comment 13•5 months ago
|
||
Inline in preparation for part 16.
| Assignee | ||
Comment 14•5 months ago
|
||
Make ma_branch the internal branch method, which is only called from ma_b
and jump. This should make it easier to reason about the code. Also make
JumpKind a required parameter instead of implicitly defaulting it to
ShortJump. (Also pay attention that ma_b defaults to LongJump!).
| Assignee | ||
Comment 15•5 months ago
|
||
Both methods are only called from BranchAndLink.
| Assignee | ||
Comment 16•5 months ago
|
||
This part finishes the code restructuring for branch methods. The next part will
only remove more unused functions and move more related functions next to each
other.
The new code structure for branch methods:
- The five argument
ma_branchmethod calls either the two or five argument
Branchmethod. - The
Branchmethods callUseShortBranchto determine if short or long
branches must be emitted. BranchShortresp.BranchLongemit the actual branch instructions.
| Assignee | ||
Comment 17•5 months ago
|
||
Comment 18•5 months ago
|
||
Comment 19•5 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/14269ff3b9cd
https://hg.mozilla.org/mozilla-central/rev/3102abb08908
https://hg.mozilla.org/mozilla-central/rev/bbf768f7a6ed
https://hg.mozilla.org/mozilla-central/rev/8417ad26d175
https://hg.mozilla.org/mozilla-central/rev/c28db72ab1e4
https://hg.mozilla.org/mozilla-central/rev/56469cc16c79
https://hg.mozilla.org/mozilla-central/rev/1bd95dfdc6e9
https://hg.mozilla.org/mozilla-central/rev/4ec6fe6d7c30
https://hg.mozilla.org/mozilla-central/rev/605af5af91a9
https://hg.mozilla.org/mozilla-central/rev/a30fce27ffb6
https://hg.mozilla.org/mozilla-central/rev/f1b0c9b5af88
https://hg.mozilla.org/mozilla-central/rev/db23d15f7a18
https://hg.mozilla.org/mozilla-central/rev/123e2a70b48f
https://hg.mozilla.org/mozilla-central/rev/8be82b45fa8a
https://hg.mozilla.org/mozilla-central/rev/1ecdb86d1c1c
https://hg.mozilla.org/mozilla-central/rev/043769adfbb8
https://hg.mozilla.org/mozilla-central/rev/182818addff6
Updated•4 months ago
|
Description
•