Commit 962ea055 authored by Zhi An Ng's avatar Zhi An Ng Committed by Commit Bot

[cleanup] Remove DISALLOW_COPY_AND_ASSIGN in objects/

Bug: v8:11074
Change-Id: I1cbe60d9e9adc7f7836aceda6cb864f2245c7a45
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2525545Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71031}
parent c468f338
...@@ -157,6 +157,8 @@ class V8_EXPORT_PRIVATE BackingStore : public BackingStoreBase { ...@@ -157,6 +157,8 @@ class V8_EXPORT_PRIVATE BackingStore : public BackingStoreBase {
globally_registered_(false), globally_registered_(false),
custom_deleter_(custom_deleter), custom_deleter_(custom_deleter),
empty_deleter_(empty_deleter) {} empty_deleter_(empty_deleter) {}
BackingStore(const BackingStore&) = delete;
BackingStore& operator=(const BackingStore&) = delete;
void SetAllocatorFromIsolate(Isolate* isolate); void SetAllocatorFromIsolate(Isolate* isolate);
void* buffer_start_ = nullptr; void* buffer_start_ = nullptr;
...@@ -209,8 +211,6 @@ class V8_EXPORT_PRIVATE BackingStore : public BackingStoreBase { ...@@ -209,8 +211,6 @@ class V8_EXPORT_PRIVATE BackingStore : public BackingStoreBase {
static std::unique_ptr<BackingStore> TryAllocateWasmMemory( static std::unique_ptr<BackingStore> TryAllocateWasmMemory(
Isolate* isolate, size_t initial_pages, size_t maximum_pages, Isolate* isolate, size_t initial_pages, size_t maximum_pages,
SharedFlag shared); SharedFlag shared);
DISALLOW_COPY_AND_ASSIGN(BackingStore);
}; };
// A global, per-process mapping from buffer addresses to backing stores. // A global, per-process mapping from buffer addresses to backing stores.
......
...@@ -521,6 +521,8 @@ class Code : public HeapObject { ...@@ -521,6 +521,8 @@ class Code : public HeapObject {
class Code::OptimizedCodeIterator { class Code::OptimizedCodeIterator {
public: public:
explicit OptimizedCodeIterator(Isolate* isolate); explicit OptimizedCodeIterator(Isolate* isolate);
OptimizedCodeIterator(const OptimizedCodeIterator&) = delete;
OptimizedCodeIterator& operator=(const OptimizedCodeIterator&) = delete;
Code Next(); Code Next();
private: private:
...@@ -529,7 +531,6 @@ class Code::OptimizedCodeIterator { ...@@ -529,7 +531,6 @@ class Code::OptimizedCodeIterator {
Isolate* isolate_; Isolate* isolate_;
DISALLOW_HEAP_ALLOCATION(no_gc) DISALLOW_HEAP_ALLOCATION(no_gc)
DISALLOW_COPY_AND_ASSIGN(OptimizedCodeIterator);
}; };
class AbstractCode : public HeapObject { class AbstractCode : public HeapObject {
......
...@@ -540,6 +540,8 @@ template <typename Subclass, typename ElementsTraitsParam> ...@@ -540,6 +540,8 @@ template <typename Subclass, typename ElementsTraitsParam>
class ElementsAccessorBase : public InternalElementsAccessor { class ElementsAccessorBase : public InternalElementsAccessor {
public: public:
ElementsAccessorBase() = default; ElementsAccessorBase() = default;
ElementsAccessorBase(const ElementsAccessorBase&) = delete;
ElementsAccessorBase& operator=(const ElementsAccessorBase&) = delete;
using ElementsTraits = ElementsTraitsParam; using ElementsTraits = ElementsTraitsParam;
using BackingStore = typename ElementsTraitsParam::BackingStore; using BackingStore = typename ElementsTraitsParam::BackingStore;
...@@ -1323,9 +1325,6 @@ class ElementsAccessorBase : public InternalElementsAccessor { ...@@ -1323,9 +1325,6 @@ class ElementsAccessorBase : public InternalElementsAccessor {
uint32_t length) { uint32_t length) {
UNREACHABLE(); UNREACHABLE();
} }
private:
DISALLOW_COPY_AND_ASSIGN(ElementsAccessorBase);
}; };
class DictionaryElementsAccessor class DictionaryElementsAccessor
......
...@@ -22,6 +22,8 @@ class ElementsAccessor { ...@@ -22,6 +22,8 @@ class ElementsAccessor {
public: public:
ElementsAccessor() = default; ElementsAccessor() = default;
virtual ~ElementsAccessor() = default; virtual ~ElementsAccessor() = default;
ElementsAccessor(const ElementsAccessor&) = delete;
ElementsAccessor& operator=(const ElementsAccessor&) = delete;
// Returns a shared ElementsAccessor for the specified ElementsKind. // Returns a shared ElementsAccessor for the specified ElementsKind.
static ElementsAccessor* ForKind(ElementsKind elements_kind) { static ElementsAccessor* ForKind(ElementsKind elements_kind) {
...@@ -202,8 +204,6 @@ class ElementsAccessor { ...@@ -202,8 +204,6 @@ class ElementsAccessor {
private: private:
V8_EXPORT_PRIVATE static ElementsAccessor** elements_accessors_; V8_EXPORT_PRIVATE static ElementsAccessor** elements_accessors_;
DISALLOW_COPY_AND_ASSIGN(ElementsAccessor);
}; };
V8_WARN_UNUSED_RESULT MaybeHandle<Object> ArrayConstructInitializeElements( V8_WARN_UNUSED_RESULT MaybeHandle<Object> ArrayConstructInitializeElements(
......
...@@ -406,6 +406,8 @@ class WeakArrayList ...@@ -406,6 +406,8 @@ class WeakArrayList
class WeakArrayList::Iterator { class WeakArrayList::Iterator {
public: public:
explicit Iterator(WeakArrayList array) : index_(0), array_(array) {} explicit Iterator(WeakArrayList array) : index_(0), array_(array) {}
Iterator(const Iterator&) = delete;
Iterator& operator=(const Iterator&) = delete;
inline HeapObject Next(); inline HeapObject Next();
...@@ -415,7 +417,6 @@ class WeakArrayList::Iterator { ...@@ -415,7 +417,6 @@ class WeakArrayList::Iterator {
#ifdef DEBUG #ifdef DEBUG
DisallowHeapAllocation no_gc_; DisallowHeapAllocation no_gc_;
#endif // DEBUG #endif // DEBUG
DISALLOW_COPY_AND_ASSIGN(Iterator);
}; };
// Generic array grows dynamically with O(1) amortized insertion. // Generic array grows dynamically with O(1) amortized insertion.
......
...@@ -38,6 +38,8 @@ class KeyAccumulator final { ...@@ -38,6 +38,8 @@ class KeyAccumulator final {
PropertyFilter filter) PropertyFilter filter)
: isolate_(isolate), mode_(mode), filter_(filter) {} : isolate_(isolate), mode_(mode), filter_(filter) {}
~KeyAccumulator() = default; ~KeyAccumulator() = default;
KeyAccumulator(const KeyAccumulator&) = delete;
KeyAccumulator& operator=(const KeyAccumulator&) = delete;
static MaybeHandle<FixedArray> GetKeys( static MaybeHandle<FixedArray> GetKeys(
Handle<JSReceiver> object, KeyCollectionMode mode, PropertyFilter filter, Handle<JSReceiver> object, KeyCollectionMode mode, PropertyFilter filter,
...@@ -137,8 +139,6 @@ class KeyAccumulator final { ...@@ -137,8 +139,6 @@ class KeyAccumulator final {
bool skip_shadow_check_ = true; bool skip_shadow_check_ = true;
bool may_have_elements_ = true; bool may_have_elements_ = true;
bool try_prototype_info_cache_ = false; bool try_prototype_info_cache_ = false;
DISALLOW_COPY_AND_ASSIGN(KeyAccumulator);
}; };
// The FastKeyAccumulator handles the cases where there are no elements on the // The FastKeyAccumulator handles the cases where there are no elements on the
...@@ -158,6 +158,8 @@ class FastKeyAccumulator { ...@@ -158,6 +158,8 @@ class FastKeyAccumulator {
skip_indices_(skip_indices) { skip_indices_(skip_indices) {
Prepare(); Prepare();
} }
FastKeyAccumulator(const FastKeyAccumulator&) = delete;
FastKeyAccumulator& operator=(const FastKeyAccumulator&) = delete;
bool is_receiver_simple_enum() { return is_receiver_simple_enum_; } bool is_receiver_simple_enum() { return is_receiver_simple_enum_; }
bool has_empty_prototype() { return has_empty_prototype_; } bool has_empty_prototype() { return has_empty_prototype_; }
...@@ -193,8 +195,6 @@ class FastKeyAccumulator { ...@@ -193,8 +195,6 @@ class FastKeyAccumulator {
bool has_prototype_info_cache_ = false; bool has_prototype_info_cache_ = false;
bool try_prototype_info_cache_ = false; bool try_prototype_info_cache_ = false;
bool only_own_has_simple_elements_ = false; bool only_own_has_simple_elements_ = false;
DISALLOW_COPY_AND_ASSIGN(FastKeyAccumulator);
}; };
} // namespace internal } // namespace internal
......
...@@ -18,6 +18,8 @@ namespace internal { ...@@ -18,6 +18,8 @@ namespace internal {
// Cleared at startup and prior to any gc. // Cleared at startup and prior to any gc.
class DescriptorLookupCache { class DescriptorLookupCache {
public: public:
DescriptorLookupCache(const DescriptorLookupCache&) = delete;
DescriptorLookupCache& operator=(const DescriptorLookupCache&) = delete;
// Lookup descriptor index for (map, name). // Lookup descriptor index for (map, name).
// If absent, kAbsent is returned. // If absent, kAbsent is returned.
inline int Lookup(Map source, Name name); inline int Lookup(Map source, Name name);
...@@ -51,7 +53,6 @@ class DescriptorLookupCache { ...@@ -51,7 +53,6 @@ class DescriptorLookupCache {
int results_[kLength]; int results_[kLength];
friend class Isolate; friend class Isolate;
DISALLOW_COPY_AND_ASSIGN(DescriptorLookupCache);
}; };
} // namespace internal } // namespace internal
......
...@@ -42,6 +42,8 @@ class PrototypeIterator { ...@@ -42,6 +42,8 @@ class PrototypeIterator {
WhereToEnd where_to_end = END_AT_NULL); WhereToEnd where_to_end = END_AT_NULL);
~PrototypeIterator() = default; ~PrototypeIterator() = default;
PrototypeIterator(const PrototypeIterator&) = delete;
PrototypeIterator& operator=(const PrototypeIterator&) = delete;
inline bool HasAccess() const; inline bool HasAccess() const;
...@@ -78,8 +80,6 @@ class PrototypeIterator { ...@@ -78,8 +80,6 @@ class PrototypeIterator {
WhereToEnd where_to_end_; WhereToEnd where_to_end_;
bool is_at_end_; bool is_at_end_;
int seen_proxies_; int seen_proxies_;
DISALLOW_COPY_AND_ASSIGN(PrototypeIterator);
}; };
} // namespace internal } // namespace internal
......
...@@ -174,11 +174,12 @@ class Script : public TorqueGeneratedScript<Script, Struct> { ...@@ -174,11 +174,12 @@ class Script : public TorqueGeneratedScript<Script, Struct> {
class V8_EXPORT_PRIVATE Iterator { class V8_EXPORT_PRIVATE Iterator {
public: public:
explicit Iterator(Isolate* isolate); explicit Iterator(Isolate* isolate);
Iterator(const Iterator&) = delete;
Iterator& operator=(const Iterator&) = delete;
Script Next(); Script Next();
private: private:
WeakArrayList::Iterator iterator_; WeakArrayList::Iterator iterator_;
DISALLOW_COPY_AND_ASSIGN(Iterator);
}; };
// Dispatched behavior. // Dispatched behavior.
......
...@@ -613,6 +613,8 @@ class SharedFunctionInfo : public HeapObject { ...@@ -613,6 +613,8 @@ class SharedFunctionInfo : public HeapObject {
public: public:
V8_EXPORT_PRIVATE ScriptIterator(Isolate* isolate, Script script); V8_EXPORT_PRIVATE ScriptIterator(Isolate* isolate, Script script);
explicit ScriptIterator(Handle<WeakFixedArray> shared_function_infos); explicit ScriptIterator(Handle<WeakFixedArray> shared_function_infos);
ScriptIterator(const ScriptIterator&) = delete;
ScriptIterator& operator=(const ScriptIterator&) = delete;
V8_EXPORT_PRIVATE SharedFunctionInfo Next(); V8_EXPORT_PRIVATE SharedFunctionInfo Next();
int CurrentIndex() const { return index_ - 1; } int CurrentIndex() const { return index_ - 1; }
...@@ -622,7 +624,6 @@ class SharedFunctionInfo : public HeapObject { ...@@ -622,7 +624,6 @@ class SharedFunctionInfo : public HeapObject {
private: private:
Handle<WeakFixedArray> shared_function_infos_; Handle<WeakFixedArray> shared_function_infos_;
int index_; int index_;
DISALLOW_COPY_AND_ASSIGN(ScriptIterator);
}; };
DECL_CAST(SharedFunctionInfo) DECL_CAST(SharedFunctionInfo)
......
...@@ -55,6 +55,8 @@ class StringComparator { ...@@ -55,6 +55,8 @@ class StringComparator {
class State { class State {
public: public:
State() : is_one_byte_(true), length_(0), buffer8_(nullptr) {} State() : is_one_byte_(true), length_(0), buffer8_(nullptr) {}
State(const State&) = delete;
State& operator=(const State&) = delete;
void Init(String string); void Init(String string);
...@@ -79,13 +81,12 @@ class StringComparator { ...@@ -79,13 +81,12 @@ class StringComparator {
const uint8_t* buffer8_; const uint8_t* buffer8_;
const uint16_t* buffer16_; const uint16_t* buffer16_;
}; };
private:
DISALLOW_COPY_AND_ASSIGN(State);
}; };
public: public:
inline StringComparator() = default; inline StringComparator() = default;
StringComparator(const StringComparator&) = delete;
StringComparator& operator=(const StringComparator&) = delete;
template <typename Chars1, typename Chars2> template <typename Chars1, typename Chars2>
static inline bool Equals(State* state_1, State* state_2, int to_check) { static inline bool Equals(State* state_1, State* state_2, int to_check) {
...@@ -99,8 +100,6 @@ class StringComparator { ...@@ -99,8 +100,6 @@ class StringComparator {
private: private:
State state_1_; State state_1_;
State state_2_; State state_2_;
DISALLOW_COPY_AND_ASSIGN(StringComparator);
}; };
} // namespace internal } // namespace internal
......
...@@ -876,6 +876,8 @@ class ConsStringIterator { ...@@ -876,6 +876,8 @@ class ConsStringIterator {
inline explicit ConsStringIterator(ConsString cons_string, int offset = 0) { inline explicit ConsStringIterator(ConsString cons_string, int offset = 0) {
Reset(cons_string, offset); Reset(cons_string, offset);
} }
ConsStringIterator(const ConsStringIterator&) = delete;
ConsStringIterator& operator=(const ConsStringIterator&) = delete;
inline void Reset(ConsString cons_string, int offset = 0) { inline void Reset(ConsString cons_string, int offset = 0) {
depth_ = 0; depth_ = 0;
// Next will always return nullptr. // Next will always return nullptr.
...@@ -914,12 +916,13 @@ class ConsStringIterator { ...@@ -914,12 +916,13 @@ class ConsStringIterator {
int depth_; int depth_;
int maximum_depth_; int maximum_depth_;
int consumed_; int consumed_;
DISALLOW_COPY_AND_ASSIGN(ConsStringIterator);
}; };
class StringCharacterStream { class StringCharacterStream {
public: public:
inline explicit StringCharacterStream(String string, int offset = 0); inline explicit StringCharacterStream(String string, int offset = 0);
StringCharacterStream(const StringCharacterStream&) = delete;
StringCharacterStream& operator=(const StringCharacterStream&) = delete;
inline uint16_t GetNext(); inline uint16_t GetNext();
inline bool HasMore(); inline bool HasMore();
inline void Reset(String string, int offset = 0); inline void Reset(String string, int offset = 0);
...@@ -934,7 +937,6 @@ class StringCharacterStream { ...@@ -934,7 +937,6 @@ class StringCharacterStream {
const uint16_t* buffer16_; const uint16_t* buffer16_;
}; };
const uint8_t* end_; const uint8_t* end_;
DISALLOW_COPY_AND_ASSIGN(StringCharacterStream);
}; };
template <typename Char> template <typename Char>
......
...@@ -48,6 +48,8 @@ class ValueSerializer { ...@@ -48,6 +48,8 @@ class ValueSerializer {
public: public:
ValueSerializer(Isolate* isolate, v8::ValueSerializer::Delegate* delegate); ValueSerializer(Isolate* isolate, v8::ValueSerializer::Delegate* delegate);
~ValueSerializer(); ~ValueSerializer();
ValueSerializer(const ValueSerializer&) = delete;
ValueSerializer& operator=(const ValueSerializer&) = delete;
/* /*
* Writes out a header, which includes the format version. * Writes out a header, which includes the format version.
...@@ -168,8 +170,6 @@ class ValueSerializer { ...@@ -168,8 +170,6 @@ class ValueSerializer {
// A similar map, for transferred array buffers. // A similar map, for transferred array buffers.
IdentityMap<uint32_t, ZoneAllocationPolicy> array_buffer_transfer_map_; IdentityMap<uint32_t, ZoneAllocationPolicy> array_buffer_transfer_map_;
DISALLOW_COPY_AND_ASSIGN(ValueSerializer);
}; };
/* /*
...@@ -181,6 +181,8 @@ class ValueDeserializer { ...@@ -181,6 +181,8 @@ class ValueDeserializer {
ValueDeserializer(Isolate* isolate, Vector<const uint8_t> data, ValueDeserializer(Isolate* isolate, Vector<const uint8_t> data,
v8::ValueDeserializer::Delegate* delegate); v8::ValueDeserializer::Delegate* delegate);
~ValueDeserializer(); ~ValueDeserializer();
ValueDeserializer(const ValueDeserializer&) = delete;
ValueDeserializer& operator=(const ValueDeserializer&) = delete;
/* /*
* Runs version detection logic, which may fail if the format is invalid. * Runs version detection logic, which may fail if the format is invalid.
...@@ -299,8 +301,6 @@ class ValueDeserializer { ...@@ -299,8 +301,6 @@ class ValueDeserializer {
// Always global handles. // Always global handles.
Handle<FixedArray> id_map_; Handle<FixedArray> id_map_;
MaybeHandle<SimpleNumberDictionary> array_buffer_transfer_map_; MaybeHandle<SimpleNumberDictionary> array_buffer_transfer_map_;
DISALLOW_COPY_AND_ASSIGN(ValueDeserializer);
}; };
} // 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