Commit 1ed86c9e authored by Zhi An Ng's avatar Zhi An Ng Committed by Commit Bot

[cleanup][debug] Remove DISALLOW_COPY_AND_ASSIGN

Bug: v8:11074
Change-Id: Ifd47a3256ec23d2c62ff7bbaf4de226fdfd3f68d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2546123Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71249}
parent da888fed
...@@ -22,6 +22,8 @@ class WasmFrame; ...@@ -22,6 +22,8 @@ class WasmFrame;
class FrameInspector { class FrameInspector {
public: public:
FrameInspector(CommonFrame* frame, int inlined_frame_index, Isolate* isolate); FrameInspector(CommonFrame* frame, int inlined_frame_index, Isolate* isolate);
FrameInspector(const FrameInspector&) = delete;
FrameInspector& operator=(const FrameInspector&) = delete;
~FrameInspector(); ~FrameInspector();
...@@ -60,8 +62,6 @@ class FrameInspector { ...@@ -60,8 +62,6 @@ class FrameInspector {
bool is_interpreted_ = false; bool is_interpreted_ = false;
bool has_adapted_arguments_ = false; bool has_adapted_arguments_ = false;
bool is_constructor_ = false; bool is_constructor_ = false;
DISALLOW_COPY_AND_ASSIGN(FrameInspector);
}; };
class RedirectActiveFunctions : public ThreadVisitor { class RedirectActiveFunctions : public ThreadVisitor {
......
...@@ -423,6 +423,8 @@ class V8_EXPORT_PRIVATE ScopeIterator { ...@@ -423,6 +423,8 @@ class V8_EXPORT_PRIVATE ScopeIterator {
ScopeIterator() = default; ScopeIterator() = default;
virtual ~ScopeIterator() = default; virtual ~ScopeIterator() = default;
ScopeIterator(const ScopeIterator&) = delete;
ScopeIterator& operator=(const ScopeIterator&) = delete;
enum ScopeType { enum ScopeType {
ScopeTypeGlobal = 0, ScopeTypeGlobal = 0,
...@@ -449,9 +451,6 @@ class V8_EXPORT_PRIVATE ScopeIterator { ...@@ -449,9 +451,6 @@ class V8_EXPORT_PRIVATE ScopeIterator {
virtual bool SetVariableValue(v8::Local<v8::String> name, virtual bool SetVariableValue(v8::Local<v8::String> name,
v8::Local<v8::Value> value) = 0; v8::Local<v8::Value> value) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(ScopeIterator);
}; };
class V8_EXPORT_PRIVATE StackTraceIterator { class V8_EXPORT_PRIVATE StackTraceIterator {
...@@ -461,6 +460,8 @@ class V8_EXPORT_PRIVATE StackTraceIterator { ...@@ -461,6 +460,8 @@ class V8_EXPORT_PRIVATE StackTraceIterator {
int index = 0); int index = 0);
StackTraceIterator() = default; StackTraceIterator() = default;
virtual ~StackTraceIterator() = default; virtual ~StackTraceIterator() = default;
StackTraceIterator(const StackTraceIterator&) = delete;
StackTraceIterator& operator=(const StackTraceIterator&) = delete;
virtual bool Done() const = 0; virtual bool Done() const = 0;
virtual void Advance() = 0; virtual void Advance() = 0;
...@@ -479,9 +480,6 @@ class V8_EXPORT_PRIVATE StackTraceIterator { ...@@ -479,9 +480,6 @@ class V8_EXPORT_PRIVATE StackTraceIterator {
bool throw_on_side_effect) = 0; bool throw_on_side_effect) = 0;
virtual v8::MaybeLocal<v8::String> EvaluateWasm( virtual v8::MaybeLocal<v8::String> EvaluateWasm(
internal::Vector<const internal::byte> source, int frame_index) = 0; internal::Vector<const internal::byte> source, int frame_index) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(StackTraceIterator);
}; };
class QueryObjectPredicate { class QueryObjectPredicate {
......
...@@ -21,6 +21,8 @@ class DebugPropertyIterator final : public debug::PropertyIterator { ...@@ -21,6 +21,8 @@ class DebugPropertyIterator final : public debug::PropertyIterator {
public: public:
DebugPropertyIterator(Isolate* isolate, Handle<JSReceiver> receiver); DebugPropertyIterator(Isolate* isolate, Handle<JSReceiver> receiver);
~DebugPropertyIterator() override = default; ~DebugPropertyIterator() override = default;
DebugPropertyIterator(const DebugPropertyIterator&) = delete;
DebugPropertyIterator& operator=(const DebugPropertyIterator&) = delete;
bool Done() const override; bool Done() const override;
void Advance() override; void Advance() override;
...@@ -53,8 +55,6 @@ class DebugPropertyIterator final : public debug::PropertyIterator { ...@@ -53,8 +55,6 @@ class DebugPropertyIterator final : public debug::PropertyIterator {
bool calculated_native_accessor_flags_ = false; bool calculated_native_accessor_flags_ = false;
int native_accessor_flags_ = 0; int native_accessor_flags_ = 0;
bool is_own_ = true; bool is_own_ = true;
DISALLOW_COPY_AND_ASSIGN(DebugPropertyIterator);
}; };
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
......
...@@ -47,6 +47,8 @@ class Debug::TemporaryObjectsTracker : public HeapObjectAllocationTracker { ...@@ -47,6 +47,8 @@ class Debug::TemporaryObjectsTracker : public HeapObjectAllocationTracker {
public: public:
TemporaryObjectsTracker() = default; TemporaryObjectsTracker() = default;
~TemporaryObjectsTracker() override = default; ~TemporaryObjectsTracker() override = default;
TemporaryObjectsTracker(const TemporaryObjectsTracker&) = delete;
TemporaryObjectsTracker& operator=(const TemporaryObjectsTracker&) = delete;
void AllocationEvent(Address addr, int) override { objects_.insert(addr); } void AllocationEvent(Address addr, int) override { objects_.insert(addr); }
...@@ -80,7 +82,6 @@ class Debug::TemporaryObjectsTracker : public HeapObjectAllocationTracker { ...@@ -80,7 +82,6 @@ class Debug::TemporaryObjectsTracker : public HeapObjectAllocationTracker {
private: private:
std::unordered_set<Address> objects_; std::unordered_set<Address> objects_;
base::Mutex mutex_; base::Mutex mutex_;
DISALLOW_COPY_AND_ASSIGN(TemporaryObjectsTracker);
}; };
Debug::Debug(Isolate* isolate) Debug::Debug(Isolate* isolate)
......
...@@ -129,6 +129,8 @@ class BreakLocation { ...@@ -129,6 +129,8 @@ class BreakLocation {
class V8_EXPORT_PRIVATE BreakIterator { class V8_EXPORT_PRIVATE BreakIterator {
public: public:
explicit BreakIterator(Handle<DebugInfo> debug_info); explicit BreakIterator(Handle<DebugInfo> debug_info);
BreakIterator(const BreakIterator&) = delete;
BreakIterator& operator=(const BreakIterator&) = delete;
BreakLocation GetBreakLocation(); BreakLocation GetBreakLocation();
bool Done() const { return source_position_iterator_.done(); } bool Done() const { return source_position_iterator_.done(); }
...@@ -160,8 +162,6 @@ class V8_EXPORT_PRIVATE BreakIterator { ...@@ -160,8 +162,6 @@ class V8_EXPORT_PRIVATE BreakIterator {
int statement_position_; int statement_position_;
SourcePositionTableIterator source_position_iterator_; SourcePositionTableIterator source_position_iterator_;
DisallowHeapAllocation no_gc_; DisallowHeapAllocation no_gc_;
DISALLOW_COPY_AND_ASSIGN(BreakIterator);
}; };
// Linked list holding debug info objects. The debug info objects are kept as // Linked list holding debug info objects. The debug info objects are kept as
...@@ -214,6 +214,9 @@ class DebugFeatureTracker { ...@@ -214,6 +214,9 @@ class DebugFeatureTracker {
// DebugInfo. // DebugInfo.
class V8_EXPORT_PRIVATE Debug { class V8_EXPORT_PRIVATE Debug {
public: public:
Debug(const Debug&) = delete;
Debug& operator=(const Debug&) = delete;
// Debug event triggers. // Debug event triggers.
void OnDebugBreak(Handle<FixedArray> break_points_hit, StepAction stepAction); void OnDebugBreak(Handle<FixedArray> break_points_hit, StepAction stepAction);
...@@ -566,8 +569,6 @@ class V8_EXPORT_PRIVATE Debug { ...@@ -566,8 +569,6 @@ class V8_EXPORT_PRIVATE Debug {
friend Handle<FixedArray> GetDebuggedFunctions(); // In test-debug.cc friend Handle<FixedArray> GetDebuggedFunctions(); // In test-debug.cc
friend void CheckDebuggerUnloaded(); // In test-debug.cc friend void CheckDebuggerUnloaded(); // In test-debug.cc
DISALLOW_COPY_AND_ASSIGN(Debug);
}; };
// This scope is used to load and enter the debug context and create a new // This scope is used to load and enter the debug context and create a new
...@@ -614,11 +615,12 @@ class DisableBreak { ...@@ -614,11 +615,12 @@ class DisableBreak {
~DisableBreak() { ~DisableBreak() {
debug_->break_disabled_ = previous_break_disabled_; debug_->break_disabled_ = previous_break_disabled_;
} }
DisableBreak(const DisableBreak&) = delete;
DisableBreak& operator=(const DisableBreak&) = delete;
private: private:
Debug* debug_; Debug* debug_;
bool previous_break_disabled_; bool previous_break_disabled_;
DISALLOW_COPY_AND_ASSIGN(DisableBreak);
}; };
class SuppressDebug { class SuppressDebug {
...@@ -628,11 +630,12 @@ class SuppressDebug { ...@@ -628,11 +630,12 @@ class SuppressDebug {
debug_->is_suppressed_ = true; debug_->is_suppressed_ = true;
} }
~SuppressDebug() { debug_->is_suppressed_ = old_state_; } ~SuppressDebug() { debug_->is_suppressed_ = old_state_; }
SuppressDebug(const SuppressDebug&) = delete;
SuppressDebug& operator=(const SuppressDebug&) = delete;
private: private:
Debug* debug_; Debug* debug_;
bool old_state_; bool old_state_;
DISALLOW_COPY_AND_ASSIGN(SuppressDebug);
}; };
// Code generator routines. // Code generator routines.
......
...@@ -22,6 +22,8 @@ class GdbServer; ...@@ -22,6 +22,8 @@ class GdbServer;
class GdbServerThread : public v8::base::Thread { class GdbServerThread : public v8::base::Thread {
public: public:
explicit GdbServerThread(GdbServer* gdb_server); explicit GdbServerThread(GdbServer* gdb_server);
GdbServerThread(const GdbServerThread&) = delete;
GdbServerThread& operator=(const GdbServerThread&) = delete;
// base::Thread // base::Thread
void Run() override; void Run() override;
...@@ -51,8 +53,6 @@ class GdbServerThread : public v8::base::Thread { ...@@ -51,8 +53,6 @@ class GdbServerThread : public v8::base::Thread {
// Protected by {mutex_}: // Protected by {mutex_}:
std::unique_ptr<TransportBase> transport_; std::unique_ptr<TransportBase> transport_;
std::unique_ptr<Target> target_; std::unique_ptr<Target> target_;
DISALLOW_COPY_AND_ASSIGN(GdbServerThread);
}; };
} // namespace gdb_server } // namespace gdb_server
......
...@@ -51,6 +51,9 @@ class TaskRunner { ...@@ -51,6 +51,9 @@ class TaskRunner {
nested_loop_count_(0), nested_loop_count_(0),
is_terminated_(false) {} is_terminated_(false) {}
TaskRunner(const TaskRunner&) = delete;
TaskRunner& operator=(const TaskRunner&) = delete;
// Starts the task runner. All tasks posted are run, in order, in the thread // Starts the task runner. All tasks posted are run, in order, in the thread
// that calls this function. // that calls this function.
void Run() { void Run() {
...@@ -100,8 +103,6 @@ class TaskRunner { ...@@ -100,8 +103,6 @@ class TaskRunner {
v8::base::Semaphore process_queue_semaphore_; v8::base::Semaphore process_queue_semaphore_;
int nested_loop_count_; int nested_loop_count_;
std::atomic<bool> is_terminated_; std::atomic<bool> is_terminated_;
DISALLOW_COPY_AND_ASSIGN(TaskRunner);
}; };
GdbServer::GdbServer() { task_runner_ = std::make_unique<TaskRunner>(); } GdbServer::GdbServer() { task_runner_ = std::make_unique<TaskRunner>(); }
......
...@@ -24,6 +24,9 @@ class TaskRunner; ...@@ -24,6 +24,9 @@ class TaskRunner;
// the Wasm engine. // the Wasm engine.
class GdbServer { class GdbServer {
public: public:
GdbServer(const GdbServer&) = delete;
GdbServer& operator=(const GdbServer&) = delete;
// Factory method: creates and returns a GdbServer. Spawns a "GDB-remote" // Factory method: creates and returns a GdbServer. Spawns a "GDB-remote"
// thread that will be used to communicate with the debugger. // thread that will be used to communicate with the debugger.
// May return null on failure. // May return null on failure.
...@@ -189,8 +192,6 @@ class GdbServer { ...@@ -189,8 +192,6 @@ class GdbServer {
// End of fields always accessed in the isolate thread. // End of fields always accessed in the isolate thread.
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
DISALLOW_COPY_AND_ASSIGN(GdbServer);
}; };
} // namespace gdb_server } // namespace gdb_server
......
...@@ -19,6 +19,8 @@ class TransportBase; ...@@ -19,6 +19,8 @@ class TransportBase;
class V8_EXPORT_PRIVATE Session { class V8_EXPORT_PRIVATE Session {
public: public:
explicit Session(TransportBase* transport); explicit Session(TransportBase* transport);
Session(const Session&) = delete;
Session& operator=(const Session&) = delete;
// Attempt to send a packet and optionally wait for an ACK from the receiver. // Attempt to send a packet and optionally wait for an ACK from the receiver.
bool SendPacket(Packet* packet, bool expect_ack = true); bool SendPacket(Packet* packet, bool expect_ack = true);
...@@ -61,8 +63,6 @@ class V8_EXPORT_PRIVATE Session { ...@@ -61,8 +63,6 @@ class V8_EXPORT_PRIVATE Session {
TransportBase* io_; // Transport object not owned by the Session. TransportBase* io_; // Transport object not owned by the Session.
bool connected_; // Is the connection still valid. bool connected_; // Is the connection still valid.
bool ack_enabled_; // If true, emit or wait for '+' from RSP stream. bool ack_enabled_; // If true, emit or wait for '+' from RSP stream.
DISALLOW_COPY_AND_ASSIGN(Session);
}; };
} // namespace gdb_server } // namespace gdb_server
......
...@@ -26,6 +26,8 @@ class Target { ...@@ -26,6 +26,8 @@ class Target {
public: public:
// Contruct a Target object. // Contruct a Target object.
explicit Target(GdbServer* gdb_server); explicit Target(GdbServer* gdb_server);
Target(const Target&) = delete;
Target& operator=(const Target&) = delete;
// This function spin on a debugging session, until it closes. // This function spin on a debugging session, until it closes.
void Run(Session* ses); void Run(Session* ses);
...@@ -128,8 +130,6 @@ class Target { ...@@ -128,8 +130,6 @@ class Target {
// End of fields protected by {mutex_}. // End of fields protected by {mutex_}.
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
DISALLOW_COPY_AND_ASSIGN(Target);
}; };
} // namespace gdb_server } // namespace gdb_server
......
...@@ -146,6 +146,8 @@ class SocketTransport : public Transport { ...@@ -146,6 +146,8 @@ class SocketTransport : public Transport {
public: public:
explicit SocketTransport(SocketHandle s); explicit SocketTransport(SocketHandle s);
~SocketTransport() override; ~SocketTransport() override;
SocketTransport(const SocketTransport&) = delete;
SocketTransport& operator=(const SocketTransport&) = delete;
// TransportBase // TransportBase
bool AcceptConnection() override; bool AcceptConnection() override;
...@@ -158,8 +160,6 @@ class SocketTransport : public Transport { ...@@ -158,8 +160,6 @@ class SocketTransport : public Transport {
HANDLE socket_event_; HANDLE socket_event_;
HANDLE faulted_thread_event_; HANDLE faulted_thread_event_;
DISALLOW_COPY_AND_ASSIGN(SocketTransport);
}; };
#else // _WIN32 #else // _WIN32
...@@ -168,6 +168,8 @@ class SocketTransport : public Transport { ...@@ -168,6 +168,8 @@ class SocketTransport : public Transport {
public: public:
explicit SocketTransport(SocketHandle s); explicit SocketTransport(SocketHandle s);
~SocketTransport() override; ~SocketTransport() override;
SocketTransport(const SocketTransport&) = delete;
SocketTransport& operator=(const SocketTransport&) = delete;
// TransportBase // TransportBase
bool AcceptConnection() override; bool AcceptConnection() override;
...@@ -179,8 +181,6 @@ class SocketTransport : public Transport { ...@@ -179,8 +181,6 @@ class SocketTransport : public Transport {
int faulted_thread_fd_read_; int faulted_thread_fd_read_;
int faulted_thread_fd_write_; int faulted_thread_fd_write_;
DISALLOW_COPY_AND_ASSIGN(SocketTransport);
}; };
#endif // _WIN32 #endif // _WIN32
......
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