[cleanup] Replace simple typedefs by using

This replaces all typedefs that define types and not functions by the
equivalent "using" declaration.

This was done mostly automatically using this command:
ag -l '\btypedef\b' src test | xargs -L1 \
     perl -i -p0e 's/typedef ([^*;{}]+) (\w+);/using \2 = \1;/sg'

Patchset 2 then adds some manual changes for typedefs for pointer types,
where the regular expression did not match.

R=mstarzinger@chromium.org
TBR=yangguo@chromium.org, jarin@chromium.org

Bug: v8:9183
Change-Id: I6f6ee28d1793b7ac34a58f980b94babc21874b78
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1631409
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61849}
This commit is contained in:
Clemens Hammacher 2019-05-27 13:31:49 +02:00 committed by Commit Bot
parent 0ec82d51dc
commit a335f2aeed
180 changed files with 622 additions and 721 deletions

View File

@ -60,8 +60,8 @@ class CustomArguments : public CustomArgumentsBase {
class PropertyCallbackArguments
: public CustomArguments<PropertyCallbackInfo<Value> > {
public:
typedef PropertyCallbackInfo<Value> T;
typedef CustomArguments<T> Super;
using T = PropertyCallbackInfo<Value>;
using Super = CustomArguments<T>;
static const int kArgsLength = T::kArgsLength;
static const int kThisIndex = T::kThisIndex;
static const int kHolderIndex = T::kHolderIndex;
@ -150,8 +150,8 @@ class PropertyCallbackArguments
class FunctionCallbackArguments
: public CustomArguments<FunctionCallbackInfo<Value> > {
public:
typedef FunctionCallbackInfo<Value> T;
typedef CustomArguments<T> Super;
using T = FunctionCallbackInfo<Value>;
using Super = CustomArguments<T>;
static const int kArgsLength = T::kArgsLength;
static const int kHolderIndex = T::kHolderIndex;
static const int kDataIndex = T::kDataIndex;

View File

@ -5290,7 +5290,7 @@ void v8::String::VerifyExternalStringResourceBase(
String::ExternalStringResource* String::GetExternalStringResourceSlow() const {
i::DisallowHeapAllocation no_allocation;
typedef internal::Internals I;
using I = internal::Internals;
i::String str = *Utils::OpenHandle(this);
if (str.IsThinString()) {
@ -5307,7 +5307,7 @@ String::ExternalStringResource* String::GetExternalStringResourceSlow() const {
String::ExternalStringResourceBase* String::GetExternalStringResourceBaseSlow(
String::Encoding* encoding_out) const {
i::DisallowHeapAllocation no_allocation;
typedef internal::Internals I;
using I = internal::Internals;
ExternalStringResourceBase* resource = nullptr;
i::String str = *Utils::OpenHandle(this);

View File

@ -114,8 +114,7 @@ inline Condition NegateCondition(Condition cond) {
// representing instructions from usual 32 bit values.
// Instruction objects are pointers to 32bit values, and provide methods to
// access the various ISA fields.
typedef int32_t Instr;
using Instr = int32_t;
// Opcodes for Data-processing instructions (instructions with a type 0 and 1)
// as defined in section A3.4
@ -263,8 +262,7 @@ enum SRegisterField {
};
// Status register field mask (or'ed SRegisterField enum values).
typedef uint32_t SRegisterFieldMask;
using SRegisterFieldMask = uint32_t;
// Memory operand addressing mode.
enum AddrMode {

View File

@ -151,7 +151,7 @@ enum SwVfpRegisterCode {
// This way, we make sure no registers in the list ever overlap. However, a list
// may represent multiple different sets of registers,
// e.g. [d0 s2 s3] <=> [s0 s1 d1].
typedef uint64_t VfpRegList;
using VfpRegList = uint64_t;
// Single word VFP register.
class SwVfpRegister : public RegisterBase<SwVfpRegister, kSwVfpAfterLast> {
@ -179,7 +179,7 @@ ASSERT_TRIVIALLY_COPYABLE(SwVfpRegister);
static_assert(sizeof(SwVfpRegister) == sizeof(int),
"SwVfpRegister can efficiently be passed by value");
typedef SwVfpRegister FloatRegister;
using FloatRegister = SwVfpRegister;
enum DoubleRegisterCode {
#define REGISTER_CODE(R) kDoubleCode_##R,
@ -217,7 +217,7 @@ ASSERT_TRIVIALLY_COPYABLE(DwVfpRegister);
static_assert(sizeof(DwVfpRegister) == sizeof(int),
"DwVfpRegister can efficiently be passed by value");
typedef DwVfpRegister DoubleRegister;
using DoubleRegister = DwVfpRegister;
// Double word VFP register d0-15.
class LowDwVfpRegister
@ -272,9 +272,9 @@ class QwNeonRegister : public RegisterBase<QwNeonRegister, kSimd128AfterLast> {
explicit constexpr QwNeonRegister(int code) : RegisterBase(code) {}
};
typedef QwNeonRegister QuadRegister;
using QuadRegister = QwNeonRegister;
typedef QwNeonRegister Simd128Register;
using Simd128Register = QwNeonRegister;
enum CRegisterCode {
#define REGISTER_CODE(R) kCCode_##R,

View File

@ -860,7 +860,7 @@ void Assembler::DeleteUnresolvedBranchInfoForLabelTraverse(Label* label) {
int max_reachable_pc =
static_cast<int>(InstructionOffset(link) +
Instruction::ImmBranchRange(link->BranchType()));
typedef std::multimap<int, FarBranchInfo>::iterator unresolved_info_it;
using unresolved_info_it = std::multimap<int, FarBranchInfo>::iterator;
std::pair<unresolved_info_it, unresolved_info_it> range;
range = unresolved_branches_.equal_range(max_reachable_pc);
unresolved_info_it it;

View File

@ -215,7 +215,7 @@ class ConstPool {
void EmitGuard();
void EmitEntries();
typedef std::map<uint64_t, int> SharedEntryMap;
using SharedEntryMap = std::map<uint64_t, int>;
// Adds a shared entry to entries_, using 'entry_map' to determine whether we
// already track this entry. Returns true if this is the first time we add
// this entry, false otherwise.

View File

@ -148,7 +148,7 @@ const unsigned kFloat16ExponentBias = 15;
// TODO(sigurds): Choose best value.
constexpr int kRootRegisterBias = 256;
typedef uint16_t float16;
using float16 = uint16_t;
#define INSTRUCTION_FIELDS_LIST(V_) \
/* Register fields */ \

View File

@ -18,7 +18,7 @@ struct AssemblerOptions;
// ISA constants. --------------------------------------------------------------
typedef uint32_t Instr;
using Instr = uint32_t;
#if defined(V8_OS_WIN)
extern "C" {

View File

@ -551,9 +551,9 @@ V8_EXPORT_PRIVATE bool AreConsecutive(const VRegister& reg1,
const VRegister& reg3 = NoVReg,
const VRegister& reg4 = NoVReg);
typedef VRegister FloatRegister;
typedef VRegister DoubleRegister;
typedef VRegister Simd128Register;
using FloatRegister = VRegister;
using DoubleRegister = VRegister;
using Simd128Register = VRegister;
// -----------------------------------------------------------------------------
// Lists of registers.

View File

@ -45,7 +45,7 @@ namespace internal {
#define CYAN "36"
#define WHITE "37"
typedef char const * const TEXT_COLOUR;
using TEXT_COLOUR = char const* const;
TEXT_COLOUR clr_normal = FLAG_log_colour ? COLOUR(NORMAL) : "";
TEXT_COLOUR clr_flag_name = FLAG_log_colour ? COLOUR_BOLD(WHITE) : "";
TEXT_COLOUR clr_flag_value = FLAG_log_colour ? COLOUR(NORMAL) : "";
@ -874,7 +874,7 @@ void Simulator::AddSubWithCarry(Instruction* instr) {
template <typename T>
T Simulator::ShiftOperand(T value, Shift shift_type, unsigned amount) {
typedef typename std::make_unsigned<T>::type unsignedT;
using unsignedT = typename std::make_unsigned<T>::type;
if (amount == 0) {
return value;
@ -2388,7 +2388,7 @@ void Simulator::DataProcessing2Source(Instruction* instr) {
}
case UDIV_w:
case UDIV_x: {
typedef typename std::make_unsigned<T>::type unsignedT;
using unsignedT = typename std::make_unsigned<T>::type;
unsignedT rn = static_cast<unsignedT>(reg<T>(instr->Rn()));
unsignedT rm = static_cast<unsignedT>(reg<T>(instr->Rm()));
if (rm == 0) {
@ -2493,7 +2493,7 @@ void Simulator::VisitDataProcessing3Source(Instruction* instr) {
template <typename T>
void Simulator::BitfieldHelper(Instruction* instr) {
typedef typename std::make_unsigned<T>::type unsignedT;
using unsignedT = typename std::make_unsigned<T>::type;
T reg_size = sizeof(T) * 8;
T R = instr->ImmR();
T S = instr->ImmS();

View File

@ -372,8 +372,8 @@ class SimRegisterBase {
void NotifyRegisterWrite() { written_since_last_log_ = true; }
};
typedef SimRegisterBase<kXRegSize> SimRegister; // r0-r31
typedef SimRegisterBase<kQRegSize> SimVRegister; // v0-v31
using SimRegister = SimRegisterBase<kXRegSize>; // r0-r31
using SimVRegister = SimRegisterBase<kQRegSize>; // v0-v31
// Representation of a vector register, with typed getters and setters for lanes
// and additional information to represent lane state.

View File

@ -29,7 +29,7 @@ class Utf16CharacterStream;
// (for performance).
class V8_EXPORT_PRIVATE AsmJsScanner {
public:
typedef int32_t token_t;
using token_t = int32_t;
explicit AsmJsScanner(Utf16CharacterStream* stream);

View File

@ -60,7 +60,7 @@ class AsmOverloadedFunctionType;
class AsmValueType {
public:
typedef uint32_t bitset_t;
using bitset_t = uint32_t;
enum : uint32_t {
#define DEFINE_TAG(CamelName, string_name, number, parent_types) \

View File

@ -422,7 +422,7 @@ class DoExpression final : public Expression {
class Declaration : public AstNode {
public:
typedef base::ThreadedList<Declaration> List;
using List = base::ThreadedList<Declaration>;
Variable* var() const { return var_; }
void set_var(Variable* var) { var_ = var; }
@ -1300,7 +1300,7 @@ class ObjectLiteralProperty final : public LiteralProperty {
// for minimizing the work when constructing it at runtime.
class ObjectLiteral final : public AggregateLiteral {
public:
typedef ObjectLiteralProperty Property;
using Property = ObjectLiteralProperty;
Handle<ObjectBoilerplateDescription> boilerplate_description() const {
DCHECK(!boilerplate_description_.is_null());
@ -2459,7 +2459,7 @@ class ClassLiteralProperty final : public LiteralProperty {
class InitializeClassMembersStatement final : public Statement {
public:
typedef ClassLiteralProperty Property;
using Property = ClassLiteralProperty;
ZonePtrList<Property>* fields() const { return fields_; }
@ -2474,7 +2474,7 @@ class InitializeClassMembersStatement final : public Statement {
class ClassLiteral final : public Expression {
public:
typedef ClassLiteralProperty Property;
using Property = ClassLiteralProperty;
ClassScope* scope() const { return scope_; }
Variable* class_variable() const { return class_variable_; }

View File

@ -125,12 +125,12 @@ class ModuleDescriptor : public ZoneObject {
bool operator()(const AstRawString* lhs, const AstRawString* rhs) const;
};
typedef ZoneMap<const AstRawString*, ModuleRequest, AstRawStringComparer>
ModuleRequestMap;
typedef ZoneMultimap<const AstRawString*, Entry*, AstRawStringComparer>
RegularExportMap;
typedef ZoneMap<const AstRawString*, Entry*, AstRawStringComparer>
RegularImportMap;
using ModuleRequestMap =
ZoneMap<const AstRawString*, ModuleRequest, AstRawStringComparer>;
using RegularExportMap =
ZoneMultimap<const AstRawString*, Entry*, AstRawStringComparer>;
using RegularImportMap =
ZoneMap<const AstRawString*, Entry*, AstRawStringComparer>;
// Module requests.
const ModuleRequestMap& module_requests() const { return module_requests_; }

View File

@ -30,8 +30,8 @@ class Statement;
class StringSet;
class VariableProxy;
typedef base::ThreadedList<VariableProxy, VariableProxy::UnresolvedNext>
UnresolvedList;
using UnresolvedList =
base::ThreadedList<VariableProxy, VariableProxy::UnresolvedNext>;
// A hash map to support fast variable declaration and lookup.
class VariableMap : public ZoneHashMap {

View File

@ -193,7 +193,7 @@ class Variable final : public ZoneObject {
: kNeedsInitialization;
}
typedef base::ThreadedList<Variable> List;
using List = base::ThreadedList<Variable>;
private:
Scope* scope_;

View File

@ -7,9 +7,9 @@
#include "include/v8config.h"
// Annotate a typedef or function indicating it's ok if it's not used.
// Use like:
// typedef Foo Bar ALLOW_UNUSED_TYPE;
// Annotate a using ALLOW_UNUSED_TYPE = or function indicating it's ok if it's
// not used. Use like:
// using Bar = Foo;
#if V8_HAS_ATTRIBUTE_UNUSED
#define ALLOW_UNUSED_TYPE __attribute__((unused))
#else

View File

@ -2941,7 +2941,7 @@ void Builtins::Generate_CallApiCallback(MacroAssembler* masm) {
DCHECK(!AreAliased(api_function_address, argc, call_data, holder, scratch));
typedef FunctionCallbackArguments FCA;
using FCA = FunctionCallbackArguments;
STATIC_ASSERT(FCA::kArgsLength == 6);
STATIC_ASSERT(FCA::kNewTargetIndex == 5);

View File

@ -3530,7 +3530,7 @@ void Builtins::Generate_CallApiCallback(MacroAssembler* masm) {
DCHECK(!AreAliased(api_function_address, argc, call_data, holder, scratch));
typedef FunctionCallbackArguments FCA;
using FCA = FunctionCallbackArguments;
STATIC_ASSERT(FCA::kArgsLength == 6);
STATIC_ASSERT(FCA::kNewTargetIndex == 5);

View File

@ -17,7 +17,7 @@
namespace v8 {
namespace internal {
typedef compiler::Node Node;
using Node = compiler::Node;
std::tuple<Node*, Node*, Node*>
ArgumentsBuiltinsAssembler::AllocateArgumentsObject(Node* map,

View File

@ -11,9 +11,9 @@
namespace v8 {
namespace internal {
typedef compiler::Node Node;
typedef compiler::CodeAssemblerState CodeAssemblerState;
typedef compiler::CodeAssemblerLabel CodeAssemblerLabel;
using Node = compiler::Node;
using CodeAssemblerState = compiler::CodeAssemblerState;
using CodeAssemblerLabel = compiler::CodeAssemblerLabel;
class ArgumentsBuiltinsAssembler
: public CodeStubAssembler,

View File

@ -2208,7 +2208,7 @@ void ArrayBuiltinsAssembler::GenerateConstructor(
void ArrayBuiltinsAssembler::GenerateArrayNoArgumentConstructor(
ElementsKind kind, AllocationSiteOverrideMode mode) {
typedef ArrayNoArgumentConstructorDescriptor Descriptor;
using Descriptor = ArrayNoArgumentConstructorDescriptor;
Node* native_context = LoadObjectField(Parameter(Descriptor::kFunction),
JSFunction::kContextOffset);
bool track_allocation_site =
@ -2224,7 +2224,7 @@ void ArrayBuiltinsAssembler::GenerateArrayNoArgumentConstructor(
void ArrayBuiltinsAssembler::GenerateArraySingleArgumentConstructor(
ElementsKind kind, AllocationSiteOverrideMode mode) {
typedef ArraySingleArgumentConstructorDescriptor Descriptor;
using Descriptor = ArraySingleArgumentConstructorDescriptor;
Node* context = Parameter(Descriptor::kContext);
Node* function = Parameter(Descriptor::kFunction);
Node* native_context = LoadObjectField(function, JSFunction::kContextOffset);
@ -2318,7 +2318,7 @@ GENERATE_ARRAY_CTOR(SingleArgument, HoleyDouble, HOLEY_DOUBLE_ELEMENTS,
#undef GENERATE_ARRAY_CTOR
TF_BUILTIN(InternalArrayNoArgumentConstructor_Packed, ArrayBuiltinsAssembler) {
typedef ArrayNoArgumentConstructorDescriptor Descriptor;
using Descriptor = ArrayNoArgumentConstructorDescriptor;
TNode<Map> array_map =
CAST(LoadObjectField(Parameter(Descriptor::kFunction),
JSFunction::kPrototypeOrInitialMapOffset));

View File

@ -14,14 +14,13 @@ class ArrayBuiltinsAssembler : public CodeStubAssembler {
public:
explicit ArrayBuiltinsAssembler(compiler::CodeAssemblerState* state);
typedef std::function<void(ArrayBuiltinsAssembler* masm)>
BuiltinResultGenerator;
using BuiltinResultGenerator =
std::function<void(ArrayBuiltinsAssembler* masm)>;
typedef std::function<Node*(ArrayBuiltinsAssembler* masm, Node* k_value,
Node* k)>
CallResultProcessor;
using CallResultProcessor = std::function<Node*(ArrayBuiltinsAssembler* masm,
Node* k_value, Node* k)>;
typedef std::function<void(ArrayBuiltinsAssembler* masm)> PostLoopAction;
using PostLoopAction = std::function<void(ArrayBuiltinsAssembler* masm)>;
void FindResultGenerator();

View File

@ -389,7 +389,7 @@ TF_BUILTIN(AsyncGeneratorAwaitCaught, AsyncGeneratorBuiltinsAssembler) {
}
TF_BUILTIN(AsyncGeneratorResumeNext, AsyncGeneratorBuiltinsAssembler) {
typedef AsyncGeneratorResumeNextDescriptor Descriptor;
using Descriptor = AsyncGeneratorResumeNextDescriptor;
Node* const generator = Parameter(Descriptor::kGenerator);
Node* const context = Parameter(Descriptor::kContext);
@ -552,7 +552,7 @@ TF_BUILTIN(AsyncGeneratorResolve, AsyncGeneratorBuiltinsAssembler) {
}
TF_BUILTIN(AsyncGeneratorReject, AsyncGeneratorBuiltinsAssembler) {
typedef AsyncGeneratorRejectDescriptor Descriptor;
using Descriptor = AsyncGeneratorRejectDescriptor;
Node* const generator = Parameter(Descriptor::kGenerator);
Node* const value = Parameter(Descriptor::kValue);
Node* const context = Parameter(Descriptor::kContext);

View File

@ -25,10 +25,9 @@ class AsyncFromSyncBuiltinsAssembler : public AsyncBuiltinsAssembler {
Variable* var_exception,
const char* method_name);
typedef std::function<void(Node* const context, Node* const promise,
Label* if_exception)>
UndefinedMethodHandler;
typedef std::function<Node*(Node*)> SyncIteratorNodeGenerator;
using UndefinedMethodHandler = std::function<void(
Node* const context, Node* const promise, Label* if_exception)>;
using SyncIteratorNodeGenerator = std::function<Node*(Node*)>;
void Generate_AsyncFromSyncIteratorMethod(
Node* const context, Node* const iterator, Node* const sent_value,
const SyncIteratorNodeGenerator& get_method,

View File

@ -600,8 +600,8 @@ class CollectionsBuiltinsAssembler : public BaseCollectionsAssembler {
// Transitions the iterator to the non obsolete backing store.
// This is a NOP if the [table] is not obsolete.
typedef std::function<void(Node* const table, Node* const index)>
UpdateInTransition;
using UpdateInTransition =
std::function<void(Node* const table, Node* const index)>;
template <typename TableType>
std::pair<TNode<TableType>, TNode<IntPtrT>> Transition(
TNode<TableType> const table, TNode<IntPtrT> const index,
@ -2301,8 +2301,8 @@ class WeakCollectionsBuiltinsAssembler : public BaseCollectionsAssembler {
// Builds code that finds the EphemeronHashTable entry for a {key} using the
// comparison code generated by {key_compare}. The key index is returned if
// the {key} is found.
typedef std::function<void(TNode<Object> entry_key, Label* if_same)>
KeyComparator;
using KeyComparator =
std::function<void(TNode<Object> entry_key, Label* if_same)>;
TNode<IntPtrT> FindKeyIndex(TNode<HeapObject> table, TNode<IntPtrT> key_hash,
TNode<IntPtrT> entry_mask,
const KeyComparator& key_compare);

View File

@ -54,7 +54,7 @@ TF_BUILTIN(ConstructWithSpread, CallOrConstructBuiltinsAssembler) {
CallOrConstructWithSpread(target, new_target, spread, args_count, context);
}
typedef compiler::Node Node;
using Node = compiler::Node;
TF_BUILTIN(FastNewClosure, ConstructorBuiltinsAssembler) {
Node* shared_function_info = Parameter(Descriptor::kSharedFunctionInfo);

View File

@ -143,7 +143,7 @@ double ParseDateTimeString(Isolate* isolate, Handle<String> str) {
enum ToDateStringMode { kDateOnly, kTimeOnly, kDateAndTime };
typedef base::SmallVector<char, 128> DateBuffer;
using DateBuffer = base::SmallVector<char, 128>;
template <class... Args>
DateBuffer FormatDate(const char* format, Args... args) {

View File

@ -31,17 +31,17 @@ namespace internal {
// Define interface descriptors for builtins with StubCall linkage.
#define DEFINE_TFC_INTERFACE_DESCRIPTOR(Name, InterfaceDescriptor) \
typedef InterfaceDescriptor##Descriptor Builtin_##Name##_InterfaceDescriptor;
using Builtin_##Name##_InterfaceDescriptor = InterfaceDescriptor##Descriptor;
#define DEFINE_TFS_INTERFACE_DESCRIPTOR(Name, ...) \
typedef Name##Descriptor Builtin_##Name##_InterfaceDescriptor;
using Builtin_##Name##_InterfaceDescriptor = Name##Descriptor;
// Define interface descriptors for IC handlers/dispatchers.
#define DEFINE_TFH_INTERFACE_DESCRIPTOR(Name, InterfaceDescriptor) \
typedef InterfaceDescriptor##Descriptor Builtin_##Name##_InterfaceDescriptor;
using Builtin_##Name##_InterfaceDescriptor = InterfaceDescriptor##Descriptor;
#define DEFINE_ASM_INTERFACE_DESCRIPTOR(Name, InterfaceDescriptor) \
typedef InterfaceDescriptor##Descriptor Builtin_##Name##_InterfaceDescriptor;
using Builtin_##Name##_InterfaceDescriptor = InterfaceDescriptor##Descriptor;
BUILTIN_LIST(IGNORE_BUILTIN, DEFINE_TFJ_INTERFACE_DESCRIPTOR,
DEFINE_TFC_INTERFACE_DESCRIPTOR, DEFINE_TFS_INTERFACE_DESCRIPTOR,

View File

@ -26,13 +26,13 @@ class HandlerBuiltinsAssembler : public CodeStubAssembler {
// compile-time types (int) by dispatching over the runtime type and
// emitting a specialized copy of the given case function for each elements
// kind. Use with caution. This produces a *lot* of code.
typedef std::function<void(ElementsKind)> ElementsKindSwitchCase;
using ElementsKindSwitchCase = std::function<void(ElementsKind)>;
void DispatchByElementsKind(TNode<Int32T> elements_kind,
const ElementsKindSwitchCase& case_function);
// Dispatches over all possible combinations of {from,to} elements kinds.
typedef std::function<void(ElementsKind, ElementsKind)>
ElementsKindTransitionSwitchCase;
using ElementsKindTransitionSwitchCase =
std::function<void(ElementsKind, ElementsKind)>;
void DispatchForElementsKindTransition(
TNode<Int32T> from_kind, TNode<Int32T> to_kind,
const ElementsKindTransitionSwitchCase& case_function);
@ -73,7 +73,7 @@ void Builtins::Generate_StoreIC_Uninitialized(
// TODO(mythria): Check if we can remove feedback vector and slot parameters in
// descriptor.
void HandlerBuiltinsAssembler::Generate_KeyedStoreIC_Slow() {
typedef StoreWithVectorDescriptor Descriptor;
using Descriptor = StoreWithVectorDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* name = Parameter(Descriptor::kName);
Node* value = Parameter(Descriptor::kValue);
@ -106,7 +106,7 @@ TF_BUILTIN(KeyedStoreIC_Slow_NoTransitionHandleCOW, HandlerBuiltinsAssembler) {
}
void HandlerBuiltinsAssembler::Generate_StoreInArrayLiteralIC_Slow() {
typedef StoreWithVectorDescriptor Descriptor;
using Descriptor = StoreWithVectorDescriptor;
Node* array = Parameter(Descriptor::kReceiver);
Node* index = Parameter(Descriptor::kName);
Node* value = Parameter(Descriptor::kValue);
@ -204,7 +204,7 @@ void HandlerBuiltinsAssembler::DispatchForElementsKindTransition(
void HandlerBuiltinsAssembler::Generate_ElementsTransitionAndStore(
KeyedAccessStoreMode store_mode) {
typedef StoreTransitionDescriptor Descriptor;
using Descriptor = StoreTransitionDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* key = Parameter(Descriptor::kName);
Node* value = Parameter(Descriptor::kValue);
@ -322,7 +322,7 @@ void HandlerBuiltinsAssembler::DispatchByElementsKind(
void HandlerBuiltinsAssembler::Generate_StoreFastElementIC(
KeyedAccessStoreMode store_mode) {
typedef StoreWithVectorDescriptor Descriptor;
using Descriptor = StoreWithVectorDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* key = Parameter(Descriptor::kName);
Node* value = Parameter(Descriptor::kValue);
@ -430,7 +430,7 @@ TF_BUILTIN(KeyedLoadIC_SloppyArguments, CodeStubAssembler) {
}
void HandlerBuiltinsAssembler::Generate_KeyedStoreIC_SloppyArguments() {
typedef StoreWithVectorDescriptor Descriptor;
using Descriptor = StoreWithVectorDescriptor;
Node* receiver = Parameter(Descriptor::kReceiver);
Node* key = Parameter(Descriptor::kName);
Node* value = Parameter(Descriptor::kValue);

View File

@ -16,7 +16,7 @@
namespace v8 {
namespace internal {
typedef TorqueGeneratedIteratorBuiltinsAssembler::IteratorRecord IteratorRecord;
using IteratorRecord = TorqueGeneratedIteratorBuiltinsAssembler::IteratorRecord;
using compiler::Node;

View File

@ -12,7 +12,7 @@ namespace internal {
class LazyBuiltinsAssembler : public CodeStubAssembler {
public:
typedef JSTrampolineDescriptor Descriptor;
using Descriptor = JSTrampolineDescriptor;
explicit LazyBuiltinsAssembler(compiler::CodeAssemblerState* state)
: CodeStubAssembler(state) {}

View File

@ -21,7 +21,7 @@ namespace internal {
// -----------------------------------------------------------------------------
// ES6 section 19.1 Object Objects
typedef compiler::Node Node;
using Node = compiler::Node;
template <class T>
using TNode = CodeStubAssembler::TNode<T>;

View File

@ -18,7 +18,7 @@
namespace v8 {
namespace internal {
typedef compiler::Node Node;
using Node = compiler::Node;
template <class T>
using TNode = CodeStubAssembler::TNode<T>;
using IteratorRecord = IteratorBuiltinsAssembler::IteratorRecord;

View File

@ -13,7 +13,7 @@
namespace v8 {
namespace internal {
typedef compiler::CodeAssemblerState CodeAssemblerState;
using CodeAssemblerState = compiler::CodeAssemblerState;
class V8_EXPORT_PRIVATE PromiseBuiltinsAssembler : public CodeStubAssembler {
public:
@ -133,10 +133,10 @@ class V8_EXPORT_PRIVATE PromiseBuiltinsAssembler : public CodeStubAssembler {
Node* CreateThrowerFunction(Node* reason, Node* native_context);
typedef std::function<TNode<Object>(TNode<Context> context, TNode<Smi> index,
TNode<NativeContext> native_context,
TNode<PromiseCapability> capability)>
PromiseAllResolvingElementFunction;
using PromiseAllResolvingElementFunction =
std::function<TNode<Object>(TNode<Context> context, TNode<Smi> index,
TNode<NativeContext> native_context,
TNode<PromiseCapability> capability)>;
Node* PerformPromiseAll(
Node* context, Node* constructor, Node* capability,
@ -172,10 +172,10 @@ class V8_EXPORT_PRIVATE PromiseBuiltinsAssembler : public CodeStubAssembler {
const PromiseAllResolvingElementFunction& create_resolve_element_function,
const PromiseAllResolvingElementFunction& create_reject_element_function);
typedef std::function<TNode<Object>(TNode<Context> context,
TNode<NativeContext> native_context,
TNode<Object> value)>
CreatePromiseAllResolveElementFunctionValue;
using CreatePromiseAllResolveElementFunctionValue =
std::function<TNode<Object>(TNode<Context> context,
TNode<NativeContext> native_context,
TNode<Object> value)>;
void Generate_PromiseAllResolveElementClosure(
TNode<Context> context, TNode<Object> value, TNode<JSFunction> function,

View File

@ -16,7 +16,7 @@
namespace v8 {
namespace internal {
typedef compiler::Node Node;
using Node = compiler::Node;
template <class T>
using TNode = compiler::TNode<T>;
@ -748,8 +748,8 @@ void StringBuiltinsAssembler::StringIndexOf(
search_to_direct.instance_type(), &one_one,
&one_two, &two_one, &two_two);
typedef const uint8_t onebyte_t;
typedef const uc16 twobyte_t;
using onebyte_t = const uint8_t;
using twobyte_t = const uc16;
BIND(&one_one);
{

View File

@ -62,9 +62,8 @@ class StringBuiltinsAssembler : public CodeStubAssembler {
void GenerateStringRelationalComparison(Node* context, Node* left,
Node* right, Operation op);
typedef std::function<TNode<Object>(
TNode<String> receiver, TNode<IntPtrT> length, TNode<IntPtrT> index)>
StringAtAccessor;
using StringAtAccessor = std::function<TNode<Object>(
TNode<String> receiver, TNode<IntPtrT> length, TNode<IntPtrT> index)>;
void StringIndexOf(Node* const subject_string, Node* const search_string,
Node* const position,
@ -96,8 +95,8 @@ class StringBuiltinsAssembler : public CodeStubAssembler {
//
// Contains fast paths for Smi and RegExp objects.
// Important: {regexp_call} may not contain any code that can call into JS.
typedef std::function<void()> NodeFunction0;
typedef std::function<void(Node* fn)> NodeFunction1;
using NodeFunction0 = std::function<void()>;
using NodeFunction1 = std::function<void(Node* fn)>;
void MaybeCallFunctionAtSymbol(Node* const context, Node* const object,
Node* const maybe_string,
Handle<Symbol> symbol,

View File

@ -114,7 +114,7 @@ class TypedArrayBuiltinsAssembler : public CodeStubAssembler {
TNode<IntPtrT> start,
TNode<IntPtrT> end);
typedef std::function<void(ElementsKind, int, int)> TypedArraySwitchCase;
using TypedArraySwitchCase = std::function<void(ElementsKind, int, int)>;
void DispatchTypedArrayByElementsKind(
TNode<Word32T> elements_kind, const TypedArraySwitchCase& case_function);

View File

@ -29,7 +29,7 @@ class CodeAssemblerState;
#define TF_BUILTIN(Name, AssemblerBase) \
class Name##Assembler : public AssemblerBase { \
public: \
typedef Builtin_##Name##_InterfaceDescriptor Descriptor; \
using Descriptor = Builtin_##Name##_InterfaceDescriptor; \
\
explicit Name##Assembler(compiler::CodeAssemblerState* state) \
: AssemblerBase(state) {} \

View File

@ -42,7 +42,7 @@ class BuiltinsConstantsTableBuilder final {
Isolate* isolate_;
// Maps objects to corresponding indices within the constants list.
typedef IdentityMap<uint32_t, FreeStoreAllocationPolicy> ConstantsMap;
using ConstantsMap = IdentityMap<uint32_t, FreeStoreAllocationPolicy>;
ConstantsMap map_;
DISALLOW_COPY_AND_ASSIGN(BuiltinsConstantsTableBuilder);

View File

@ -3151,7 +3151,7 @@ void Builtins::Generate_CallApiCallback(MacroAssembler* masm) {
DCHECK(!AreAliased(api_function_address, argc, holder));
typedef FunctionCallbackArguments FCA;
using FCA = FunctionCallbackArguments;
STATIC_ASSERT(FCA::kArgsLength == 6);
STATIC_ASSERT(FCA::kNewTargetIndex == 5);

View File

@ -2941,7 +2941,7 @@ void Builtins::Generate_CallApiCallback(MacroAssembler* masm) {
DCHECK(!AreAliased(api_function_address, argc, call_data,
holder, scratch, base));
typedef FunctionCallbackArguments FCA;
using FCA = FunctionCallbackArguments;
STATIC_ASSERT(FCA::kArgsLength == 6);
STATIC_ASSERT(FCA::kNewTargetIndex == 5);
@ -3058,7 +3058,7 @@ void Builtins::Generate_CallApiGetter(MacroAssembler* masm) {
Register api_function_address = a2;
// Here and below +1 is for name() pushed after the args_ array.
typedef PropertyCallbackArguments PCA;
using PCA = PropertyCallbackArguments;
__ Subu(sp, sp, (PCA::kArgsLength + 1) * kPointerSize);
__ sw(receiver, MemOperand(sp, (PCA::kThisIndex + 1) * kPointerSize));
__ lw(scratch, FieldMemOperand(callback, AccessorInfo::kDataOffset));

View File

@ -2977,7 +2977,7 @@ void Builtins::Generate_CallApiCallback(MacroAssembler* masm) {
DCHECK(!AreAliased(api_function_address, argc, call_data,
holder, scratch, base));
typedef FunctionCallbackArguments FCA;
using FCA = FunctionCallbackArguments;
STATIC_ASSERT(FCA::kArgsLength == 6);
STATIC_ASSERT(FCA::kNewTargetIndex == 5);
@ -3098,7 +3098,7 @@ void Builtins::Generate_CallApiGetter(MacroAssembler* masm) {
Register api_function_address = a2;
// Here and below +1 is for name() pushed after the args_ array.
typedef PropertyCallbackArguments PCA;
using PCA = PropertyCallbackArguments;
__ Dsubu(sp, sp, (PCA::kArgsLength + 1) * kPointerSize);
__ Sd(receiver, MemOperand(sp, (PCA::kThisIndex + 1) * kPointerSize));
__ Ld(scratch, FieldMemOperand(callback, AccessorInfo::kDataOffset));

View File

@ -3063,7 +3063,7 @@ void Builtins::Generate_CallApiCallback(MacroAssembler* masm) {
Register scratch = r7;
DCHECK(!AreAliased(api_function_address, argc, call_data, holder, scratch));
typedef FunctionCallbackArguments FCA;
using FCA = FunctionCallbackArguments;
STATIC_ASSERT(FCA::kArgsLength == 6);
STATIC_ASSERT(FCA::kNewTargetIndex == 5);

View File

@ -3101,7 +3101,7 @@ void Builtins::Generate_CallApiCallback(MacroAssembler* masm) {
Register scratch = r6;
DCHECK(!AreAliased(api_function_address, argc, call_data, holder, scratch));
typedef FunctionCallbackArguments FCA;
using FCA = FunctionCallbackArguments;
STATIC_ASSERT(FCA::kArgsLength == 6);
STATIC_ASSERT(FCA::kNewTargetIndex == 5);

View File

@ -3138,7 +3138,7 @@ void Builtins::Generate_CallApiCallback(MacroAssembler* masm) {
DCHECK(!AreAliased(api_function_address, argc, holder, call_data,
kScratchRegister));
typedef FunctionCallbackArguments FCA;
using FCA = FunctionCallbackArguments;
STATIC_ASSERT(FCA::kArgsLength == 6);
STATIC_ASSERT(FCA::kNewTargetIndex == 5);

View File

@ -13254,7 +13254,7 @@ void CodeStubArguments::SetReceiver(TNode<Object> object) const {
TNode<WordT> CodeStubArguments::AtIndexPtr(
Node* index, CodeStubAssembler::ParameterMode mode) const {
typedef compiler::Node Node;
using Node = compiler::Node;
Node* negated_index = assembler_->IntPtrOrSmiSub(
assembler_->IntPtrOrSmiConstant(0, mode), index, mode);
Node* offset = assembler_->ElementOffsetFromIndex(

View File

@ -227,7 +227,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
enum SlackTrackingMode { kWithSlackTracking, kNoSlackTracking };
typedef base::Flags<AllocationFlag> AllocationFlags;
using AllocationFlags = base::Flags<AllocationFlag>;
enum ParameterMode { SMI_PARAMETERS, INTPTR_PARAMETERS };
@ -624,8 +624,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
TNode<BoolT> IsRegularHeapObjectSize(TNode<IntPtrT> size);
typedef std::function<void(Label*, Label*)> BranchGenerator;
typedef std::function<Node*()> NodeGenerator;
using BranchGenerator = std::function<void(Label*, Label*)>;
using NodeGenerator = std::function<Node*()>;
void Assert(const BranchGenerator& branch, const char* message = nullptr,
const char* file = nullptr, int line = 0,
@ -1883,7 +1883,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
kAllFixedArraysDontCopyCOW = kAllFixedArrays | kDontCopyCOW
};
typedef base::Flags<ExtractFixedArrayFlag> ExtractFixedArrayFlags;
using ExtractFixedArrayFlags = base::Flags<ExtractFixedArrayFlag>;
// Copy a portion of an existing FixedArray or FixedDoubleArray into a new
// array, including special appropriate handling for empty arrays and COW
@ -2925,10 +2925,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
// This is a type of a lookup in holder generator function. In case of a
// property lookup the {key} is guaranteed to be an unique name and in case of
// element lookup the key is an Int32 index.
typedef std::function<void(Node* receiver, Node* holder, Node* map,
Node* instance_type, Node* key, Label* next_holder,
Label* if_bailout)>
LookupInHolder;
using LookupInHolder = std::function<void(
Node* receiver, Node* holder, Node* map, Node* instance_type, Node* key,
Label* next_holder, Label* if_bailout)>;
// For integer indexed exotic cases, check if the given string cannot be a
// special index. If we are not sure that the given string is not a special
@ -3093,7 +3092,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
enum class IndexAdvanceMode { kPre, kPost };
typedef std::function<void(Node* index)> FastLoopBody;
using FastLoopBody = std::function<void(Node* index)>;
Node* BuildFastLoop(const VariableList& var_list, Node* start_index,
Node* end_index, const FastLoopBody& body, int increment,
@ -3110,8 +3109,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
enum class ForEachDirection { kForward, kReverse };
typedef std::function<void(Node* fixed_array, Node* offset)>
FastFixedArrayForEachBody;
using FastFixedArrayForEachBody =
std::function<void(Node* fixed_array, Node* offset)>;
void BuildFastFixedArrayForEach(
const CodeStubAssembler::VariableList& vars, Node* fixed_array,
@ -3444,8 +3443,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
TNode<Uint32T> DescriptorArrayGetDetails(TNode<DescriptorArray> descriptors,
TNode<Uint32T> descriptor_number);
typedef std::function<void(TNode<IntPtrT> descriptor_key_index)>
ForEachDescriptorBodyFunction;
using ForEachDescriptorBodyFunction =
std::function<void(TNode<IntPtrT> descriptor_key_index)>;
// Descriptor array accessors based on key_index, which is equal to
// DescriptorArray::ToKeyIndex(descriptor).
@ -3474,8 +3473,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
TNode<MaybeObject> LoadFieldTypeByDescriptorEntry(
TNode<DescriptorArray> descriptors, TNode<IntPtrT> descriptor);
typedef std::function<void(TNode<Name> key, TNode<Object> value)>
ForEachKeyValueFunction;
using ForEachKeyValueFunction =
std::function<void(TNode<Name> key, TNode<Object> value)>;
enum ForEachEnumerationMode {
// String and then Symbol properties according to the spec
@ -3600,7 +3599,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
class V8_EXPORT_PRIVATE CodeStubArguments {
public:
typedef compiler::Node Node;
using Node = compiler::Node;
template <class T>
using TNode = compiler::TNode<T>;
template <class T>
@ -3680,7 +3679,7 @@ class V8_EXPORT_PRIVATE CodeStubArguments {
return assembler_->UncheckedCast<IntPtrT>(argc_);
}
typedef std::function<void(Node* arg)> ForEachBodyFunction;
using ForEachBodyFunction = std::function<void(Node* arg)>;
// Iteration doesn't include the receiver. |first| and |last| are zero-based.
void ForEach(const ForEachBodyFunction& body, Node* first = nullptr,
@ -3719,7 +3718,7 @@ class ToDirectStringAssembler : public CodeStubAssembler {
enum Flag {
kDontUnpackSlicedStrings = 1 << 0,
};
typedef base::Flags<Flag> Flags;
using Flags = base::Flags<Flag>;
ToDirectStringAssembler(compiler::CodeAssemblerState* state, Node* string,
Flags flags = Flags());

View File

@ -35,8 +35,8 @@ class UnoptimizedCompilationInfo;
class UnoptimizedCompilationJob;
class WorkerThreadRuntimeCallStats;
typedef std::forward_list<std::unique_ptr<UnoptimizedCompilationJob>>
UnoptimizedCompilationJobList;
using UnoptimizedCompilationJobList =
std::forward_list<std::unique_ptr<UnoptimizedCompilationJob>>;
// The V8 compiler API.
//

View File

@ -270,8 +270,6 @@ class ExternalReference {
EXTERNAL_REFERENCE_LIST_WITH_ISOLATE(COUNT_EXTERNAL_REFERENCE);
#undef COUNT_EXTERNAL_REFERENCE
typedef Address ExternalReferenceRedirector(Address original, Type type);
ExternalReference() : address_(kNullAddress) {}
static ExternalReference Create(const SCTableReference& table_ref);
static ExternalReference Create(StatsCounter* counter);

View File

@ -99,7 +99,7 @@ class V8_EXPORT_PRIVATE CallInterfaceDescriptorData {
// untagged stack arguments.
kNoStackScan = 1u << 1,
};
typedef base::Flags<Flag> Flags;
using Flags = base::Flags<Flag>;
CallInterfaceDescriptorData() = default;
@ -225,7 +225,7 @@ class V8_EXPORT_PRIVATE CallDescriptors : public AllStatic {
class V8_EXPORT_PRIVATE CallInterfaceDescriptor {
public:
typedef CallInterfaceDescriptorData::Flags Flags;
using Flags = CallInterfaceDescriptorData::Flags;
CallInterfaceDescriptor() : data_(nullptr) {}
virtual ~CallInterfaceDescriptor() = default;
@ -485,10 +485,10 @@ class V8_EXPORT_PRIVATE VoidDescriptor : public CallInterfaceDescriptor {
// Dummy descriptor used to mark builtins that don't yet have their proper
// descriptor associated.
typedef VoidDescriptor DummyDescriptor;
using DummyDescriptor = VoidDescriptor;
// Dummy descriptor that marks builtins with C calling convention.
typedef VoidDescriptor CCallDescriptor;
using CCallDescriptor = VoidDescriptor;
class AllocateDescriptor : public CallInterfaceDescriptor {
public:

View File

@ -259,7 +259,7 @@ class V8_EXPORT_PRIVATE OptimizedCompilationInfo final {
}
};
typedef std::vector<InlinedFunctionHolder> InlinedFunctionList;
using InlinedFunctionList = std::vector<InlinedFunctionHolder>;
InlinedFunctionList& inlined_functions() { return inlined_functions_; }
// Returns the inlining id for source position tracking.

View File

@ -15,9 +15,9 @@ namespace internal {
// Register configurations.
#if V8_TARGET_ARCH_ARM64
typedef uint64_t RegList;
using RegList = uint64_t;
#else
typedef uint32_t RegList;
using RegList = uint32_t;
#endif
// Get the number of registers in a given register list.

View File

@ -105,7 +105,7 @@ class Signature : public ZoneObject {
const T* reps_;
};
typedef Signature<MachineType> MachineSignature;
using MachineSignature = Signature<MachineType>;
template <typename T>
size_t hash_value(const Signature<T>& sig) {

View File

@ -48,7 +48,7 @@ void SubtractFromEntry(PositionTableEntry& value,
// Helper: Encode an integer.
template <typename T>
void EncodeInt(std::vector<byte>& bytes, T value) {
typedef typename std::make_unsigned<T>::type unsigned_type;
using unsigned_type = typename std::make_unsigned<T>::type;
// Zig-zag encoding.
static const int kShift = sizeof(T) * kBitsPerByte - 1;
value = ((static_cast<unsigned_type>(value) << 1) ^ (value >> kShift));

View File

@ -142,18 +142,18 @@ class SourcePosition final {
void Print(std::ostream& out, SharedFunctionInfo function) const;
typedef BitField64<bool, 0, 1> IsExternalField;
using IsExternalField = BitField64<bool, 0, 1>;
// The two below are only used if IsExternal() is true.
typedef BitField64<int, 1, 20> ExternalLineField;
typedef BitField64<int, 21, 10> ExternalFileIdField;
using ExternalLineField = BitField64<int, 1, 20>;
using ExternalFileIdField = BitField64<int, 21, 10>;
// ScriptOffsetField is only used if IsExternal() is false.
typedef BitField64<int, 1, 30> ScriptOffsetField;
using ScriptOffsetField = BitField64<int, 1, 30>;
// InliningId is in the high bits for better compression in
// SourcePositionTable.
typedef BitField64<int, 31, 16> InliningIdField;
using InliningIdField = BitField64<int, 31, 16>;
// Leaving the highest bit untouched to allow for signed conversion.
uint64_t value_;

View File

@ -119,16 +119,16 @@ class PerIsolateAssertScopeDebugOnly {
// Per-thread assert scopes.
// Scope to document where we do not expect handles to be created.
typedef PerThreadAssertScopeDebugOnly<HANDLE_ALLOCATION_ASSERT, false>
DisallowHandleAllocation;
using DisallowHandleAllocation =
PerThreadAssertScopeDebugOnly<HANDLE_ALLOCATION_ASSERT, false>;
// Scope to introduce an exception to DisallowHandleAllocation.
typedef PerThreadAssertScopeDebugOnly<HANDLE_ALLOCATION_ASSERT, true>
AllowHandleAllocation;
using AllowHandleAllocation =
PerThreadAssertScopeDebugOnly<HANDLE_ALLOCATION_ASSERT, true>;
// Scope to document where we do not expect any allocation and GC.
typedef PerThreadAssertScopeDebugOnly<HEAP_ALLOCATION_ASSERT, false>
DisallowHeapAllocation;
using DisallowHeapAllocation =
PerThreadAssertScopeDebugOnly<HEAP_ALLOCATION_ASSERT, false>;
#ifdef DEBUG
#define DISALLOW_HEAP_ALLOCATION(name) DisallowHeapAllocation name;
#else
@ -136,32 +136,32 @@ typedef PerThreadAssertScopeDebugOnly<HEAP_ALLOCATION_ASSERT, false>
#endif
// Scope to introduce an exception to DisallowHeapAllocation.
typedef PerThreadAssertScopeDebugOnly<HEAP_ALLOCATION_ASSERT, true>
AllowHeapAllocation;
using AllowHeapAllocation =
PerThreadAssertScopeDebugOnly<HEAP_ALLOCATION_ASSERT, true>;
// Scope to document where we do not expect any handle dereferences.
typedef PerThreadAssertScopeDebugOnly<HANDLE_DEREFERENCE_ASSERT, false>
DisallowHandleDereference;
using DisallowHandleDereference =
PerThreadAssertScopeDebugOnly<HANDLE_DEREFERENCE_ASSERT, false>;
// Scope to introduce an exception to DisallowHandleDereference.
typedef PerThreadAssertScopeDebugOnly<HANDLE_DEREFERENCE_ASSERT, true>
AllowHandleDereference;
using AllowHandleDereference =
PerThreadAssertScopeDebugOnly<HANDLE_DEREFERENCE_ASSERT, true>;
// Scope to document where we do not expect deferred handles to be dereferenced.
typedef PerThreadAssertScopeDebugOnly<DEFERRED_HANDLE_DEREFERENCE_ASSERT, false>
DisallowDeferredHandleDereference;
using DisallowDeferredHandleDereference =
PerThreadAssertScopeDebugOnly<DEFERRED_HANDLE_DEREFERENCE_ASSERT, false>;
// Scope to introduce an exception to DisallowDeferredHandleDereference.
typedef PerThreadAssertScopeDebugOnly<DEFERRED_HANDLE_DEREFERENCE_ASSERT, true>
AllowDeferredHandleDereference;
using AllowDeferredHandleDereference =
PerThreadAssertScopeDebugOnly<DEFERRED_HANDLE_DEREFERENCE_ASSERT, true>;
// Scope to document where we do not expect deferred handles to be dereferenced.
typedef PerThreadAssertScopeDebugOnly<CODE_DEPENDENCY_CHANGE_ASSERT, false>
DisallowCodeDependencyChange;
using DisallowCodeDependencyChange =
PerThreadAssertScopeDebugOnly<CODE_DEPENDENCY_CHANGE_ASSERT, false>;
// Scope to introduce an exception to DisallowDeferredHandleDereference.
typedef PerThreadAssertScopeDebugOnly<CODE_DEPENDENCY_CHANGE_ASSERT, true>
AllowCodeDependencyChange;
using AllowCodeDependencyChange =
PerThreadAssertScopeDebugOnly<CODE_DEPENDENCY_CHANGE_ASSERT, true>;
class DisallowHeapAccess {
DisallowCodeDependencyChange no_dependency_change_;
@ -183,60 +183,60 @@ class DisallowHeapAccessIf {
// Per-isolate assert scopes.
// Scope to document where we do not expect javascript execution.
typedef PerIsolateAssertScope<JAVASCRIPT_EXECUTION_ASSERT, false>
DisallowJavascriptExecution;
using DisallowJavascriptExecution =
PerIsolateAssertScope<JAVASCRIPT_EXECUTION_ASSERT, false>;
// Scope to introduce an exception to DisallowJavascriptExecution.
typedef PerIsolateAssertScope<JAVASCRIPT_EXECUTION_ASSERT, true>
AllowJavascriptExecution;
using AllowJavascriptExecution =
PerIsolateAssertScope<JAVASCRIPT_EXECUTION_ASSERT, true>;
// Scope to document where we do not expect javascript execution (debug only)
typedef PerIsolateAssertScopeDebugOnly<JAVASCRIPT_EXECUTION_ASSERT, false>
DisallowJavascriptExecutionDebugOnly;
using DisallowJavascriptExecutionDebugOnly =
PerIsolateAssertScopeDebugOnly<JAVASCRIPT_EXECUTION_ASSERT, false>;
// Scope to introduce an exception to DisallowJavascriptExecutionDebugOnly.
typedef PerIsolateAssertScopeDebugOnly<JAVASCRIPT_EXECUTION_ASSERT, true>
AllowJavascriptExecutionDebugOnly;
using AllowJavascriptExecutionDebugOnly =
PerIsolateAssertScopeDebugOnly<JAVASCRIPT_EXECUTION_ASSERT, true>;
// Scope in which javascript execution leads to exception being thrown.
typedef PerIsolateAssertScope<JAVASCRIPT_EXECUTION_THROWS, false>
ThrowOnJavascriptExecution;
using ThrowOnJavascriptExecution =
PerIsolateAssertScope<JAVASCRIPT_EXECUTION_THROWS, false>;
// Scope to introduce an exception to ThrowOnJavascriptExecution.
typedef PerIsolateAssertScope<JAVASCRIPT_EXECUTION_THROWS, true>
NoThrowOnJavascriptExecution;
using NoThrowOnJavascriptExecution =
PerIsolateAssertScope<JAVASCRIPT_EXECUTION_THROWS, true>;
// Scope in which javascript execution causes dumps.
typedef PerIsolateAssertScope<JAVASCRIPT_EXECUTION_DUMP, false>
DumpOnJavascriptExecution;
using DumpOnJavascriptExecution =
PerIsolateAssertScope<JAVASCRIPT_EXECUTION_DUMP, false>;
// Scope in which javascript execution causes dumps.
typedef PerIsolateAssertScope<JAVASCRIPT_EXECUTION_DUMP, true>
NoDumpOnJavascriptExecution;
using NoDumpOnJavascriptExecution =
PerIsolateAssertScope<JAVASCRIPT_EXECUTION_DUMP, true>;
// Scope to document where we do not expect deoptimization.
typedef PerIsolateAssertScopeDebugOnly<DEOPTIMIZATION_ASSERT, false>
DisallowDeoptimization;
using DisallowDeoptimization =
PerIsolateAssertScopeDebugOnly<DEOPTIMIZATION_ASSERT, false>;
// Scope to introduce an exception to DisallowDeoptimization.
typedef PerIsolateAssertScopeDebugOnly<DEOPTIMIZATION_ASSERT, true>
AllowDeoptimization;
using AllowDeoptimization =
PerIsolateAssertScopeDebugOnly<DEOPTIMIZATION_ASSERT, true>;
// Scope to document where we do not expect deoptimization.
typedef PerIsolateAssertScopeDebugOnly<COMPILATION_ASSERT, false>
DisallowCompilation;
using DisallowCompilation =
PerIsolateAssertScopeDebugOnly<COMPILATION_ASSERT, false>;
// Scope to introduce an exception to DisallowDeoptimization.
typedef PerIsolateAssertScopeDebugOnly<COMPILATION_ASSERT, true>
AllowCompilation;
using AllowCompilation =
PerIsolateAssertScopeDebugOnly<COMPILATION_ASSERT, true>;
// Scope to document where we do not expect exceptions.
typedef PerIsolateAssertScopeDebugOnly<NO_EXCEPTION_ASSERT, false>
DisallowExceptions;
using DisallowExceptions =
PerIsolateAssertScopeDebugOnly<NO_EXCEPTION_ASSERT, false>;
// Scope to introduce an exception to DisallowExceptions.
typedef PerIsolateAssertScopeDebugOnly<NO_EXCEPTION_ASSERT, true>
AllowExceptions;
using AllowExceptions =
PerIsolateAssertScopeDebugOnly<NO_EXCEPTION_ASSERT, true>;
// Explicit instantiation declarations.
extern template class PerThreadAssertScope<HEAP_ALLOCATION_ASSERT, false>;

View File

@ -110,7 +110,7 @@ class AllStatic {
#endif
};
typedef uint8_t byte;
using byte = uint8_t;
// -----------------------------------------------------------------------------
// Constants
@ -316,8 +316,8 @@ constexpr uint64_t kQuietNaNMask = static_cast<uint64_t>(0xfff) << 51;
// Latin1/UTF-16 constants
// Code-point values in Unicode 4.0 are 21 bits wide.
// Code units in UTF-16 are 16 bits wide.
typedef uint16_t uc16;
typedef int32_t uc32;
using uc16 = uint16_t;
using uc32 = int32_t;
constexpr int kOneByteSize = kCharSize;
constexpr int kUC16Size = sizeof(uc16); // NOLINT
@ -892,11 +892,11 @@ union IeeeDoubleBigEndianArchType {
};
#if V8_TARGET_LITTLE_ENDIAN
typedef IeeeDoubleLittleEndianArchType IeeeDoubleArchType;
using IeeeDoubleArchType = IeeeDoubleLittleEndianArchType;
constexpr int kIeeeDoubleMantissaWordOffset = 0;
constexpr int kIeeeDoubleExponentWordOffset = 4;
#else
typedef IeeeDoubleBigEndianArchType IeeeDoubleArchType;
using IeeeDoubleArchType = IeeeDoubleBigEndianArchType;
constexpr int kIeeeDoubleMantissaWordOffset = 4;
constexpr int kIeeeDoubleExponentWordOffset = 0;
#endif
@ -1384,7 +1384,7 @@ enum class DataPropertyInLiteralFlag {
kDontEnum = 1 << 0,
kSetFunctionName = 1 << 1
};
typedef base::Flags<DataPropertyInLiteralFlag> DataPropertyInLiteralFlags;
using DataPropertyInLiteralFlags = base::Flags<DataPropertyInLiteralFlag>;
DEFINE_OPERATORS_FOR_FLAGS(DataPropertyInLiteralFlags)
enum ExternalArrayType {

View File

@ -75,7 +75,7 @@ class Handle;
// thread.
class V8_EXPORT_PRIVATE CompilerDispatcher {
public:
typedef uintptr_t JobId;
using JobId = uintptr_t;
CompilerDispatcher(Isolate* isolate, Platform* platform,
size_t max_stack_size);
@ -136,8 +136,8 @@ class V8_EXPORT_PRIVATE CompilerDispatcher {
bool aborted;
};
typedef std::map<JobId, std::unique_ptr<Job>> JobMap;
typedef IdentityMap<JobId, FreeStoreAllocationPolicy> SharedToJobIdMap;
using JobMap = std::map<JobId, std::unique_ptr<Job>>;
using SharedToJobIdMap = IdentityMap<JobId, FreeStoreAllocationPolicy>;
void WaitForJobIfRunningOnBackground(Job* job);
JobMap::const_iterator GetJobFor(Handle<SharedFunctionInfo> shared) const;

View File

@ -12,7 +12,7 @@
namespace v8 {
typedef double async_id_t;
using async_id_t = double;
struct AsyncContext {
async_id_t execution_async_id;

View File

@ -57,7 +57,7 @@ class CounterCollection {
Counter counters_[kMaxCounters];
};
typedef std::unordered_map<std::string, Counter*> CounterMap;
using CounterMap = std::unordered_map<std::string, Counter*>;
class SourceGroup {
public:

View File

@ -219,8 +219,8 @@ class TranslatedFrame {
int input_index_;
};
typedef TranslatedValue& reference;
typedef TranslatedValue const& const_reference;
using reference = TranslatedValue&;
using const_reference = TranslatedValue const&;
iterator begin() { return iterator(values_.begin()); }
iterator end() { return iterator(values_.end()); }
@ -278,7 +278,7 @@ class TranslatedFrame {
int return_value_offset_;
int return_value_count_;
typedef std::deque<TranslatedValue> ValuesContainer;
using ValuesContainer = std::deque<TranslatedValue>;
ValuesContainer values_;
};
@ -308,11 +308,11 @@ class TranslatedState {
// Store newly materialized values into the isolate.
void StoreMaterializedValuesAndDeopt(JavaScriptFrame* frame);
typedef std::vector<TranslatedFrame>::iterator iterator;
using iterator = std::vector<TranslatedFrame>::iterator;
iterator begin() { return frames_.begin(); }
iterator end() { return frames_.end(); }
typedef std::vector<TranslatedFrame>::const_iterator const_iterator;
using const_iterator = std::vector<TranslatedFrame>::const_iterator;
const_iterator begin() const { return frames_.begin(); }
const_iterator end() const { return frames_.end(); }

View File

@ -78,7 +78,7 @@ void BasicBlockProfiler::ResetCounts() {
std::ostream& operator<<(std::ostream& os, const BasicBlockProfiler& p) {
os << "---- Start Profiling Data ----" << std::endl;
typedef BasicBlockProfiler::DataList::const_iterator iterator;
using iterator = BasicBlockProfiler::DataList::const_iterator;
for (iterator i = p.data_list_.begin(); i != p.data_list_.end(); ++i) {
os << **i;
}

View File

@ -49,7 +49,7 @@ class BasicBlockProfiler {
DISALLOW_COPY_AND_ASSIGN(Data);
};
typedef std::list<Data*> DataList;
using DataList = std::list<Data*>;
BasicBlockProfiler() = default;
~BasicBlockProfiler();

View File

@ -113,16 +113,16 @@ std::ostream& operator<<(std::ostream& os, const AsPrintableStatistics& ps) {
// pointers into them.
const CompilationStatistics& s = ps.s;
typedef std::vector<CompilationStatistics::PhaseKindMap::const_iterator>
SortedPhaseKinds;
using SortedPhaseKinds =
std::vector<CompilationStatistics::PhaseKindMap::const_iterator>;
SortedPhaseKinds sorted_phase_kinds(s.phase_kind_map_.size());
for (auto it = s.phase_kind_map_.begin(); it != s.phase_kind_map_.end();
++it) {
sorted_phase_kinds[it->second.insert_order_] = it;
}
typedef std::vector<CompilationStatistics::PhaseMap::const_iterator>
SortedPhases;
using SortedPhases =
std::vector<CompilationStatistics::PhaseMap::const_iterator>;
SortedPhases sorted_phases(s.phase_map_.size());
for (auto it = s.phase_map_.begin(); it != s.phase_map_.end(); ++it) {
sorted_phases[it->second.insert_order_] = it;

View File

@ -73,9 +73,9 @@ class CompilationStatistics final : public Malloced {
friend std::ostream& operator<<(std::ostream& os,
const AsPrintableStatistics& s);
typedef OrderedStats PhaseKindStats;
typedef std::map<std::string, PhaseKindStats> PhaseKindMap;
typedef std::map<std::string, PhaseStats> PhaseMap;
using PhaseKindStats = OrderedStats;
using PhaseKindMap = std::map<std::string, PhaseKindStats>;
using PhaseMap = std::map<std::string, PhaseStats>;
TotalStats total_stats_;
PhaseKindMap phase_kind_map_;

View File

@ -9,7 +9,7 @@
namespace disasm {
typedef unsigned char byte;
using byte = unsigned char;
// Interface and default implementation for converting addresses and
// register-numbers to text. The default implementation is machine

View File

@ -31,14 +31,14 @@ namespace GDBJITInterface {
#define __MACH_O
class MachO;
class MachOSection;
typedef MachO DebugObject;
typedef MachOSection DebugSection;
using DebugObject = MachO;
using DebugSection = MachOSection;
#else
#define __ELF
class ELF;
class ELFSection;
typedef ELF DebugObject;
typedef ELFSection DebugSection;
using DebugObject = ELF;
using DebugSection = ELFSection;
#endif
class Writer {
@ -183,7 +183,7 @@ class DebugSectionBase : public ZoneObject {
virtual bool WriteBodyInternal(Writer* writer) { return false; }
typedef THeader Header;
using Header = THeader;
};
struct MachOSectionHeader {
@ -1823,8 +1823,8 @@ struct AddressRange {
};
struct SplayTreeConfig {
typedef AddressRange Key;
typedef JITCodeEntry* Value;
using Key = AddressRange;
using Value = JITCodeEntry*;
static const AddressRange kNoKey;
static Value NoValue() { return nullptr; }
static int Compare(const AddressRange& a, const AddressRange& b) {
@ -1836,7 +1836,7 @@ struct SplayTreeConfig {
};
const AddressRange SplayTreeConfig::kNoKey = {0, 0};
typedef SplayTree<SplayTreeConfig> CodeMap;
using CodeMap = SplayTree<SplayTreeConfig>;
static CodeMap* GetCodeMap() {
static CodeMap* code_map = nullptr;

View File

@ -1755,7 +1755,7 @@ class Isolate final : private HiddenFactory {
CompilerDispatcher* compiler_dispatcher_ = nullptr;
typedef std::pair<InterruptCallback, void*> InterruptEntry;
using InterruptEntry = std::pair<InterruptCallback, void*>;
std::queue<InterruptEntry> api_interrupts_queue_;
#define GLOBAL_BACKING_STORE(type, name, initialvalue) type name##_;

View File

@ -31,11 +31,10 @@ class SimpleStringResource : public Base {
const size_t length_;
};
typedef SimpleStringResource<char, v8::String::ExternalOneByteStringResource>
SimpleOneByteStringResource;
typedef SimpleStringResource<uc16, v8::String::ExternalStringResource>
SimpleTwoByteStringResource;
using SimpleOneByteStringResource =
SimpleStringResource<char, v8::String::ExternalOneByteStringResource>;
using SimpleTwoByteStringResource =
SimpleStringResource<uc16, v8::String::ExternalStringResource>;
const char* const ExternalizeStringExtension::kSource =
"native function externalizeString();"

View File

@ -763,7 +763,7 @@ void GlobalHandles::SetFinalizationCallbackForTraced(
callback);
}
typedef v8::WeakCallbackInfo<void>::Callback GenericCallback;
using GenericCallback = v8::WeakCallbackInfo<void>::Callback;
void GlobalHandles::MakeWeak(Address* location, void* parameter,
GenericCallback phantom_callback,

View File

@ -241,7 +241,7 @@ class V8_EXPORT_PRIVATE GlobalHandles final {
class GlobalHandles::PendingPhantomCallback final {
public:
typedef v8::WeakCallbackInfo<void> Data;
using Data = v8::WeakCallbackInfo<void>;
enum InvocationType { kFirstPass, kSecondPass };

View File

@ -19,7 +19,7 @@ namespace internal {
// Convenience for platform-independent signatures. We do not normally
// distinguish memory operands from other operands on ia32.
typedef Operand MemOperand;
using MemOperand = Operand;
enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET };
enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK };

View File

@ -92,11 +92,11 @@ class XMMRegister : public RegisterBase<XMMRegister, kDoubleAfterLast> {
explicit constexpr XMMRegister(int code) : RegisterBase(code) {}
};
typedef XMMRegister FloatRegister;
using FloatRegister = XMMRegister;
typedef XMMRegister DoubleRegister;
using DoubleRegister = XMMRegister;
typedef XMMRegister Simd128Register;
using Simd128Register = XMMRegister;
#define DEFINE_REGISTER(R) \
constexpr DoubleRegister R = DoubleRegister::from_code<kDoubleCode_##R>();

View File

@ -97,7 +97,7 @@ class Bootstrapper final {
void LogAllMaps();
Isolate* isolate_;
typedef int NestingCounterType;
using NestingCounterType = int;
NestingCounterType nesting_;
SourceCodeCache extensions_cache_;

View File

@ -303,8 +303,8 @@ Response V8ProfilerAgentImpl::startPreciseCoverage(Maybe<bool> callCount,
// coverage data if it exists (at the time of writing, that's the case for
// each function recompiled after the BlockCount mode has been set); and
// function-granularity coverage data otherwise.
typedef v8::debug::Coverage C;
typedef v8::debug::CoverageMode Mode;
using C = v8::debug::Coverage;
using Mode = v8::debug::CoverageMode;
Mode mode = callCountValue
? (detailedValue ? Mode::kBlockCount : Mode::kPreciseCount)
: (detailedValue ? Mode::kBlockBinary : Mode::kPreciseBinary);

View File

@ -20,7 +20,7 @@ class PerfettoTracingController;
class PerfettoProducer final : public ::perfetto::Producer {
public:
typedef ::perfetto::TracingService::ProducerEndpoint ServiceEndpoint;
using ServiceEndpoint = ::perfetto::TracingService::ProducerEndpoint;
explicit PerfettoProducer(PerfettoTracingController* tracing_controller);

View File

@ -46,9 +46,9 @@ zx_status_t zx_thread_read_state(zx_handle_t h, uint32_t k, void* b, size_t l) {
&dummy_out_len);
}
#if defined(__x86_64__)
typedef zx_x86_64_general_regs_t zx_thread_state_general_regs_t;
using zx_thread_state_general_regs_t = zx_x86_64_general_regs_t;
#else
typedef zx_arm64_general_regs_t zx_thread_state_general_regs_t;
using zx_thread_state_general_regs_t = zx_arm64_general_regs_t;
#endif
#endif // !defined(ZX_THREAD_STATE_GENERAL_REGS)
@ -71,7 +71,7 @@ typedef zx_arm64_general_regs_t zx_thread_state_general_regs_t;
#if defined(__arm__)
typedef struct sigcontext mcontext_t;
using mcontext_t = struct sigcontext;
typedef struct ucontext {
uint32_t uc_flags;
@ -83,7 +83,7 @@ typedef struct ucontext {
#elif defined(__aarch64__)
typedef struct sigcontext mcontext_t;
using mcontext_t = struct sigcontext;
typedef struct ucontext {
uint64_t uc_flags;

View File

@ -92,7 +92,7 @@ class V8_EXPORT_PRIVATE Sampler {
#ifdef USE_SIGNALS
typedef std::atomic_bool AtomicMutex;
using AtomicMutex = std::atomic_bool;
// A helper that uses an std::atomic_bool to create a lock that is obtained on
// construction and released on destruction.
@ -120,7 +120,7 @@ class V8_EXPORT_PRIVATE AtomicGuard {
// take a sample for every Sampler on the current thread.
class V8_EXPORT_PRIVATE SamplerManager {
public:
typedef std::vector<Sampler*> SamplerList;
using SamplerList = std::vector<Sampler*>;
// Add |sampler| to the map if it is not already present.
void AddSampler(Sampler* sampler);

View File

@ -290,7 +290,7 @@ class MSARegisters {
// Instructions encoding constants.
// On MIPS all instructions are 32 bits.
typedef int32_t Instr;
using Instr = int32_t;
// Special Software Interrupt codes when used in the presence of the MIPS
// simulator.

View File

@ -260,9 +260,9 @@ class MSARegister : public RegisterBase<MSARegister, kMsaAfterLast> {
// but it is not in common use. Someday we will want to support this in v8.)
// For O32 ABI, Floats and Doubles refer to same set of 32 32-bit registers.
typedef FPURegister FloatRegister;
using FloatRegister = FPURegister;
typedef FPURegister DoubleRegister;
using DoubleRegister = FPURegister;
#define DECLARE_DOUBLE_REGISTER(R) \
constexpr DoubleRegister R = DoubleRegister::from_code<kDoubleCode_##R>();
@ -272,7 +272,7 @@ DOUBLE_REGISTERS(DECLARE_DOUBLE_REGISTER)
constexpr DoubleRegister no_dreg = DoubleRegister::no_reg();
// SIMD registers.
typedef MSARegister Simd128Register;
using Simd128Register = MSARegister;
#define DECLARE_SIMD128_REGISTER(R) \
constexpr Simd128Register R = Simd128Register::from_code<kMsaCode_##R>();

View File

@ -4754,7 +4754,7 @@ void Simulator::DecodeTypeMsaELM() {
template <typename T>
T Simulator::MsaBitInstrHelper(uint32_t opcode, T wd, T ws, int32_t m) {
typedef typename std::make_unsigned<T>::type uT;
using uT = typename std::make_unsigned<T>::type;
T res;
switch (opcode) {
case SLLI:
@ -4947,7 +4947,7 @@ void Simulator::DecodeTypeMsaMI10() {
template <typename T>
T Simulator::Msa3RInstrHelper(uint32_t opcode, T wd, T ws, T wt) {
typedef typename std::make_unsigned<T>::type uT;
using uT = typename std::make_unsigned<T>::type;
T res;
T wt_modulo = wt % (sizeof(T) * 8);
switch (opcode) {
@ -5228,8 +5228,8 @@ template <typename T_int, typename T_smaller_int, typename T_reg>
void Msa3RInstrHelper_horizontal(const uint32_t opcode, T_reg ws, T_reg wt,
T_reg wd, const int i,
const int num_of_lanes) {
typedef typename std::make_unsigned<T_int>::type T_uint;
typedef typename std::make_unsigned<T_smaller_int>::type T_smaller_uint;
using T_uint = typename std::make_unsigned<T_int>::type;
using T_smaller_uint = typename std::make_unsigned<T_smaller_int>::type;
T_int* wd_p;
T_smaller_int *ws_p, *wt_p;
ws_p = reinterpret_cast<T_smaller_int*>(ws);
@ -5522,8 +5522,8 @@ void Msa3RFInstrHelper(uint32_t opcode, T_reg ws, T_reg wt, T_reg& wd) {
template <typename T_int, typename T_int_dbl, typename T_reg>
void Msa3RFInstrHelper2(uint32_t opcode, T_reg ws, T_reg wt, T_reg& wd) {
// typedef typename std::make_unsigned<T_int>::type T_uint;
typedef typename std::make_unsigned<T_int_dbl>::type T_uint_dbl;
// using T_uint = typename std::make_unsigned<T_int>::type;
using T_uint_dbl = typename std::make_unsigned<T_int_dbl>::type;
const T_int max_int = std::numeric_limits<T_int>::max();
const T_int min_int = std::numeric_limits<T_int>::min();
const int shift = kBitsPerByte * sizeof(T_int) - 1;
@ -5968,7 +5968,7 @@ static inline bool isSnan(double fp) { return !QUIET_BIT_D(fp); }
template <typename T_int, typename T_fp, typename T_src, typename T_dst>
T_int Msa2RFInstrHelper(uint32_t opcode, T_src src, T_dst& dst,
Simulator* sim) {
typedef typename std::make_unsigned<T_int>::type T_uint;
using T_uint = typename std::make_unsigned<T_int>::type;
switch (opcode) {
case FCLASS: {
#define SNAN_BIT BIT(0)
@ -6153,7 +6153,7 @@ T_int Msa2RFInstrHelper(uint32_t opcode, T_src src, T_dst& dst,
dst = bit_cast<T_int>(static_cast<T_fp>(src));
break;
case FFINT_U:
typedef typename std::make_unsigned<T_src>::type uT_src;
using uT_src = typename std::make_unsigned<T_src>::type;
dst = bit_cast<T_int>(static_cast<T_fp>(bit_cast<uT_src>(src)));
break;
default:

View File

@ -253,7 +253,7 @@ class MSARegisters {
// Instructions encoding constants.
// On MIPS all instructions are 32 bits.
typedef int32_t Instr;
using Instr = int32_t;
// Special Software Interrupt codes when used in the presence of the MIPS
// simulator.

View File

@ -266,9 +266,9 @@ class MSARegister : public RegisterBase<MSARegister, kMsaAfterLast> {
// but it is not in common use. Someday we will want to support this in v8.)
// For O32 ABI, Floats and Doubles refer to same set of 32 32-bit registers.
typedef FPURegister FloatRegister;
using FloatRegister = FPURegister;
typedef FPURegister DoubleRegister;
using DoubleRegister = FPURegister;
#define DECLARE_DOUBLE_REGISTER(R) \
constexpr DoubleRegister R = DoubleRegister::from_code<kDoubleCode_##R>();
@ -278,7 +278,7 @@ DOUBLE_REGISTERS(DECLARE_DOUBLE_REGISTER)
constexpr DoubleRegister no_dreg = DoubleRegister::no_reg();
// SIMD registers.
typedef MSARegister Simd128Register;
using Simd128Register = MSARegister;
#define DECLARE_SIMD128_REGISTER(R) \
constexpr Simd128Register R = Simd128Register::from_code<kMsaCode_##R>();

View File

@ -5009,7 +5009,7 @@ void Simulator::DecodeTypeMsaELM() {
template <typename T>
T Simulator::MsaBitInstrHelper(uint32_t opcode, T wd, T ws, int32_t m) {
typedef typename std::make_unsigned<T>::type uT;
using uT = typename std::make_unsigned<T>::type;
T res;
switch (opcode) {
case SLLI:
@ -5202,7 +5202,7 @@ void Simulator::DecodeTypeMsaMI10() {
template <typename T>
T Simulator::Msa3RInstrHelper(uint32_t opcode, T wd, T ws, T wt) {
typedef typename std::make_unsigned<T>::type uT;
using uT = typename std::make_unsigned<T>::type;
T res;
int wt_modulo = wt % (sizeof(T) * 8);
switch (opcode) {
@ -5482,8 +5482,8 @@ template <typename T_int, typename T_smaller_int, typename T_reg>
void Msa3RInstrHelper_horizontal(const uint32_t opcode, T_reg ws, T_reg wt,
T_reg wd, const int i,
const int num_of_lanes) {
typedef typename std::make_unsigned<T_int>::type T_uint;
typedef typename std::make_unsigned<T_smaller_int>::type T_smaller_uint;
using T_uint = typename std::make_unsigned<T_int>::type;
using T_smaller_uint = typename std::make_unsigned<T_smaller_int>::type;
T_int* wd_p;
T_smaller_int *ws_p, *wt_p;
ws_p = reinterpret_cast<T_smaller_int*>(ws);
@ -5776,8 +5776,8 @@ void Msa3RFInstrHelper(uint32_t opcode, T_reg ws, T_reg wt, T_reg& wd) {
template <typename T_int, typename T_int_dbl, typename T_reg>
void Msa3RFInstrHelper2(uint32_t opcode, T_reg ws, T_reg wt, T_reg& wd) {
// typedef typename std::make_unsigned<T_int>::type T_uint;
typedef typename std::make_unsigned<T_int_dbl>::type T_uint_dbl;
// using T_uint = typename std::make_unsigned<T_int>::type;
using T_uint_dbl = typename std::make_unsigned<T_int_dbl>::type;
const T_int max_int = std::numeric_limits<T_int>::max();
const T_int min_int = std::numeric_limits<T_int>::min();
const int shift = kBitsPerByte * sizeof(T_int) - 1;
@ -6229,7 +6229,7 @@ static inline bool isSnan(double fp) { return !QUIET_BIT_D(fp); }
template <typename T_int, typename T_fp, typename T_src, typename T_dst>
T_int Msa2RFInstrHelper(uint32_t opcode, T_src src, T_dst& dst,
Simulator* sim) {
typedef typename std::make_unsigned<T_int>::type T_uint;
using T_uint = typename std::make_unsigned<T_int>::type;
switch (opcode) {
case FCLASS: {
#define SNAN_BIT BIT(0)
@ -6414,7 +6414,7 @@ T_int Msa2RFInstrHelper(uint32_t opcode, T_src src, T_dst& dst,
dst = bit_cast<T_int>(static_cast<T_fp>(src));
break;
case FFINT_U:
typedef typename std::make_unsigned<T_src>::type uT_src;
using uT_src = typename std::make_unsigned<T_src>::type;
dst = bit_cast<T_int>(static_cast<T_fp>(bit_cast<uT_src>(src)));
break;
default:

View File

@ -73,8 +73,8 @@ class V8_EXPORT_PRIVATE Bignum {
}
private:
typedef uint32_t Chunk;
typedef uint64_t DoubleChunk;
using Chunk = uint32_t;
using DoubleChunk = uint64_t;
static const int kChunkSize = sizeof(Chunk) * 8;
static const int kDoubleChunkSize = sizeof(DoubleChunk) * 8;

View File

@ -656,7 +656,7 @@ class Context : public HeapObject {
DECL_PRINTER(Context)
DECL_VERIFIER(Context)
typedef FlexibleBodyDescriptor<kStartOfTaggedFieldsOffset> BodyDescriptor;
using BodyDescriptor = FlexibleBodyDescriptor<kStartOfTaggedFieldsOffset>;
private:
#ifdef DEBUG
@ -710,7 +710,7 @@ class NativeContext : public Context {
OBJECT_CONSTRUCTORS(NativeContext, Context);
};
typedef Context::Field ContextField;
using ContextField = Context::Field;
} // namespace internal
} // namespace v8

View File

@ -116,7 +116,7 @@ enum Where { AT_START, AT_END };
template <ElementsKind Kind>
class ElementsKindTraits {
public:
typedef FixedArrayBase BackingStore;
using BackingStore = FixedArrayBase;
};
#define ELEMENTS_TRAITS(Class, KindParam, Store) \
@ -124,7 +124,7 @@ class ElementsKindTraits {
class ElementsKindTraits<KindParam> { \
public: /* NOLINT */ \
static constexpr ElementsKind Kind = KindParam; \
typedef Store BackingStore; \
using BackingStore = Store; \
}; \
constexpr ElementsKind ElementsKindTraits<KindParam>::Kind;
ELEMENTS_LIST(ELEMENTS_TRAITS)
@ -570,8 +570,8 @@ class ElementsAccessorBase : public InternalElementsAccessor {
public:
ElementsAccessorBase() = default;
typedef ElementsTraitsParam ElementsTraits;
typedef typename ElementsTraitsParam::BackingStore BackingStore;
using ElementsTraits = ElementsTraitsParam;
using BackingStore = typename ElementsTraitsParam::BackingStore;
static ElementsKind kind() { return ElementsTraits::Kind; }
@ -1888,7 +1888,7 @@ class DictionaryElementsAccessor
template <typename Subclass, typename KindTraits>
class FastElementsAccessor : public ElementsAccessorBase<Subclass, KindTraits> {
public:
typedef typename KindTraits::BackingStore BackingStore;
using BackingStore = typename KindTraits::BackingStore;
static Handle<NumberDictionary> NormalizeImpl(Handle<JSObject> object,
Handle<FixedArrayBase> store) {
@ -2605,7 +2605,7 @@ template <typename Subclass, typename KindTraits>
class FastSealedObjectElementsAccessor
: public FastSmiOrObjectElementsAccessor<Subclass, KindTraits> {
public:
typedef typename KindTraits::BackingStore BackingStore;
using BackingStore = typename KindTraits::BackingStore;
static Handle<Object> RemoveElement(Handle<JSArray> receiver,
Where remove_position) {
@ -2699,7 +2699,7 @@ template <typename Subclass, typename KindTraits>
class FastFrozenObjectElementsAccessor
: public FastSmiOrObjectElementsAccessor<Subclass, KindTraits> {
public:
typedef typename KindTraits::BackingStore BackingStore;
using BackingStore = typename KindTraits::BackingStore;
static inline void SetImpl(Handle<JSObject> holder, uint32_t entry,
Object value) {
@ -2910,8 +2910,8 @@ class TypedElementsAccessor
: public ElementsAccessorBase<TypedElementsAccessor<Kind, ctype>,
ElementsKindTraits<Kind>> {
public:
typedef typename ElementsKindTraits<Kind>::BackingStore BackingStore;
typedef TypedElementsAccessor<Kind, ctype> AccessorClass;
using BackingStore = typename ElementsKindTraits<Kind>::BackingStore;
using AccessorClass = TypedElementsAccessor<Kind, ctype>;
static inline void SetImpl(Handle<JSObject> holder, uint32_t entry,
Object value) {
@ -3587,8 +3587,8 @@ class TypedElementsAccessor
};
#define FIXED_ELEMENTS_ACCESSOR(Type, type, TYPE, ctype) \
typedef TypedElementsAccessor<TYPE##_ELEMENTS, ctype> \
Fixed##Type##ElementsAccessor;
using Fixed##Type##ElementsAccessor = \
TypedElementsAccessor<TYPE##_ELEMENTS, ctype>;
TYPED_ARRAYS(FIXED_ELEMENTS_ACCESSOR)
#undef FIXED_ELEMENTS_ACCESSOR

View File

@ -141,7 +141,7 @@ inline LanguageMode GetLanguageModeFromSlotKind(FeedbackSlotKind kind) {
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
FeedbackSlotKind kind);
typedef std::vector<MaybeObjectHandle> MaybeObjectHandles;
using MaybeObjectHandles = std::vector<MaybeObjectHandle>;
class FeedbackMetadata;
@ -552,9 +552,9 @@ class FeedbackMetadata : public HeapObject {
void SetKind(FeedbackSlot slot, FeedbackSlotKind kind);
typedef BitSetComputer<FeedbackSlotKind, kFeedbackSlotKindBits,
kInt32Size * kBitsPerByte, uint32_t>
VectorICComputer;
using VectorICComputer =
BitSetComputer<FeedbackSlotKind, kFeedbackSlotKindBits,
kInt32Size * kBitsPerByte, uint32_t>;
OBJECT_CONSTRUCTORS(FeedbackMetadata, HeapObject);
};
@ -697,8 +697,8 @@ class V8_EXPORT_PRIVATE FeedbackNexus final {
// count (taken from the type feedback vector).
float ComputeCallFrequency();
typedef BitField<SpeculationMode, 0, 1> SpeculationModeField;
typedef BitField<uint32_t, 1, 31> CallCountField;
using SpeculationModeField = BitField<SpeculationMode, 0, 1>;
using CallCountField = BitField<uint32_t, 1, 31>;
// For InstanceOf ICs.
MaybeHandle<JSObject> GetConstructorFeedback() const;

View File

@ -123,7 +123,7 @@ class FlexibleBodyDescriptor final : public BodyDescriptorBase {
static inline int SizeOf(Map map, HeapObject object);
};
typedef FlexibleBodyDescriptor<HeapObject::kHeaderSize> StructBodyDescriptor;
using StructBodyDescriptor = FlexibleBodyDescriptor<HeapObject::kHeaderSize>;
template <int start_offset>
class FlexibleWeakBodyDescriptor final : public BodyDescriptorBase {

View File

@ -2847,7 +2847,7 @@ static int AppendUniqueCallbacks(Isolate* isolate,
}
struct FixedArrayAppender {
typedef FixedArray Array;
using Array = FixedArray;
static bool Contains(Handle<Name> key, Handle<AccessorInfo> entry,
int valid_descriptors, Handle<FixedArray> array) {
for (int i = 0; i < valid_descriptors; i++) {

View File

@ -128,7 +128,7 @@ inline Condition NegateCondition(Condition cond) {
// representing instructions from usual 32 bit values.
// Instruction objects are pointers to 32bit values, and provide methods to
// access the various ISA fields.
typedef uint32_t Instr;
using Instr = uint32_t;
#define PPC_XX3_OPCODE_LIST(V) \
/* VSX Scalar Add Double-Precision */ \

View File

@ -249,10 +249,10 @@ ASSERT_TRIVIALLY_COPYABLE(DoubleRegister);
static_assert(sizeof(DoubleRegister) == sizeof(int),
"DoubleRegister can efficiently be passed by value");
typedef DoubleRegister FloatRegister;
using FloatRegister = DoubleRegister;
// TODO(ppc) Define SIMD registers.
typedef DoubleRegister Simd128Register;
using Simd128Register = DoubleRegister;
#define DEFINE_REGISTER(R) \
constexpr DoubleRegister R = DoubleRegister::from_code<kDoubleCode_##R>();

View File

@ -87,7 +87,7 @@ class V8_EXPORT_PRIVATE AddressToTraceMap {
unsigned trace_node_id;
};
// [start, end) -> trace
typedef std::map<Address, RangeStack> RangeMap;
using RangeMap = std::map<Address, RangeStack>;
void RemoveRange(Address start, Address end);

View File

@ -253,8 +253,8 @@ class V8_EXPORT_PRIVATE CpuProfiler {
static void CollectSample(Isolate* isolate);
typedef v8::CpuProfilingMode ProfilingMode;
typedef v8::CpuProfilingNamingMode NamingMode;
using ProfilingMode = v8::CpuProfilingMode;
using NamingMode = v8::CpuProfilingNamingMode;
base::TimeDelta sampling_interval() const { return base_sampling_interval_; }
void set_sampling_interval(base::TimeDelta value);

View File

@ -2204,11 +2204,11 @@ namespace {
template<size_t size> struct ToUnsigned;
template<> struct ToUnsigned<4> {
typedef uint32_t Type;
using Type = uint32_t;
};
template<> struct ToUnsigned<8> {
typedef uint64_t Type;
using Type = uint64_t;
};
} // namespace

View File

@ -294,7 +294,7 @@ class HeapObjectsMap {
// A typedef for referencing anything that can be snapshotted living
// in any kind of heap memory.
typedef void* HeapThing;
using HeapThing = void*;
// An interface that creates HeapEntries by HeapThings.
class HeapEntriesAllocator {

View File

@ -234,7 +234,7 @@ struct CodeEntryAndLineNumber {
int line_number;
};
typedef std::vector<CodeEntryAndLineNumber> ProfileStackTrace;
using ProfileStackTrace = std::vector<CodeEntryAndLineNumber>;
class ProfileTree;
@ -311,7 +311,7 @@ class V8_EXPORT_PRIVATE ProfileTree {
explicit ProfileTree(Isolate* isolate);
~ProfileTree();
typedef v8::CpuProfilingMode ProfilingMode;
using ProfilingMode = v8::CpuProfilingMode;
ProfileNode* AddPathFromEnd(
const std::vector<CodeEntry*>& path,

View File

@ -49,7 +49,7 @@ class SamplingHeapProfiler {
public:
class AllocationNode {
public:
typedef uint64_t FunctionId;
using FunctionId = uint64_t;
AllocationNode(AllocationNode* parent, const char* name, int script_id,
int start_position, uint32_t id)
: parent_(parent),

Some files were not shown because too many files have changed in this diff Show More