[compiler][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 compiler code to 'using' declarations.

R=mstarzinger@chromium.org

Bug: v8:8834
Change-Id: I3baf3ecbfe2c853cb17bb479ebbf140382193b5c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1545896
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60527}
This commit is contained in:
Clemens Hammacher 2019-03-29 13:31:21 +01:00 committed by Commit Bot
parent cde53270e3
commit 3e7a089c62
49 changed files with 222 additions and 229 deletions

View File

@ -265,8 +265,8 @@ class OutOfLineFloatMin final : public OutOfLineCode {
T const left_;
T const right_;
};
typedef OutOfLineFloatMin<SwVfpRegister> OutOfLineFloat32Min;
typedef OutOfLineFloatMin<DwVfpRegister> OutOfLineFloat64Min;
using OutOfLineFloat32Min = OutOfLineFloatMin<SwVfpRegister>;
using OutOfLineFloat64Min = OutOfLineFloatMin<DwVfpRegister>;
template <typename T>
class OutOfLineFloatMax final : public OutOfLineCode {
@ -281,8 +281,8 @@ class OutOfLineFloatMax final : public OutOfLineCode {
T const left_;
T const right_;
};
typedef OutOfLineFloatMax<SwVfpRegister> OutOfLineFloat32Max;
typedef OutOfLineFloatMax<DwVfpRegister> OutOfLineFloat64Max;
using OutOfLineFloat32Max = OutOfLineFloatMax<SwVfpRegister>;
using OutOfLineFloat64Max = OutOfLineFloatMax<DwVfpRegister>;
Condition FlagsConditionToCondition(FlagsCondition condition) {
switch (condition) {

View File

@ -354,15 +354,15 @@ bool TryMatchLoadStoreShift(Arm64OperandGenerator* g,
// Bitfields describing binary operator properties:
// CanCommuteField is true if we can switch the two operands, potentially
// requiring commuting the flags continuation condition.
typedef BitField8<bool, 1, 1> CanCommuteField;
using CanCommuteField = BitField8<bool, 1, 1>;
// MustCommuteCondField is true when we need to commute the flags continuation
// condition in order to switch the operands.
typedef BitField8<bool, 2, 1> MustCommuteCondField;
using MustCommuteCondField = BitField8<bool, 2, 1>;
// IsComparisonField is true when the operation is a comparison and has no other
// result other than the condition.
typedef BitField8<bool, 3, 1> IsComparisonField;
using IsComparisonField = BitField8<bool, 3, 1>;
// IsAddSubField is true when an instruction is encoded as ADD or SUB.
typedef BitField8<bool, 4, 1> IsAddSubField;
using IsAddSubField = BitField8<bool, 4, 1>;
// Get properties of a binary operator.
uint8_t GetBinopProperties(InstructionCode opcode) {

View File

@ -262,7 +262,7 @@ class CodeGenerator final : public GapResolver::Assembler {
kScalarPush = kRegisterPush | kStackSlotPush
};
typedef base::Flags<PushTypeFlag> PushTypeFlags;
using PushTypeFlags = base::Flags<PushTypeFlag>;
static bool IsValidPush(InstructionOperand source, PushTypeFlags push_type);

View File

@ -250,17 +250,17 @@ enum MemoryAccessMode {
// what code to emit for an instruction in the code generator. It is not
// interesting to the register allocator, as the inputs and flags on the
// instructions specify everything of interest.
typedef int32_t InstructionCode;
using InstructionCode = int32_t;
// Helpers for encoding / decoding InstructionCode into the fields needed
// for code generation. We encode the instruction, addressing mode, and flags
// continuation into a single InstructionCode which is stored as part of
// the instruction.
typedef BitField<ArchOpcode, 0, 9> ArchOpcodeField;
typedef BitField<AddressingMode, 9, 5> AddressingModeField;
typedef BitField<FlagsMode, 14, 3> FlagsModeField;
typedef BitField<FlagsCondition, 17, 5> FlagsConditionField;
typedef BitField<int, 22, 10> MiscField;
using ArchOpcodeField = BitField<ArchOpcode, 0, 9>;
using AddressingModeField = BitField<AddressingMode, 9, 5>;
using FlagsModeField = BitField<FlagsMode, 14, 3>;
using FlagsConditionField = BitField<FlagsCondition, 17, 5>;
using MiscField = BitField<int, 22, 10>;
} // namespace compiler
} // namespace internal

View File

@ -555,7 +555,7 @@ class V8_EXPORT_PRIVATE InstructionSelector final {
kCallFixedTargetRegister = 1u << 3,
kAllowCallThroughSlot = 1u << 4
};
typedef base::Flags<CallBufferFlag> CallBufferFlags;
using CallBufferFlags = base::Flags<CallBufferFlag>;
// Initialize the call buffer with the InstructionOperands, nodes, etc,
// corresponding

View File

@ -135,7 +135,7 @@ class V8_EXPORT_PRIVATE InstructionOperand {
uint64_t value_;
};
typedef ZoneVector<InstructionOperand> InstructionOperandVector;
using InstructionOperandVector = ZoneVector<InstructionOperand>;
std::ostream& operator<<(std::ostream&, const InstructionOperand&);
@ -929,9 +929,9 @@ class V8_EXPORT_PRIVATE Instruction final {
// APIs to aid debugging. For general-stream APIs, use operator<<.
void Print() const;
typedef BitField<size_t, 0, 8> OutputCountField;
typedef BitField<size_t, 8, 16> InputCountField;
typedef BitField<size_t, 24, 6> TempCountField;
using OutputCountField = BitField<size_t, 0, 8>;
using InputCountField = BitField<size_t, 8, 16>;
using TempCountField = BitField<size_t, 24, 6>;
static const size_t kMaxOutputCount = OutputCountField::kMax;
static const size_t kMaxInputCount = InputCountField::kMax;
@ -945,7 +945,7 @@ class V8_EXPORT_PRIVATE Instruction final {
InstructionOperand* inputs, size_t temp_count,
InstructionOperand* temps);
typedef BitField<bool, 30, 1> IsCallField;
using IsCallField = BitField<bool, 30, 1>;
InstructionCode opcode_;
uint32_t bit_field_;
@ -1313,12 +1313,12 @@ class DeoptimizationEntry final {
VectorSlotPair feedback_ = VectorSlotPair();
};
typedef ZoneVector<DeoptimizationEntry> DeoptimizationVector;
using DeoptimizationVector = ZoneVector<DeoptimizationEntry>;
class V8_EXPORT_PRIVATE PhiInstruction final
: public NON_EXPORTED_BASE(ZoneObject) {
public:
typedef ZoneVector<InstructionOperand> Inputs;
using Inputs = ZoneVector<InstructionOperand>;
PhiInstruction(Zone* zone, int virtual_register, size_t input_count);
@ -1380,18 +1380,18 @@ class V8_EXPORT_PRIVATE InstructionBlock final
inline bool IsSwitchTarget() const { return switch_target_; }
inline bool ShouldAlign() const { return alignment_; }
typedef ZoneVector<RpoNumber> Predecessors;
using Predecessors = ZoneVector<RpoNumber>;
Predecessors& predecessors() { return predecessors_; }
const Predecessors& predecessors() const { return predecessors_; }
size_t PredecessorCount() const { return predecessors_.size(); }
size_t PredecessorIndexOf(RpoNumber rpo_number) const;
typedef ZoneVector<RpoNumber> Successors;
using Successors = ZoneVector<RpoNumber>;
Successors& successors() { return successors_; }
const Successors& successors() const { return successors_; }
size_t SuccessorCount() const { return successors_.size(); }
typedef ZoneVector<PhiInstruction*> PhiInstructions;
using PhiInstructions = ZoneVector<PhiInstruction*>;
const PhiInstructions& phis() const { return phis_; }
PhiInstruction* PhiAt(size_t i) const { return phis_[i]; }
void AddPhi(PhiInstruction* phi) { phis_.push_back(phi); }
@ -1439,14 +1439,13 @@ struct PrintableInstructionBlock {
std::ostream& operator<<(std::ostream&, const PrintableInstructionBlock&);
typedef ZoneDeque<Constant> ConstantDeque;
typedef std::map<int, Constant, std::less<int>,
ZoneAllocator<std::pair<const int, Constant> > >
ConstantMap;
using ConstantDeque = ZoneDeque<Constant>;
using ConstantMap = std::map<int, Constant, std::less<int>,
ZoneAllocator<std::pair<const int, Constant> > >;
typedef ZoneDeque<Instruction*> InstructionDeque;
typedef ZoneDeque<ReferenceMap*> ReferenceMapDeque;
typedef ZoneVector<InstructionBlock*> InstructionBlocks;
using InstructionDeque = ZoneDeque<Instruction*>;
using ReferenceMapDeque = ZoneDeque<ReferenceMap*>;
using InstructionBlocks = ZoneVector<InstructionBlock*>;
// Represents architecture-specific generated code before, during, and after
// register allocation.
@ -1509,7 +1508,7 @@ class V8_EXPORT_PRIVATE InstructionSequence final
Instruction* GetBlockStart(RpoNumber rpo) const;
typedef InstructionDeque::const_iterator const_iterator;
using const_iterator = InstructionDeque::const_iterator;
const_iterator begin() const { return instructions_.begin(); }
const_iterator end() const { return instructions_.end(); }
const InstructionDeque& instructions() const { return instructions_; }
@ -1547,7 +1546,7 @@ class V8_EXPORT_PRIVATE InstructionSequence final
return it->second;
}
typedef ZoneVector<Constant> Immediates;
using Immediates = ZoneVector<Constant>;
Immediates& immediates() { return immediates_; }
ImmediateOperand AddImmediate(const Constant& constant) {
@ -1615,7 +1614,7 @@ class V8_EXPORT_PRIVATE InstructionSequence final
friend V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&,
const InstructionSequence&);
typedef ZoneMap<const Instruction*, SourcePosition> SourcePositionMap;
using SourcePositionMap = ZoneMap<const Instruction*, SourcePosition>;
static const RegisterConfiguration* RegisterConfigurationForTesting();
static const RegisterConfiguration* registerConfigurationForTesting_;

View File

@ -26,7 +26,7 @@ struct MoveKeyCompare {
}
};
typedef ZoneMap<MoveKey, unsigned, MoveKeyCompare> MoveMap;
using MoveMap = ZoneMap<MoveKey, unsigned, MoveKeyCompare>;
class OperandSet {
public:

View File

@ -19,8 +19,8 @@ class V8_EXPORT_PRIVATE MoveOptimizer final {
void Run();
private:
typedef ZoneVector<MoveOperands*> MoveOpVector;
typedef ZoneVector<Instruction*> Instructions;
using MoveOpVector = ZoneVector<MoveOperands*>;
using Instructions = ZoneVector<Instruction*>;
InstructionSequence* code() const { return code_; }
Zone* local_zone() const { return local_zone_; }

View File

@ -132,7 +132,7 @@ struct OperandAsKeyLess {
// Assessments associated with a basic block.
class BlockAssessments : public ZoneObject {
public:
typedef ZoneMap<InstructionOperand, Assessment*, OperandAsKeyLess> OperandMap;
using OperandMap = ZoneMap<InstructionOperand, Assessment*, OperandAsKeyLess>;
explicit BlockAssessments(Zone* zone)
: map_(zone), map_for_moves_(zone), zone_(zone) {}
void Drop(InstructionOperand operand) { map_.erase(operand); }
@ -208,7 +208,7 @@ class RegisterAllocatorVerifier final : public ZoneObject {
OperandConstraint* operand_constraints_;
};
typedef ZoneVector<InstructionConstraint> Constraints;
using Constraints = ZoneVector<InstructionConstraint>;
class DelayedAssessments : public ZoneObject {
public:

View File

@ -232,7 +232,7 @@ class LiveRangeFinder {
DISALLOW_COPY_AND_ASSIGN(LiveRangeFinder);
};
typedef std::pair<ParallelMove*, InstructionOperand> DelayedInsertionMapKey;
using DelayedInsertionMapKey = std::pair<ParallelMove*, InstructionOperand>;
struct DelayedInsertionMapCompare {
bool operator()(const DelayedInsertionMapKey& a,
@ -244,9 +244,8 @@ struct DelayedInsertionMapCompare {
}
};
typedef ZoneMap<DelayedInsertionMapKey, InstructionOperand,
DelayedInsertionMapCompare>
DelayedInsertionMap;
using DelayedInsertionMap = ZoneMap<DelayedInsertionMapKey, InstructionOperand,
DelayedInsertionMapCompare>;
UsePosition::UsePosition(LifetimePosition pos, InstructionOperand* operand,
void* hint, UsePositionHintType hint_type)

View File

@ -178,7 +178,7 @@ enum class RegisterAllocationFlag : unsigned {
kTurboPreprocessRanges = 1 << 1
};
typedef base::Flags<RegisterAllocationFlag> RegisterAllocationFlags;
using RegisterAllocationFlags = base::Flags<RegisterAllocationFlag>;
class SpillRange;
class LiveRange;
@ -224,15 +224,15 @@ class RegisterAllocationData final : public ZoneObject {
ZoneVector<InstructionOperand*> incoming_operands_;
int assigned_register_;
};
typedef ZoneMap<int, PhiMapValue*> PhiMap;
using PhiMap = ZoneMap<int, PhiMapValue*>;
struct DelayedReference {
ReferenceMap* map;
InstructionOperand* operand;
};
typedef ZoneVector<DelayedReference> DelayedReferences;
typedef ZoneVector<std::pair<TopLevelLiveRange*, int>>
RangesWithPreassignedSlots;
using DelayedReferences = ZoneVector<DelayedReference>;
using RangesWithPreassignedSlots =
ZoneVector<std::pair<TopLevelLiveRange*, int>>;
RegisterAllocationData(const RegisterConfiguration* config,
Zone* allocation_zone, Frame* frame,
@ -469,10 +469,10 @@ class V8_EXPORT_PRIVATE UsePosition final
static UsePositionHintType HintTypeForOperand(const InstructionOperand& op);
private:
typedef BitField<UsePositionType, 0, 2> TypeField;
typedef BitField<UsePositionHintType, 2, 3> HintTypeField;
typedef BitField<bool, 5, 1> RegisterBeneficialField;
typedef BitField<int32_t, 6, 6> AssignedRegisterField;
using TypeField = BitField<UsePositionType, 0, 2>;
using HintTypeField = BitField<UsePositionHintType, 2, 3>;
using RegisterBeneficialField = BitField<bool, 5, 1>;
using AssignedRegisterField = BitField<int32_t, 6, 6>;
InstructionOperand* const operand_;
void* hint_;
@ -652,12 +652,12 @@ class V8_EXPORT_PRIVATE LiveRange : public NON_EXPORTED_BASE(ZoneObject) {
void VerifyPositions() const;
void VerifyIntervals() const;
typedef BitField<bool, 0, 1> SpilledField;
using SpilledField = BitField<bool, 0, 1>;
// Bits (1,7[ are used by TopLevelLiveRange.
typedef BitField<int32_t, 7, 6> AssignedRegisterField;
typedef BitField<MachineRepresentation, 13, 8> RepresentationField;
typedef BitField<bool, 21, 1> RecombineField;
typedef BitField<uint8_t, 22, 6> ControlFlowRegisterHint;
using AssignedRegisterField = BitField<int32_t, 7, 6>;
using RepresentationField = BitField<MachineRepresentation, 13, 8>;
using RecombineField = BitField<bool, 21, 1>;
using ControlFlowRegisterHint = BitField<uint8_t, 22, 6>;
// Bit 28 is used by TopLevelLiveRange.
// Unique among children and splinters of the same virtual register.
@ -964,11 +964,11 @@ class V8_EXPORT_PRIVATE TopLevelLiveRange final : public LiveRange {
friend class LiveRange;
void SetSplinteredFrom(TopLevelLiveRange* splinter_parent);
typedef BitField<SlotUseKind, 1, 2> HasSlotUseField;
typedef BitField<bool, 3, 1> IsPhiField;
typedef BitField<bool, 4, 1> IsNonLoopPhiField;
typedef BitField<SpillType, 5, 2> SpillTypeField;
typedef BitField<bool, 28, 1> DeferredFixedField;
using HasSlotUseField = BitField<SlotUseKind, 1, 2>;
using IsPhiField = BitField<bool, 3, 1>;
using IsNonLoopPhiField = BitField<bool, 4, 1>;
using SpillTypeField = BitField<SpillType, 5, 2>;
using DeferredFixedField = BitField<bool, 28, 1>;
int vreg_;
int last_child_id_;

View File

@ -36,7 +36,7 @@ enum class OperandMode : uint32_t {
kArithmeticCommonMode = kAllowRM | kAllowRI
};
typedef base::Flags<OperandMode, uint32_t> OperandModes;
using OperandModes = base::Flags<OperandMode, uint32_t>;
DEFINE_OPERATORS_FOR_FLAGS(OperandModes)
OperandModes immediateModeMask =
OperandMode::kShift32Imm | OperandMode::kShift64Imm |

View File

@ -363,9 +363,9 @@ class RawMachineAssembler;
class RawMachineLabel;
class SourcePositionTable;
typedef ZoneVector<CodeAssemblerVariable*> CodeAssemblerVariableList;
using CodeAssemblerVariableList = ZoneVector<CodeAssemblerVariable*>;
typedef std::function<void()> CodeAssemblerCallback;
using CodeAssemblerCallback = std::function<void()>;
template <class T, class U>
struct is_subtype {
@ -1650,8 +1650,8 @@ class CodeAssemblerParameterizedLabel
}
};
typedef CodeAssemblerParameterizedLabel<Object>
CodeAssemblerExceptionHandlerLabel;
using CodeAssemblerExceptionHandlerLabel =
CodeAssemblerParameterizedLabel<Object>;
class V8_EXPORT_PRIVATE CodeAssemblerState {
public:
@ -1706,7 +1706,7 @@ class V8_EXPORT_PRIVATE CodeAssemblerState {
CodeAssemblerCallback call_prologue_;
CodeAssemblerCallback call_epilogue_;
std::vector<CodeAssemblerExceptionHandlerLabel*> exception_handler_labels_;
typedef uint32_t VariableId;
using VariableId = uint32_t;
VariableId next_variable_id_ = 0;
VariableId NextVariableId() { return next_variable_id_++; }
@ -1738,9 +1738,9 @@ class CodeAssemblerScopedExceptionHandler {
} // namespace compiler
#if defined(V8_HOST_ARCH_32_BIT)
typedef Smi BInt;
using BInt = Smi;
#elif defined(V8_HOST_ARCH_64_BIT)
typedef IntPtrT BInt;
using BInt = IntPtrT;
#else
#error Unknown architecture.
#endif

View File

@ -244,7 +244,7 @@ size_t hash_value(RelocatablePtrConstantInfo const& p);
// value.
class SparseInputMask final {
public:
typedef uint32_t BitMaskType;
using BitMaskType = uint32_t;
// The mask representing a dense input set.
static const BitMaskType kDenseBitMask = 0x0;
@ -399,7 +399,7 @@ ZoneVector<MachineType> const* MachineTypesOf(Operator const*)
//
// Also note that it is possible for an arguments object of {kMappedArguments}
// type to carry a backing store of {kUnappedArguments} type when {K == 0}.
typedef CreateArgumentsType ArgumentsStateType;
using ArgumentsStateType = CreateArgumentsType;
ArgumentsStateType ArgumentsStateTypeOf(Operator const*) V8_WARN_UNUSED_RESULT;

View File

@ -56,7 +56,7 @@ class V8_EXPORT_PRIVATE ControlEquivalence final
private:
static const size_t kInvalidClass = static_cast<size_t>(-1);
typedef enum { kInputDirection, kUseDirection } DFSDirection;
enum DFSDirection { kInputDirection, kUseDirection };
struct Bracket {
DFSDirection direction; // Direction in which this bracket was added.
@ -67,7 +67,7 @@ class V8_EXPORT_PRIVATE ControlEquivalence final
};
// The set of brackets for each node during the DFS walk.
typedef ZoneLinkedList<Bracket> BracketList;
using BracketList = ZoneLinkedList<Bracket>;
struct DFSStackEntry {
DFSDirection direction; // Direction currently used in DFS walk.
@ -78,7 +78,7 @@ class V8_EXPORT_PRIVATE ControlEquivalence final
};
// The stack is used during the undirected DFS walk.
typedef ZoneStack<DFSStackEntry> DFSStack;
using DFSStack = ZoneStack<DFSStackEntry>;
struct NodeData : ZoneObject {
explicit NodeData(Zone* zone)
@ -94,7 +94,7 @@ class V8_EXPORT_PRIVATE ControlEquivalence final
};
// The per-node data computed during the DFS walk.
typedef ZoneVector<NodeData*> Data;
using Data = ZoneVector<NodeData*>;
// Called at pre-visit during DFS walk.
void VisitPre(Node* node);

View File

@ -77,8 +77,8 @@ class BlockEffectControlMap {
}
private:
typedef std::pair<int32_t, int32_t> Key;
typedef ZoneMap<Key, BlockEffectControlData> Map;
using Key = std::pair<int32_t, int32_t>;
using Map = ZoneMap<Key, BlockEffectControlData>;
Map map_;
};

View File

@ -71,7 +71,7 @@ class SparseSidetable {
// necessary node revisitations happen.
class ReduceScope {
public:
typedef EffectGraphReducer::Reduction Reduction;
using Reduction = EffectGraphReducer::Reduction;
explicit ReduceScope(Node* node, Reduction* reduction)
: current_node_(node), reduction_(reduction) {}
@ -96,9 +96,9 @@ class VariableTracker {
private:
// The state of all variables at one point in the effect chain.
class State {
typedef PersistentMap<Variable, Node*> Map;
public:
using Map = PersistentMap<Variable, Node*>;
explicit State(Zone* zone) : map_(zone) {}
Node* Get(Variable var) const {
CHECK(var != Variable::Invalid());

View File

@ -88,7 +88,7 @@ class Variable {
}
private:
typedef int Id;
using Id = int;
explicit Variable(Id id) : id_(id) {}
Id id_;
static const Id kInvalid = -1;
@ -117,8 +117,8 @@ class Dependable : public ZoneObject {
// associated with its fields as well as its global escape status.
class VirtualObject : public Dependable {
public:
typedef uint32_t Id;
typedef ZoneVector<Variable>::const_iterator const_iterator;
using Id = uint32_t;
using const_iterator = ZoneVector<Variable>::const_iterator;
VirtualObject(VariableTracker* var_states, Id id, int size);
Maybe<Variable> FieldAt(int offset) const {
CHECK(IsAligned(offset, kTaggedSize));

View File

@ -21,7 +21,7 @@ class Node;
// NodeIds are identifying numbers for nodes that can be used to index auxiliary
// out-of-line data associated with each node.
typedef uint32_t NodeId;
using NodeId = uint32_t;
// Possible outcomes for decisions.
enum class Decision : uint8_t { kUnknown, kTrue, kFalse };

View File

@ -25,12 +25,11 @@ class Operator;
// Marks are used during traversal of the graph to distinguish states of nodes.
// Each node has a mark which is a monotonically increasing integer, and a
// {NodeMarker} has a range of values that indicate states of a node.
typedef uint32_t Mark;
using Mark = uint32_t;
// NodeIds are identifying numbers for nodes that can be used to index auxiliary
// out-of-line data associated with each node.
typedef uint32_t NodeId;
using NodeId = uint32_t;
class V8_EXPORT_PRIVATE Graph final : public NON_EXPORTED_BASE(ZoneObject) {
public:

View File

@ -38,7 +38,7 @@ class V8_EXPORT_PRIVATE JSCallReducer final : public AdvancedReducer {
public:
// Flags that control the mode of operation.
enum Flag { kNoFlags = 0u, kBailoutOnUninitialized = 1u << 0 };
typedef base::Flags<Flag> Flags;
using Flags = base::Flags<Flag>;
JSCallReducer(Editor* editor, JSGraph* jsgraph, JSHeapBroker* broker,
Flags flags, CompilationDependencies* dependencies)

View File

@ -148,7 +148,7 @@ class HeapObjectType {
public:
enum Flag : uint8_t { kUndetectable = 1 << 0, kCallable = 1 << 1 };
typedef base::Flags<Flag> Flags;
using Flags = base::Flags<Flag>;
HeapObjectType(InstanceType instance_type, Flags flags,
OddballType oddball_type)

View File

@ -65,7 +65,7 @@ class JSInliningHeuristic final : public AdvancedReducer {
};
// Candidates are kept in a sorted set of unique candidates.
typedef ZoneSet<Candidate, CandidateCompare> Candidates;
using Candidates = ZoneSet<Candidate, CandidateCompare>;
// Dumps candidates to console.
void PrintCandidates();

View File

@ -48,7 +48,7 @@ class V8_EXPORT_PRIVATE JSNativeContextSpecialization final
kAccessorInliningEnabled = 1u << 0,
kBailoutOnUninitialized = 1u << 1
};
typedef base::Flags<Flag> Flags;
using Flags = base::Flags<Flag>;
JSNativeContextSpecialization(Editor* editor, JSGraph* jsgraph,
JSHeapBroker* broker, Flags flags,

View File

@ -85,8 +85,8 @@ class ConstructForwardVarargsParameters final {
return p.bit_field_;
}
typedef BitField<size_t, 0, 16> ArityField;
typedef BitField<uint32_t, 16, 16> StartIndexField;
using ArityField = BitField<size_t, 0, 16>;
using StartIndexField = BitField<uint32_t, 16, 16>;
uint32_t const bit_field_;
};
@ -147,8 +147,8 @@ class CallForwardVarargsParameters final {
return p.bit_field_;
}
typedef BitField<size_t, 0, 15> ArityField;
typedef BitField<uint32_t, 15, 15> StartIndexField;
using ArityField = BitField<size_t, 0, 15>;
using StartIndexField = BitField<uint32_t, 15, 15>;
uint32_t const bit_field_;
};
@ -195,9 +195,9 @@ class CallParameters final {
return base::hash_combine(p.bit_field_, p.frequency_, p.feedback_);
}
typedef BitField<size_t, 0, 28> ArityField;
typedef BitField<SpeculationMode, 28, 1> SpeculationModeField;
typedef BitField<ConvertReceiverMode, 29, 2> ConvertReceiverModeField;
using ArityField = BitField<size_t, 0, 28>;
using SpeculationModeField = BitField<SpeculationMode, 28, 1>;
using ConvertReceiverModeField = BitField<ConvertReceiverMode, 29, 2>;
uint32_t const bit_field_;
CallFrequency const frequency_;

View File

@ -39,7 +39,7 @@ class JSTypeHintLowering {
public:
// Flags that control the mode of operation.
enum Flag { kNoFlags = 0u, kBailoutOnUninitialized = 1u << 1 };
typedef base::Flags<Flag> Flags;
using Flags = base::Flags<Flag>;
JSTypeHintLowering(JSGraph* jsgraph, Handle<FeedbackVector> feedback_vector,
Flags flags);

View File

@ -163,7 +163,7 @@ class LinkageLocation {
MachineType machine_type_;
};
typedef Signature<LinkageLocation> LocationSignature;
using LocationSignature = Signature<LinkageLocation>;
// Describes a call to various parts of the compiler. Every call has the notion
// of a "target", which is the first input to the call.
@ -198,7 +198,7 @@ class V8_EXPORT_PRIVATE CallDescriptor final
kFixedTargetRegister = 1u << 7,
kAllowCallThroughSlot = 1u << 8
};
typedef base::Flags<Flag> Flags;
using Flags = base::Flags<Flag>;
CallDescriptor(Kind kind, MachineType target_type, LinkageLocation target_loc,
LocationSignature* location_sig, size_t stack_param_count,

View File

@ -20,7 +20,7 @@ static const int kAssumedLoopEntryIndex = 0; // assume loops are entered here.
class LoopFinderImpl;
typedef base::iterator_range<Node**> NodeRange;
using NodeRange = base::iterator_range<Node**>;
// Represents a tree of loops in a graph.
class LoopTree : public ZoneObject {

View File

@ -44,7 +44,7 @@ class OptionalOperator final {
// A Load needs a MachineType.
typedef MachineType LoadRepresentation;
using LoadRepresentation = MachineType;
V8_EXPORT_PRIVATE LoadRepresentation LoadRepresentationOf(Operator const*)
V8_WARN_UNUSED_RESULT;
@ -77,7 +77,7 @@ V8_EXPORT_PRIVATE StoreRepresentation const& StoreRepresentationOf(
Operator const*) V8_WARN_UNUSED_RESULT;
// An UnalignedStore needs a MachineType.
typedef MachineRepresentation UnalignedStoreRepresentation;
using UnalignedStoreRepresentation = MachineRepresentation;
UnalignedStoreRepresentation const& UnalignedStoreRepresentationOf(
Operator const*) V8_WARN_UNUSED_RESULT;
@ -150,7 +150,7 @@ class V8_EXPORT_PRIVATE MachineOperatorBuilder final
kWord32ReverseBits | kWord64ReverseBits |
kInt32AbsWithOverflow | kInt64AbsWithOverflow
};
typedef base::Flags<Flag, unsigned> Flags;
using Flags = base::Flags<Flag, unsigned>;
class AlignmentRequirements {
public:

View File

@ -23,7 +23,7 @@ class Operator;
// NodeIds are identifying numbers for nodes that can be used to index auxiliary
// out-of-line data associated with each node.
typedef uint32_t NodeId;
using NodeId = uint32_t;
// Lowers all simplified memory access and allocation related nodes (i.e.
// Allocate, LoadField, StoreField and friends) to machine operators.
@ -102,7 +102,7 @@ class MemoryOptimizer final {
};
// An array of allocation states used to collect states on merges.
typedef ZoneVector<AllocationState const*> AllocationStates;
using AllocationStates = ZoneVector<AllocationState const*>;
// We thread through tokens to represent the current state on a given effect
// path through the graph.

View File

@ -56,11 +56,11 @@ class NodeAuxData {
template <class T, T def()>
class NodeAuxData<T, def>::const_iterator {
public:
typedef std::forward_iterator_tag iterator_category;
typedef int difference_type;
typedef std::pair<size_t, T> value_type;
typedef value_type* pointer;
typedef value_type& reference;
using iterator_category = std::forward_iterator_tag;
using difference_type = int;
using value_type = std::pair<size_t, T>;
using pointer = value_type*;
using reference = value_type&;
const_iterator(const ZoneVector<T>* data, size_t current)
: data_(data), current_(current) {}

View File

@ -62,20 +62,20 @@ class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) NodeCache final {
};
// Various default cache types.
typedef NodeCache<int32_t> Int32NodeCache;
typedef NodeCache<int64_t> Int64NodeCache;
using Int32NodeCache = NodeCache<int32_t>;
using Int64NodeCache = NodeCache<int64_t>;
// All we want is the numeric value of the RelocInfo::Mode enum. We typedef
// below to avoid pulling in assembler.h
typedef char RelocInfoMode;
typedef std::pair<int32_t, RelocInfoMode> RelocInt32Key;
typedef std::pair<int64_t, RelocInfoMode> RelocInt64Key;
typedef NodeCache<RelocInt32Key> RelocInt32NodeCache;
typedef NodeCache<RelocInt64Key> RelocInt64NodeCache;
using RelocInfoMode = char;
using RelocInt32Key = std::pair<int32_t, RelocInfoMode>;
using RelocInt64Key = std::pair<int64_t, RelocInfoMode>;
using RelocInt32NodeCache = NodeCache<RelocInt32Key>;
using RelocInt64NodeCache = NodeCache<RelocInt64Key>;
#if V8_HOST_ARCH_32_BIT
typedef Int32NodeCache IntPtrNodeCache;
using IntPtrNodeCache = Int32NodeCache;
#else
typedef Int64NodeCache IntPtrNodeCache;
using IntPtrNodeCache = Int64NodeCache;
#endif
// Explicit instantiation declarations.

View File

@ -51,7 +51,7 @@ struct NodeMatcher {
// A pattern matcher for abitrary value constants.
template <typename T, IrOpcode::Value kOpcode>
struct ValueMatcher : public NodeMatcher {
typedef T ValueType;
using ValueType = T;
explicit ValueMatcher(Node* node)
: NodeMatcher(node), value_(), has_value_(opcode() == kOpcode) {
@ -137,16 +137,16 @@ struct IntMatcher final : public ValueMatcher<T, kOpcode> {
bool IsNegative() const { return this->HasValue() && this->Value() < 0; }
};
typedef IntMatcher<int32_t, IrOpcode::kInt32Constant> Int32Matcher;
typedef IntMatcher<uint32_t, IrOpcode::kInt32Constant> Uint32Matcher;
typedef IntMatcher<int64_t, IrOpcode::kInt64Constant> Int64Matcher;
typedef IntMatcher<uint64_t, IrOpcode::kInt64Constant> Uint64Matcher;
using Int32Matcher = IntMatcher<int32_t, IrOpcode::kInt32Constant>;
using Uint32Matcher = IntMatcher<uint32_t, IrOpcode::kInt32Constant>;
using Int64Matcher = IntMatcher<int64_t, IrOpcode::kInt64Constant>;
using Uint64Matcher = IntMatcher<uint64_t, IrOpcode::kInt64Constant>;
#if V8_HOST_ARCH_32_BIT
typedef Int32Matcher IntPtrMatcher;
typedef Uint32Matcher UintPtrMatcher;
using IntPtrMatcher = Int32Matcher;
using UintPtrMatcher = Uint32Matcher;
#else
typedef Int64Matcher IntPtrMatcher;
typedef Uint64Matcher UintPtrMatcher;
using IntPtrMatcher = Int64Matcher;
using UintPtrMatcher = Uint64Matcher;
#endif
@ -182,10 +182,9 @@ struct FloatMatcher final : public ValueMatcher<T, kOpcode> {
}
};
typedef FloatMatcher<float, IrOpcode::kFloat32Constant> Float32Matcher;
typedef FloatMatcher<double, IrOpcode::kFloat64Constant> Float64Matcher;
typedef FloatMatcher<double, IrOpcode::kNumberConstant> NumberMatcher;
using Float32Matcher = FloatMatcher<float, IrOpcode::kFloat32Constant>;
using Float64Matcher = FloatMatcher<double, IrOpcode::kFloat64Constant>;
using NumberMatcher = FloatMatcher<double, IrOpcode::kNumberConstant>;
// A pattern matcher for heap object constants.
struct HeapObjectMatcher final
@ -221,7 +220,7 @@ struct LoadMatcher : public NodeMatcher {
explicit LoadMatcher(Node* node)
: NodeMatcher(node), object_(InputAt(0)), index_(InputAt(1)) {}
typedef Object ObjectMatcher;
using ObjectMatcher = Object;
Object const& object() const { return object_; }
IntPtrMatcher const& index() const { return index_; }
@ -246,8 +245,8 @@ struct BinopMatcher : public NodeMatcher {
if (allow_input_swap) PutConstantOnRight();
}
typedef Left LeftMatcher;
typedef Right RightMatcher;
using LeftMatcher = Left;
using RightMatcher = Right;
const Left& left() const { return left_; }
const Right& right() const { return right_; }
@ -276,17 +275,17 @@ struct BinopMatcher : public NodeMatcher {
Right right_;
};
typedef BinopMatcher<Int32Matcher, Int32Matcher> Int32BinopMatcher;
typedef BinopMatcher<Uint32Matcher, Uint32Matcher> Uint32BinopMatcher;
typedef BinopMatcher<Int64Matcher, Int64Matcher> Int64BinopMatcher;
typedef BinopMatcher<Uint64Matcher, Uint64Matcher> Uint64BinopMatcher;
typedef BinopMatcher<IntPtrMatcher, IntPtrMatcher> IntPtrBinopMatcher;
typedef BinopMatcher<UintPtrMatcher, UintPtrMatcher> UintPtrBinopMatcher;
typedef BinopMatcher<Float32Matcher, Float32Matcher> Float32BinopMatcher;
typedef BinopMatcher<Float64Matcher, Float64Matcher> Float64BinopMatcher;
typedef BinopMatcher<NumberMatcher, NumberMatcher> NumberBinopMatcher;
typedef BinopMatcher<HeapObjectMatcher, HeapObjectMatcher>
HeapObjectBinopMatcher;
using Int32BinopMatcher = BinopMatcher<Int32Matcher, Int32Matcher>;
using Uint32BinopMatcher = BinopMatcher<Uint32Matcher, Uint32Matcher>;
using Int64BinopMatcher = BinopMatcher<Int64Matcher, Int64Matcher>;
using Uint64BinopMatcher = BinopMatcher<Uint64Matcher, Uint64Matcher>;
using IntPtrBinopMatcher = BinopMatcher<IntPtrMatcher, IntPtrMatcher>;
using UintPtrBinopMatcher = BinopMatcher<UintPtrMatcher, UintPtrMatcher>;
using Float32BinopMatcher = BinopMatcher<Float32Matcher, Float32Matcher>;
using Float64BinopMatcher = BinopMatcher<Float64Matcher, Float64Matcher>;
using NumberBinopMatcher = BinopMatcher<NumberMatcher, NumberMatcher>;
using HeapObjectBinopMatcher =
BinopMatcher<HeapObjectMatcher, HeapObjectMatcher>;
template <class BinopMatcher, IrOpcode::Value kMulOpcode,
IrOpcode::Value kShiftOpcode>
@ -340,10 +339,10 @@ struct ScaleMatcher {
bool power_of_two_plus_one_;
};
typedef ScaleMatcher<Int32BinopMatcher, IrOpcode::kInt32Mul,
IrOpcode::kWord32Shl> Int32ScaleMatcher;
typedef ScaleMatcher<Int64BinopMatcher, IrOpcode::kInt64Mul,
IrOpcode::kWord64Shl> Int64ScaleMatcher;
using Int32ScaleMatcher =
ScaleMatcher<Int32BinopMatcher, IrOpcode::kInt32Mul, IrOpcode::kWord32Shl>;
using Int64ScaleMatcher =
ScaleMatcher<Int64BinopMatcher, IrOpcode::kInt64Mul, IrOpcode::kWord64Shl>;
template <class BinopMatcher, IrOpcode::Value AddOpcode,
IrOpcode::Value SubOpcode, IrOpcode::Value kMulOpcode,
@ -351,7 +350,7 @@ template <class BinopMatcher, IrOpcode::Value AddOpcode,
struct AddMatcher : public BinopMatcher {
static const IrOpcode::Value kAddOpcode = AddOpcode;
static const IrOpcode::Value kSubOpcode = SubOpcode;
typedef ScaleMatcher<BinopMatcher, kMulOpcode, kShiftOpcode> Matcher;
using Matcher = ScaleMatcher<BinopMatcher, kMulOpcode, kShiftOpcode>;
AddMatcher(Node* node, bool allow_input_swap)
: BinopMatcher(node, allow_input_swap),
@ -410,12 +409,12 @@ struct AddMatcher : public BinopMatcher {
bool power_of_two_plus_one_;
};
typedef AddMatcher<Int32BinopMatcher, IrOpcode::kInt32Add, IrOpcode::kInt32Sub,
IrOpcode::kInt32Mul, IrOpcode::kWord32Shl>
Int32AddMatcher;
typedef AddMatcher<Int64BinopMatcher, IrOpcode::kInt64Add, IrOpcode::kInt64Sub,
IrOpcode::kInt64Mul, IrOpcode::kWord64Shl>
Int64AddMatcher;
using Int32AddMatcher =
AddMatcher<Int32BinopMatcher, IrOpcode::kInt32Add, IrOpcode::kInt32Sub,
IrOpcode::kInt32Mul, IrOpcode::kWord32Shl>;
using Int64AddMatcher =
AddMatcher<Int64BinopMatcher, IrOpcode::kInt64Add, IrOpcode::kInt64Sub,
IrOpcode::kInt64Mul, IrOpcode::kWord64Shl>;
enum DisplacementMode { kPositiveDisplacement, kNegativeDisplacement };
@ -426,7 +425,7 @@ enum class AddressOption : uint8_t {
kAllowAll = kAllowInputSwap | kAllowScale
};
typedef base::Flags<AddressOption, uint8_t> AddressOptions;
using AddressOptions = base::Flags<AddressOption, uint8_t>;
DEFINE_OPERATORS_FOR_FLAGS(AddressOptions)
template <class AddMatcher>
@ -700,10 +699,10 @@ struct BaseWithIndexAndDisplacementMatcher {
}
};
typedef BaseWithIndexAndDisplacementMatcher<Int32AddMatcher>
BaseWithIndexAndDisplacement32Matcher;
typedef BaseWithIndexAndDisplacementMatcher<Int64AddMatcher>
BaseWithIndexAndDisplacement64Matcher;
using BaseWithIndexAndDisplacement32Matcher =
BaseWithIndexAndDisplacementMatcher<Int32AddMatcher>;
using BaseWithIndexAndDisplacement64Matcher =
BaseWithIndexAndDisplacementMatcher<Int64AddMatcher>;
struct V8_EXPORT_PRIVATE BranchMatcher : public NON_EXPORTED_BASE(NodeMatcher) {
explicit BranchMatcher(Node* branch);

View File

@ -18,7 +18,7 @@ namespace compiler {
class NodeOrigin {
public:
typedef enum { kWasmBytecode, kGraphNode } OriginKind;
enum OriginKind { kWasmBytecode, kGraphNode };
NodeOrigin(const char* phase_name, const char* reducer_name,
NodeId created_from)
: phase_name_(phase_name),

View File

@ -23,13 +23,11 @@ class Graph;
// Marks are used during traversal of the graph to distinguish states of nodes.
// Each node has a mark which is a monotonically increasing integer, and a
// {NodeMarker} has a range of values that indicate states of a node.
typedef uint32_t Mark;
using Mark = uint32_t;
// NodeIds are identifying numbers for nodes that can be used to index auxiliary
// out-of-line data associated with each node.
typedef uint32_t NodeId;
using NodeId = uint32_t;
// A Node is the basic primitive of graphs. Nodes are chained together by
// input/use chains but by default otherwise contain only an identifying number
@ -117,7 +115,7 @@ class V8_EXPORT_PRIVATE Node final {
class UseEdges final {
public:
typedef Edge value_type;
using value_type = Edge;
class iterator;
inline iterator begin() const;
@ -135,7 +133,7 @@ class V8_EXPORT_PRIVATE Node final {
class V8_EXPORT_PRIVATE Uses final {
public:
typedef Node* value_type;
using value_type = Node*;
class const_iterator;
inline const_iterator begin() const;
@ -202,8 +200,8 @@ class V8_EXPORT_PRIVATE Node final {
: reinterpret_cast<OutOfLineInputs*>(start)->node_;
}
typedef BitField<bool, 0, 1> InlineField;
typedef BitField<unsigned, 1, 17> InputIndexField;
using InlineField = BitField<bool, 0, 1>;
using InputIndexField = BitField<unsigned, 1, 17>;
// Leaving some space in the bitset in case we ever decide to record
// the output index.
};
@ -289,9 +287,9 @@ class V8_EXPORT_PRIVATE Node final {
void ClearInputs(int start, int count);
typedef BitField<NodeId, 0, 24> IdField;
typedef BitField<unsigned, 24, 4> InlineCountField;
typedef BitField<unsigned, 28, 4> InlineCapacityField;
using IdField = BitField<NodeId, 0, 24>;
using InlineCountField = BitField<unsigned, 24, 4>;
using InlineCapacityField = BitField<unsigned, 28, 4>;
static const int kOutlineMarker = InlineCountField::kMax;
static const int kMaxInlineCount = InlineCountField::kMax - 1;
static const int kMaxInlineCapacity = InlineCapacityField::kMax - 1;
@ -322,15 +320,14 @@ std::ostream& operator<<(std::ostream& os, const Node& n);
// Typedefs to shorten commonly used Node containers.
typedef ZoneDeque<Node*> NodeDeque;
typedef ZoneSet<Node*> NodeSet;
typedef ZoneVector<Node*> NodeVector;
typedef ZoneVector<NodeVector> NodeVectorVector;
using NodeDeque = ZoneDeque<Node*>;
using NodeSet = ZoneSet<Node*>;
using NodeVector = ZoneVector<Node*>;
using NodeVectorVector = ZoneVector<NodeVector>;
class Node::InputEdges final {
public:
typedef Edge value_type;
using value_type = Edge;
class iterator;
inline iterator begin() const;
@ -352,7 +349,7 @@ class Node::InputEdges final {
class V8_EXPORT_PRIVATE Node::Inputs final {
public:
typedef Node* value_type;
using value_type = Node*;
class const_iterator;
inline const_iterator begin() const;
@ -440,11 +437,11 @@ Node::Inputs Node::inputs() const {
// A forward iterator to visit the edges for the input dependencies of a node.
class Node::InputEdges::iterator final {
public:
typedef std::forward_iterator_tag iterator_category;
typedef std::ptrdiff_t difference_type;
typedef Edge value_type;
typedef Edge* pointer;
typedef Edge& reference;
using iterator_category = std::forward_iterator_tag;
using difference_type = std::ptrdiff_t;
using value_type = Edge;
using pointer = Edge*;
using reference = Edge&;
iterator() : use_(nullptr), input_ptr_(nullptr) {}
iterator(const iterator& other) = default;
@ -499,11 +496,11 @@ Edge Node::InputEdges::operator[](int index) const {
// A forward iterator to visit the inputs of a node.
class Node::Inputs::const_iterator final {
public:
typedef std::forward_iterator_tag iterator_category;
typedef std::ptrdiff_t difference_type;
typedef Node* value_type;
typedef const value_type* pointer;
typedef value_type& reference;
using iterator_category = std::forward_iterator_tag;
using difference_type = std::ptrdiff_t;
using value_type = Node*;
using pointer = const value_type*;
using reference = value_type&;
const_iterator(const const_iterator& other) = default;
@ -594,11 +591,11 @@ Node::UseEdges::iterator Node::UseEdges::end() const {
// A forward iterator to visit the uses of a node.
class Node::Uses::const_iterator final {
public:
typedef std::forward_iterator_tag iterator_category;
typedef int difference_type;
typedef Node* value_type;
typedef Node** pointer;
typedef Node*& reference;
using iterator_category = std::forward_iterator_tag;
using difference_type = int;
using value_type = Node*;
using pointer = Node**;
using reference = Node*&;
Node* operator*() const { return current_->from(); }
bool operator==(const const_iterator& other) const {

View File

@ -85,7 +85,7 @@ class V8_EXPORT_PRIVATE OperationTyper {
Type singleton_the_hole() const { return singleton_the_hole_; }
private:
typedef base::Flags<ComparisonOutcomeFlags> ComparisonOutcome;
using ComparisonOutcome = base::Flags<ComparisonOutcomeFlags>;
ComparisonOutcome Invert(ComparisonOutcome);
Type Invert(Type);

View File

@ -32,7 +32,7 @@ namespace compiler {
// meaningful to the operator itself.
class V8_EXPORT_PRIVATE Operator : public NON_EXPORTED_BASE(ZoneObject) {
public:
typedef uint16_t Opcode;
using Opcode = uint16_t;
// Properties inform the operator-independent optimizer about legal
// transformations for nodes that have this operator.
@ -57,7 +57,7 @@ class V8_EXPORT_PRIVATE Operator : public NON_EXPORTED_BASE(ZoneObject) {
V(Commutative) \
V(Associative) V(Idempotent) V(NoRead) V(NoWrite) V(NoThrow) V(NoDeopt)
typedef base::Flags<Property, uint8_t> Properties;
using Properties = base::Flags<Property, uint8_t>;
enum class PrintVerbosity { kVerbose, kSilent };
// Constructor.

View File

@ -512,7 +512,7 @@ void RawMachineAssembler::Return(Node* v1, Node* v2, Node* v3, Node* v4) {
}
void RawMachineAssembler::Return(int count, Node* vs[]) {
typedef Node* Node_ptr;
using Node_ptr = Node*;
Node** values = new Node_ptr[count + 1];
values[0] = Int32Constant(0);
for (int i = 0; i < count; ++i) values[i + 1] = vs[i];

View File

@ -20,8 +20,8 @@ class BasicBlock;
class BasicBlockInstrumentor;
class Node;
typedef ZoneVector<BasicBlock*> BasicBlockVector;
typedef ZoneVector<Node*> NodeVector;
using BasicBlockVector = ZoneVector<BasicBlock*>;
using NodeVector = ZoneVector<Node*>;
// A basic block contains an ordered list of nodes and ends with a control
// node. Note that if a basic block has phis, then all phis must appear as the
@ -84,7 +84,7 @@ class V8_EXPORT_PRIVATE BasicBlock final
void AddSuccessor(BasicBlock* successor);
// Nodes in the basic block.
typedef Node* value_type;
using value_type = Node*;
bool empty() const { return nodes_.empty(); }
size_t size() const { return nodes_.size(); }
Node* NodeAt(size_t index) { return nodes_[index]; }
@ -93,17 +93,17 @@ class V8_EXPORT_PRIVATE BasicBlock final
value_type& front() { return nodes_.front(); }
value_type const& front() const { return nodes_.front(); }
typedef NodeVector::iterator iterator;
using iterator = NodeVector::iterator;
iterator begin() { return nodes_.begin(); }
iterator end() { return nodes_.end(); }
void RemoveNode(iterator it) { nodes_.erase(it); }
typedef NodeVector::const_iterator const_iterator;
using const_iterator = NodeVector::const_iterator;
const_iterator begin() const { return nodes_.begin(); }
const_iterator end() const { return nodes_.end(); }
typedef NodeVector::reverse_iterator reverse_iterator;
using reverse_iterator = NodeVector::reverse_iterator;
reverse_iterator rbegin() { return nodes_.rbegin(); }
reverse_iterator rend() { return nodes_.rend(); }

View File

@ -698,7 +698,7 @@ class SpecialRPONumberer : public ZoneObject {
}
private:
typedef std::pair<BasicBlock*, size_t> Backedge;
using Backedge = std::pair<BasicBlock*, size_t>;
// Numbering for BasicBlock::rpo_number for this block traversal:
static const int kBlockOnStack = -2;

View File

@ -30,7 +30,7 @@ class V8_EXPORT_PRIVATE Scheduler {
public:
// Flags that control the mode of operation.
enum Flag { kNoFlags = 0u, kSplitNodes = 1u << 1, kTempSchedule = 1u << 2 };
typedef base::Flags<Flag> Flags;
using Flags = base::Flags<Flag>;
// The complete scheduling algorithm. Creates a new schedule and places all
// nodes from the graph into it.

View File

@ -188,9 +188,9 @@ class CompilationSubject {
MaybeHandle<JSFunction> closure_;
};
typedef ZoneSet<Handle<Object>, HandleComparator<Object>> ConstantsSet;
typedef ZoneSet<Handle<Map>, HandleComparator<Map>> MapsSet;
typedef ZoneSet<FunctionBlueprint> BlueprintsSet;
using ConstantsSet = ZoneSet<Handle<Object>, HandleComparator<Object>>;
using MapsSet = ZoneSet<Handle<Map>, HandleComparator<Map>>;
using BlueprintsSet = ZoneSet<FunctionBlueprint>;
class Hints {
public:
@ -215,7 +215,7 @@ class Hints {
BlueprintsSet function_blueprints_;
};
typedef ZoneVector<Hints> HintsVector;
using HintsVector = ZoneVector<Hints>;
// The SerializerForBackgroundCompilation makes sure that the relevant function
// data such as bytecode, SharedFunctionInfo and FeedbackVector, used by later

View File

@ -321,7 +321,7 @@ enum class CheckMapsFlag : uint8_t {
kNone = 0u,
kTryMigrateInstance = 1u << 0, // Try instance migration.
};
typedef base::Flags<CheckMapsFlag> CheckMapsFlags;
using CheckMapsFlags = base::Flags<CheckMapsFlag>;
DEFINE_OPERATORS_FOR_FLAGS(CheckMapsFlags)

View File

@ -29,7 +29,7 @@ class V8_EXPORT_PRIVATE StateValuesCache {
private:
static const size_t kMaxInputCount = 8;
typedef std::array<Node*, kMaxInputCount> WorkingBuffer;
using WorkingBuffer = std::array<Node*, kMaxInputCount>;
struct NodeKey {
Node* node;

View File

@ -71,7 +71,7 @@ namespace compiler {
namespace {
typedef uint32_t StoreOffset;
using StoreOffset = uint32_t;
struct UnobservableStore {
NodeId id_;

View File

@ -237,8 +237,8 @@ class Typer::Visitor : public Reducer {
return weakened_nodes_.find(node_id) != weakened_nodes_.end();
}
typedef Type (*UnaryTyperFun)(Type, Typer* t);
typedef Type (*BinaryTyperFun)(Type, Type, Typer* t);
using UnaryTyperFun = Type (*)(Type, Typer* t);
using BinaryTyperFun = Type (*)(Type, Type, Typer* t);
Type TypeUnaryOp(Node* node, UnaryTyperFun);
Type TypeBinaryOp(Node* node, BinaryTyperFun);
@ -251,7 +251,7 @@ class Typer::Visitor : public Reducer {
kComparisonFalse = 2,
kComparisonUndefined = 4
};
typedef base::Flags<ComparisonOutcomeFlags> ComparisonOutcome;
using ComparisonOutcome = base::Flags<ComparisonOutcomeFlags>;
static ComparisonOutcome Invert(ComparisonOutcome, Typer*);
static Type FalsifyUndefined(ComparisonOutcome, Typer*);

View File

@ -23,7 +23,7 @@ class V8_EXPORT_PRIVATE Typer {
kThisIsReceiver = 1u << 0, // Parameter this is an Object.
kNewTargetIsReceiver = 1u << 1, // Parameter new.target is an Object.
};
typedef base::Flags<Flag> Flags;
using Flags = base::Flags<Flag>;
Typer(JSHeapBroker* broker, Flags flags, Graph* graph);
~Typer();

View File

@ -246,7 +246,7 @@ class UnionType;
class V8_EXPORT_PRIVATE BitsetType {
public:
typedef uint32_t bitset; // Internal
using bitset = uint32_t; // Internal
enum : uint32_t {
#define DECLARE_TYPE(type, value) k##type = (value),
@ -370,7 +370,7 @@ class RangeType : public TypeBase {
class V8_EXPORT_PRIVATE Type {
public:
typedef BitsetType::bitset bitset; // Internal
using bitset = BitsetType::bitset; // Internal
// Constructors.
#define DEFINE_TYPE_CONSTRUCTOR(type, value) \

View File

@ -53,7 +53,7 @@ class V8_EXPORT_PRIVATE ZoneStats final {
friend class ZoneStats;
void ZoneReturned(Zone* zone);
typedef std::map<Zone*, size_t> InitialValues;
using InitialValues = std::map<Zone*, size_t>;
ZoneStats* const zone_stats_;
InitialValues initial_values_;
@ -75,8 +75,8 @@ class V8_EXPORT_PRIVATE ZoneStats final {
void ReturnZone(Zone* zone);
static const size_t kMaxUnusedSize = 3;
typedef std::vector<Zone*> Zones;
typedef std::vector<StatsScope*> Stats;
using Zones = std::vector<Zone*>;
using Stats = std::vector<StatsScope*>;
Zones zones_;
Stats stats_;