Some interpreter loop optimizations
Categories
(Core :: JavaScript Engine: JIT, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(3 files)
Some minor optimizations:
-
The table base address is currently a 10-byte MOV instruction for each opcode. We should use a RIP-relative LEA here (7 bytes, the difference adds up to a few hundred bytes and it's what C++ compilers do). More importantly, on ARM64 we currently use LDR where we can similarly use ADR (because we know the interpreter code is much smaller than 1 MB).
-
We could order the list of bytecode ops in BaselineCodeGen.h on measured frequency in the browser. This should be a bit more cache friendly.
-
The toggled call for the debugger is unfortunately implemented pretty inefficiently on ARM64 (sync stack pointer, LDR, NOP). We should get this down to one instruction, probably with toggledJump.
Assignee | ||
Comment 1•5 years ago
|
||
This affects the following platforms:
-
x64: use a RIP-relative LEA instead of an immediate MOV. This saves a few
hundred bytes total and seems to be a little bit faster on interpreter
micro-benchmarks. -
arm64: use ADR instead of LDR.
Assignee | ||
Comment 2•5 years ago
|
||
Depends on D43398
Assignee | ||
Comment 3•5 years ago
|
||
We now use real NOPs on all platforms. On x86/x64 this used to be a CMP
instruction and on ARM64 this involved an unconditional LDR with some
other instructions.
Depends on D43413
Updated•5 years ago
|
Assignee | ||
Comment 5•5 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #0)
- We could order the list of bytecode ops in BaselineCodeGen.h on measured frequency in the browser. This should be a bit more cache friendly.
I'm leaving this one for now, we can always try it later.
Comment 6•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/dae1e9839adc
https://hg.mozilla.org/mozilla-central/rev/feec09fd96eb
https://hg.mozilla.org/mozilla-central/rev/e72770318826
Description
•