LibJS: Precompute the number of regs/constants/locals in Executable

Instead of doing it again on every call. Minor bump in call performance.
This commit is contained in:
Andreas Kling 2025-10-30 00:09:09 +01:00 committed by Andreas Kling
parent cdcbbcf48b
commit 6671cbef41
Notes: github-actions[bot] 2025-10-30 07:56:02 +00:00
3 changed files with 5 additions and 1 deletions

View file

@ -477,6 +477,8 @@ CodeGenerationErrorOr<GC::Ref<Executable>> Generator::compile(VM& vm, ASTNode co
executable->argument_index_base = number_of_registers + number_of_constants + number_of_locals;
executable->length_identifier = generator.m_length_identifier;
executable->registers_and_constants_and_locals_count = executable->number_of_registers + executable->constants.size() + executable->local_variable_names.size();
generator.m_finished = true;
return executable;