V8 Project
v8::internal::List< T, AllocationPolicy > Class Template Reference

#include <list.h>

Inherited by v8::internal::ZoneList< v8::internal::OutSet * >, v8::internal::ZoneList< Label * >, v8::internal::ZoneList< v8::internal::LInstruction * >, v8::internal::ZoneList< LEnvironment * >, v8::internal::ZoneList< v8::internal::Handle< v8::internal::JSFunction > >, v8::internal::ZoneList< uint32_t >, v8::internal::ZoneList< v8::internal::BitVector * >, v8::internal::ZoneList< v8::internal::Deoptimizer::JumpTableEntry * >, v8::internal::ZoneList< v8::internal::HValue * >, v8::internal::ZoneList< HBasicBlock * >, v8::internal::ZoneList< v8::internal::Variable * >, v8::internal::ZoneList< Property * >, v8::internal::ZoneList< v8::internal::CharacterRange >, v8::internal::ZoneList< FunctionLiteral * >, v8::internal::ZoneList< SideEffects >, v8::internal::ZoneList< v8::internal::Statement * >, v8::internal::ZoneList< v8::internal::BoyerMoorePositionInfo * >, v8::internal::ZoneList< TextElement >, v8::internal::ZoneList< v8::internal::Handle< v8::internal::String > >, v8::internal::ZoneList< T * >, v8::internal::ZoneList< int >, v8::internal::ZoneList< v8::internal::BASE_EMBEDDED::Element >, v8::internal::ZoneList< MoveOperands >, v8::internal::ZoneList< v8::internal::State * >, v8::internal::ZoneList< v8::internal::compiler::LiveRange * >, v8::internal::ZoneList< v8::internal::Deoptimizer::JumpTableEntry >, v8::internal::ZoneList< v8::internal::FuncNameInferrer::Name >, v8::internal::ZoneList< v8::internal::Handle< v8::internal::Object > >, v8::internal::ZoneList< v8::internal::ZoneList< int > * >, v8::internal::ZoneList< uint8_t >, v8::internal::ZoneList< HSimulate * >, v8::internal::ZoneList< v8::internal::Guard * >, v8::internal::ZoneList< v8::internal::FullCodeGenerator::BailoutEntry >, v8::internal::ZoneList< v8::internal::HInstruction * >, v8::internal::ZoneList< v8::internal::CompiledReplacement::ReplacementPart >, v8::internal::ZoneList< v8::internal::AlternativeGeneration * >, v8::internal::ZoneList< BasicBlock * >, v8::internal::ZoneList< uc16 >, v8::internal::ZoneList< v8::internal::HFieldApproximation * >, v8::internal::ZoneList< v8::internal::RegExpTree * >, v8::internal::ZoneList< v8::internal::compiler::InstructionOperand * >, v8::internal::ZoneList< LPointerMap * >, v8::internal::ZoneList< HEnvironmentMarker * >, v8::internal::ZoneList< unsigned >, v8::internal::ZoneList< v8::internal::BASE_EMBEDDED::DeoptimizationInfo >, v8::internal::ZoneList< v8::internal::Scope * >, v8::internal::ZoneList< HUnknownOSRValue * >, v8::internal::ZoneList< CaseClause * >, v8::internal::ZoneList< bool >, v8::internal::ZoneList< v8::internal::LiveRange * >, v8::internal::ZoneList< v8::internal::Declaration * >, v8::internal::ZoneList< VariableProxy * >, v8::internal::ZoneList< v8::internal::FullCodeGenerator::BackEdgeEntry >, v8::internal::ZoneList< v8::internal::FINAL::InlinedFunctionInfo >, v8::internal::ZoneList< HPhi * >, v8::internal::ZoneList< v8::internal::LOperand * >, v8::internal::ZoneList< v8::internal::GuardedAlternative >, v8::internal::ZoneList< LMoveOperands >, v8::internal::ZoneList< const v8::internal::AstRawString * >, v8::internal::ZoneList< HStoreNamedField * >, v8::internal::ZoneList< Environment * >, v8::internal::ZoneList< v8::internal::LDeferredCode * >, v8::internal::ZoneList< v8::internal::Effects * >, v8::internal::ZoneList< HCapturedObject * >, v8::internal::ZoneList< v8::internal::Expression * >, v8::internal::ZoneList< v8::internal::Handle< v8::internal::HeapObject > >, and v8::internal::ZoneList< RegExpCapture * >.

+ Collaboration diagram for v8::internal::List< T, AllocationPolicy >:

Public Types

typedef Titerator
 

Public Member Functions

 List (AllocationPolicy allocator=AllocationPolicy())
 
 INLINE (explicit List(int capacity, AllocationPolicy allocator=AllocationPolicy()))
 
 INLINE (~List())
 
void Free ()
 
 INLINE (void *operator new(size_t size, AllocationPolicy allocator=AllocationPolicy()))
 
 INLINE (void operator delete(void *p))
 
 INLINE (void operator delete(void *p, AllocationPolicy allocator))
 
Toperator[] (int i) const
 
Tat (int i) const
 
Tlast () const
 
Tfirst () const
 
iterator begin () const
 
