From 86dde1658a1951c251dd5c6ff21ecc5c281879a6 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Mon, 26 Jan 2015 12:54:33 +0000 Subject: Introduce a SideEffectsAnalysis class. LICM also needs the side effects information of loops, so move the GVN::ComputeSideEffects method into its own analysis class. Change-Id: I810c8230a0eb6b9b536e8f808e17a3a4ad72f7db --- compiler/utils/growable_array.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'compiler/utils/growable_array.h') diff --git a/compiler/utils/growable_array.h b/compiler/utils/growable_array.h index fde65e79c3..b84842910b 100644 --- a/compiler/utils/growable_array.h +++ b/compiler/utils/growable_array.h @@ -37,6 +37,18 @@ class GrowableArray : public ArenaObject { kArenaAllocGrowableArray)); } + GrowableArray(ArenaAllocator* arena, size_t init_length, T initial_data) + : arena_(arena), + num_allocated_(init_length), + num_used_(0) { + SetSize(init_length); + elem_list_ = static_cast(arena_->Alloc(sizeof(T) * init_length, + kArenaAllocGrowableArray)); + for (size_t i = 0; i < init_length; ++i) { + elem_list_[i] = initial_data; + } + } + // Expand the list size to at least new length. void Resize(size_t new_length) { -- cgit v1.2.3-59-g8ed1b