summaryrefslogtreecommitdiff
path: root/compiler/optimizing/side_effects_analysis.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2015-09-25 13:59:08 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-09-25 13:59:08 +0000
commitec7e44f7afe0ff48d4d1ae54a12d375e0392d24c (patch)
tree30ce5725c7258d6584a56f2c6382cee529df2cc2 /compiler/optimizing/side_effects_analysis.cc
parente92ed9d31bae7ccd48b60aa921e9dd2ca96ac9db (diff)
parent2aaa4b5532d30c4e65d8892b556400bb61f9dc8c (diff)
Merge "Optimizing: Tag more arena allocations."
Diffstat (limited to 'compiler/optimizing/side_effects_analysis.cc')
-rw-r--r--compiler/optimizing/side_effects_analysis.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/compiler/optimizing/side_effects_analysis.cc b/compiler/optimizing/side_effects_analysis.cc
index 1956781b79..338a3aaad0 100644
--- a/compiler/optimizing/side_effects_analysis.cc
+++ b/compiler/optimizing/side_effects_analysis.cc
@@ -21,8 +21,8 @@ namespace art {
void SideEffectsAnalysis::Run() {
// Inlining might have created more blocks, so we need to increase the size
// if needed.
- block_effects_.SetSize(graph_->GetBlocks().size());
- loop_effects_.SetSize(graph_->GetBlocks().size());
+ block_effects_.resize(graph_->GetBlocks().size());
+ loop_effects_.resize(graph_->GetBlocks().size());
// In DEBUG mode, ensure side effects are properly initialized to empty.
if (kIsDebugBuild) {
@@ -54,7 +54,7 @@ void SideEffectsAnalysis::Run() {
}
}
- block_effects_.Put(block->GetBlockId(), effects);
+ block_effects_[block->GetBlockId()] = effects;
if (block->IsLoopHeader()) {
// The side effects of the loop header are part of the loop.
@@ -76,16 +76,19 @@ void SideEffectsAnalysis::Run() {
SideEffects SideEffectsAnalysis::GetLoopEffects(HBasicBlock* block) const {
DCHECK(block->IsLoopHeader());
- return loop_effects_.Get(block->GetBlockId());
+ DCHECK_LT(block->GetBlockId(), loop_effects_.size());
+ return loop_effects_[block->GetBlockId()];
}
SideEffects SideEffectsAnalysis::GetBlockEffects(HBasicBlock* block) const {
- return block_effects_.Get(block->GetBlockId());
+ DCHECK_LT(block->GetBlockId(), block_effects_.size());
+ return block_effects_[block->GetBlockId()];
}
void SideEffectsAnalysis::UpdateLoopEffects(HLoopInformation* info, SideEffects effects) {
- int id = info->GetHeader()->GetBlockId();
- loop_effects_.Put(id, loop_effects_.Get(id).Union(effects));
+ uint32_t id = info->GetHeader()->GetBlockId();
+ DCHECK_LT(id, loop_effects_.size());
+ loop_effects_[id] = loop_effects_[id].Union(effects);
}
} // namespace art