Commit 8a91429e authored by Zhi An Ng's avatar Zhi An Ng Committed by Commit Bot

[cleanup][codegen] Remove uses of DISALLOW_COPY_AND_ASSIGN

Bug: v8:11074
Change-Id: Ifdd52d501a1d55a2fe176f0995f8c0e7f71ca1fd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2569131
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71568}
parent 3238162d
...@@ -184,6 +184,9 @@ class CompilationCacheCode : public CompilationSubCache { ...@@ -184,6 +184,9 @@ class CompilationCacheCode : public CompilationSubCache {
// compilation data is cached. // compilation data is cached.
class V8_EXPORT_PRIVATE CompilationCache { class V8_EXPORT_PRIVATE CompilationCache {
public: public:
CompilationCache(const CompilationCache&) = delete;
CompilationCache& operator=(const CompilationCache&) = delete;
// Finds the script shared function info for a source // Finds the script shared function info for a source
// string. Returns an empty handle if the cache doesn't contain a // string. Returns an empty handle if the cache doesn't contain a
// script for the given source string with the right origin. // script for the given source string with the right origin.
...@@ -278,8 +281,6 @@ class V8_EXPORT_PRIVATE CompilationCache { ...@@ -278,8 +281,6 @@ class V8_EXPORT_PRIVATE CompilationCache {
bool enabled_script_and_eval_; bool enabled_script_and_eval_;
friend class Isolate; friend class Isolate;
DISALLOW_COPY_AND_ASSIGN(CompilationCache);
}; };
} // namespace internal } // namespace internal
......
...@@ -1535,6 +1535,9 @@ class V8_NODISCARD OffThreadParseInfoScope { ...@@ -1535,6 +1535,9 @@ class V8_NODISCARD OffThreadParseInfoScope {
worker_thread_scope_.Get()); worker_thread_scope_.Get());
} }
OffThreadParseInfoScope(const OffThreadParseInfoScope&) = delete;
OffThreadParseInfoScope& operator=(const OffThreadParseInfoScope&) = delete;
~OffThreadParseInfoScope() { ~OffThreadParseInfoScope() {
DCHECK_NOT_NULL(parse_info_); DCHECK_NOT_NULL(parse_info_);
parse_info_->SetPerThreadState(original_stack_limit_, parse_info_->SetPerThreadState(original_stack_limit_,
...@@ -1546,8 +1549,6 @@ class V8_NODISCARD OffThreadParseInfoScope { ...@@ -1546,8 +1549,6 @@ class V8_NODISCARD OffThreadParseInfoScope {
RuntimeCallStats* original_runtime_call_stats_; RuntimeCallStats* original_runtime_call_stats_;
uintptr_t original_stack_limit_; uintptr_t original_stack_limit_;
WorkerThreadRuntimeCallStatsScope worker_thread_scope_; WorkerThreadRuntimeCallStatsScope worker_thread_scope_;
DISALLOW_COPY_AND_ASSIGN(OffThreadParseInfoScope);
}; };
} // namespace } // namespace
......
...@@ -461,6 +461,8 @@ class V8_EXPORT_PRIVATE BackgroundCompileTask { ...@@ -461,6 +461,8 @@ class V8_EXPORT_PRIVATE BackgroundCompileTask {
// Note: does not take ownership of |data|. // Note: does not take ownership of |data|.
BackgroundCompileTask(ScriptStreamingData* data, Isolate* isolate, BackgroundCompileTask(ScriptStreamingData* data, Isolate* isolate,
v8::ScriptType type); v8::ScriptType type);
BackgroundCompileTask(const BackgroundCompileTask&) = delete;
BackgroundCompileTask& operator=(const BackgroundCompileTask&) = delete;
~BackgroundCompileTask(); ~BackgroundCompileTask();
// Creates a new task that when run will parse and compile the // Creates a new task that when run will parse and compile the
...@@ -534,8 +536,6 @@ class V8_EXPORT_PRIVATE BackgroundCompileTask { ...@@ -534,8 +536,6 @@ class V8_EXPORT_PRIVATE BackgroundCompileTask {
WorkerThreadRuntimeCallStats* worker_thread_runtime_call_stats_; WorkerThreadRuntimeCallStats* worker_thread_runtime_call_stats_;
TimedHistogram* timer_; TimedHistogram* timer_;
LanguageMode language_mode_; LanguageMode language_mode_;
DISALLOW_COPY_AND_ASSIGN(BackgroundCompileTask);
}; };
// Contains all data which needs to be transmitted between threads for // Contains all data which needs to be transmitted between threads for
...@@ -544,6 +544,8 @@ struct ScriptStreamingData { ...@@ -544,6 +544,8 @@ struct ScriptStreamingData {
ScriptStreamingData( ScriptStreamingData(
std::unique_ptr<ScriptCompiler::ExternalSourceStream> source_stream, std::unique_ptr<ScriptCompiler::ExternalSourceStream> source_stream,
ScriptCompiler::StreamedSource::Encoding encoding); ScriptCompiler::StreamedSource::Encoding encoding);
ScriptStreamingData(const ScriptStreamingData&) = delete;
ScriptStreamingData& operator=(const ScriptStreamingData&) = delete;
~ScriptStreamingData(); ~ScriptStreamingData();
void Release(); void Release();
...@@ -554,8 +556,6 @@ struct ScriptStreamingData { ...@@ -554,8 +556,6 @@ struct ScriptStreamingData {
// Task that performs background parsing and compilation. // Task that performs background parsing and compilation.
std::unique_ptr<BackgroundCompileTask> task; std::unique_ptr<BackgroundCompileTask> task;
DISALLOW_COPY_AND_ASSIGN(ScriptStreamingData);
}; };
} // namespace internal } // namespace internal
......
...@@ -83,6 +83,9 @@ enum CpuFeature { ...@@ -83,6 +83,9 @@ enum CpuFeature {
// } // }
class V8_EXPORT_PRIVATE CpuFeatures : public AllStatic { class V8_EXPORT_PRIVATE CpuFeatures : public AllStatic {
public: public:
CpuFeatures(const CpuFeatures&) = delete;
CpuFeatures& operator=(const CpuFeatures&) = delete;
static void Probe(bool cross_compile) { static void Probe(bool cross_compile) {
STATIC_ASSERT(NUMBER_OF_CPU_FEATURES <= kBitsPerInt); STATIC_ASSERT(NUMBER_OF_CPU_FEATURES <= kBitsPerInt);
if (initialized_) return; if (initialized_) return;
...@@ -129,7 +132,6 @@ class V8_EXPORT_PRIVATE CpuFeatures : public AllStatic { ...@@ -129,7 +132,6 @@ class V8_EXPORT_PRIVATE CpuFeatures : public AllStatic {
static unsigned icache_line_size_; static unsigned icache_line_size_;
static unsigned dcache_line_size_; static unsigned dcache_line_size_;
static bool initialized_; static bool initialized_;
DISALLOW_COPY_AND_ASSIGN(CpuFeatures);
}; };
} // namespace internal } // namespace internal
......
...@@ -34,6 +34,8 @@ class ExternalReferenceEncoder { ...@@ -34,6 +34,8 @@ class ExternalReferenceEncoder {
}; };
explicit ExternalReferenceEncoder(Isolate* isolate); explicit ExternalReferenceEncoder(Isolate* isolate);
ExternalReferenceEncoder(const ExternalReferenceEncoder&) = delete;
ExternalReferenceEncoder& operator=(const ExternalReferenceEncoder&) = delete;
#ifdef DEBUG #ifdef DEBUG
~ExternalReferenceEncoder(); ~ExternalReferenceEncoder();
#endif // DEBUG #endif // DEBUG
...@@ -50,8 +52,6 @@ class ExternalReferenceEncoder { ...@@ -50,8 +52,6 @@ class ExternalReferenceEncoder {
std::vector<int> count_; std::vector<int> count_;
const intptr_t* api_references_; const intptr_t* api_references_;
#endif // DEBUG #endif // DEBUG
DISALLOW_COPY_AND_ASSIGN(ExternalReferenceEncoder);
}; };
} // namespace internal } // namespace internal
......
...@@ -71,6 +71,8 @@ class ExternalReferenceTable { ...@@ -71,6 +71,8 @@ class ExternalReferenceTable {
} }
ExternalReferenceTable() = default; ExternalReferenceTable() = default;
ExternalReferenceTable(const ExternalReferenceTable&) = delete;
ExternalReferenceTable& operator=(const ExternalReferenceTable&) = delete;
void Init(Isolate* isolate); void Init(Isolate* isolate);
private: private:
...@@ -99,8 +101,6 @@ class ExternalReferenceTable { ...@@ -99,8 +101,6 @@ class ExternalReferenceTable {
// This field is uint32_t since the MacroAssembler and CodeStubAssembler // This field is uint32_t since the MacroAssembler and CodeStubAssembler
// accesses this field as a uint32_t. // accesses this field as a uint32_t.
uint32_t dummy_stats_counter_ = 0; uint32_t dummy_stats_counter_ = 0;
DISALLOW_COPY_AND_ASSIGN(ExternalReferenceTable);
}; };
STATIC_ASSERT(ExternalReferenceTable::kSizeInBytes == STATIC_ASSERT(ExternalReferenceTable::kSizeInBytes ==
......
...@@ -133,6 +133,10 @@ class V8_EXPORT_PRIVATE CallInterfaceDescriptorData { ...@@ -133,6 +133,10 @@ class V8_EXPORT_PRIVATE CallInterfaceDescriptorData {
CallInterfaceDescriptorData() = default; CallInterfaceDescriptorData() = default;
CallInterfaceDescriptorData(const CallInterfaceDescriptorData&) = delete;
CallInterfaceDescriptorData& operator=(const CallInterfaceDescriptorData&) =
delete;
// A copy of the passed in registers and param_representations is made // A copy of the passed in registers and param_representations is made
// and owned by the CallInterfaceDescriptorData. // and owned by the CallInterfaceDescriptorData.
...@@ -223,8 +227,6 @@ class V8_EXPORT_PRIVATE CallInterfaceDescriptorData { ...@@ -223,8 +227,6 @@ class V8_EXPORT_PRIVATE CallInterfaceDescriptorData {
// runtime static initializers which we don't want. // runtime static initializers which we don't want.
Register* register_params_ = nullptr; Register* register_params_ = nullptr;
MachineType* machine_types_ = nullptr; MachineType* machine_types_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(CallInterfaceDescriptorData);
}; };
class V8_EXPORT_PRIVATE CallDescriptors : public AllStatic { class V8_EXPORT_PRIVATE CallDescriptors : public AllStatic {
......
...@@ -25,6 +25,11 @@ class Label { ...@@ -25,6 +25,11 @@ class Label {
Label() = default; Label() = default;
// Disallow copy construction and assignment, but allow move construction and
// move assignment on selected platforms (see below).
Label(const Label&) = delete;
Label& operator=(const Label&) = delete;
// On ARM64, the Assembler keeps track of pointers to Labels to resolve // On ARM64, the Assembler keeps track of pointers to Labels to resolve
// branches to distant targets. Copying labels would confuse the Assembler. // branches to distant targets. Copying labels would confuse the Assembler.
// On other platforms, allow move construction. // On other platforms, allow move construction.
...@@ -100,10 +105,6 @@ class Label { ...@@ -100,10 +105,6 @@ class Label {
friend class Assembler; friend class Assembler;
friend class Displacement; friend class Displacement;
friend class RegExpBytecodeGenerator; friend class RegExpBytecodeGenerator;
// Disallow copy construction and assignment, but allow move construction and
// move assignment on selected platforms (see above).
DISALLOW_COPY_AND_ASSIGN(Label);
}; };
} // namespace internal } // namespace internal
......
...@@ -103,6 +103,9 @@ class V8_EXPORT_PRIVATE OptimizedCompilationInfo final { ...@@ -103,6 +103,9 @@ class V8_EXPORT_PRIVATE OptimizedCompilationInfo final {
OptimizedCompilationInfo(Vector<const char> debug_name, Zone* zone, OptimizedCompilationInfo(Vector<const char> debug_name, Zone* zone,
CodeKind code_kind); CodeKind code_kind);
OptimizedCompilationInfo(const OptimizedCompilationInfo&) = delete;
OptimizedCompilationInfo& operator=(const OptimizedCompilationInfo&) = delete;
~OptimizedCompilationInfo(); ~OptimizedCompilationInfo();
Zone* zone() { return zone_; } Zone* zone() { return zone_; }
...@@ -312,8 +315,6 @@ class V8_EXPORT_PRIVATE OptimizedCompilationInfo final { ...@@ -312,8 +315,6 @@ class V8_EXPORT_PRIVATE OptimizedCompilationInfo final {
// handles above. The only difference is that is created in the // handles above. The only difference is that is created in the
// CanonicalHandleScope(i.e step 1) is different). // CanonicalHandleScope(i.e step 1) is different).
std::unique_ptr<CanonicalHandlesMap> canonical_handles_; std::unique_ptr<CanonicalHandlesMap> canonical_handles_;
DISALLOW_COPY_AND_ASSIGN(OptimizedCompilationInfo);
}; };
} // namespace internal } // namespace internal
......
...@@ -368,6 +368,9 @@ class RelocInfoWriter { ...@@ -368,6 +368,9 @@ class RelocInfoWriter {
public: public:
RelocInfoWriter() : pos_(nullptr), last_pc_(nullptr) {} RelocInfoWriter() : pos_(nullptr), last_pc_(nullptr) {}
RelocInfoWriter(const RelocInfoWriter&) = delete;
RelocInfoWriter& operator=(const RelocInfoWriter&) = delete;
byte* pos() const { return pos_; } byte* pos() const { return pos_; }
byte* last_pc() const { return last_pc_; } byte* last_pc() const { return last_pc_; }
...@@ -397,8 +400,6 @@ class RelocInfoWriter { ...@@ -397,8 +400,6 @@ class RelocInfoWriter {
byte* pos_; byte* pos_;
byte* last_pc_; byte* last_pc_;
DISALLOW_COPY_AND_ASSIGN(RelocInfoWriter);
}; };
// A RelocIterator iterates over relocation information. // A RelocIterator iterates over relocation information.
...@@ -426,6 +427,9 @@ class V8_EXPORT_PRIVATE RelocIterator : public Malloced { ...@@ -426,6 +427,9 @@ class V8_EXPORT_PRIVATE RelocIterator : public Malloced {
int mode_mask = -1); int mode_mask = -1);
RelocIterator(RelocIterator&&) V8_NOEXCEPT = default; RelocIterator(RelocIterator&&) V8_NOEXCEPT = default;
RelocIterator(const RelocIterator&) = delete;
RelocIterator& operator=(const RelocIterator&) = delete;
// Iteration // Iteration
bool done() const { return done_; } bool done() const { return done_; }
void next(); void next();
...@@ -467,8 +471,6 @@ class V8_EXPORT_PRIVATE RelocIterator : public Malloced { ...@@ -467,8 +471,6 @@ class V8_EXPORT_PRIVATE RelocIterator : public Malloced {
RelocInfo rinfo_; RelocInfo rinfo_;
bool done_ = false; bool done_ = false;
const int mode_mask_; const int mode_mask_;
DISALLOW_COPY_AND_ASSIGN(RelocIterator);
}; };
} // namespace internal } // namespace internal
......
...@@ -70,6 +70,9 @@ class SafepointTable { ...@@ -70,6 +70,9 @@ class SafepointTable {
explicit SafepointTable(Code code); explicit SafepointTable(Code code);
explicit SafepointTable(const wasm::WasmCode* code); explicit SafepointTable(const wasm::WasmCode* code);
SafepointTable(const SafepointTable&) = delete;
SafepointTable& operator=(const SafepointTable&) = delete;
int size() const { int size() const {
return kHeaderSize + (length_ * (kFixedEntrySize + entry_size_)); return kHeaderSize + (length_ * (kFixedEntrySize + entry_size_));
} }
...@@ -158,8 +161,6 @@ class SafepointTable { ...@@ -158,8 +161,6 @@ class SafepointTable {
friend class SafepointTableBuilder; friend class SafepointTableBuilder;
friend class SafepointEntry; friend class SafepointEntry;
DISALLOW_COPY_AND_ASSIGN(SafepointTable);
}; };
class Safepoint { class Safepoint {
...@@ -184,6 +185,9 @@ class SafepointTableBuilder { ...@@ -184,6 +185,9 @@ class SafepointTableBuilder {
emitted_(false), emitted_(false),
zone_(zone) {} zone_(zone) {}
SafepointTableBuilder(const SafepointTableBuilder&) = delete;
SafepointTableBuilder& operator=(const SafepointTableBuilder&) = delete;
// Get the offset of the emitted safepoint table in the code. // Get the offset of the emitted safepoint table in the code.
unsigned GetCodeOffset() const; unsigned GetCodeOffset() const;
...@@ -228,8 +232,6 @@ class SafepointTableBuilder { ...@@ -228,8 +232,6 @@ class SafepointTableBuilder {
bool emitted_; bool emitted_;
Zone* zone_; Zone* zone_;
DISALLOW_COPY_AND_ASSIGN(SafepointTableBuilder);
}; };
} // 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