iterator end () const
 
 INLINE (bool is_empty() const)
 
 INLINE (int length() const)
 
 INLINE (int capacity() const)
 
Vector< TToVector () const
 
Vector< const TToConstVector ()
 
void Add (const T &element, AllocationPolicy allocator=AllocationPolicy())
 
void AddAll (const List< T, AllocationPolicy > &other, AllocationPolicy allocator=AllocationPolicy())
 
void AddAll (const Vector< T > &other, AllocationPolicy allocator=AllocationPolicy())
 
void InsertAt (int index, const T &element, AllocationPolicy allocator=AllocationPolicy())
 
void Set (int index, const T &element)
 
Vector< TAddBlock (T value, int count, AllocationPolicy allocator=AllocationPolicy())
 
T Remove (int i)
 
bool RemoveElement (const T &elm)
 
 INLINE (T RemoveLast())
 
 INLINE (void Allocate(int length, AllocationPolicy allocator=AllocationPolicy()))
 
 INLINE (void Clear())
 
 INLINE (void Rewind(int pos))
 
 INLINE (void RewindBy(int count))
 
 INLINE (void Trim(AllocationPolicy allocator=AllocationPolicy()))
 
bool Contains (const T &elm) const
 
int CountOccurrences (const T &elm, int start, int end) const
 
void Iterate (void(*callback)(T *x))
 
template<class Visitor >
void Iterate (Visitor *visitor)
 
void Sort (int(*cmp)(const T *x, const T *y))
 
void Sort ()
 
 INLINE (void Initialize(int capacity, AllocationPolicy allocator=AllocationPolicy()))
 

Private Member Functions

 INLINE (T *NewData(int n, AllocationPolicy allocator))
 
 INLINE (void DeleteData(T *data))
 
void ResizeAdd (const T &element, AllocationPolicy allocator)
 
void ResizeAddInternal (const T &element, AllocationPolicy allocator)
 
void Resize (int new_capacity, AllocationPolicy allocator)
 
 DISALLOW_COPY_AND_ASSIGN (List)
 

Private Attributes

Tdata_
 
int capacity_
 
int length_
 

Detailed Description

template<typename T, class AllocationPolicy>
class v8::internal::List< T, AllocationPolicy >

Definition at line 30 of file list.h.

Member Typedef Documentation

◆ iterator

template<typename T , class AllocationPolicy >
typedef T* v8::internal::List< T, AllocationPolicy >::iterator

Definition at line 73 of file list.h.

Constructor & Destructor Documentation

◆ List()

template<typename T , class AllocationPolicy >
v8::internal::List< T, AllocationPolicy >::List ( AllocationPolicy  allocator = AllocationPolicy())
inlineexplicit

Definition at line 32 of file list.h.

32  {
33  Initialize(0, allocator);
34  }

Member Function Documentation

◆ Add()

template<typename T , class AllocationPolicy >
void v8::internal::List< T, P >::Add ( const T element,
AllocationPolicy  allocator = AllocationPolicy() 
)

Definition at line 17 of file list-inl.h.

17  {
18  if (length_ < capacity_) {
19  data_[length_++] = element;
20  } else {
21  List<T, P>::ResizeAdd(element, alloc);
22  }
23 }
void ResizeAdd(const T &element, AllocationPolicy allocator)
Definition: list-inl.h:46

References v8::internal::List< T, AllocationPolicy >::ResizeAdd().

