Closed Bug 1657830 Opened 2 years ago Closed 2 years ago

Clean up x64 jump code


(Core :: JavaScript Engine: JIT, task)

Not set



81 Branch
Tracking Status
firefox81 --- fixed


(Reporter: jandem, Assigned: jandem)



(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

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
part 1 - Remove some never-used data from jump relocation table on ARM64 and x64. r=tcampbell
part 2 - Remove dead addPatchableJump on ARM64 and x64. r=tcampbell
part 3 - Remove dead JumpRelocation struct on ARM64. r=tcampbell
part 4 - Fold writeRelocation/addJumpRelocation into sole callers. r=tcampbell
part 5 - Move jumps_ Vector from Assembler-x86-shared to Assembler-x86 and Assembler-x64. r=tcampbell
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.