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