Referenced by v8::internal::SmallPointerList< T >::Add(), v8::internal::BufferedZoneList< T, initial_size >::Add(), v8::internal::Isolate::AddCallCompletedCallback(), v8::internal::CharacterRange::AddCaseEquivalents(), v8::internal::RegExpBuilder::AddCharacter(), v8::internal::AddClass(), v8::internal::CharacterRange::AddClassEscape(), v8::internal::AddClassNegated(), v8::internal::Deoptimizer::AddDoubleValue(), v8::internal::HeapSnapshot::AddEntry(), v8::internal::FuncNameInferrer::AddFunction(), v8::internal::GuardedAlternative::AddGuard(), v8::internal::LChunk::AddInstruction(), v8::internal::Deoptimizer::AddObjectDoubleValue(), v8::internal::Deoptimizer::AddObjectDuplication(), v8::internal::Deoptimizer::AddObjectStart(), v8::internal::AddOneReceiverMapIfMissing(), v8::internal::compiler::LoopInfo::AddOutgoing(), v8::internal::CpuProfile::AddPath(), v8::internal::AddRangeOrEscape(), v8::internal::Scope::AllocateNonParameterLocals(), v8::internal::FlagList::argv(), v8::internal::BoyerMoorePositionInfo::BoyerMoorePositionInfo(), v8::internal::HOsrBuilder::BuildOsrLoopEntry(), v8::internal::CalculateLineEndsImpl(), v8::internal::CharacterRangeSplitter::Call(), v8::internal::PostorderProcessor::ClosePostorder(), v8::internal::CollectActiveFunctionsFromThread(), v8::internal::CollectElementIndices(), v8::internal::TypeFeedbackOracle::CollectReceiverTypes(), v8::internal::Scope::CollectStackAndContextLocals(), v8::internal::ElementHandlerCompiler::CompileElementHandlers(), v8::internal::PropertyICCompiler::CompileKeyedStorePolymorphic(), v8::internal::PropertyICCompiler::CompileMonomorphic(), v8::internal::PropertyICCompiler::ComputeKeyedLoadPolymorphic(), v8::internal::compiler::Scheduler::ComputeSpecialRPO(), v8::internal::EternalHandles::Create(), v8::internal::CreateStackMap(), v8::internal::CodeMap::DeleteAllCoveredCode(), v8::internal::Deoptimizer::DeoptimizeMarkedCodeForContext(), v8::internal::Parser::DesugarLetBindingsInForStatement(), v8::internal::EmitCharClass(), v8::internal::FuncNameInferrer::Enter(), v8::internal::NativeObjectsExplorer::FillRetainedObjects(), v8::internal::ChoiceNode::FilterOneByte(), v8::internal::Scope::FinalizeBlockScope(), v8::internal::Code::FindAllMaps(), v8::internal::Code::FindHandlers(), v8::internal::FindOneByteStringIndices(), v8::internal::FindStringIndices(), v8::internal::IC::FindTargetMaps(), v8::internal::FindTwoByteStringIndices(), v8::internal::HeapObjectsMap::FindUntrackedObjects(), v8::internal::SplayTree< Config, AllocationPolicy >::ForEachNode(), v8::internal::PolymorphicCodeCacheHashTableKey::FromObject(), v8::internal::JavaScriptFrame::GetFunctions(), v8::internal::OptimizedFrame::GetFunctions(), v8::internal::BufferedZoneList< T, initial_size >::GetList(), v8::internal::GetOldValue(), v8::internal::TypeFeedbackOracle::GetRelocInfos(), v8::internal::HOptimizedGraphBuilder::HandlePolymorphicElementAccess(), v8::internal::HEnvironmentLivenessAnalysisPhase::HEnvironmentLivenessAnalysisPhase(), v8::internal::ZoneList< T >::INLINE(), v8::internal::KeyedLoadIC::LoadElementStub(), v8::internal::HDeadCodeEliminationPhase::MarkLive(), v8::internal::RegExpMacroAssemblerX64::MarkPositionForCodeRelativeFixup(), v8::internal::Deoptimizer::MaterializeHeapObjects(), v8::internal::CharacterRange::Negate(), v8::internal::ParserTraits::NewThrowError(), v8::internal::Scope::NewUnresolved(), v8::internal::Parser::ParseCaseClause(), v8::internal::Parser::ParseClassDeclaration(), v8::internal::Parser::ParseEagerFunctionBody(), v8::internal::Parser::ParseExportDeclaration(), v8::internal::Parser::ParseExpressionOrLabelledStatement(), v8::internal::Parser::ParseFunctionDeclaration(), v8::internal::Parser::ParseImportDeclaration(), v8::internal::Parser::ParseModuleDeclaration(), v8::internal::Parser::ParseSourceElements(), v8::internal::Parser::ParseSwitchStatement(), v8::internal::Parser::ParseVariableDeclarations(), v8::internal::Debug::PrepareForBreakPoints(), v8::internal::HLoadEliminationEffects::Process(), v8::internal::HMarkDeoptimizeOnUndefinedPhase::ProcessPhi(), v8::internal::HStoreEliminationPhase::ProcessStore(), v8::internal::HOptimizedGraphBuilder::PushArgumentsFromEnvironment(), v8::internal::HeapObjectsMap::PushHeapObjectsStats(), v8::internal::ListSnapshotSink::Put(), v8::internal::FINAL< kOperandKind, kNumCachedOperands >::RecordUint32Instruction(), v8::internal::LCodeGen::RegisterEnvironmentForDeoptimization(), v8::internal::State::Remember(), v8::internal::HDeadCodeEliminationPhase::RemoveDeadInstructions(), v8::internal::SmallPointerList< T >::Reserve(), v8::internal::Rewriter::Rewrite(), v8::internal::HInferRepresentationPhase::Run(), v8::internal::HRangeAnalysisPhase::Run(), v8::internal::HRedundantPhiEliminationPhase::Run(), v8::internal::HRepresentationChangesPhase::Run(), v8::internal::RUNTIME_FUNCTION(), v8::internal::MaterializedObjectStore::Set(), v8::internal::OutSet::Set(), v8::internal::JavaScriptFrame::Summarize(), v8::internal::OptimizedFrame::Summarize(), v8::internal::IC::TargetMaps(), v8::internal::IC::TargetTypes(), v8::internal::TextNode::TextNode(), v8::internal::ProfileTree::TraverseDepthFirst(), v8::internal::HLoadEliminationEffects::Union(), v8::internal::HEnvironmentLivenessAnalysisPhase::UpdateLivenessAtInstruction(), and v8::internal::IC::UpdatePolymorphicIC().

+ Here is the call graph for this function:

◆ AddAll() [1/2]

template<typename T , class AllocationPolicy >
void v8::internal::List< T, AllocationPolicy >::AddAll ( const List< T, AllocationPolicy > &  other,
AllocationPolicy  allocator = AllocationPolicy() 
)

