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