Commit 587da278 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[utils][cleanup] Remove uses of DISALLOW_COPY_AND_ASSIGN

Replace by explicitly deleting the copy constructor and copy assignment
operator.

R=zhin@chromium.org

Bug: v8:11074
Change-Id: I30f4ff5ace47622cfb9891ee6a4d4f815ceb0ba3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2523314Reviewed-by: 's avatarZhi An Ng <zhin@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71115}
parent 47ddc5b1
......@@ -56,6 +56,8 @@ class HeapObjectToIndexHashMap : public PointerToIndexHashMap<HeapObject> {};
class RootIndexMap {
public:
explicit RootIndexMap(Isolate* isolate);
RootIndexMap(const RootIndexMap&) = delete;
RootIndexMap& operator=(const RootIndexMap&) = delete;
// Returns true on successful lookup and sets *|out_root_list|.
bool Lookup(HeapObject obj, RootIndex* out_root_list) const {
......@@ -70,8 +72,6 @@ class RootIndexMap {
private:
HeapObjectToIndexHashMap* map_;
DISALLOW_COPY_AND_ASSIGN(RootIndexMap);
};
} // namespace internal
......
......@@ -161,6 +161,9 @@ class VirtualMemory final {
// Empty VirtualMemory object, controlling no reserved memory.
V8_EXPORT_PRIVATE VirtualMemory();
VirtualMemory(const VirtualMemory&) = delete;
VirtualMemory& operator=(const VirtualMemory&) = delete;
// Reserves virtual memory containing an area of the given size that is
// aligned per |alignment| rounded up to the |page_allocator|'s allocate page
// size. The |size| must be aligned with |page_allocator|'s commit page size.
......@@ -247,8 +250,6 @@ class VirtualMemory final {
// Page allocator that controls the virtual memory.
v8::PageAllocator* page_allocator_ = nullptr;
base::AddressRegion region_;
DISALLOW_COPY_AND_ASSIGN(VirtualMemory);
};
} // namespace internal
......
......@@ -28,6 +28,8 @@ struct IdentityMapFindResult {
// instantions.
class V8_EXPORT_PRIVATE IdentityMapBase {
public:
IdentityMapBase(const IdentityMapBase&) = delete;
IdentityMapBase& operator=(const IdentityMapBase&) = delete;
bool empty() const { return size_ == 0; }
int size() const { return size_; }
int capacity() const { return capacity_; }
......@@ -90,8 +92,6 @@ class V8_EXPORT_PRIVATE IdentityMapBase {
StrongRootsEntry* strong_roots_entry_;
uintptr_t* values_;
bool is_iterable_;
DISALLOW_COPY_AND_ASSIGN(IdentityMapBase);
};
// Implements an identity map from object addresses to a given value type {V}.
......@@ -110,6 +110,8 @@ class IdentityMap : public IdentityMapBase {
explicit IdentityMap(Heap* heap,
AllocationPolicy allocator = AllocationPolicy())
: IdentityMapBase(heap), allocator_(allocator) {}
IdentityMap(const IdentityMap&) = delete;
IdentityMap& operator=(const IdentityMap&) = delete;
~IdentityMap() override { Clear(); }
// Searches this map for the given key using the object's address
......@@ -188,6 +190,8 @@ class IdentityMap : public IdentityMapBase {
CHECK(!map_->is_iterable());
map_->EnableIteration();
}
IteratableScope(const IteratableScope&) = delete;
IteratableScope& operator=(const IteratableScope&) = delete;
~IteratableScope() {
CHECK(map_->is_iterable());
map_->DisableIteration();
......@@ -198,7 +202,6 @@ class IdentityMap : public IdentityMapBase {
private:
IdentityMap* map_;
DISALLOW_COPY_AND_ASSIGN(IteratableScope);
};
protected:
......@@ -217,7 +220,6 @@ class IdentityMap : public IdentityMapBase {
private:
AllocationPolicy allocator_;
DISALLOW_COPY_AND_ASSIGN(IdentityMap);
};
} // namespace internal
......
......@@ -20,6 +20,8 @@ template <typename Record>
class LockedQueue final {
public:
inline LockedQueue();
LockedQueue(const LockedQueue&) = delete;
LockedQueue& operator=(const LockedQueue&) = delete;
inline ~LockedQueue();
inline void Enqueue(Record record);
inline bool Dequeue(Record* record);
......@@ -33,8 +35,6 @@ class LockedQueue final {
base::Mutex tail_mutex_;
Node* head_;
Node* tail_;
DISALLOW_COPY_AND_ASSIGN(LockedQueue);
};
} // namespace internal
......
......@@ -308,15 +308,14 @@ template <typename T, size_t kSize>
class EmbeddedVector : public Vector<T> {
public:
EmbeddedVector() : Vector<T>(buffer_, kSize) {}
explicit EmbeddedVector(const T& initial_value) : Vector<T>(buffer_, kSize) {
std::fill_n(buffer_, kSize, initial_value);
}
EmbeddedVector(const EmbeddedVector&) = delete;
EmbeddedVector& operator=(const EmbeddedVector&) = delete;
private:
T buffer_[kSize];
DISALLOW_COPY_AND_ASSIGN(EmbeddedVector);
};
} // namespace internal
......
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