Referenced by v8::internal::ZoneList< T >::INLINE(), v8::internal::AllocationTracker::PrepareForSerialization(), and SnapshotWriter::WriteData().

+ Here is the caller graph for this function:

◆ AddAll() [2/2]

template<typename T , class AllocationPolicy >
void v8::internal::List< T, AllocationPolicy >::AddAll ( const Vector< T > &  other,
AllocationPolicy  allocator = AllocationPolicy() 
)

◆ AddBlock()

template<typename T , class AllocationPolicy >
Vector< T > v8::internal::List< T, P >::AddBlock ( T  value,
int  count,
AllocationPolicy  allocator = AllocationPolicy() 
)

Definition at line 77 of file list-inl.h.

77  {
78  int start = length_;
79  for (int i = 0; i < count; i++) Add(value, alloc);
80  return Vector<T>(&data_[start], count);
81 }
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
Definition: list-inl.h:17

Referenced by v8::internal::HEscapeAnalysisPhase::AnalyzeDataFlow(), v8::internal::compiler::SwitchBuilder::BeginSwitch(), v8::internal::HeapProfiler::DefineWrapperClass(), v8::internal::ZoneList< T >::INLINE(), v8::internal::SmallPointerList< T >::Reserve(), and v8::internal::compiler::ScheduleVerifier::Run().

+ Here is the caller graph for this function:

◆ at()

template<typename T , class AllocationPolicy >
T& v8::internal::List< T, AllocationPolicy >::at ( int  i) const
inline

Definition at line 69 of file list.h.

69 { return operator[](i); }
T & operator[](int i) const
Definition: list.h:64

References v8::internal::List< T, AllocationPolicy >::operator[]().

Referenced by v8::internal::Isolate::AddCallCompletedCallback(), v8::internal::DispatchTableConstructor::AddInverse(), v8::internal::AddOneReceiverMapIfMissing(), v8::internal::FullCodeGenerator::AllocateModules(), v8::internal::Deoptimizer::ArgumentsObjectFunction(), v8::internal::Deoptimizer::ArgumentsObjectIsAdapted(), v8::internal::ChoiceNode::AssertGuardsMentionRegisters(), v8::internal::BoyerMoorePositionInfo::at(), v8::internal::SmallPointerList< T >::at(), v8::internal::DispatchTableConstructor::BuildTable(), v8::internal::TextNode::CalculateOffsets(), v8::internal::CharacterRange::Canonicalize(), v8::internal::TypeFeedbackOracle::CollectReceiverTypes(), v8::internal::CompilationInfo::CommitDependencies(), v8::internal::CompareInverseRanges(), v8::internal::CompareRanges(), v8::internal::ElementHandlerCompiler::CompileElementHandlers(), v8::internal::PropertyICCompiler::CompileKeyedStorePolymorphic(), v8::internal::PropertyICCompiler::ComputeKeyedLoadPolymorphic(), v8::internal::PropertyICCompiler::ComputeKeyedStorePolymorphic(), v8::internal::PropertyICCompiler::ComputePolymorphic(), v8::internal::compiler::Scheduler::ComputeSpecialRPO(), v8::internal::ContainsLabel(), v8::internal::ContainsMap(), v8::internal::IC::CopyICToMegamorphicCache(), v8::internal::CutOutRange(), v8::internal::Parser::DesugarLetBindingsInForStatement(), v8::internal::Parser::DoParseProgram(), v8::internal::HBoundsCheckEliminationPhase::EliminateRedundantBoundsChecks(), v8::internal::EmitCharClass(), v8::internal::ChoiceNode::EmitChoices(), v8::internal::ChoiceNode::EmitOutOfLineContinuation(), v8::internal::EmitUseLookupTable(), v8::internal::HOptimizedGraphBuilder::EnsureArgumentsArePushedForAccess(), v8::internal::NativeObjectsExplorer::FillImplicitReferences(), v8::internal::TextNode::FillInBMInfo(), v8::internal::ChoiceNode::FillInBMInfo(), v8::internal::NativeObjectsExplorer::FillRetainedObjects(), v8::internal::TextNode::FilterOneByte(), v8::internal::HOsrBuilder::FinishOsrValues(), v8::internal::Isolate::FireCallCompletedCallback(), v8::internal::List< T, AllocationPolicy >::first(), v8::internal::IC::FirstTargetMap(), v8::internal::GenerateBranches(), v8::internal::BufferedZoneList< T, initial_size >::Get(), v8::internal::HeapSnapshot::GetEntryById(), v8::internal::TextNode::GetQuickCheckDetails(), v8::internal::TextNode::GetSuccessorOfOmnivorousTextNode(), v8::internal::HOptimizedGraphBuilder::HandlePolymorphicElementAccess(), v8::internal::PropertyICCompiler::IncludesNumberType(), v8::internal::HInferTypesPhase::InferTypes(), v8::internal::InsertRangeInCanonicalList(), v8::internal::CharacterRange::IsCanonical(), v8::internal::PolymorphicCodeCacheHashTableKey::IsMatch(), v8::internal::NativeObjectsExplorer::IterateAndExtractReferences(), v8::internal::List< T, AllocationPolicy >::last(), v8::internal::ListCaptureRegisters(), v8::internal::KeyedLoadIC::LoadElementStub(), v8::internal::TextNode::MakeCaseIndependent(), v8::internal::PolymorphicCodeCacheHashTableKey::MapsHashHelper(), v8::internal::MarkCompactCollector::MarkImplicitRefGroups(), v8::internal::HMarkUnreachableBlocksPhase::MarkUnreachableBlocks(), v8::internal::Deoptimizer::MaterializeHeapObjects(), v8::internal::MoveRanges(), v8::internal::CharacterRange::Negate(), v8::internal::AstTyper::ObserveTypesAtOsrEntry(), v8::internal::Parser::ParseV8Intrinsic(), v8::internal::LCodeGen::PopulateDeoptimizationLiteralsWithInlinedFunctions(), v8::internal::Processor::Process(), v8::internal::HStoreEliminationPhase::ProcessLoad(), v8::internal::HRedundantPhiEliminationPhase::ProcessPhis(), v8::internal::HStoreEliminationPhase::ProcessStore(), v8::internal::RangesContainLatin1Equivalents(), v8::internal::LCodeGen::RecordSafepoint(), v8::internal::ProfileGenerator::RecordTickSample(), v8::internal::IC::RegisterWeakMapDependency(), v8::internal::Isolate::RemoveCallCompletedCallback(), v8::internal::ReplayEnvironmentNested(), v8::internal::CompilationInfo::RollbackDependencies(), v8::internal::HCanonicalizePhase::Run(), v8::internal::HDehoistIndexComputationsPhase::Run(), v8::internal::HInferRepresentationPhase::Run(), v8::internal::HMarkDeoptimizeOnUndefinedPhase::Run(), v8::internal::HComputeChangeUndefinedToNaN::Run(), v8::internal::HRangeAnalysisPhase::Run(), v8::internal::HRedundantPhiEliminationPhase::Run(), v8::internal::HRepresentationChangesPhase::Run(), v8::internal::HUint32AnalysisPhase::Run(), v8::internal::RUNTIME_FUNCTION(), v8::internal::CpuProfile::sample_timestamp(), v8::internal::CharacterRange::Split(), v8::internal::SplitSearchSpace(), v8::internal::HEscapeAnalysisPhase::StateAt(), v8::internal::KeyedStoreIC::StoreElementStub(), v8::internal::StringReplaceGlobalAtomRegExpWithString(), v8::internal::IC::TargetMaps(), v8::internal::IC::TargetTypes(), v8::internal::HOptimizedGraphBuilder::TryCallApply(), v8::internal::HOptimizedGraphBuilder::TryInline(), v8::internal::IC::UpdatePolymorphicIC(), v8::internal::AstTyper::VisitDeclarations(), v8::internal::HOptimizedGraphBuilder::VisitExpressions(), v8::internal::compiler::AstGraphBuilder::VisitForValues(), v8::internal::AstTyper::VisitStatements(), v8::internal::HOptimizedGraphBuilder::VisitStatements(), SnapshotWriter::WriteSnapshotData(), and v8::internal::HEnvironmentLivenessAnalysisPhase::ZapEnvironmentSlotsInSuccessors().

