diff options
author | Vladimir Marko <vmarko@google.com> | 2014-09-25 11:23:21 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-09-25 11:23:22 +0000 |
commit | f2476d524281c6d649f5deb6d1ccccc92380c1ed (patch) | |
tree | 5a7351ed7b785d096ccec00871c8f8007d5449c9 /compiler/utils | |
parent | c5c71bfa21aee5ad05217af57e94a0263c4eef1d (diff) | |
parent | e39c54ea575ec710d5e84277fcdcc049f8acb3c9 (diff) | |
download | art-f2476d524281c6d649f5deb6d1ccccc92380c1ed.zip art-f2476d524281c6d649f5deb6d1ccccc92380c1ed.tar.gz art-f2476d524281c6d649f5deb6d1ccccc92380c1ed.tar.bz2 |
Merge "Deprecate GrowableArray, use ArenaVector instead."
Diffstat (limited to 'compiler/utils')
-rw-r--r-- | compiler/utils/arena_allocator.cc | 11 | ||||
-rw-r--r-- | compiler/utils/arena_allocator.h | 11 | ||||
-rw-r--r-- | compiler/utils/growable_array.h | 51 |
3 files changed, 24 insertions, 49 deletions
diff --git a/compiler/utils/arena_allocator.cc b/compiler/utils/arena_allocator.cc index da49524..516ac2b 100644 --- a/compiler/utils/arena_allocator.cc +++ b/compiler/utils/arena_allocator.cc @@ -35,12 +35,23 @@ template <bool kCount> const char* const ArenaAllocatorStatsImpl<kCount>::kAllocNames[] = { "Misc ", "BasicBlock ", + "BBList " + "BBPreds ", + "DfsPreOrd ", + "DfsPostOrd ", + "DomPostOrd ", + "TopoOrd ", + "Lowering ", "LIR ", "LIR masks ", + "SwitchTbl ", + "FillArray ", + "SlowPaths ", "MIR ", "DataFlow ", "GrowList ", "GrowBitMap ", + "SSA2Dalvik ", "Dalvik2SSA ", "DebugInfo ", "Successor ", diff --git a/compiler/utils/arena_allocator.h b/compiler/utils/arena_allocator.h index 7bfbb6f..b2f5ca9 100644 --- a/compiler/utils/arena_allocator.h +++ b/compiler/utils/arena_allocator.h @@ -44,12 +44,23 @@ static constexpr bool kArenaAllocatorCountAllocations = false; enum ArenaAllocKind { kArenaAllocMisc, kArenaAllocBB, + kArenaAllocBBList, + kArenaAllocBBPredecessors, + kArenaAllocDfsPreOrder, + kArenaAllocDfsPostOrder, + kArenaAllocDomPostOrder, + kArenaAllocTopologicalSortOrder, + kArenaAllocLoweringInfo, kArenaAllocLIR, kArenaAllocLIRResourceMask, + kArenaAllocSwitchTable, + kArenaAllocFillArrayData, + kArenaAllocSlowPaths, kArenaAllocMIR, kArenaAllocDFInfo, kArenaAllocGrowableArray, kArenaAllocGrowableBitMap, + kArenaAllocSSAToDalvikMap, kArenaAllocDalvikToSSAMap, kArenaAllocDebugInfo, kArenaAllocSuccessor, diff --git a/compiler/utils/growable_array.h b/compiler/utils/growable_array.h index a1a3312..5b55b80 100644 --- a/compiler/utils/growable_array.h +++ b/compiler/utils/growable_array.h @@ -26,61 +26,14 @@ namespace art { // Type of growable list for memory tuning. enum OatListKind { kGrowableArrayMisc = 0, - kGrowableArrayBlockList, - kGrowableArraySSAtoDalvikMap, - kGrowableArrayDfsOrder, - kGrowableArrayDfsPostOrder, - kGrowableArrayDomPostOrderTraversal, - kGrowableArraySwitchTables, - kGrowableArrayFillArrayData, - kGrowableArraySuccessorBlocks, - kGrowableArrayPredecessors, - kGrowableArraySlowPaths, kGNumListKinds }; +// Deprecated +// TODO: Replace all uses with ArenaVector<T>. template<typename T> class GrowableArray { public: - class Iterator { - public: - explicit Iterator(GrowableArray* g_list) - : idx_(0), - g_list_(g_list) {} - - explicit Iterator() - : idx_(0), - g_list_(nullptr) {} - - // NOTE: returns 0/NULL when no next. - // TODO: redo to make usage consistent with other iterators. - T Next() { - DCHECK(g_list_ != nullptr); - if (idx_ >= g_list_->Size()) { - return 0; - } else { - return g_list_->Get(idx_++); - } - } - - void Reset() { - idx_ = 0; - } - - void Reset(GrowableArray* g_list) { - idx_ = 0; - g_list_ = g_list; - } - - size_t GetIndex() const { - return idx_; - } - - private: - size_t idx_; - GrowableArray* g_list_; - }; - GrowableArray(ArenaAllocator* arena, size_t init_length, OatListKind kind = kGrowableArrayMisc) : arena_(arena), num_allocated_(init_length), |