Commit 7fd3c94c authored by Zhi An Ng's avatar Zhi An Ng Committed by Commit Bot

[cleanup][execution] Remove uses of DISALLOW_COPY_AND_ASSIGN

Bug: v8:11074
Change-Id: Iae76972afb7d1933b8eb57cf634053bb518eeb4b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2565080Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71509}
parent 6ef18cf6
......@@ -27,6 +27,9 @@ class InnerPointerToCodeCache {
Flush();
}
InnerPointerToCodeCache(const InnerPointerToCodeCache&) = delete;
InnerPointerToCodeCache& operator=(const InnerPointerToCodeCache&) = delete;
void Flush() { memset(static_cast<void*>(&cache_[0]), 0, sizeof(cache_)); }
InnerPointerToCodeCacheEntry* GetCacheEntry(Address inner_pointer);
......@@ -38,8 +41,6 @@ class InnerPointerToCodeCache {
static const int kInnerPointerToCodeCacheSize = 1024;
InnerPointerToCodeCacheEntry cache_[kInnerPointerToCodeCacheSize];
DISALLOW_COPY_AND_ASSIGN(InnerPointerToCodeCache);
};
inline Address StackHandler::address() const {
......
......@@ -1175,6 +1175,9 @@ class JavaScriptBuiltinContinuationWithCatchFrame
class StackFrameIteratorBase {
public:
StackFrameIteratorBase(const StackFrameIteratorBase&) = delete;
StackFrameIteratorBase& operator=(const StackFrameIteratorBase&) = delete;
Isolate* isolate() const { return isolate_; }
bool done() const { return frame_ == nullptr; }
......@@ -1203,7 +1206,6 @@ class StackFrameIteratorBase {
private:
friend class StackFrame;
DISALLOW_COPY_AND_ASSIGN(StackFrameIteratorBase);
};
class StackFrameIterator : public StackFrameIteratorBase {
......@@ -1213,6 +1215,9 @@ class StackFrameIterator : public StackFrameIteratorBase {
// An iterator that iterates over a given thread's stack.
V8_EXPORT_PRIVATE StackFrameIterator(Isolate* isolate, ThreadLocalTop* t);
StackFrameIterator(const StackFrameIterator&) = delete;
StackFrameIterator& operator=(const StackFrameIterator&) = delete;
StackFrame* frame() const {
DCHECK(!done());
return frame_;
......@@ -1222,8 +1227,6 @@ class StackFrameIterator : public StackFrameIteratorBase {
private:
// Go back to the first frame.
void Reset(ThreadLocalTop* top);
DISALLOW_COPY_AND_ASSIGN(StackFrameIterator);
};
// Iterator that supports iterating through all JavaScript frames.
......
......@@ -27,6 +27,8 @@ using AtomicsWaitEvent = v8::Isolate::AtomicsWaitEvent;
class FutexWaitList {
public:
FutexWaitList() = default;
FutexWaitList(const FutexWaitList&) = delete;
FutexWaitList& operator=(const FutexWaitList&) = delete;
void AddNode(FutexWaitListNode* node);
void RemoveNode(FutexWaitListNode* node);
......@@ -95,8 +97,6 @@ class FutexWaitList {
// Isolate* -> linked list of Nodes which are waiting for their Promises to
// be resolved.
std::map<Isolate*, HeadAndTail> isolate_promises_to_resolve_;
DISALLOW_COPY_AND_ASSIGN(FutexWaitList);
};
namespace {
......
......@@ -65,6 +65,8 @@ class FutexWaitListNode {
size_t wait_addr, Handle<JSObject> promise_capability,
Isolate* isolate);
~FutexWaitListNode();
FutexWaitListNode(const FutexWaitListNode&) = delete;
FutexWaitListNode& operator=(const FutexWaitListNode&) = delete;
void NotifyWake();
......@@ -77,11 +79,11 @@ class FutexWaitListNode {
public:
explicit ResetWaitingOnScopeExit(FutexWaitListNode* node) : node_(node) {}
~ResetWaitingOnScopeExit() { node_->waiting_ = false; }
ResetWaitingOnScopeExit(const ResetWaitingOnScopeExit&) = delete;
ResetWaitingOnScopeExit& operator=(const ResetWaitingOnScopeExit&) = delete;
private:
FutexWaitListNode* node_;
DISALLOW_COPY_AND_ASSIGN(ResetWaitingOnScopeExit);
};
private:
......@@ -132,8 +134,6 @@ class FutexWaitListNode {
CancelableTaskManager::Id timeout_task_id_ =
CancelableTaskManager::kInvalidTaskId;
DISALLOW_COPY_AND_ASSIGN(FutexWaitListNode);
};
class FutexEmulation : public AllStatic {
......
......@@ -31,6 +31,9 @@ class IsolateData final {
public:
explicit IsolateData(Isolate* isolate) : stack_guard_(isolate) {}
IsolateData(const IsolateData&) = delete;
IsolateData& operator=(const IsolateData&) = delete;
static constexpr intptr_t kIsolateRootBias = kRootRegisterBias;
// The value of the kRootRegister.
......@@ -219,8 +222,6 @@ class IsolateData final {
friend class Heap;
FRIEND_TEST(HeapTest, ExternalLimitDefault);
FRIEND_TEST(HeapTest, ExternalLimitStaysAboveDefaultForExplicitHandling);
DISALLOW_COPY_AND_ASSIGN(IsolateData);
};
// IsolateData object must have "predictable" layout which does not change when
......
......@@ -483,6 +483,9 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory {
class EntryStackItem;
public:
Isolate(const Isolate&) = delete;
Isolate& operator=(const Isolate&) = delete;
using HandleScopeType = HandleScope;
void* operator new(size_t) = delete;
void operator delete(void*) = delete;
......@@ -504,6 +507,8 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory {
{
}
~PerIsolateThreadData();
PerIsolateThreadData(const PerIsolateThreadData&) = delete;
PerIsolateThreadData& operator=(const PerIsolateThreadData&) = delete;
Isolate* isolate() const { return isolate_; }
ThreadId thread_id() const { return thread_id_; }
......@@ -531,8 +536,6 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory {
friend class Isolate;
friend class ThreadDataTable;
friend class EntryStackItem;
DISALLOW_COPY_AND_ASSIGN(PerIsolateThreadData);
};
static void InitializeOncePerProcess();
......@@ -1697,14 +1700,13 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory {
previous_thread_data(previous_thread_data),
previous_isolate(previous_isolate),
previous_item(previous_item) {}
EntryStackItem(const EntryStackItem&) = delete;
EntryStackItem& operator=(const EntryStackItem&) = delete;
int entry_count;
PerIsolateThreadData* previous_thread_data;
Isolate* previous_isolate;
EntryStackItem* previous_item;
private:
DISALLOW_COPY_AND_ASSIGN(EntryStackItem);
};
static base::Thread::LocalStorageKey per_isolate_thread_data_key_;
......@@ -2022,8 +2024,6 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory {
friend class heap::HeapTester;
friend class TestSerializer;
DISALLOW_COPY_AND_ASSIGN(Isolate);
};
#undef FIELD_ACCESSOR
......
......@@ -845,10 +845,11 @@ class V8_NODISCARD PrepareStackTraceScope {
~PrepareStackTraceScope() { isolate_->set_formatting_stack_trace(false); }
PrepareStackTraceScope(const PrepareStackTraceScope&) = delete;
PrepareStackTraceScope& operator=(const PrepareStackTraceScope&) = delete;
private:
Isolate* isolate_;
DISALLOW_COPY_AND_ASSIGN(PrepareStackTraceScope);
};
} // namespace
......
......@@ -23,6 +23,9 @@ class RootVisitor;
// invocation.
class V8_EXPORT_PRIVATE V8_NODISCARD StackGuard final {
public:
StackGuard(const StackGuard&) = delete;
StackGuard& operator=(const StackGuard&) = delete;
explicit StackGuard(Isolate* isolate) : isolate_(isolate) {}
// Pass the address beyond which the stack should not grow. The stack
......@@ -179,8 +182,6 @@ class V8_EXPORT_PRIVATE V8_NODISCARD StackGuard final {
friend class Isolate;
friend class StackLimitCheck;
friend class InterruptsScope;
DISALLOW_COPY_AND_ASSIGN(StackGuard);
};
STATIC_ASSERT(StackGuard::kSizeInBytes == sizeof(StackGuard));
......
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