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