1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:18:11 +00:00
serenity/Userland/Libraries/LibJS/Bytecode/Pass
Andreas Kling 4438ec481c LibJS/Bytecode: Add peephole optimization pass and fuse compare+jump
This patch adds a new "Peephole" pass for performing small, local
optimizations to bytecode.

We also introduce the first such optimization, fusing a sequence of
some comparison instruction FooCompare followed by a JumpIf into a
new set of JumpFooCompare instructions.

This gives a ~50% speed-up on the following microbenchmark:

    for (let i = 0; i < 10_000_000; ++i) {
    }

But more traditional benchmarks see a pretty sizable speed-up as well,
for example 15% on Kraken/ai-astar.js and 16% on Kraken/audio-dft.js :^)
2024-03-04 20:54:51 +01:00
..
DumpCFG.cpp LibJS/Bytecode: Bring back the bytecode optimization pipeline 2024-03-04 20:54:51 +01:00
GenerateCFG.cpp LibJS/Bytecode: Add peephole optimization pass and fuse compare+jump 2024-03-04 20:54:51 +01:00
MergeBlocks.cpp LibJS/Bytecode: Don't replace the entry block in MergeBlocks 2024-03-04 20:54:51 +01:00
Peephole.cpp LibJS/Bytecode: Add peephole optimization pass and fuse compare+jump 2024-03-04 20:54:51 +01:00
PlaceBlocks.cpp LibJS/Bytecode: Bring back the bytecode optimization pipeline 2024-03-04 20:54:51 +01:00
UnifySameBlocks.cpp LibJS/Bytecode: Bring back the bytecode optimization pipeline 2024-03-04 20:54:51 +01:00