+ Here is the call graph for this function:

◆ begin()

template<typename T , class AllocationPolicy >
iterator v8::internal::List< T, AllocationPolicy >::begin ( ) const
inline

Definition at line 74 of file list.h.

74 { return &data_[0]; }

References v8::internal::List< T, AllocationPolicy >::data_.

Referenced by SnapshotWriter::MaybeWriteRawFile(), SnapshotWriter::MaybeWriteStartupBlob(), v8::internal::compiler::operator<<(), v8::internal::SerializedCodeData::SerializedCodeData(), and v8::internal::compiler::VerifyMovesAreInjective().

+ Here is the caller graph for this function:

◆ Contains()

template<typename T , class P >
bool v8::internal::List< T, P >::Contains ( const T elm) const

Definition at line 174 of file list-inl.h.

174  {
175  for (int i = 0; i < length_; i++) {
176  if (data_[i] == elm)
177  return true;
178  }
179  return false;
180 }

Referenced by v8::internal::PostorderProcessor::ClosePostorder(), v8::internal::OutSet::Get(), v8::internal::compiler::ScheduleVerifier::Run(), and v8::internal::OutSet::Set().

+ Here is the caller graph for this function:

◆ CountOccurrences()

template<typename T , class P >
int v8::internal::List< T, P >::CountOccurrences ( const T elm,
int  start,
int  end 
) const

Definition at line 184 of file list-inl.h.

184  {
185  int result = 0;
186  for (int i = start; i <= end; i++) {
187  if (data_[i] == elm) ++result;
188  }
189  return result;
190 }
iterator end() const
Definition: list.h:75

Referenced by v8::internal::SmallPointerList< T >::CountOccurrences().

+ Here is the caller graph for this function:

◆ DISALLOW_COPY_AND_ASSIGN()

