diff --git a/include/cppgc/internal/gc-info.h b/include/cppgc/internal/gc-info.h index 82a0d05343..e8f90fed57 100644 --- a/include/cppgc/internal/gc-info.h +++ b/include/cppgc/internal/gc-info.h @@ -48,7 +48,6 @@ struct V8_EXPORT EnsureGCInfoIndexTrait final { static GCInfoIndex EnsureGCInfoIndexNonPolymorphic(std::atomic&, TraceCallback, FinalizationCallback, - NameCallback); static GCInfoIndex EnsureGCInfoIndexNonPolymorphic(std::atomic&, TraceCallback, diff --git a/src/heap/cppgc/compactor.cc b/src/heap/cppgc/compactor.cc index f346e41e1c..e3792a32f8 100644 --- a/src/heap/cppgc/compactor.cc +++ b/src/heap/cppgc/compactor.cc @@ -487,14 +487,13 @@ void Compactor::InitializeIfShouldCompact( is_cancelled_ = false; } -bool Compactor::CancelIfShouldNotCompact( +void Compactor::CancelIfShouldNotCompact( GarbageCollector::Config::MarkingType marking_type, GarbageCollector::Config::StackState stack_state) { - if (!is_enabled_ || ShouldCompact(marking_type, stack_state)) return false; + if (!is_enabled_ || ShouldCompact(marking_type, stack_state)) return; is_cancelled_ = true; is_enabled_ = false; - return true; } Compactor::CompactableSpaceHandling Compactor::CompactSpacesIfEnabled() { diff --git a/src/heap/cppgc/compactor.h b/src/heap/cppgc/compactor.h index 82ce5291bb..d79e6a7a65 100644 --- a/src/heap/cppgc/compactor.h +++ b/src/heap/cppgc/compactor.h @@ -25,9 +25,10 @@ class V8_EXPORT_PRIVATE Compactor final { void InitializeIfShouldCompact(GarbageCollector::Config::MarkingType, GarbageCollector::Config::StackState); - // Returns true is compaction was cancelled. - bool CancelIfShouldNotCompact(GarbageCollector::Config::MarkingType, + void CancelIfShouldNotCompact(GarbageCollector::Config::MarkingType, GarbageCollector::Config::StackState); + // Returns whether spaces need to be processed by the Sweeper after + // compaction. CompactableSpaceHandling CompactSpacesIfEnabled(); CompactionWorklists* compaction_worklists() { diff --git a/src/heap/cppgc/heap-base.cc b/src/heap/cppgc/heap-base.cc index 495effc26b..8a81b67ea7 100644 --- a/src/heap/cppgc/heap-base.cc +++ b/src/heap/cppgc/heap-base.cc @@ -275,7 +275,7 @@ void HeapBase::Terminate() { }(); } while (more_termination_gcs_needed); - object_allocator().Terminate(); + object_allocator().ResetLinearAllocationBuffers(); disallow_gc_scope_++; CHECK_EQ(0u, strong_persistent_region_.NodesInUse()); diff --git a/src/heap/cppgc/object-allocator.cc b/src/heap/cppgc/object-allocator.cc index 5e1962c9a1..38a3ccd8e9 100644 --- a/src/heap/cppgc/object-allocator.cc +++ b/src/heap/cppgc/object-allocator.cc @@ -261,10 +261,6 @@ void ObjectAllocator::ResetLinearAllocationBuffers() { visitor.Traverse(raw_heap_); } -void ObjectAllocator::Terminate() { - ResetLinearAllocationBuffers(); -} - bool ObjectAllocator::in_disallow_gc_scope() const { return raw_heap_.heap()->in_disallow_gc_scope(); } diff --git a/src/heap/cppgc/object-allocator.h b/src/heap/cppgc/object-allocator.h index 89a0b588dd..ea01f671f7 100644 --- a/src/heap/cppgc/object-allocator.h +++ b/src/heap/cppgc/object-allocator.h @@ -53,9 +53,6 @@ class V8_EXPORT_PRIVATE ObjectAllocator final : public cppgc::AllocationHandle { void ResetLinearAllocationBuffers(); - // Terminate the allocator. Subsequent allocation calls result in a crash. - void Terminate(); - private: bool in_disallow_gc_scope() const;