Closed Bug 1562830 Opened 7 months ago Closed 7 months ago

Baseline Interpreter: keep bytecode pc in a register between VM/IC calls

Categories

(Core :: JavaScript Engine: JIT, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(2 files)

The current design where the bytecode pc is stored in the frame but can also be in a register at the start of an op (until R2 is used) is not as simple and performant as I'd like.

Having a dedicated bytecode PC register (that's saved and restored around VM/IC calls) lets us simplify the code and it's significantly faster on x64, about 9-10%.

The main issue is that on 32-bit x86 we don't have enough registers to do this nicely without complicating the code, so there we won't have a PC register and we'll continue to always store it in the frame. That's a 2-3% perf regression compared to the current scheme, but I think it's an acceptable trade-off considering ongoing migration to x64 and code simplification.

This is both simpler and faster than the old scheme where the pc was stored in
a register but could be clobbered by R2.

On x64 this wins about 9-10%. On 32-bit x86 we don't have enough registers so
there we load the pc from the frame in more cases. That's about a 2-3%
regression and is a reasonable trade-off.

Priority: -- → P1
Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/874fd6880afc
Keep Baseline Interpreter bytecode pc in a register between VM/IC calls. r=djvj
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
Attachment #9076697 - Attachment description: Bug 1562830 - MIPS fixes (Depends on D36583) → Bug 1562830 - [mips] Baseline Interpreter: keep bytecode pc in a register between VM/IC calls r=jandem
Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/410a216f6b52
[mips] Baseline Interpreter: keep bytecode pc in a register between VM/IC calls r=jandem
You need to log in before you can comment on or make changes to this bug.