template<typename T , class AllocationPolicy >
v8::internal::List< T, AllocationPolicy >::DISALLOW_COPY_AND_ASSIGN ( List< T, AllocationPolicy )
private

◆ end()

template<typename T , class AllocationPolicy >
iterator v8::internal::List< T, AllocationPolicy >::end ( ) const
inline

Definition at line 75 of file list.h.

75 { return &data_[length_]; }

References v8::internal::List< T, AllocationPolicy >::data_, and v8::internal::List< T, AllocationPolicy >::length_.

Referenced by SnapshotWriter::MaybeWriteRawFile(), and v8::internal::compiler::VerifyMovesAreInjective().

+ Here is the caller graph for this function:

◆ first()

template<typename T , class AllocationPolicy >
T& v8::internal::List< T, AllocationPolicy >::first ( ) const
inline

Definition at line 71 of file list.h.

71 { return at(0); }
T & at(int i) const
Definition: list.h:69

References v8::internal::List< T, AllocationPolicy >::at().

Referenced by v8::internal::HandleScopeImplementer::IterateThis(), and v8::internal::HeapObjectsMap::PushHeapObjectsStats().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Free()

template<typename T , class AllocationPolicy >
void v8::internal::List< T, AllocationPolicy >::Free ( )
inline

Definition at line 43 of file list.h.

43  {
44  DeleteData(data_);
45  Initialize(0);
46  }

References v8::internal::List< T, AllocationPolicy >::data_.

◆ INLINE() [1/17]

template<typename T , class AllocationPolicy >
v8::internal::List< T, AllocationPolicy >::INLINE ( bool is_empty() const   )
inline

Definition at line 77 of file list.h.

77 { return length_ == 0; }

References v8::internal::List< T, AllocationPolicy >::length_.

◆ INLINE() [2/17]

template<typename T , class AllocationPolicy >
v8::internal::List< T, AllocationPolicy >::INLINE ( explicit   Listint capacity, AllocationPolicy allocator=AllocationPolicy())
inline

Definition at line 35 of file list.h.

36  {
37  Initialize(capacity, allocator);
38  }

◆ INLINE() [3/17]

template<typename T , class AllocationPolicy >
v8::internal::List< T, AllocationPolicy >::INLINE ( int capacity() const   )
inline

Definition at line 79 of file list.h.

79 { return capacity_; }

References v8::internal::List< T, AllocationPolicy >::capacity_.

◆ INLINE() [4/17]

template<typename T , class AllocationPolicy >
v8::internal::List< T, AllocationPolicy >::INLINE ( int length() const   )
inline

Definition at line 78 of file list.h.

78 { return length_; }

References v8::internal::List< T, AllocationPolicy >::length_.

◆ INLINE() [5/17]

template<typename T , class AllocationPolicy >
v8::internal::List< T, AllocationPolicy >::INLINE ( T NewDataint n, AllocationPolicy allocator)
inlineprivate

Definition at line 161 of file list.h.

161  {
162  return static_cast<T*>(allocator.New(n * sizeof(T)));
163  }
#define T(name, string, precedence)
Definition: token.cc:25

References T.

◆ INLINE() [6/17]

template<typename T , class AllocationPolicy >
v8::internal::List< T, AllocationPolicy >::INLINE ( T   RemoveLast())
inline

Definition at line 122 of file list.h.

122 { return Remove(length_ - 1); }
T Remove(int i)
Definition: list-inl.h:103

References v8::internal::List< T, AllocationPolicy >::length_, and v8::internal::List< T, AllocationPolicy >::Remove().

+ Here is the call graph for this function:

◆ INLINE() [7/17]

template<typename T , class AllocationPolicy >
v8::internal::List< T, AllocationPolicy >::INLINE ( void *operator   newsize_t size, AllocationPolicy allocator=AllocationPolicy())
inline

Definition at line 48 of file list.h.

49  {
50  return allocator.New(static_cast<int>(size));
51  }
enable harmony numeric enable harmony object literal extensions Optimize object size

References size.

◆ INLINE() [8/17]

template<typename T , class AllocationPolicy >
v8::internal::List< T, AllocationPolicy >::INLINE ( void   Allocateint length, AllocationPolicy allocator=AllocationPolicy())

◆ INLINE() [9/17]

template<typename T , class AllocationPolicy >
v8::internal::List< T, AllocationPolicy >::INLINE ( void   Clear())

◆ INLINE() [10/17]

template<typename T , class AllocationPolicy >
v8::internal::List< T, AllocationPolicy >::INLINE ( void   DeleteDataT *data)
inlineprivate

Definition at line 164 of file list.h.

164  {
165  AllocationPolicy::Delete(data);
166  }

◆ INLINE() [11/17]

template<typename T , class AllocationPolicy >
v8::internal::List< T, AllocationPolicy >::INLINE ( void   Initializeint capacity, AllocationPolicy allocator=AllocationPolicy())

◆ INLINE() [12/17]

template<typename T , class AllocationPolicy >
v8::internal::List< T, AllocationPolicy >::INLINE ( void operator   deletevoid *p)
inline

Definition at line 52 of file list.h.

52  {
53  AllocationPolicy::Delete(p);
54  }

