diff --git a/runtime/ecma_vm.cpp b/runtime/ecma_vm.cpp index 2e496f896b4762f93312de48d49613ccffda976d..262bd50eb338dd2ab162d516dc033d04973d52da 100644 --- a/runtime/ecma_vm.cpp +++ b/runtime/ecma_vm.cpp @@ -789,12 +789,11 @@ void EcmaVM::ProcessReferences(const WeakRootVisitor &v0) } } -void EcmaVM::HandleEnqueueReferences() +void EcmaVM::HandleGCRoutineInMutator() { // Handle references only in JS thread - if (Thread::GetCurrent() != thread_) { - return; - } + ASSERT(Thread::GetCurrent() == thread_); + ASSERT(GetMutatorLock()->HasLock()); [[maybe_unused]] EcmaHandleScope scope(thread_); for (JSFinalizationRegistry *registry : finalization_registries_) { JSHandle handle(thread_, registry); diff --git a/runtime/ecma_vm.h b/runtime/ecma_vm.h index 1a83220cb9e3bb9a5ec949bfd60efa2a554bf134..ea77d595b3aab2d53eff72913671d1d8e2304632 100644 --- a/runtime/ecma_vm.h +++ b/runtime/ecma_vm.h @@ -377,7 +377,7 @@ public: void CollectGarbage() const; void ProcessReferences(const WeakRootVisitor &v0); - void HandleEnqueueReferences() override; + void HandleGCRoutineInMutator() override; JSHandle GetModuleByName(JSHandle module_name);