1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:38:12 +00:00

LibJS: Make one compact allocation for CallExpression and its Arguments

Instead of CallExpression storing its arguments in a Vector<Argument>,
we now custom-allocate the memory slot for CallExpression (and its
subclass NewExpression) so that it fits both CallExpression and its list
of Arguments in one allocation.

This reduces memory usage on twitter.com/awesomekling by 8.8 MiB :^)
This commit is contained in:
Andreas Kling 2022-11-26 19:51:50 +01:00 committed by Linus Groh
parent 8a8d8ecb35
commit b894acd6b2
4 changed files with 56 additions and 32 deletions

View file

@ -1551,7 +1551,7 @@ Bytecode::CodeGenerationErrorOr<void> CallExpression::generate_bytecode(Bytecode
generator.emit<Bytecode::Op::Store>(callee_reg);
}
TRY(arguments_to_array_for_call(generator, m_arguments));
TRY(arguments_to_array_for_call(generator, arguments()));
Bytecode::Op::Call::CallType call_type;
if (is<NewExpression>(*this)) {