◆ INLINE() [13/17]

template<typename T , class AllocationPolicy >
v8::internal::List< T, AllocationPolicy >::INLINE ( void operator   deletevoid *p, AllocationPolicy allocator)
inline

Definition at line 57 of file list.h.

57  {
58  UNREACHABLE();
59  }
#define UNREACHABLE()
Definition: logging.h:30

References UNREACHABLE.

◆ INLINE() [14/17]

template<typename T , class AllocationPolicy >
v8::internal::List< T, AllocationPolicy >::INLINE ( void   Rewindint pos)

◆ INLINE() [15/17]

template<typename T , class AllocationPolicy >
v8::internal::List< T, AllocationPolicy >::INLINE ( void   RewindByint count)
inline

Definition at line 136 of file list.h.

136 { Rewind(length_ - count); }

References v8::internal::List< T, AllocationPolicy >::length_.

◆ INLINE() [16/17]

template<typename T , class AllocationPolicy >
v8::internal::List< T, AllocationPolicy >::INLINE ( void   TrimAllocationPolicy allocator=AllocationPolicy())

◆ INLINE() [17/17]

template<typename T , class AllocationPolicy >
v8::internal::List< T, AllocationPolicy >::INLINE ( List())
inline

Definition at line 39 of file list.h.

39 { DeleteData(data_); }

References v8::internal::List< T, AllocationPolicy >::data_.

◆ InsertAt()

template<typename T , class AllocationPolicy >
void v8::internal::List< T, P >::InsertAt ( int  index,
const T element,
AllocationPolicy  allocator = AllocationPolicy() 
)

Definition at line 92 of file list-inl.h.

92  {
93  DCHECK(index >= 0 && index <= length_);
94  Add(elm, alloc);
95  for (int i = length_ - 1; i > index; --i) {
96  data_[i] = data_[i - 1];
97  }
98  data_[index] = elm;
99 }
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK.

Referenced by v8::internal::ZoneList< T >::INLINE().

+ Here is the caller graph for this function:

◆ Iterate() [1/2]

template<typename T , class P >
template<class Visitor >
void v8::internal::List< T, P >::Iterate ( Visitor *  visitor)

Definition at line 168 of file list-inl.h.

168  {
169  for (int i = 0; i < length_; i++) visitor->Apply(&data_[i]);
170 }

◆ Iterate() [2/2]

template<typename T , class P >
void v8::internal::List< T, P >::Iterate ( void(*)(T *x)  callback)

Definition at line 161 of file list-inl.h.

161  {
162  for (int i = 0; i < length_; i++) callback(&data_[i]);
163 }

◆ last()

template<typename T , class AllocationPolicy >
T& v8::internal::List< T, AllocationPolicy >::last ( ) const
inline

Definition at line 70 of file list.h.

70 { return at(length_ - 1); }

References v8::internal::List< T, AllocationPolicy >::at(), and v8::internal::List< T, AllocationPolicy >::length_.

Referenced by v8::internal::HeapSnapshot::AddEntry(), and v8::internal::ProfileTree::TraverseDepthFirst().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator[]()

template<typename T , class AllocationPolicy >
T& v8::internal::List< T, AllocationPolicy >::operator[] ( int  i) const
inline

Definition at line 64 of file list.h.

64  {
65  DCHECK(0 <= i);
67  return data_[i];
68  }
#define SLOW_DCHECK(condition)
Definition: checks.h:30

References v8::internal::List< T, AllocationPolicy >::data_, DCHECK, v8::internal::List< T, AllocationPolicy >::length_, and SLOW_DCHECK.

Referenced by v8::internal::List< T, AllocationPolicy >::at().

+ Here is the caller graph for this function:

◆ Remove()

template<typename T , class P >
T v8::internal::List< T, P >::Remove ( int  i)

Definition at line 103 of file list-inl.h.

103  {
104  T element = at(i);
105  length_--;
106  while (i < length_) {
107  data_[i] = data_[i + 1];
108  i++;
109  }
110  return element;
111 }

References T.

Referenced by v8::internal::List< T, AllocationPolicy >::INLINE(), v8::internal::HStoreEliminationPhase::ProcessLoad(), v8::internal::HStoreEliminationPhase::ProcessStore(), v8::internal::MaterializedObjectStore::Remove(), v8::internal::Isolate::RemoveCallCompletedCallback(), and v8::internal::Scope::RemoveUnresolved().

+ Here is the caller graph for this function:

◆ RemoveElement()

template<typename T , class P >
bool v8::internal::List< T, P >::RemoveElement ( const T elm)

Definition at line 115 of file list-inl.h.

115  {
116  for (int i = 0; i < length_; i++) {
117  if (data_[i] == elm) {
118  Remove(i);
119  return true;
120  }
121  }
122  return false;
123 }

Referenced by v8::internal::SmallPointerList< T >::RemoveElement().

+ Here is the caller graph for this function:

◆ Resize()

template<typename T , class AllocationPolicy >
void v8::internal::List< T, P >::Resize ( int  new_capacity,
AllocationPolicy  allocator 
)
private

Definition at line 66 of file list-inl.h.

