Closed Bug 2046867 Opened 5 months ago Closed 5 months ago

Align RISCV64 label tracking with the ARM64 implementation

Categories

(Core :: JavaScript Engine: JIT, task)

task

Tracking

()

RESOLVED FIXED
154 Branch
Tracking Status
firefox154 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(8 external files)

Change the RISCV64 code which tracks unbound labels to match the ARM64 implementation.

Replacing the bnez(Register,Label*) call in RoundHelper allows to remove all
branch methods which take a Label* argument. This ensures all branches are
constructed through MacroAssemblerRiscv64, which takes care to properly compute
the correct offsets and disallow constant pools when necessary.

These case statements were copied from V8, but don't apply to our implementation.

Drive-by change:

  • Inline UNIMPLEMENTED_RISCV

This avoids duplicating the same code in two methods.

Rename the methods to simply branchOffset. Short range branches take an additional
OffsetSize parameter to describe the kind of short range branch.

The previous code always executed the MOZ_CRASH.

Branches are now only encoded in the linked list through the Label, exactly
like how the ARM64 code works.

Pushed by andre.bargull@gmail.com: https://github.com/mozilla-firefox/firefox/commit/c31a35cde647 https://hg.mozilla.org/integration/autoland/rev/3e2ab52a689d Part 1: Remove (almost) unused Label-based branch methods. r=jandem https://github.com/mozilla-firefox/firefox/commit/86b6f406dd10 https://hg.mozilla.org/integration/autoland/rev/ee6b9295f198 Part 2: Remove unreachable case statements from jump-chain methods. r=jandem https://github.com/mozilla-firefox/firefox/commit/41dfed319cbe https://hg.mozilla.org/integration/autoland/rev/345da95f3b1d Part 3: Move common code into an internal branchOffset method. r=jandem https://github.com/mozilla-firefox/firefox/commit/6a5098c97c49 https://hg.mozilla.org/integration/autoland/rev/c6c1e7e02a39 Part 4: Remove 'Helper' suffix from branchOffset method names. r=jandem https://github.com/mozilla-firefox/firefox/commit/594ca197cd38 https://hg.mozilla.org/integration/autoland/rev/c7dc472a0f1c Part 5: Copy some comments from ARM64. r=jandem https://github.com/mozilla-firefox/firefox/commit/46b81b24fe24 https://hg.mozilla.org/integration/autoland/rev/93c640237d19 Part 6: Align Assembler::retarget with ARM64. r=jandem https://github.com/mozilla-firefox/firefox/commit/47a2ca855cfc https://hg.mozilla.org/integration/autoland/rev/76c33e55dace Part 7: Align Assembler::bind with ARM64. r=jandem https://github.com/mozilla-firefox/firefox/commit/793b7291b56f https://hg.mozilla.org/integration/autoland/rev/b0ad2052a167 Part 8: Remove label cache and align remaining code with ARM64. r=jandem
QA Whiteboard: [qa-triage-done-c155/b154]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: