Commit graph

5 commits

Author SHA1 Message Date
Andreas Kling
e695dc1405 LibJS: Don't make Bytecode::Operand::Type an u8 outside of aarch64
This is a slightly mystified attempt to recover the performance
regression seen on our JS benchmark runner after 3c2a2bb39f
and c7bba505ea.

With this change, c7bba505ea is effectively reverted from the
perspective of x86_64.
2025-04-06 20:12:58 +02:00
Andreas Kling
c7bba505ea LibJS: Only use bitfields in Bytecode::Operand on aarch64
It seems both aarch64 and x86_64 are extremely sensitive to the use of
bitfields here. Unfortunately, aarch64 gains a huge speedup from them
while x86_64 sees a very noticeable slowdown.

Since we're talking about 5%+ swings in both directions here, let's go
for the best of both worlds and use ifdefs in the Operand memory layout.
2025-04-06 14:14:34 +02:00
Andreas Kling
3c2a2bb39f LibJS: Shrink JS::Bytecode::Operand from 8 bytes to 4 bytes
This packs the bytecode much better and gives us a decent performance
boost on throughput-focused benchmarks.

Measured on my M3 MacBook Pro:
- 4.7% speedup on Kraken
- 2.3% speedup on Octane
- 2.7% speedup on JetStream1
2025-04-06 02:05:27 +02:00
Andreas Kling
900f209b34 LibJS: Make Optional<Operand> use less space
Shrink these down from 12 bytes to 8 bytes, which helps make many
bytecode instructions smaller.
2025-03-27 19:50:13 +00:00
Timothy Flynn
93712b24bf Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Renamed from Userland/Libraries/LibJS/Bytecode/Operand.h (Browse further)