66  {
67  DCHECK_LE(length_, new_capacity);
68  T* new_data = NewData(new_capacity, alloc);
69  MemCopy(new_data, data_, length_ * sizeof(T));
70  List<T, P>::DeleteData(data_);
71  data_ = new_data;
72  capacity_ = new_capacity;
73 }
#define DCHECK_LE(v1, v2)
Definition: logging.h:210
void MemCopy(void *dest, const void *src, size_t size)
Definition: utils.h:350

References DCHECK_LE, v8::internal::MemCopy(), and T.

+ Here is the call graph for this function:

◆ ResizeAdd()

template<typename T , class AllocationPolicy >
void v8::internal::List< T, P >::ResizeAdd ( const T element,
AllocationPolicy  allocator 
)
private

Definition at line 46 of file list-inl.h.

46  {
47  ResizeAddInternal(element, alloc);
48 }
void ResizeAddInternal(const T &element, AllocationPolicy allocator)
Definition: list-inl.h:52

Referenced by v8::internal::List< T, AllocationPolicy >::Add().

+ Here is the caller graph for this function:

◆ ResizeAddInternal()

template<typename T , class AllocationPolicy >
void v8::internal::List< T, P >::ResizeAddInternal ( const T element,
AllocationPolicy  allocator 
)
private

Definition at line 52 of file list-inl.h.

52  {
54  // Grow the list capacity by 100%, but make sure to let it grow
55  // even when the capacity is zero (possible initial case).
56  int new_capacity = 1 + 2 * capacity_;
57  // Since the element reference could be an element of the list, copy
58  // it out of the old backing storage before resizing.
59  T temp = element;
60  Resize(new_capacity, alloc);
61  data_[length_++] = temp;
62 }
void Resize(int new_capacity, AllocationPolicy allocator)
Definition: list-inl.h:66

References DCHECK, and T.

◆ Set()

template<typename T , class P >
void v8::internal::List< T, P >::Set ( int  index,
const T element 
)

Definition at line 85 of file list-inl.h.

85  {
86  DCHECK(index >= 0 && index <= length_);
87  data_[index] = elm;
88 }

References DCHECK.

Referenced by v8::internal::Deoptimizer::MaterializeHeapObjects(), v8::internal::HEnvironmentLivenessAnalysisPhase::Run(), v8::internal::HEscapeAnalysisPhase::SetStateAt(), and v8::internal::IC::UpdatePolymorphicIC().

+ Here is the caller graph for this function:

◆ Sort() [1/2]

template<typename T , class P >
void v8::internal::List< T, P >::Sort

Definition at line 204 of file list-inl.h.

204  {
205  ToVector().Sort();
206 }
Vector< T > ToVector() const
Definition: list.h:81

◆ Sort() [2/2]

template<typename T , class P >
void v8::internal::List< T, P >::Sort ( int(*)(const T *x, const T *y)  cmp)

Definition at line 194 of file list-inl.h.

194  {
195  ToVector().Sort(cmp);
196 #ifdef DEBUG
197  for (int i = 1; i < length_; i++)
198  DCHECK(cmp(&data_[i - 1], &data_[i]) <= 0);
199 #endif
200 }

References DCHECK.

Referenced by v8::internal::DispatchTableConstructor::AddInverse(), v8::internal::Scope::AllocateNonParameterLocals(), v8::internal::Scope::CollectStackAndContextLocals(), v8::internal::ScopeInfo::Create(), v8::internal::HeapObjectsMap::FindUntrackedObjects(), v8::internal::HeapSnapshot::GetSortedEntriesList(), v8::internal::IterateElements(), v8::internal::FunctionInfoListener::SerializeFunctionScope(), and v8::internal::SmallPointerList< T >::Sort().

+ Here is the caller graph for this function:

◆ ToConstVector()

template<typename T , class AllocationPolicy >
Vector<const T> v8::internal::List< T, AllocationPolicy >::ToConstVector ( )
inline

Definition at line 83 of file list.h.

83 { return Vector<const T>(data_, length_); }

References v8::internal::List< T, AllocationPolicy >::data_, and v8::internal::List< T, AllocationPolicy >::length_.

Referenced by v8::internal::RegExpBuilder::AddQuantifierToAtom(), and v8::internal::RegExpBuilder::FlushCharacters().

+ Here is the caller graph for this function:

◆ ToVector()

template<typename T , class AllocationPolicy >
Vector<T> v8::internal::List< T, AllocationPolicy >::ToVector ( ) const
inline

Definition at line 81 of file list.h.

81 { return Vector<T>(data_, length_); }

References v8::internal::List< T, AllocationPolicy >::data_, and v8::internal::List< T, AllocationPolicy >::length_.

Referenced by v8::internal::CreateStackMap(), and SnapshotWriter::WriteData().

+ Here is the caller graph for this function:

Member Data Documentation

◆ capacity_

template<typename T , class AllocationPolicy >
int v8::internal::List< T, AllocationPolicy >::capacity_
private

Definition at line 158 of file list.h.

Referenced by v8::internal::List< T, AllocationPolicy >::INLINE().

◆ data_

◆ length_


The documentation for this class was generated from the following files: