mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-31 23:42:52 +00:00
If a function has the following properties: - uses only local variables and registers - does not use `this` - does not use `new.target` - does not use `super` - does not use direct eval() calls then it is possible to entirely skip function environment allocation because it will never be used This change adds gathering of information whether a function needs to access `this` from environment and updates `prepare_for_ordinary_call()` to skip allocation when possible. For now, this optimisation is too aggressively blocked; e.g. if `this` is used in a function scope, then all functions in outer scopes have to allocate an environment. It could be improved in the future, although this implementation already allows skipping >80% of environment allocations on Discord, GitHub and Twitter. |
||
---|---|---|
.. | ||
Bytecode | ||
Contrib/Test262 | ||
Heap | ||
Runtime | ||
Tests | ||
AST.cpp | ||
AST.h | ||
CMakeLists.txt | ||
Console.cpp | ||
Console.h | ||
CyclicModule.cpp | ||
CyclicModule.h | ||
Forward.h | ||
Lexer.cpp | ||
Lexer.h | ||
MarkupGenerator.cpp | ||
MarkupGenerator.h | ||
Module.cpp | ||
Module.h | ||
ModuleLoading.h | ||
Parser.cpp | ||
Parser.h | ||
ParserError.cpp | ||
ParserError.h | ||
Position.h | ||
Print.cpp | ||
Print.h | ||
SafeFunction.h | ||
Script.cpp | ||
Script.h | ||
SourceCode.cpp | ||
SourceCode.h | ||
SourceRange.h | ||
SourceTextModule.cpp | ||
SourceTextModule.h | ||
SyntaxHighlighter.cpp | ||
SyntaxHighlighter.h | ||
SyntheticModule.cpp | ||
SyntheticModule.h | ||
Token.cpp | ||
Token.h |