LibJS: Store bytecode VM program counter in ExecutionContext

This way it's always automatically correct, and we don't have to
manually flush it in push_execution_context().

~7% speedup on the MicroBench/call* tests :^)
This commit is contained in:
Andreas Kling 2025-04-28 19:02:56 +02:00 committed by Jelle Raaijmakers
commit 4d17707b26
Notes: github-actions[bot] 2025-04-28 19:13:46 +00:00
6 changed files with 22 additions and 33 deletions

View file

@ -76,7 +76,6 @@ public:
Executable& current_executable() { return *m_current_executable; }
Executable const& current_executable() const { return *m_current_executable; }
Optional<size_t> program_counter() const { return m_program_counter; }
Span<Value> allocate_argument_values(size_t argument_count)
{
m_argument_values_buffer.resize_and_keep_capacity(argument_count);
@ -100,7 +99,6 @@ private:
GC::Ptr<Realm> m_realm { nullptr };
GC::Ptr<Object> m_global_object { nullptr };
GC::Ptr<DeclarativeEnvironment> m_global_declarative_environment { nullptr };
Optional<size_t&> m_program_counter;
Span<Value> m_registers_and_constants_and_locals_arguments;
Vector<Value> m_argument_values_buffer;
ExecutionContext* m_running_execution_context { nullptr };