Commit 6df4c377 authored by Florian Sattler's avatar Florian Sattler Committed by Commit Bot

[cleanup] Mark heap/ methods in subclasses with override.

Fixing clang-tidy warning.

Bug: v8:8015
Change-Id: Ibdb4b81e1ba764d73bac6592eeef5783097076fc
Reviewed-on: https://chromium-review.googlesource.com/1225896Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Commit-Queue: Florian Sattler <sattlerf@google.com>
Cr-Commit-Position: refs/heads/master@{#55965}
parent 83db8c36
......@@ -47,7 +47,7 @@ class ArrayBufferCollector::FreeingTask final : public CancelableTask {
explicit FreeingTask(Heap* heap)
: CancelableTask(heap->isolate()), heap_(heap) {}
virtual ~FreeingTask() = default;
~FreeingTask() override = default;
private:
void RunInternal() final {
......
......@@ -505,7 +505,7 @@ class ConcurrentMarking::Task : public CancelableTask {
task_state_(task_state),
task_id_(task_id) {}
virtual ~Task() = default;
~Task() override = default;
private:
// v8::internal::CancelableTask overrides.
......
......@@ -64,7 +64,7 @@ class V8_EXPORT_PRIVATE HeapController : public MemoryController {
double MaxGrowingFactor(size_t curr_max_size);
protected:
const char* ControllerName() { return "HeapController"; }
const char* ControllerName() override { return "HeapController"; }
};
} // namespace internal
......
......@@ -1954,7 +1954,7 @@ static bool IsUnscavengedHeapObject(Heap* heap, Object** p) {
class ScavengeWeakObjectRetainer : public WeakObjectRetainer {
public:
virtual Object* RetainAs(Object* object) {
Object* RetainAs(Object* object) override {
if (!Heap::InFromSpace(object)) {
return object;
}
......@@ -2021,7 +2021,7 @@ static bool IsLogging(Isolate* isolate) {
class PageScavengingItem final : public ItemParallelJob::Item {
public:
explicit PageScavengingItem(MemoryChunk* chunk) : chunk_(chunk) {}
virtual ~PageScavengingItem() = default;
~PageScavengingItem() override = default;
void Process(Scavenger* scavenger) { scavenger->ScavengePage(chunk_); }
......@@ -2555,8 +2555,8 @@ void Heap::VisitExternalResources(v8::ExternalResourceVisitor* visitor) {
explicit ExternalStringTableVisitorAdapter(
Isolate* isolate, v8::ExternalResourceVisitor* visitor)
: isolate_(isolate), visitor_(visitor) {}
virtual void VisitRootPointers(Root root, const char* description,
Object** start, Object** end) {
void VisitRootPointers(Root root, const char* description,
Object** start, Object** end) override {
for (Object** p = start; p < end; p++) {
DCHECK((*p)->IsExternalString());
visitor_->VisitExternalString(
......@@ -2865,8 +2865,8 @@ class LeftTrimmerVerifierRootVisitor : public RootVisitor {
explicit LeftTrimmerVerifierRootVisitor(FixedArrayBase* to_check)
: to_check_(to_check) {}
virtual void VisitRootPointers(Root root, const char* description,
Object** start, Object** end) {
void VisitRootPointers(Root root, const char* description,
Object** start, Object** end) override {
for (Object** p = start; p < end; ++p) {
DCHECK_NE(*p, to_check_);
}
......@@ -3532,7 +3532,7 @@ class MemoryPressureInterruptTask : public CancelableTask {
explicit MemoryPressureInterruptTask(Heap* heap)
: CancelableTask(heap->isolate()), heap_(heap) {}
virtual ~MemoryPressureInterruptTask() = default;
~MemoryPressureInterruptTask() override = default;
private:
// v8::internal::CancelableTask overrides.
......@@ -5351,14 +5351,14 @@ class UnreachableObjectsFilter : public HeapObjectsFilter {
MarkReachableObjects();
}
~UnreachableObjectsFilter() {
~UnreachableObjectsFilter() override {
for (auto it : reachable_) {
delete it.second;
it.second = nullptr;
}
}
bool SkipObject(HeapObject* object) {
bool SkipObject(HeapObject* object) override {
if (object->IsFiller()) return true;
MemoryChunk* chunk = MemoryChunk::FromAddress(object->address());
if (reachable_.count(chunk) == 0) return true;
......
......@@ -71,7 +71,7 @@ class V8_EXPORT_PRIVATE ItemParallelJob {
class V8_EXPORT_PRIVATE Task : public CancelableTask {
public:
explicit Task(Isolate* isolate);
virtual ~Task();
~Task() override;
virtual void RunInParallel() = 0;
......
......@@ -989,7 +989,7 @@ class MarkCompactWeakObjectRetainer : public WeakObjectRetainer {
MarkCompactCollector::NonAtomicMarkingState* marking_state)
: marking_state_(marking_state) {}
virtual Object* RetainAs(Object* object) {
Object* RetainAs(Object* object) override {
HeapObject* heap_object = HeapObject::cast(object);
DCHECK(!marking_state_->IsGrey(heap_object));
if (marking_state_->IsBlack(heap_object)) {
......@@ -1352,7 +1352,7 @@ class EvacuateNewSpacePageVisitor final : public HeapObjectVisitor {
}
}
inline bool Visit(HeapObject* object, int size) {
inline bool Visit(HeapObject* object, int size) override {
if (mode == NEW_TO_NEW) {
heap_->UpdateAllocationSite(object->map(), object,
local_pretenuring_feedback_);
......@@ -1394,7 +1394,7 @@ class EvacuateRecordOnlyVisitor final : public HeapObjectVisitor {
public:
explicit EvacuateRecordOnlyVisitor(Heap* heap) : heap_(heap) {}
inline bool Visit(HeapObject* object, int size) {
inline bool Visit(HeapObject* object, int size) override {
RecordMigratedSlotVisitor visitor(heap_->mark_compact_collector());
object->IterateBodyFast(&visitor);
return true;
......@@ -2486,7 +2486,7 @@ void FullEvacuator::RawEvacuatePage(Page* page, intptr_t* live_bytes) {
class PageEvacuationItem : public ItemParallelJob::Item {
public:
explicit PageEvacuationItem(Page* page) : page_(page) {}
virtual ~PageEvacuationItem() = default;
~PageEvacuationItem() override = default;
Page* page() const { return page_; }
private:
......@@ -2608,7 +2608,7 @@ void MarkCompactCollector::EvacuatePagesInParallel() {
class EvacuationWeakObjectRetainer : public WeakObjectRetainer {
public:
virtual Object* RetainAs(Object* object) {
Object* RetainAs(Object* object) override {
if (object->IsHeapObject()) {
HeapObject* heap_object = HeapObject::cast(object);
MapWord map_word = heap_object->map_word();
......@@ -2783,7 +2783,7 @@ void MarkCompactCollector::Evacuate() {
class UpdatingItem : public ItemParallelJob::Item {
public:
virtual ~UpdatingItem() = default;
~UpdatingItem() override = default;
virtual void Process() = 0;
};
......@@ -2818,7 +2818,7 @@ class ToSpaceUpdatingItem : public UpdatingItem {
start_(start),
end_(end),
marking_state_(marking_state) {}
virtual ~ToSpaceUpdatingItem() = default;
~ToSpaceUpdatingItem() override = default;
void Process() override {
if (chunk_->IsFlagSet(Page::PAGE_NEW_NEW_PROMOTION)) {
......@@ -2872,7 +2872,7 @@ class RememberedSetUpdatingItem : public UpdatingItem {
marking_state_(marking_state),
chunk_(chunk),
updating_mode_(updating_mode) {}
virtual ~RememberedSetUpdatingItem() = default;
~RememberedSetUpdatingItem() override = default;
void Process() override {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
......@@ -3020,7 +3020,7 @@ class GlobalHandlesUpdatingItem : public UpdatingItem {
global_handles_(global_handles),
start_(start),
end_(end) {}
virtual ~GlobalHandlesUpdatingItem() = default;
~GlobalHandlesUpdatingItem() override = default;
void Process() override {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
......@@ -3047,7 +3047,7 @@ class ArrayBufferTrackerUpdatingItem : public UpdatingItem {
explicit ArrayBufferTrackerUpdatingItem(Page* page, EvacuationState state)
: page_(page), state_(state) {}
virtual ~ArrayBufferTrackerUpdatingItem() = default;
~ArrayBufferTrackerUpdatingItem() override = default;
void Process() override {
TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
......@@ -3916,7 +3916,7 @@ class MinorMarkCompactWeakObjectRetainer : public WeakObjectRetainer {
MinorMarkCompactCollector* collector)
: marking_state_(collector->non_atomic_marking_state()) {}
virtual Object* RetainAs(Object* object) {
Object* RetainAs(Object* object) override {
HeapObject* heap_object = HeapObject::cast(object);
if (!Heap::InNewSpace(heap_object)) return object;
......@@ -3991,7 +3991,7 @@ class YoungGenerationMarkingTask;
class MarkingItem : public ItemParallelJob::Item {
public:
virtual ~MarkingItem() = default;
~MarkingItem() override = default;
virtual void Process(YoungGenerationMarkingTask* task) = 0;
};
......@@ -4079,7 +4079,7 @@ class PageMarkingItem : public MarkingItem {
public:
explicit PageMarkingItem(MemoryChunk* chunk, std::atomic<int>* global_slots)
: chunk_(chunk), global_slots_(global_slots), slots_(0) {}
virtual ~PageMarkingItem() { *global_slots_ = *global_slots_ + slots_; }
~PageMarkingItem() override { *global_slots_ = *global_slots_ + slots_; }
void Process(YoungGenerationMarkingTask* task) override {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
......@@ -4139,7 +4139,7 @@ class GlobalHandlesMarkingItem : public MarkingItem {
GlobalHandlesMarkingItem(Heap* heap, GlobalHandles* global_handles,
size_t start, size_t end)
: global_handles_(global_handles), start_(start), end_(end) {}
virtual ~GlobalHandlesMarkingItem() = default;
~GlobalHandlesMarkingItem() override = default;
void Process(YoungGenerationMarkingTask* task) override {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
......
......@@ -701,7 +701,7 @@ class MarkCompactCollector final : public MarkCompactCollectorBase {
private:
explicit MarkCompactCollector(Heap* heap);
~MarkCompactCollector();
~MarkCompactCollector() override;
bool WillBeDeoptimized(Code* code);
......@@ -974,7 +974,7 @@ class MinorMarkCompactCollector final : public MarkCompactCollectorBase {
using NonAtomicMarkingState = MinorNonAtomicMarkingState;
explicit MinorMarkCompactCollector(Heap* heap);
~MinorMarkCompactCollector();
~MinorMarkCompactCollector() override;
MarkingState* marking_state() { return &marking_state_; }
......
......@@ -123,7 +123,7 @@ class StoreBuffer {
: CancelableTask(isolate),
store_buffer_(store_buffer),
tracer_(isolate->heap()->tracer()) {}
virtual ~Task() = default;
~Task() override = default;
private:
void RunInternal() override {
......
......@@ -76,7 +76,7 @@ class Sweeper::SweeperTask final : public CancelableTask {
space_to_start_(space_to_start),
tracer_(isolate->heap()->tracer()) {}
virtual ~SweeperTask() = default;
~SweeperTask() override = default;
private:
void RunInternal() final {
......@@ -111,7 +111,7 @@ class Sweeper::IncrementalSweeperTask final : public CancelableTask {
IncrementalSweeperTask(Isolate* isolate, Sweeper* sweeper)
: CancelableTask(isolate), isolate_(isolate), sweeper_(sweeper) {}
virtual ~IncrementalSweeperTask() = default;
~IncrementalSweeperTask() override = default;
private:
void RunInternal() final {
......@@ -530,7 +530,7 @@ class Sweeper::IterabilityTask final : public CancelableTask {
pending_iterability_task_(pending_iterability_task),
tracer_(isolate->heap()->tracer()) {}
virtual ~IterabilityTask() = default;
~IterabilityTask() override = default;
private:
void RunInternal() final {
......
......@@ -135,10 +135,10 @@ class ProfilerEventsProcessor : public base::Thread {
public:
ProfilerEventsProcessor(Isolate* isolate, ProfileGenerator* generator,
base::TimeDelta period);
virtual ~ProfilerEventsProcessor();
~ProfilerEventsProcessor() override;
// Thread control.
virtual void Run();
void Run() override;
void StopSynchronously();
V8_INLINE bool running() { return !!base::Relaxed_Load(&running_); }
void Enqueue(const CodeEventsContainer& event);
......
......@@ -27,7 +27,7 @@ class StringsStorage;
class HeapProfiler : public HeapObjectAllocationTracker {
public:
explicit HeapProfiler(Heap* heap);
~HeapProfiler();
~HeapProfiler() override;
HeapSnapshot* TakeSnapshot(
v8::ActivityControl* control,
......
......@@ -1352,7 +1352,7 @@ class JSArrayBufferDataEntryAllocator : public HeapEntriesAllocator {
: size_(size)
, explorer_(explorer) {
}
virtual HeapEntry* AllocateEntry(HeapThing ptr) {
HeapEntry* AllocateEntry(HeapThing ptr) override {
return explorer_->AddEntry(reinterpret_cast<Address>(ptr),
HeapEntry::kNative, "system / JSArrayBufferData",
size_);
......@@ -2076,7 +2076,7 @@ class BasicHeapEntriesAllocator : public HeapEntriesAllocator {
heap_object_map_(snapshot_->profiler()->heap_object_map()),
entries_type_(entries_type) {
}
virtual HeapEntry* AllocateEntry(HeapThing ptr);
HeapEntry* AllocateEntry(HeapThing ptr) override;
private:
HeapSnapshot* snapshot_;
StringsStorage* names_;
......@@ -2107,7 +2107,7 @@ class EmbedderGraphEntriesAllocator : public HeapEntriesAllocator {
: snapshot_(snapshot),
names_(snapshot_->profiler()->names()),
heap_object_map_(snapshot_->profiler()->heap_object_map()) {}
virtual HeapEntry* AllocateEntry(HeapThing ptr);
HeapEntry* AllocateEntry(HeapThing ptr) override;
private:
HeapSnapshot* snapshot_;
......@@ -2162,17 +2162,17 @@ class NativeGroupRetainedObjectInfo : public v8::RetainedObjectInfo {
hash_(reinterpret_cast<intptr_t>(label)),
label_(label) {}
virtual ~NativeGroupRetainedObjectInfo() {}
virtual void Dispose() {
~NativeGroupRetainedObjectInfo() override {}
void Dispose() override {
CHECK(!disposed_);
disposed_ = true;
delete this;
}
virtual bool IsEquivalent(RetainedObjectInfo* other) {
bool IsEquivalent(RetainedObjectInfo* other) override {
return hash_ == other->GetHash() && !strcmp(label_, other->GetLabel());
}
virtual intptr_t GetHash() { return hash_; }
virtual const char* GetLabel() { return label_; }
intptr_t GetHash() override { return hash_; }
const char* GetLabel() override { return label_; }
private:
bool disposed_;
......
......@@ -352,8 +352,8 @@ class V8HeapExplorer : public HeapEntriesAllocator {
V8HeapExplorer(HeapSnapshot* snapshot,
SnapshottingProgressReportingInterface* progress,
v8::HeapProfiler::ObjectNameResolver* resolver);
virtual ~V8HeapExplorer();
virtual HeapEntry* AllocateEntry(HeapThing ptr);
~V8HeapExplorer() override;
HeapEntry* AllocateEntry(HeapThing ptr) override;
int EstimateObjectsCount();
bool IterateAndExtractReferences(SnapshotFiller* filler);
void TagGlobalObjects();
......@@ -570,8 +570,8 @@ class HeapSnapshotGenerator : public SnapshottingProgressReportingInterface {
private:
bool FillReferences();
void ProgressStep();
bool ProgressReport(bool force = false);
void ProgressStep() override;
bool ProgressReport(bool force = false) override;
void InitProgressCounter();
HeapSnapshot* snapshot_;
......
......@@ -166,7 +166,7 @@ class SamplingAllocationObserver : public AllocationObserver {
heap_(heap),
random_(random),
rate_(rate) {}
virtual ~SamplingAllocationObserver() {}
~SamplingAllocationObserver() override {}
protected:
void Step(int bytes_allocated, Address soon_object, size_t size) override {
......
......@@ -20,7 +20,7 @@ class TracingCpuProfilerImpl final
: private v8::TracingController::TraceStateObserver {
public:
explicit TracingCpuProfilerImpl(Isolate*);
~TracingCpuProfilerImpl();
~TracingCpuProfilerImpl() override;
// v8::TracingController::TraceStateObserver
void OnTraceEnabled() final;
......
......@@ -27,14 +27,14 @@ class TestOneByteResource : public v8::String::ExternalOneByteStringResource {
length_(strlen(data) - offset),
counter_(counter) {}
~TestOneByteResource() {
~TestOneByteResource() override {
i::DeleteArray(orig_data_);
if (counter_ != nullptr) ++*counter_;
}
const char* data() const { return data_; }
const char* data() const override { return data_; }
size_t length() const { return length_; }
size_t length() const override { return length_; }
private:
const char* orig_data_;
......
......@@ -3247,14 +3247,14 @@ class SourceResource : public v8::String::ExternalOneByteStringResource {
explicit SourceResource(const char* data)
: data_(data), length_(strlen(data)) { }
virtual void Dispose() {
void Dispose() override {
i::DeleteArray(data_);
data_ = nullptr;
}
const char* data() const { return data_; }
const char* data() const override { return data_; }
size_t length() const { return length_; }
size_t length() const override { return length_; }
bool IsDisposed() { return data_ == nullptr; }
......@@ -5427,11 +5427,11 @@ class StaticOneByteResource : public v8::String::ExternalOneByteStringResource {
public:
explicit StaticOneByteResource(const char* data) : data_(data) {}
~StaticOneByteResource() = default;
~StaticOneByteResource() override = default;
const char* data() const { return data_; }
const char* data() const override { return data_; }
size_t length() const { return strlen(data_); }
size_t length() const override { return strlen(data_); }
private:
const char* data_;
......
......@@ -37,7 +37,7 @@ class MockPlatform : public TestPlatform {
// Now that it's completely constructed, make this the current platform.
i::V8::SetPlatformForTesting(this);
}
virtual ~MockPlatform() {
~MockPlatform() override {
delete task_;
i::V8::SetPlatformForTesting(old_platform_);
for (auto& task : worker_tasks_) {
......
......@@ -23,7 +23,7 @@ class MockPlatformForUnmapper : public TestPlatform {
// Now that it's completely constructed, make this the current platform.
i::V8::SetPlatformForTesting(this);
}
virtual ~MockPlatformForUnmapper() {
~MockPlatformForUnmapper() override {
delete task_;
i::V8::SetPlatformForTesting(old_platform_);
for (auto& task : worker_tasks_) {
......
......@@ -20,7 +20,7 @@ class BitmapTest : public ::testing::Test {
memset(memory_, 0, Bitmap::kSize);
}
virtual ~BitmapTest() { delete[] memory_; }
~BitmapTest() override { delete[] memory_; }
Bitmap* bitmap() { return reinterpret_cast<Bitmap*>(memory_); }
uint8_t* raw_bitmap() { return memory_; }
......
......@@ -15,7 +15,7 @@ namespace {
class GCIdleTimeHandlerTest : public ::testing::Test {
public:
GCIdleTimeHandlerTest() = default;
virtual ~GCIdleTimeHandlerTest() = default;
~GCIdleTimeHandlerTest() override = default;
GCIdleTimeHandler* handler() { return &handler_; }
......
......@@ -151,7 +151,7 @@ class TaskForDifferentItems;
class BaseItem : public ItemParallelJob::Item {
public:
virtual ~BaseItem() = default;
~BaseItem() override = default;
virtual void ProcessItem(TaskForDifferentItems* task) = 0;
};
......@@ -162,7 +162,7 @@ class TaskForDifferentItems : public ItemParallelJob::Task {
: ItemParallelJob::Task(isolate),
processed_a_(processed_a),
processed_b_(processed_b) {}
virtual ~TaskForDifferentItems() = default;
~TaskForDifferentItems() override = default;
void RunInParallel() override {
BaseItem* item = nullptr;
......@@ -182,13 +182,13 @@ class TaskForDifferentItems : public ItemParallelJob::Task {
class ItemA : public BaseItem {
public:
virtual ~ItemA() = default;
~ItemA() override = default;
void ProcessItem(TaskForDifferentItems* task) override { task->ProcessA(); }
};
class ItemB : public BaseItem {
public:
virtual ~ItemB() = default;
~ItemB() override = default;
void ProcessItem(TaskForDifferentItems* task) override { task->ProcessB(); }
};
......
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