diff options
author | David Brazdil <dbrazdil@google.com> | 2015-01-27 17:32:30 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-01-27 17:32:31 +0000 |
commit | c19e7f187d744992072e2e56cb3b131fb4c140f8 (patch) | |
tree | 835aec3eab728ecc8afe1d5a96858aca272e2250 /compiler/optimizing/nodes.h | |
parent | 8c776cd9186e68c23b0983415ae14798e5ea5ab3 (diff) | |
parent | ea55b934cff1280318f5514039549799227cfa3d (diff) | |
download | art-c19e7f187d744992072e2e56cb3b131fb4c140f8.tar.gz art-c19e7f187d744992072e2e56cb3b131fb4c140f8.tar.bz2 art-c19e7f187d744992072e2e56cb3b131fb4c140f8.zip |
Merge "ART: Further refactor use lists"
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r-- | compiler/optimizing/nodes.h | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index cac78f602c..2cc021cccf 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -623,7 +623,7 @@ class HUseList : public ValueObject { // Adds a new entry at the beginning of the use list and returns // the newly created node. HUseListNode<T>* AddUse(T user, size_t index, ArenaAllocator* arena) { - HUseListNode<T>* new_node = new(arena) HUseListNode<T>(user, index); + HUseListNode<T>* new_node = new (arena) HUseListNode<T>(user, index); if (IsEmpty()) { first_ = new_node; } else { @@ -863,21 +863,12 @@ class HInstruction : public ArenaObject<kArenaAllocMisc> { void RemoveUser(HInstruction* user, size_t index); void RemoveEnvironmentUser(HUseListNode<HEnvironment*>* use); - HUseList<HInstruction*>& GetUses() { return uses_; } - HUseList<HEnvironment*>& GetEnvUses() { return env_uses_; } + const HUseList<HInstruction*>& GetUses() { return uses_; } + const HUseList<HEnvironment*>& GetEnvUses() { return env_uses_; } bool HasUses() const { return !uses_.IsEmpty() || !env_uses_.IsEmpty(); } bool HasEnvironmentUses() const { return !env_uses_.IsEmpty(); } - size_t ExpensiveComputeNumberOfUses() const { - // TODO: Optimize this method if it is used outside of the HGraphVisualizer. - size_t result = 0; - for (HUseIterator<HInstruction*> it(uses_); !it.Done(); it.Advance()) { - ++result; - } - return result; - } - // Does this instruction strictly dominate `other_instruction`? // Returns false if this instruction and `other_instruction` are the same. // Aborts if this instruction and `other_instruction` are both phis. |