Commit 6f24e4d1 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[objects][cleanup] Using 'using' instead of 'typedef'

Even though both are allowed in the style guide, it recommends to use
'using', as its syntax is more consistent with the rest of C++.
This CL turns all typedefs in src/objects to 'using' declarations.

R=mstarzinger@chromium.org

Bug: v8:8834
Change-Id: Iec455b40e9256ee3aae867a42c0e949a338d417c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1545893Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60531}
parent 52d319e0
...@@ -2486,11 +2486,11 @@ uint64_t BigInt::AsUint64(bool* lossless) { ...@@ -2486,11 +2486,11 @@ uint64_t BigInt::AsUint64(bool* lossless) {
#if V8_TARGET_ARCH_32_BIT #if V8_TARGET_ARCH_32_BIT
#define HAVE_TWODIGIT_T 1 #define HAVE_TWODIGIT_T 1
typedef uint64_t twodigit_t; using twodigit_t = uint64_t;
#elif defined(__SIZEOF_INT128__) #elif defined(__SIZEOF_INT128__)
// Both Clang and GCC support this on x64. // Both Clang and GCC support this on x64.
#define HAVE_TWODIGIT_T 1 #define HAVE_TWODIGIT_T 1
typedef __uint128_t twodigit_t; using twodigit_t = __uint128_t;
#endif #endif
// {carry} must point to an initialized digit_t and will either be incremented // {carry} must point to an initialized digit_t and will either be incremented
......
...@@ -70,7 +70,7 @@ class BigIntBase : public HeapObject { ...@@ -70,7 +70,7 @@ class BigIntBase : public HeapObject {
friend class ::v8::internal::BigInt; // MSVC wants full namespace. friend class ::v8::internal::BigInt; // MSVC wants full namespace.
friend class MutableBigInt; friend class MutableBigInt;
typedef uintptr_t digit_t; using digit_t = uintptr_t;
static const int kDigitSize = sizeof(digit_t); static const int kDigitSize = sizeof(digit_t);
// kMaxLength definition assumes this: // kMaxLength definition assumes this:
STATIC_ASSERT(kDigitSize == kSystemPointerSize); STATIC_ASSERT(kDigitSize == kSystemPointerSize);
......
...@@ -32,7 +32,7 @@ class Cell : public HeapObject { ...@@ -32,7 +32,7 @@ class Cell : public HeapObject {
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
TORQUE_GENERATED_CELL_FIELDS) TORQUE_GENERATED_CELL_FIELDS)
typedef FixedBodyDescriptor<kValueOffset, kSize, kSize> BodyDescriptor; using BodyDescriptor = FixedBodyDescriptor<kValueOffset, kSize, kSize>;
OBJECT_CONSTRUCTORS(Cell, HeapObject); OBJECT_CONSTRUCTORS(Cell, HeapObject);
}; };
......
...@@ -34,7 +34,7 @@ class Code : public HeapObject { ...@@ -34,7 +34,7 @@ class Code : public HeapObject {
NEVER_READ_ONLY_SPACE NEVER_READ_ONLY_SPACE
// Opaque data type for encapsulating code flags like kind, inline // Opaque data type for encapsulating code flags like kind, inline
// cache state, and arguments count. // cache state, and arguments count.
typedef uint32_t Flags; using Flags = uint32_t;
#define CODE_KIND_LIST(V) \ #define CODE_KIND_LIST(V) \
V(OPTIMIZED_FUNCTION) \ V(OPTIMIZED_FUNCTION) \
......
...@@ -33,7 +33,7 @@ class DebugInfo : public Struct { ...@@ -33,7 +33,7 @@ class DebugInfo : public Struct {
kDebugExecutionMode = 1 << 5 kDebugExecutionMode = 1 << 5
}; };
typedef base::Flags<Flag> Flags; using Flags = base::Flags<Flag>;
// A bitfield that lists uses of the current instance. // A bitfield that lists uses of the current instance.
DECL_INT_ACCESSORS(flags) DECL_INT_ACCESSORS(flags)
......
...@@ -171,7 +171,7 @@ class DescriptorArray : public HeapObject { ...@@ -171,7 +171,7 @@ class DescriptorArray : public HeapObject {
inline ObjectSlot GetKeySlot(int descriptor); inline ObjectSlot GetKeySlot(int descriptor);
inline MaybeObjectSlot GetValueSlot(int descriptor); inline MaybeObjectSlot GetValueSlot(int descriptor);
typedef FlexibleWeakBodyDescriptor<kPointersStartOffset> BodyDescriptor; using BodyDescriptor = FlexibleWeakBodyDescriptor<kPointersStartOffset>;
// Layout of descriptor. // Layout of descriptor.
// Naming is consistent with Dictionary classes for easy templating. // Naming is consistent with Dictionary classes for easy templating.
......
...@@ -25,10 +25,10 @@ class Isolate; ...@@ -25,10 +25,10 @@ class Isolate;
template <typename Derived, typename Shape> template <typename Derived, typename Shape>
class Dictionary : public HashTable<Derived, Shape> { class Dictionary : public HashTable<Derived, Shape> {
typedef HashTable<Derived, Shape> DerivedHashTable; using DerivedHashTable = HashTable<Derived, Shape>;
public: public:
typedef typename Shape::Key Key; using Key = typename Shape::Key;
// Returns the value at entry. // Returns the value at entry.
Object ValueAt(int entry) { Object ValueAt(int entry) {
return this->get(DerivedHashTable::EntryToIndex(entry) + 1); return this->get(DerivedHashTable::EntryToIndex(entry) + 1);
...@@ -126,7 +126,7 @@ class NameDictionaryShape : public BaseDictionaryShape<Handle<Name>> { ...@@ -126,7 +126,7 @@ class NameDictionaryShape : public BaseDictionaryShape<Handle<Name>> {
template <typename Derived, typename Shape> template <typename Derived, typename Shape>
class BaseNameDictionary : public Dictionary<Derived, Shape> { class BaseNameDictionary : public Dictionary<Derived, Shape> {
typedef typename Shape::Key Key; using Key = typename Shape::Key;
public: public:
static const int kNextEnumerationIndexIndex = static const int kNextEnumerationIndexIndex =
......
...@@ -49,7 +49,7 @@ class EmbedderDataSlot ...@@ -49,7 +49,7 @@ class EmbedderDataSlot
static constexpr int kRequiredPtrAlignment = kSmiTagSize; static constexpr int kRequiredPtrAlignment = kSmiTagSize;
// Opaque type used for storing raw embedder data. // Opaque type used for storing raw embedder data.
typedef Address RawData; using RawData = Address;
V8_INLINE Object load_tagged() const; V8_INLINE Object load_tagged() const;
V8_INLINE void store_smi(Smi value); V8_INLINE void store_smi(Smi value);
......
...@@ -38,7 +38,7 @@ class FeedbackCell : public Struct { ...@@ -38,7 +38,7 @@ class FeedbackCell : public Struct {
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, FEEDBACK_CELL_FIELDS) DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, FEEDBACK_CELL_FIELDS)
#undef FEEDBACK_CELL_FIELDS #undef FEEDBACK_CELL_FIELDS
typedef FixedBodyDescriptor<kValueOffset, kSize, kSize> BodyDescriptor; using BodyDescriptor = FixedBodyDescriptor<kValueOffset, kSize, kSize>;
OBJECT_CONSTRUCTORS(FeedbackCell, Struct); OBJECT_CONSTRUCTORS(FeedbackCell, Struct);
}; };
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
typedef FlexibleWeakBodyDescriptor<HeapObject::kHeaderSize> using WeakArrayBodyDescriptor =
WeakArrayBodyDescriptor; FlexibleWeakBodyDescriptor<HeapObject::kHeaderSize>;
#define FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(V) \ #define FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(V) \
V(BYTECODE_ARRAY_CONSTANT_POOL_SUB_TYPE) \ V(BYTECODE_ARRAY_CONSTANT_POOL_SUB_TYPE) \
...@@ -198,7 +198,7 @@ class FixedArray : public FixedArrayBase { ...@@ -198,7 +198,7 @@ class FixedArray : public FixedArrayBase {
DECL_PRINTER(FixedArray) DECL_PRINTER(FixedArray)
DECL_VERIFIER(FixedArray) DECL_VERIFIER(FixedArray)
typedef FlexibleBodyDescriptor<kHeaderSize> BodyDescriptor; using BodyDescriptor = FlexibleBodyDescriptor<kHeaderSize>;
protected: protected:
// Set operation on FixedArray without using write barriers. Can // Set operation on FixedArray without using write barriers. Can
...@@ -298,7 +298,7 @@ class WeakFixedArray : public HeapObject { ...@@ -298,7 +298,7 @@ class WeakFixedArray : public HeapObject {
DECL_PRINTER(WeakFixedArray) DECL_PRINTER(WeakFixedArray)
DECL_VERIFIER(WeakFixedArray) DECL_VERIFIER(WeakFixedArray)
typedef WeakArrayBodyDescriptor BodyDescriptor; using BodyDescriptor = WeakArrayBodyDescriptor;
// Layout description. // Layout description.
#define WEAK_FIXED_ARRAY_FIELDS(V) \ #define WEAK_FIXED_ARRAY_FIELDS(V) \
...@@ -379,7 +379,7 @@ class WeakArrayList : public HeapObject { ...@@ -379,7 +379,7 @@ class WeakArrayList : public HeapObject {
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, WEAK_ARRAY_LIST_FIELDS) DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, WEAK_ARRAY_LIST_FIELDS)
#undef WEAK_ARRAY_LIST_FIELDS #undef WEAK_ARRAY_LIST_FIELDS
typedef WeakArrayBodyDescriptor BodyDescriptor; using BodyDescriptor = WeakArrayBodyDescriptor;
static const int kMaxCapacity = static const int kMaxCapacity =
(FixedArray::kMaxSize - kHeaderSize) / kTaggedSize; (FixedArray::kMaxSize - kHeaderSize) / kTaggedSize;
...@@ -652,7 +652,7 @@ class FixedTypedArrayBase : public FixedArrayBase { ...@@ -652,7 +652,7 @@ class FixedTypedArrayBase : public FixedArrayBase {
template <class Traits> template <class Traits>
class FixedTypedArray : public FixedTypedArrayBase { class FixedTypedArray : public FixedTypedArrayBase {
public: public:
typedef typename Traits::ElementType ElementType; using ElementType = typename Traits::ElementType;
static const InstanceType kInstanceType = Traits::kInstanceType; static const InstanceType kInstanceType = Traits::kInstanceType;
DECL_CAST(FixedTypedArray<Traits>) DECL_CAST(FixedTypedArray<Traits>)
...@@ -687,7 +687,7 @@ class FixedTypedArray : public FixedTypedArrayBase { ...@@ -687,7 +687,7 @@ class FixedTypedArray : public FixedTypedArrayBase {
STATIC_ASSERT(sizeof(elementType) <= FixedTypedArrayBase::kMaxElementSize); \ STATIC_ASSERT(sizeof(elementType) <= FixedTypedArrayBase::kMaxElementSize); \
class Type##ArrayTraits { \ class Type##ArrayTraits { \
public: /* NOLINT */ \ public: /* NOLINT */ \
typedef elementType ElementType; \ using ElementType = elementType; \
static const InstanceType kInstanceType = FIXED_##TYPE##_ARRAY_TYPE; \ static const InstanceType kInstanceType = FIXED_##TYPE##_ARRAY_TYPE; \
static const char* ArrayTypeName() { return "Fixed" #Type "Array"; } \ static const char* ArrayTypeName() { return "Fixed" #Type "Array"; } \
static inline Handle<Object> ToHandle(Isolate* isolate, \ static inline Handle<Object> ToHandle(Isolate* isolate, \
...@@ -695,7 +695,7 @@ class FixedTypedArray : public FixedTypedArrayBase { ...@@ -695,7 +695,7 @@ class FixedTypedArray : public FixedTypedArrayBase {
static inline elementType defaultValue(); \ static inline elementType defaultValue(); \
}; \ }; \
\ \
typedef FixedTypedArray<Type##ArrayTraits> Fixed##Type##Array; using Fixed##Type##Array = FixedTypedArray<Type##ArrayTraits>;
TYPED_ARRAYS(FIXED_TYPED_ARRAY_TRAITS) TYPED_ARRAYS(FIXED_TYPED_ARRAY_TRAITS)
......
...@@ -56,7 +56,7 @@ namespace internal { ...@@ -56,7 +56,7 @@ namespace internal {
template <typename KeyT> template <typename KeyT>
class BaseShape { class BaseShape {
public: public:
typedef KeyT Key; using Key = KeyT;
static inline RootIndex GetMapRootIndex(); static inline RootIndex GetMapRootIndex();
static const bool kNeedsHoleCheck = true; static const bool kNeedsHoleCheck = true;
static Object Unwrap(Object key) { return key; } static Object Unwrap(Object key) { return key; }
...@@ -132,8 +132,8 @@ class V8_EXPORT_PRIVATE HashTableBase : public NON_EXPORTED_BASE(FixedArray) { ...@@ -132,8 +132,8 @@ class V8_EXPORT_PRIVATE HashTableBase : public NON_EXPORTED_BASE(FixedArray) {
template <typename Derived, typename Shape> template <typename Derived, typename Shape>
class HashTable : public HashTableBase { class HashTable : public HashTableBase {
public: public:
typedef Shape ShapeT; using ShapeT = Shape;
typedef typename Shape::Key Key; using Key = typename Shape::Key;
// Returns a new HashTable object. // Returns a new HashTable object.
V8_WARN_UNUSED_RESULT static Handle<Derived> New( V8_WARN_UNUSED_RESULT static Handle<Derived> New(
......
...@@ -116,7 +116,7 @@ class JSWeakCollection : public JSObject { ...@@ -116,7 +116,7 @@ class JSWeakCollection : public JSObject {
class BodyDescriptorImpl; class BodyDescriptorImpl;
// Visit the whole object. // Visit the whole object.
typedef BodyDescriptorImpl BodyDescriptor; using BodyDescriptor = BodyDescriptorImpl;
OBJECT_CONSTRUCTORS(JSWeakCollection, JSObject); OBJECT_CONSTRUCTORS(JSWeakCollection, JSObject);
}; };
......
...@@ -178,7 +178,7 @@ class JSReceiver : public HeapObject { ...@@ -178,7 +178,7 @@ class JSReceiver : public HeapObject {
V8_WARN_UNUSED_RESULT static Maybe<bool> GetOwnPropertyDescriptor( V8_WARN_UNUSED_RESULT static Maybe<bool> GetOwnPropertyDescriptor(
LookupIterator* it, PropertyDescriptor* desc); LookupIterator* it, PropertyDescriptor* desc);
typedef PropertyAttributes IntegrityLevel; using IntegrityLevel = PropertyAttributes;
// ES6 7.3.14 (when passed kDontThrow) // ES6 7.3.14 (when passed kDontThrow)
// 'level' must be SEALED or FROZEN. // 'level' must be SEALED or FROZEN.
...@@ -1377,9 +1377,8 @@ class JSMessageObject : public JSObject { ...@@ -1377,9 +1377,8 @@ class JSMessageObject : public JSObject {
// TODO(v8:8989): [torque] Support marker constants. // TODO(v8:8989): [torque] Support marker constants.
static const int kPointerFieldsEndOffset = kStartPositionOffset; static const int kPointerFieldsEndOffset = kStartPositionOffset;
typedef FixedBodyDescriptor<HeapObject::kMapOffset, kPointerFieldsEndOffset, using BodyDescriptor = FixedBodyDescriptor<HeapObject::kMapOffset,
kSize> kPointerFieldsEndOffset, kSize>;
BodyDescriptor;
OBJECT_CONSTRUCTORS(JSMessageObject, JSObject); OBJECT_CONSTRUCTORS(JSMessageObject, JSObject);
}; };
......
...@@ -117,8 +117,8 @@ class JSProxy : public JSReceiver { ...@@ -117,8 +117,8 @@ class JSProxy : public JSReceiver {
STATIC_ASSERT(static_cast<int>(JSObject::kElementsOffset) == STATIC_ASSERT(static_cast<int>(JSObject::kElementsOffset) ==
static_cast<int>(JSProxy::kTargetOffset)); static_cast<int>(JSProxy::kTargetOffset));
typedef FixedBodyDescriptor<JSReceiver::kPropertiesOrHashOffset, kSize, kSize> using BodyDescriptor =
BodyDescriptor; FixedBodyDescriptor<JSReceiver::kPropertiesOrHashOffset, kSize, kSize>;
static Maybe<bool> SetPrivateSymbol(Isolate* isolate, Handle<JSProxy> proxy, static Maybe<bool> SetPrivateSymbol(Isolate* isolate, Handle<JSProxy> proxy,
Handle<Symbol> private_name, Handle<Symbol> private_name,
......
...@@ -56,7 +56,7 @@ class JSRegExp : public JSObject { ...@@ -56,7 +56,7 @@ class JSRegExp : public JSObject {
// Update FlagCount when adding new flags. // Update FlagCount when adding new flags.
kInvalid = 1 << FlagShiftBit::kInvalid, // Not included in FlagCount. kInvalid = 1 << FlagShiftBit::kInvalid, // Not included in FlagCount.
}; };
typedef base::Flags<Flag> Flags; using Flags = base::Flags<Flag>;
static constexpr int FlagCount() { return 6; } static constexpr int FlagCount() { return 6; }
static int FlagShiftBits(Flag flag) { static int FlagShiftBits(Flag flag) {
......
...@@ -71,7 +71,7 @@ namespace { ...@@ -71,7 +71,7 @@ namespace {
inline int EncodeComputedEntry(ClassBoilerplate::ValueKind value_kind, inline int EncodeComputedEntry(ClassBoilerplate::ValueKind value_kind,
unsigned key_index) { unsigned key_index) {
typedef ClassBoilerplate::ComputedEntryFlags Flags; using Flags = ClassBoilerplate::ComputedEntryFlags;
int flags = Flags::ValueKindBits::encode(value_kind) | int flags = Flags::ValueKindBits::encode(value_kind) |
Flags::KeyIndexBits::encode(key_index); Flags::KeyIndexBits::encode(key_index);
return flags; return flags;
......
...@@ -93,7 +93,7 @@ enum class ObjectFields { ...@@ -93,7 +93,7 @@ enum class ObjectFields {
kMaybePointers, kMaybePointers,
}; };
typedef std::vector<Handle<Map>> MapHandles; using MapHandles = std::vector<Handle<Map>>;
// All heap objects have a Map that describes their structure. // All heap objects have a Map that describes their structure.
// A Map contains information about: // A Map contains information about:
......
...@@ -191,7 +191,7 @@ class Symbol : public Name { ...@@ -191,7 +191,7 @@ class Symbol : public Name {
DEFINE_BIT_FIELDS(FLAGS_BIT_FIELDS) DEFINE_BIT_FIELDS(FLAGS_BIT_FIELDS)
#undef FLAGS_BIT_FIELDS #undef FLAGS_BIT_FIELDS
typedef FixedBodyDescriptor<kNameOffset, kSize, kSize> BodyDescriptor; using BodyDescriptor = FixedBodyDescriptor<kNameOffset, kSize, kSize>;
void SymbolShortPrint(std::ostream& os); void SymbolShortPrint(std::ostream& os);
......
...@@ -68,9 +68,8 @@ class Oddball : public HeapObject { ...@@ -68,9 +68,8 @@ class Oddball : public HeapObject {
static const byte kStaleRegister = 10; static const byte kStaleRegister = 10;
static const byte kSelfReferenceMarker = 10; static const byte kSelfReferenceMarker = 10;
typedef FixedBodyDescriptor<kTaggedFieldsStartOffset, kTaggedFieldsEndOffset, using BodyDescriptor = FixedBodyDescriptor<kTaggedFieldsStartOffset,
kSize> kTaggedFieldsEndOffset, kSize>;
BodyDescriptor;
STATIC_ASSERT(kKindOffset == Internals::kOddballKindOffset); STATIC_ASSERT(kKindOffset == Internals::kOddballKindOffset);
STATIC_ASSERT(kNull == Internals::kNullOddballKind); STATIC_ASSERT(kNull == Internals::kNullOddballKind);
......
...@@ -336,11 +336,11 @@ template <class Derived> ...@@ -336,11 +336,11 @@ template <class Derived>
class SmallOrderedHashTable : public HeapObject { class SmallOrderedHashTable : public HeapObject {
public: public:
// Offset points to a relative location in the table // Offset points to a relative location in the table
typedef int Offset; using Offset = int;
// ByteIndex points to a index in the table that needs to be // ByteIndex points to a index in the table that needs to be
// converted to an Offset. // converted to an Offset.
typedef int ByteIndex; using ByteIndex = int;
void Initialize(Isolate* isolate, int capacity); void Initialize(Isolate* isolate, int capacity);
...@@ -638,7 +638,7 @@ STATIC_ASSERT(kSmallOrderedHashMapMinCapacity == ...@@ -638,7 +638,7 @@ STATIC_ASSERT(kSmallOrderedHashMapMinCapacity ==
template <class SmallTable, class LargeTable> template <class SmallTable, class LargeTable>
class OrderedHashTableHandler { class OrderedHashTableHandler {
public: public:
typedef int Entry; using Entry = int;
static Handle<HeapObject> Allocate(Isolate* isolate, int capacity); static Handle<HeapObject> Allocate(Isolate* isolate, int capacity);
static bool Delete(Handle<HeapObject> table, Handle<Object> key); static bool Delete(Handle<HeapObject> table, Handle<Object> key);
......
...@@ -53,7 +53,7 @@ class PropertyArray : public HeapObject { ...@@ -53,7 +53,7 @@ class PropertyArray : public HeapObject {
static const int kHeaderSize = kSize; static const int kHeaderSize = kSize;
// Garbage collection support. // Garbage collection support.
typedef FlexibleBodyDescriptor<kHeaderSize> BodyDescriptor; using BodyDescriptor = FlexibleBodyDescriptor<kHeaderSize>;
static const int kLengthFieldSize = 10; static const int kLengthFieldSize = 10;
class LengthField : public BitField<int, 0, kLengthFieldSize> {}; class LengthField : public BitField<int, 0, kLengthFieldSize> {};
......
...@@ -68,7 +68,7 @@ class PropertyCell : public HeapObject { ...@@ -68,7 +68,7 @@ class PropertyCell : public HeapObject {
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, PROPERTY_CELL_FIELDS) DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, PROPERTY_CELL_FIELDS)
#undef PROPERTY_CELL_FIELDS #undef PROPERTY_CELL_FIELDS
typedef FixedBodyDescriptor<kNameOffset, kSize, kSize> BodyDescriptor; using BodyDescriptor = FixedBodyDescriptor<kNameOffset, kSize, kSize>;
OBJECT_CONSTRUCTORS(PropertyCell, HeapObject); OBJECT_CONSTRUCTORS(PropertyCell, HeapObject);
}; };
......
...@@ -80,8 +80,8 @@ class PrototypeUsers : public WeakArrayList { ...@@ -80,8 +80,8 @@ class PrototypeUsers : public WeakArrayList {
// The callback is called when a weak pointer to HeapObject "object" is moved // The callback is called when a weak pointer to HeapObject "object" is moved
// from index "from_index" to index "to_index" during compaction. The callback // from index "from_index" to index "to_index" during compaction. The callback
// must not cause GC. // must not cause GC.
typedef void (*CompactionCallback)(HeapObject object, int from_index, using CompactionCallback = void (*)(HeapObject object, int from_index,
int to_index); int to_index);
static WeakArrayList Compact( static WeakArrayList Compact(
Handle<WeakArrayList> array, Heap* heap, CompactionCallback callback, Handle<WeakArrayList> array, Heap* heap, CompactionCallback callback,
AllocationType allocation = AllocationType::kYoung); AllocationType allocation = AllocationType::kYoung);
......
...@@ -132,9 +132,8 @@ class UncompiledData : public HeapObject { ...@@ -132,9 +132,8 @@ class UncompiledData : public HeapObject {
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, UNCOMPILED_DATA_FIELDS) DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, UNCOMPILED_DATA_FIELDS)
#undef UNCOMPILED_DATA_FIELDS #undef UNCOMPILED_DATA_FIELDS
typedef FixedBodyDescriptor<kStartOfPointerFieldsOffset, using BodyDescriptor = FixedBodyDescriptor<kStartOfPointerFieldsOffset,
kEndOfTaggedFieldsOffset, kSize> kEndOfTaggedFieldsOffset, kSize>;
BodyDescriptor;
// Clear uninitialized padding space. // Clear uninitialized padding space.
inline void clear_padding(); inline void clear_padding();
...@@ -154,7 +153,7 @@ class UncompiledDataWithoutPreparseData : public UncompiledData { ...@@ -154,7 +153,7 @@ class UncompiledDataWithoutPreparseData : public UncompiledData {
static const int kSize = UncompiledData::kSize; static const int kSize = UncompiledData::kSize;
// No extra fields compared to UncompiledData. // No extra fields compared to UncompiledData.
typedef UncompiledData::BodyDescriptor BodyDescriptor; using BodyDescriptor = UncompiledData::BodyDescriptor;
OBJECT_CONSTRUCTORS(UncompiledDataWithoutPreparseData, UncompiledData); OBJECT_CONSTRUCTORS(UncompiledDataWithoutPreparseData, UncompiledData);
}; };
...@@ -193,11 +192,10 @@ class UncompiledDataWithPreparseData : public UncompiledData { ...@@ -193,11 +192,10 @@ class UncompiledDataWithPreparseData : public UncompiledData {
// Make sure the size is aligned // Make sure the size is aligned
STATIC_ASSERT(IsAligned(kSize, kTaggedSize)); STATIC_ASSERT(IsAligned(kSize, kTaggedSize));
typedef SubclassBodyDescriptor< using BodyDescriptor = SubclassBodyDescriptor<
UncompiledData::BodyDescriptor, UncompiledData::BodyDescriptor,
FixedBodyDescriptor<kStartOfPointerFieldsOffset, kEndOfTaggedFieldsOffset, FixedBodyDescriptor<kStartOfPointerFieldsOffset, kEndOfTaggedFieldsOffset,
kSize>> kSize>>;
BodyDescriptor;
OBJECT_CONSTRUCTORS(UncompiledDataWithPreparseData, UncompiledData); OBJECT_CONSTRUCTORS(UncompiledDataWithPreparseData, UncompiledData);
}; };
......
...@@ -71,11 +71,11 @@ class AtomicSlot : public SlotBase<AtomicSlot, Tagged_t> { ...@@ -71,11 +71,11 @@ class AtomicSlot : public SlotBase<AtomicSlot, Tagged_t> {
// The rest of this class follows C++'s "RandomAccessIterator" requirements. // The rest of this class follows C++'s "RandomAccessIterator" requirements.
// Most of the heavy lifting is inherited from SlotBase. // Most of the heavy lifting is inherited from SlotBase.
typedef int difference_type; using difference_type = int;
typedef Tagged_t value_type; using value_type = Tagged_t;
typedef Reference reference; using reference = Reference;
typedef void* pointer; // Must be present, but should not be used. using pointer = void*; // Must be present, but should not be used.
typedef std::random_access_iterator_tag iterator_category; using iterator_category = std::random_access_iterator_tag;
AtomicSlot() : SlotBase(kNullAddress) {} AtomicSlot() : SlotBase(kNullAddress) {}
explicit AtomicSlot(Address address) : SlotBase(address) {} explicit AtomicSlot(Address address) : SlotBase(address) {}
......
...@@ -226,11 +226,11 @@ class UnalignedSlot : public SlotBase<UnalignedSlot<T>, T, 1> { ...@@ -226,11 +226,11 @@ class UnalignedSlot : public SlotBase<UnalignedSlot<T>, T, 1> {
// The rest of this class follows C++'s "RandomAccessIterator" requirements. // The rest of this class follows C++'s "RandomAccessIterator" requirements.
// Most of the heavy lifting is inherited from SlotBase. // Most of the heavy lifting is inherited from SlotBase.
typedef int difference_type; using difference_type = int;
typedef T value_type; using value_type = T;
typedef Reference reference; using reference = Reference;
typedef T* pointer; using pointer = T*;
typedef std::random_access_iterator_tag iterator_category; using iterator_category = std::random_access_iterator_tag;
UnalignedSlot() : SlotBase<UnalignedSlot<T>, T, 1>(kNullAddress) {} UnalignedSlot() : SlotBase<UnalignedSlot<T>, T, 1>(kNullAddress) {}
explicit UnalignedSlot(Address address) explicit UnalignedSlot(Address address)
......
...@@ -750,11 +750,11 @@ SubStringRange::SubStringRange(String string, ...@@ -750,11 +750,11 @@ SubStringRange::SubStringRange(String string,
class SubStringRange::iterator final { class SubStringRange::iterator final {
public: public:
typedef std::forward_iterator_tag iterator_category; using iterator_category = std::forward_iterator_tag;
typedef int difference_type; using difference_type = int;
typedef uc16 value_type; using value_type = uc16;
typedef uc16* pointer; using pointer = uc16*;
typedef uc16& reference; using reference = uc16&;
iterator(const iterator& other) = default; iterator(const iterator& other) = default;
......
...@@ -989,7 +989,7 @@ MaybeHandle<String> String::GetSubstitution(Isolate* isolate, Match* match, ...@@ -989,7 +989,7 @@ MaybeHandle<String> String::GetSubstitution(Isolate* isolate, Match* match,
break; break;
} }
case '<': { // $<name> - named capture case '<': { // $<name> - named capture
typedef String::Match::CaptureState CaptureState; using CaptureState = String::Match::CaptureState;
if (!match->HasNamedCaptures()) { if (!match->HasNamedCaptures()) {
builder.AppendCharacter('$'); builder.AppendCharacter('$');
......
...@@ -609,7 +609,7 @@ class ConsString : public String { ...@@ -609,7 +609,7 @@ class ConsString : public String {
// Minimum length for a cons string. // Minimum length for a cons string.
static const int kMinLength = 13; static const int kMinLength = 13;
typedef FixedBodyDescriptor<kFirstOffset, kSize, kSize> BodyDescriptor; using BodyDescriptor = FixedBodyDescriptor<kFirstOffset, kSize, kSize>;
DECL_VERIFIER(ConsString) DECL_VERIFIER(ConsString)
...@@ -639,7 +639,7 @@ class ThinString : public String { ...@@ -639,7 +639,7 @@ class ThinString : public String {
DEFINE_FIELD_OFFSET_CONSTANTS(String::kHeaderSize, DEFINE_FIELD_OFFSET_CONSTANTS(String::kHeaderSize,
TORQUE_GENERATED_THIN_STRING_FIELDS) TORQUE_GENERATED_THIN_STRING_FIELDS)
typedef FixedBodyDescriptor<kActualOffset, kSize, kSize> BodyDescriptor; using BodyDescriptor = FixedBodyDescriptor<kActualOffset, kSize, kSize>;
OBJECT_CONSTRUCTORS(ThinString, String); OBJECT_CONSTRUCTORS(ThinString, String);
}; };
...@@ -675,7 +675,7 @@ class SlicedString : public String { ...@@ -675,7 +675,7 @@ class SlicedString : public String {
// Minimum length for a sliced string. // Minimum length for a sliced string.
static const int kMinLength = 13; static const int kMinLength = 13;
typedef FixedBodyDescriptor<kParentOffset, kSize, kSize> BodyDescriptor; using BodyDescriptor = FixedBodyDescriptor<kParentOffset, kSize, kSize>;
DECL_VERIFIER(SlicedString) DECL_VERIFIER(SlicedString)
...@@ -727,7 +727,7 @@ class ExternalOneByteString : public ExternalString { ...@@ -727,7 +727,7 @@ class ExternalOneByteString : public ExternalString {
public: public:
static const bool kHasOneByteEncoding = true; static const bool kHasOneByteEncoding = true;
typedef v8::String::ExternalOneByteStringResource Resource; using Resource = v8::String::ExternalOneByteStringResource;
// The underlying resource. // The underlying resource.
inline const Resource* resource(); inline const Resource* resource();
...@@ -762,7 +762,7 @@ class ExternalTwoByteString : public ExternalString { ...@@ -762,7 +762,7 @@ class ExternalTwoByteString : public ExternalString {
public: public:
static const bool kHasOneByteEncoding = false; static const bool kHasOneByteEncoding = false;
typedef v8::String::ExternalStringResource Resource; using Resource = v8::String::ExternalStringResource;
// The underlying string resource. // The underlying string resource.
inline const Resource* resource(); inline const Resource* resource();
......
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