1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 18:17:44 +00:00

LibJS+LibWeb: Wrap raw JS::Cell*/& fields in GCPtr/NonnullGCPtr

This commit is contained in:
Matthew Olsson 2023-02-26 16:09:02 -07:00 committed by Andreas Kling
parent 1df3652e27
commit 7c0c1c8f49
214 changed files with 825 additions and 827 deletions

View file

@ -215,7 +215,7 @@ VM::InterpreterExecutionScope::~InterpreterExecutionScope()
void VM::gather_roots(HashTable<Cell*>& roots)
{
roots.set(m_empty_string);
for (auto* string : m_single_ascii_character_strings)
for (auto string : m_single_ascii_character_strings)
roots.set(string);
auto gather_roots_from_execution_context_stack = [&roots](Vector<ExecutionContext*> const& stack) {
@ -229,7 +229,7 @@ void VM::gather_roots(HashTable<Cell*>& roots)
roots.set(execution_context->lexical_environment);
roots.set(execution_context->variable_environment);
roots.set(execution_context->private_environment);
if (auto* context_owner = execution_context->context_owner)
if (auto context_owner = execution_context->context_owner)
roots.set(context_owner);
execution_context->script_or_module.visit(
[](Empty) {},
@ -251,7 +251,7 @@ void VM::gather_roots(HashTable<Cell*>& roots)
for (auto& symbol : m_global_symbol_registry)
roots.set(symbol.value);
for (auto* finalization_registry : m_finalization_registry_cleanup_jobs)
for (auto finalization_registry : m_finalization_registry_cleanup_jobs)
roots.set(finalization_registry);
}
@ -687,7 +687,7 @@ void VM::enqueue_promise_job(Function<ThrowCompletionOr<Value>()> job, Realm*)
void VM::run_queued_finalization_registry_cleanup_jobs()
{
while (!m_finalization_registry_cleanup_jobs.is_empty()) {
auto* registry = m_finalization_registry_cleanup_jobs.take_first();
auto registry = m_finalization_registry_cleanup_jobs.take_first();
// FIXME: Handle any uncatched exceptions here.
(void)registry->cleanup();
}