Commit 8434b896 authored by Zhi An Ng's avatar Zhi An Ng Committed by Commit Bot

[cleanup][handles] Remove uses of DISALLOW_COPY_AND_ASSIGN

Bug: v8:11074
Change-Id: I7af4fb1fd93e1b369fdca5b9e726dcafa43b0afb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2565081Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71476}
parent c0b46d97
...@@ -51,6 +51,9 @@ class GlobalHandles::NodeBlock final { ...@@ -51,6 +51,9 @@ class GlobalHandles::NodeBlock final {
global_handles_(global_handles), global_handles_(global_handles),
space_(space) {} space_(space) {}
NodeBlock(const NodeBlock&) = delete;
NodeBlock& operator=(const NodeBlock&) = delete;
NodeType* at(size_t index) { return &nodes_[index]; } NodeType* at(size_t index) { return &nodes_[index]; }
const NodeType* at(size_t index) const { return &nodes_[index]; } const NodeType* at(size_t index) const { return &nodes_[index]; }
GlobalHandles::NodeSpace<NodeType>* space() const { return space_; } GlobalHandles::NodeSpace<NodeType>* space() const { return space_; }
...@@ -73,8 +76,6 @@ class GlobalHandles::NodeBlock final { ...@@ -73,8 +76,6 @@ class GlobalHandles::NodeBlock final {
NodeBlock* next_used_ = nullptr; NodeBlock* next_used_ = nullptr;
NodeBlock* prev_used_ = nullptr; NodeBlock* prev_used_ = nullptr;
uint32_t used_nodes_ = 0; uint32_t used_nodes_ = 0;
DISALLOW_COPY_AND_ASSIGN(NodeBlock);
}; };
template <class NodeType> template <class NodeType>
...@@ -143,6 +144,9 @@ class GlobalHandles::NodeIterator final { ...@@ -143,6 +144,9 @@ class GlobalHandles::NodeIterator final {
NodeIterator(NodeIterator&& other) V8_NOEXCEPT : block_(other.block_), NodeIterator(NodeIterator&& other) V8_NOEXCEPT : block_(other.block_),
index_(other.index_) {} index_(other.index_) {}
NodeIterator(const NodeIterator&) = delete;
NodeIterator& operator=(const NodeIterator&) = delete;
bool operator==(const NodeIterator& other) const { bool operator==(const NodeIterator& other) const {
return block_ == other.block_; return block_ == other.block_;
} }
...@@ -163,8 +167,6 @@ class GlobalHandles::NodeIterator final { ...@@ -163,8 +167,6 @@ class GlobalHandles::NodeIterator final {
private: private:
BlockType* block_ = nullptr; BlockType* block_ = nullptr;
size_t index_ = 0; size_t index_ = 0;
DISALLOW_COPY_AND_ASSIGN(NodeIterator);
}; };
template <class NodeType> template <class NodeType>
...@@ -413,6 +415,9 @@ class GlobalHandles::Node final : public NodeBase<GlobalHandles::Node> { ...@@ -413,6 +415,9 @@ class GlobalHandles::Node final : public NodeBase<GlobalHandles::Node> {
set_in_young_list(false); set_in_young_list(false);
} }
Node(const Node&) = delete;
Node& operator=(const Node&) = delete;
void Zap() { void Zap() {
DCHECK(IsInUse()); DCHECK(IsInUse());
// Zap the values for eager trapping. // Zap the values for eager trapping.
...@@ -619,8 +624,6 @@ class GlobalHandles::Node final : public NodeBase<GlobalHandles::Node> { ...@@ -619,8 +624,6 @@ class GlobalHandles::Node final : public NodeBase<GlobalHandles::Node> {
WeakCallbackInfo<void>::Callback weak_callback_; WeakCallbackInfo<void>::Callback weak_callback_;
friend class NodeBase<Node>; friend class NodeBase<Node>;
DISALLOW_COPY_AND_ASSIGN(Node);
}; };
class GlobalHandles::TracedNode final class GlobalHandles::TracedNode final
......
...@@ -42,6 +42,9 @@ enum WeaknessType { ...@@ -42,6 +42,9 @@ enum WeaknessType {
// callbacks and finalizers attached to them. // callbacks and finalizers attached to them.
class V8_EXPORT_PRIVATE GlobalHandles final { class V8_EXPORT_PRIVATE GlobalHandles final {
public: public:
GlobalHandles(const GlobalHandles&) = delete;
GlobalHandles& operator=(const GlobalHandles&) = delete;
template <class NodeType> template <class NodeType>
class NodeBlock; class NodeBlock;
...@@ -252,8 +255,6 @@ class V8_EXPORT_PRIVATE GlobalHandles final { ...@@ -252,8 +255,6 @@ class V8_EXPORT_PRIVATE GlobalHandles final {
// Counter for recursive garbage collections during callback processing. // Counter for recursive garbage collections during callback processing.
unsigned post_gc_processing_count_ = 0; unsigned post_gc_processing_count_ = 0;
DISALLOW_COPY_AND_ASSIGN(GlobalHandles);
}; };
class GlobalHandles::PendingPhantomCallback final { class GlobalHandles::PendingPhantomCallback final {
...@@ -285,6 +286,8 @@ class EternalHandles final { ...@@ -285,6 +286,8 @@ class EternalHandles final {
public: public:
EternalHandles() = default; EternalHandles() = default;
~EternalHandles(); ~EternalHandles();
EternalHandles(const EternalHandles&) = delete;
EternalHandles& operator=(const EternalHandles&) = delete;
// Create an EternalHandle, overwriting the index. // Create an EternalHandle, overwriting the index.
V8_EXPORT_PRIVATE void Create(Isolate* isolate, Object object, int* index); V8_EXPORT_PRIVATE void Create(Isolate* isolate, Object object, int* index);
...@@ -319,8 +322,6 @@ class EternalHandles final { ...@@ -319,8 +322,6 @@ class EternalHandles final {
int size_ = 0; int size_ = 0;
std::vector<Address*> blocks_; std::vector<Address*> blocks_;
std::vector<int> young_node_indices_; std::vector<int> young_node_indices_;
DISALLOW_COPY_AND_ASSIGN(EternalHandles);
}; };
// A vector of global Handles which automatically manages the backing of those // A vector of global Handles which automatically manages the backing of those
......
...@@ -199,6 +199,8 @@ class V8_NODISCARD HandleScope { ...@@ -199,6 +199,8 @@ class V8_NODISCARD HandleScope {
public: public:
explicit inline HandleScope(Isolate* isolate); explicit inline HandleScope(Isolate* isolate);
inline HandleScope(HandleScope&& other) V8_NOEXCEPT; inline HandleScope(HandleScope&& other) V8_NOEXCEPT;
HandleScope(const HandleScope&) = delete;
HandleScope& operator=(const HandleScope&) = delete;
// Allow placement new. // Allow placement new.
void* operator new(size_t size, void* storage) { void* operator new(size_t size, void* storage) {
...@@ -265,8 +267,6 @@ class V8_NODISCARD HandleScope { ...@@ -265,8 +267,6 @@ class V8_NODISCARD HandleScope {
friend class Isolate; friend class Isolate;
friend class LocalHandles; friend class LocalHandles;
friend class PersistentHandles; friend class PersistentHandles;
DISALLOW_COPY_AND_ASSIGN(HandleScope);
}; };
// Forward declarations for CanonicalHandleScope. // Forward declarations for CanonicalHandleScope.
......
...@@ -46,6 +46,8 @@ class V8_NODISCARD LocalHandleScope { ...@@ -46,6 +46,8 @@ class V8_NODISCARD LocalHandleScope {
explicit inline LocalHandleScope(LocalIsolate* local_isolate); explicit inline LocalHandleScope(LocalIsolate* local_isolate);
explicit inline LocalHandleScope(LocalHeap* local_heap); explicit inline LocalHandleScope(LocalHeap* local_heap);
inline ~LocalHandleScope(); inline ~LocalHandleScope();
LocalHandleScope(const LocalHandleScope&) = delete;
LocalHandleScope& operator=(const LocalHandleScope&) = delete;
template <typename T> template <typename T>
Handle<T> CloseAndEscape(Handle<T> handle_value); Handle<T> CloseAndEscape(Handle<T> handle_value);
...@@ -64,8 +66,6 @@ class V8_NODISCARD LocalHandleScope { ...@@ -64,8 +66,6 @@ class V8_NODISCARD LocalHandleScope {
LocalHeap* local_heap_; LocalHeap* local_heap_;
Address* prev_limit_; Address* prev_limit_;
Address* prev_next_; Address* prev_next_;
DISALLOW_COPY_AND_ASSIGN(LocalHandleScope);
}; };
} // namespace internal } // 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