LibJS: Cache generated bytecode for ScriptFunction

It's silly to generate new bytecode every time you call a function.
Let's just cache the code instead. :^)
This commit is contained in:
Andreas Kling 2021-06-07 15:19:48 +02:00
commit 4ba2eb8fe5
Notes: sideshowbarker 2024-07-18 12:41:42 +09:00
2 changed files with 9 additions and 6 deletions

View file

@ -47,6 +47,7 @@ private:
FlyString m_name;
NonnullRefPtr<Statement> m_body;
const Vector<FunctionNode::Parameter> m_parameters;
OwnPtr<Bytecode::Block> m_bytecode_block;
ScopeObject* m_parent_scope { nullptr };
i32 m_function_length { 0 };
bool m_is_strict { false };