mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +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:
parent
8a8d8ecb35
commit
b894acd6b2
Notes:
sideshowbarker
2024-07-17 03:36:50 +09:00
Author: https://github.com/awesomekling
Commit: b894acd6b2
Pull-request: https://github.com/SerenityOS/serenity/pull/16215
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/trflynn89
4 changed files with 56 additions and 32 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue