cppgc: Random cleanups

- ObjectAllocator::Terminate() description was out of date.
- Compactor::CancelIfShouldNotCompact() return value was unused.

Change-Id: Ie47e70eaecaba1300ad638e155a9dd273202aca5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3875084
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82987}
This commit is contained in:
Michael Lippautz 2022-09-05 18:16:55 +02:00 committed by V8 LUCI CQ
parent 41df164a1a
commit e47a942a68
6 changed files with 6 additions and 14 deletions

View File

@ -48,7 +48,6 @@ struct V8_EXPORT EnsureGCInfoIndexTrait final {
static GCInfoIndex EnsureGCInfoIndexNonPolymorphic(std::atomic<GCInfoIndex>&,
TraceCallback,
FinalizationCallback,
NameCallback);
static GCInfoIndex EnsureGCInfoIndexNonPolymorphic(std::atomic<GCInfoIndex>&,
TraceCallback,

View File

@ -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() {

View File

@ -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() {

View File

@ -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());

View File

@ -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();
}

View File

@ -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;