mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-16 23:31:55 +00:00
Instead of keeping bytecode as a set of disjoint basic blocks on the malloc heap, bytecode is now a contiguous sequence of bytes(!) The transformation happens at the end of Bytecode::Generator::generate() and the only really hairy part is rerouting jump labels. This required solving a few problems: - The interpreter execution loop had to change quite a bit, since we were storing BasicBlock pointers all over the place, and control transfer was done by redirecting the interpreter's current block. - Exception handlers & finalizers are now stored per-bytecode-range in a side table in Executable. - The interpreter now has a plain program counter instead of a stream iterator. This actually makes error stack generation a bit nicer since we just have to deal with a number instead of reaching into the iterator. This yields a 25% performance improvement on this microbenchmark: for (let i = 0; i < 1_000_000; ++i) { } But basically everything gets faster. :^) |
||
---|---|---|
.. | ||
ASTCodegen.cpp | ||
BasicBlock.cpp | ||
BasicBlock.h | ||
Builtins.cpp | ||
Builtins.h | ||
CodeGenerationError.cpp | ||
CodeGenerationError.h | ||
CommonImplementations.h | ||
Executable.cpp | ||
Executable.h | ||
Generator.cpp | ||
Generator.h | ||
IdentifierTable.cpp | ||
IdentifierTable.h | ||
Instruction.cpp | ||
Instruction.h | ||
Interpreter.cpp | ||
Interpreter.h | ||
Label.h | ||
Op.h | ||
Operand.h | ||
RegexTable.cpp | ||
RegexTable.h | ||
Register.h | ||
StringTable.cpp | ||
StringTable.h |