1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:48:10 +00:00
serenity/Userland/Libraries/LibJS
Lenny Maiorani 800ea8ea96 Userland: static vs non-static constexpr variables
Problem:
- `static` variables consume memory and sometimes are less
  optimizable.
- `static const` variables can be `constexpr`, usually.
- `static` function-local variables require an initialization check
  every time the function is run.

Solution:
- If a global `static` variable is only used in a single function then
  move it into the function and make it non-`static` and `constexpr`.
- Make all global `static` variables `constexpr` instead of `const`.
- Change function-local `static const[expr]` variables to be just
  `constexpr`.
2021-05-21 10:07:06 +01:00
..
Heap LibJS: Don't consider cells in the lazy freelist in conservative scan 2021-05-17 19:57:40 +02:00
Runtime Userland: static vs non-static constexpr variables 2021-05-21 10:07:06 +01:00
Tests LibJS: Implement Object.hasOwn() :^) 2021-05-18 11:18:19 +02:00
AST.cpp LibJS: Make super() in catch block work 2021-05-11 23:31:30 +01:00
AST.h LibJS: Rename RegExpLiteral m_content to m_pattern 2021-05-10 11:57:35 +01:00
CMakeLists.txt LibJS: Move Cell.{cpp,h} from Runtime/ to Heap/ 2021-05-17 19:53:00 +02:00
Console.cpp Everywhere: Use linusg@serenityos.org for my copyright headers 2021-04-22 22:51:19 +02:00
Console.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Forward.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Interpreter.cpp LibJS: Ensure function declarations don't leak outside function scopes 2021-05-13 23:59:00 +01:00
Interpreter.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Lexer.cpp Everywhere: Use linusg@serenityos.org for my copyright headers 2021-04-22 22:51:19 +02:00
Lexer.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
MarkupGenerator.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
MarkupGenerator.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Parser.cpp LibJS: Make invalid RegExp flags a SyntaxError at parse time 2021-05-10 12:01:38 +01:00
Parser.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
SourceRange.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
SyntaxHighlighter.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
SyntaxHighlighter.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Token.cpp Everywhere: Use linusg@serenityos.org for my copyright headers 2021-04-22 22:51:19 +02:00
Token.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00