Commit e47a942a authored by Michael Lippautz's avatar Michael Lippautz Committed by V8 LUCI CQ

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/+/3875084Reviewed-by: 's avatarOmer 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}
parent 41df164a
......@@ -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,
......
......@@ -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() {
......
......@@ -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() {
......
......@@ -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());
......
......@@ -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();
}
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment