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
diff --git a/compiler/optimizing/side_effects_analysis.h b/compiler/optimizing/side_effects_analysis.h
index 9888140..bac6088 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 @@
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 @@
// Side effects of individual blocks, that is the union of the side effects
// of the instructions in the block.
- GrowableArray<SideEffects> block_effects_;
+ ArenaVector<SideEffects> block_effects_;
// Side effects of loops, that is the union of the side effects of the
// blocks contained in that loop.
- GrowableArray<SideEffects> loop_effects_;
+ ArenaVector<SideEffects> loop_effects_;
ART_FRIEND_TEST(GVNTest, LoopSideEffects);
DISALLOW_COPY_AND_ASSIGN(SideEffectsAnalysis);