From 2aaa4b5532d30c4e65d8892b556400bb61f9dc8c Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 17 Sep 2015 17:03:26 +0100 Subject: Optimizing: Tag more arena allocations. Replace GrowableArray with ArenaVector and tag arena allocations with new allocation types. As part of this, make the register allocator a bit more efficient, doing bulk insert/erase. Some loops are now O(n) instead of O(n^2). Change-Id: Ifac0871ffb34b121cc0447801a2d07eefd308c14 --- compiler/optimizing/side_effects_analysis.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'compiler/optimizing/side_effects_analysis.h') diff --git a/compiler/optimizing/side_effects_analysis.h b/compiler/optimizing/side_effects_analysis.h index 9888140fb6..bac6088bf7 100644 --- a/compiler/optimizing/side_effects_analysis.h +++ b/compiler/optimizing/side_effects_analysis.h @@ -17,6 +17,7 @@ #ifndef ART_COMPILER_OPTIMIZING_SIDE_EFFECTS_ANALYSIS_H_ #define ART_COMPILER_OPTIMIZING_SIDE_EFFECTS_ANALYSIS_H_ +#include "base/arena_containers.h" #include "nodes.h" #include "optimization.h" @@ -27,8 +28,10 @@ class SideEffectsAnalysis : public HOptimization { explicit SideEffectsAnalysis(HGraph* graph) : HOptimization(graph, kSideEffectsAnalysisPassName), graph_(graph), - block_effects_(graph->GetArena(), graph->GetBlocks().size(), SideEffects::None()), - loop_effects_(graph->GetArena(), graph->GetBlocks().size(), SideEffects::None()) {} + block_effects_(graph->GetBlocks().size(), + graph->GetArena()->Adapter(kArenaAllocSideEffectsAnalysis)), + loop_effects_(graph->GetBlocks().size(), + graph->GetArena()->Adapter(kArenaAllocSideEffectsAnalysis)) {} SideEffects GetLoopEffects(HBasicBlock* block) const; SideEffects GetBlockEffects(HBasicBlock* block) const; @@ -51,11 +54,11 @@ class SideEffectsAnalysis : public HOptimization { // Side effects of individual blocks, that is the union of the side effects // of the instructions in the block. - GrowableArray block_effects_; + ArenaVector block_effects_; // Side effects of loops, that is the union of the side effects of the // blocks contained in that loop. - GrowableArray loop_effects_; + ArenaVector loop_effects_; ART_FRIEND_TEST(GVNTest, LoopSideEffects); DISALLOW_COPY_AND_ASSIGN(SideEffectsAnalysis); -- cgit v1.2.3-59-g8ed1b