LibJS/Bytecode: Make Bytecode::Interpreter participate in GC marking

Since the relationship between VM and Bytecode::Interpreter is now
clear, we can have VM ask the Interpreter for roots in the GC marking
pass. This avoids having to register and unregister handles and
MarkedVectors over and over.

Since GeneratorObject can also own a RegisterWindow, we share the code
in a RegisterWindow::visit_edges() helper.

~4% speed-up on Kraken/stanford-crypto-ccm.js :^)
This commit is contained in:
Andreas Kling 2023-07-02 12:53:10 +02:00
parent cfb6baf973
commit fb979dcf34
Notes: sideshowbarker 2024-07-17 07:14:09 +09:00
5 changed files with 56 additions and 27 deletions

View file

@ -52,6 +52,8 @@ void GeneratorObject::visit_edges(Cell::Visitor& visitor)
visitor.visit(m_generating_function);
visitor.visit(m_previous_value);
m_execution_context.visit_edges(visitor);
if (m_frame.has_value())
m_frame->visit_edges(visitor);
}
// 27.5.3.2 GeneratorValidate ( generator, generatorBrand ), https://tc39.es/ecma262/#sec-generatorvalidate