Closed Bug 1657830 Opened 4 years ago Closed 4 years ago

Clean up x64 jump code

Categories

(Core :: JavaScript Engine: JIT, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: jandem, Assigned: jandem)

Details

Attachments

(6 files)

  • The jump relocation table on x64 contains some fields we never use (see RelocationIterator::tableStart_, RelocationIterator::extOffset_).

  • Because all JIT code is allocated in a single buffer, we don't need an extended jump table entry for jumps to other JIT code addresses. These jumps are pretty common. With Fission on the horizon I don't think we'll need more than 2 GB JIT code per process anytime soon.

I have a prototype patch for this, I just need to split it up.

Flags: needinfo?(jdemooij)

The jump instruction itself is sufficient to get the address from the extended jump
table. This has been 'dead' code on x64 since the code landed in 2011. ARM64 copied it.

Assignee: nobody → jdemooij
Status: NEW → ASSIGNED

All pending jumps then have a known (non-null) target, so replace an if-statement
with an assertion.

Other platforms don't define addPatchableJump.

Depends on D86368

This lets us make x64-specific changes in the next patch.

Depends on D86373

A lot of entries in the extended jump table were never used because they were for
jumps/calls to other addresses in the executable memory (JitCodes or trampolines).

This patch takes advantage of the contiguous 2 GB executable code buffer: we know
any address in this buffer can always be jumped to without needing an extended jump
table. This also lets us simplify the jump relocation code more.

With Fission coming soon, max 2 GB JIT code per process will hopefully be sufficient.

Depends on D86374

Flags: needinfo?(jdemooij)
Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/40177251aedf part 1 - Remove some never-used data from jump relocation table on ARM64 and x64. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/b05b003aadab part 2 - Remove dead addPatchableJump on ARM64 and x64. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/f7c04ba4c7a6 part 3 - Remove dead JumpRelocation struct on ARM64. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/e25fbc36560f part 4 - Fold writeRelocation/addJumpRelocation into sole callers. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/e60ebc67c523 part 5 - Move jumps_ Vector from Assembler-x86-shared to Assembler-x86 and Assembler-x64. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/10c27253a2a3 part 6 - Don't use extended jumps for cross-JitCode jumps on x64. r=tcampbell
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: