mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 18:50:50 +00:00
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 :^)
This commit is contained in:
parent
acd29e064c
commit
4438ec481c
Notes:
sideshowbarker
2024-07-18 02:47:59 +09:00
Author: https://github.com/awesomekling
Commit: 4438ec481c
Pull-request: https://github.com/SerenityOS/serenity/pull/23462
Reviewed-by: https://github.com/Hendiadyoin1
8 changed files with 214 additions and 24 deletions
|
@ -69,6 +69,14 @@
|
|||
O(IteratorToArray) \
|
||||
O(Jump) \
|
||||
O(JumpIf) \
|
||||
O(JumpGreaterThan) \
|
||||
O(JumpGreaterThanEquals) \
|
||||
O(JumpLessThan) \
|
||||
O(JumpLessThanEquals) \
|
||||
O(JumpLooselyEquals) \
|
||||
O(JumpLooselyInequals) \
|
||||
O(JumpStrictlyEquals) \
|
||||
O(JumpStrictlyInequals) \
|
||||
O(JumpNullish) \
|
||||
O(JumpUndefined) \
|
||||
O(LeaveLexicalEnvironment) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue